異なるタイプのエンティティを同時に運用する必要がある場合や、リソースタイプごとに別々のエンドポイントを使用するのではなく、単一のエンドポイントに書き込みを行いたい場合は、サポートされているすべての変更オペレーションに GoogleAdsService.Mutate
エンドポイントを使用できます。
mutate オペレーション
各 MutateGoogleAdsRequest
は繰り返しの MutateOperation
を受け入れ、それぞれに 1 つのリソースタイプに対して 1 つのオペレーションを含めることができます。1 つの GoogleAdsService.Mutate
呼び出しで 1 つのキャンペーンと 1 つの広告グループを作成するには、2 つの MutateOperation
エンティティ(CampaignOperation
用に 1 つ、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])
他のサービスと同様に、このエンドポイントは部分的な障害と検証のみをサポートします。