เปลี่ยนแปลงหลายรายการพร้อมกัน

หากต้องการดำเนินการกับเอนทิตีประเภทต่างๆ พร้อมกันหรือต้องการเขียนกับปลายทางเดียวแทนที่จะใช้ปลายทางแยกต่างหากต่อประเภททรัพยากร คุณใช้ปลายทาง GoogleAdsService.Mutate สำหรับ Mutate ที่รองรับทั้งหมดได้

เปลี่ยนแปลงการดำเนินการ

MutateGoogleAdsRequest แต่ละรายการยอมรับ MutateOperation ที่ซ้ำกัน โดยแต่ละรายการจะมีการดำเนินการเดียวสำหรับทรัพยากรประเภทเดียวได้ หากต้องการสร้างแคมเปญ 1 รายการและกลุ่มโฆษณา 1 รายการในการเรียกใช้ GoogleAdsService.Mutate ครั้งเดียว คุณจะต้องสร้างเอนทิตี MutateOperation 2 รายการ (รายการหนึ่งสำหรับ CampaignOperation และอีกรายการสำหรับ AdGroupOperation) จากนั้นส่งเอนทิตีทั้ง 2 รายการไปยัง GoogleAdsService

Ruby

mutate_operation1 = client.operation(:Mutate)
mutate_operation2 = client.operation(:Mutate)

campaign_operation = client.operation(:Campaign)
ad_group_operation = client.operation(:AdGroup)

# Do some setup here to get campaign_operation and ad_group_operation into the
# state you would want them for a regular mutate call to their respective
# services.

mutate_operation1.campaign_operation = campaign_operation
mutate_operation2.ad_group_operation = ad_group_operation

google_ads_service.mutate(customer_id, [mutate_operation1, mutate_operation2])

ปลายทางนี้รองรับความล้มเหลวบางส่วนและตรวจสอบสิทธิ์เท่านั้นเช่นเดียวกับบริการอื่นๆ