大量修改

如果您需要同時在不同類型的實體上執行作業,或是想要針對單一端點進行寫入,而不是根據每個資源類型使用個別端點,則可針對所有支援的 Change 作業使用 GoogleAdsService.Mutate 端點。

更改作業

每項MutateGoogleAdsRequest都會接受重複 MutateOperation,每項作業可包含一種資源類型的單一作業。如要在單一 GoogleAdsService.Mutate 呼叫中建立一個廣告活動和一個廣告群組,您必須建立兩個 MutateOperation 實體 (一個用於 CampaignOperation,另一個用於 AdGroupOperation),然後將兩者都傳遞至 GoogleAdsService

小茹

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])

與其他服務一樣,這個端點僅支援部分失敗和驗證。