一括変更

異なるタイプのエンティティを同時に操作する必要がある場合や、リソースタイプごとに個別のエンドポイントを使用するのではなく、1 つのエンドポイントに対して書き込みを行う場合は、サポートされているすべての変換オペレーションに GoogleAdsService.Mutate エンドポイントを使用できます。

mutate オペレーション

MutateGoogleAdsRequest は繰り返しの MutateOperation を受け入れ、それぞれに 1 つのリソースタイプに対して単一のオペレーションを含めることができます。1 回の GoogleAdsService.Mutate 呼び出しで 1 つのキャンペーンと 1 つの広告グループを作成するには、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])

他のサービスと同様に、このエンドポイントは部分障害と検証のみをサポートします。