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

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

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