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