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

หากต้องการดำเนินการกับเอนทิตีประเภทต่างๆ พร้อมกัน หรือ ต้องการเขียนกับปลายทางเดียวแทนการใช้ปลายทางแยก ต่อประเภททรัพยากร คุณสามารถใช้ปลายทาง GoogleAdsService.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])

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