אם אתם צריכים לפעול בסוגים שונים של ישויות בו-זמנית, או שאתם מעדיפים לכתוב מול נקודת קצה אחת במקום להשתמש בנקודת קצה נפרדת לכל סוג משאב, אפשר להשתמש בנקודת הקצה GoogleAdsService.Mutate
לכל פעולות השינוי הנתמכות.
פעולות שינוי
כל MutateGoogleAdsRequest
מקבל MutateOperation
חוזר, שיכול לכלול פעולה אחת לסוג משאב אחד. כדי ליצור קמפיין אחד וקבוצת מודעות אחת בקריאה אחת של GoogleAdsService.Mutate
, צריך ליצור שתי ישויות MutateOperation
(אחת בשביל CampaignOperation
והשנייה בשביל AdGroupOperation
)
ואז להעביר את שתיהן אל
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])
בדומה לשירותים אחרים, נקודת הקצה הזו תומכת בכשל חלקי ובאימות בלבד.