一括変更
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
異なる種類のエンティティを同時に操作する必要がある場合や単一のエンドポイントに対して書き込みを行う(リソースタイプごとに別々のエンドポイントを使用するのではなく)場合は、サポートされているすべての変更オペレーションに GoogleAdsService.Mutate
エンドポイントを使用できます。
mutate オペレーション
各 MutateGoogleAdsRequest
は繰り返しの MutateOperation
を受け取り、それぞれは 1 つのリソースタイプに対して 1 つのオペレーションを含めることができます。1 つの GoogleAdsService.Mutate
呼び出しで 1 つのキャンペーンと 1 つの広告グループを作成するには、2 つの 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])
他のサービスと同様に、このエンドポイントは部分的な障害と検証のみをサポートします。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-05 UTC。
[null,null,["最終更新日 2025-09-05 UTC。"],[[["\u003cp\u003eUse the \u003ccode\u003eGoogleAdsService.Mutate\u003c/code\u003e endpoint to operate on different entity types or prefer a single endpoint.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMutateGoogleAdsRequest\u003c/code\u003e accepts multiple \u003ccode\u003eMutateOperation\u003c/code\u003e entities, each handling a single operation for one resource type.\u003c/p\u003e\n"],["\u003cp\u003eConstruct separate \u003ccode\u003eMutateOperation\u003c/code\u003e objects for each desired operation, like creating a campaign and an ad group, and pass them to \u003ccode\u003eGoogleAdsService\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis endpoint supports partial failure handling and validate-only requests, similar to other Google Ads API services.\u003c/p\u003e\n"]]],[],null,["# Bulk Mutates\n\nIf you need to operate on different types of entities at the same time or\nprefer to write against a single endpoint rather than using a separate endpoint\nper resource type, then you can use the\n[`GoogleAdsService.Mutate`](/google-ads/api/reference/rpc/v21/GoogleAdsService/Mutate)\nendpoint for all supported mutate operations.\n| **Note:** You can see the full list of supported operations on the reference page for [`MutateOperation`](/google-ads/api/reference/rpc/v21/MutateOperation).\n\nMutate operations\n-----------------\n\nEach [`MutateGoogleAdsRequest`](/google-ads/api/reference/rpc/v21/MutateGoogleAdsRequest)\naccepts a repeated [`MutateOperation`](/google-ads/api/reference/rpc/v21/MutateOperation), each of\nwhich can include a single operation for one resource type. To create one\ncampaign and one ad group in a single\n[`GoogleAdsService.Mutate`](/google-ads/api/reference/rpc/v21/GoogleAdsService/Mutate) call,\nyou would need to create two [`MutateOperation`](/google-ads/api/reference/rpc/v21/MutateOperation)\nentities (one for the [`CampaignOperation`](/google-ads/api/reference/rpc/v21/CampaignOperation),\nthe other for the [`AdGroupOperation`](/google-ads/api/reference/rpc/v21/AdGroupOperation)),\nand then pass both to\n[`GoogleAdsService`](/google-ads/api/reference/rpc/v21/GoogleAdsService). \n\n### Ruby\n\n mutate_operation1 = client.operation(:Mutate)\n mutate_operation2 = client.operation(:Mutate)\n\n campaign_operation = client.operation(:Campaign)\n ad_group_operation = client.operation(:AdGroup)\n\n # Do some setup here to get campaign_operation and ad_group_operation into the\n # state you would want them for a regular mutate call to their respective\n # services.\n\n mutate_operation1.campaign_operation = campaign_operation\n mutate_operation2.ad_group_operation = ad_group_operation\n\n google_ads_service.mutate(customer_id, [mutate_operation1, mutate_operation2])\n\nLike other services, this endpoint supports\n[partial failure](/google-ads/api/docs/best-practices/partial-failures) and\nvalidate-only."]]