AI-generated Key Takeaways
-
The
GoogleAdsService.Mutateendpoint allows you to operate on different types of entities or use a single endpoint for all supported mutate operations. -
You can see the full list of supported operations on the reference page for
MutateOperation. -
Each
MutateGoogleAdsRequestaccepts a repeatedMutateOperation, with each operation including a single operation for one resource type. -
To perform multiple operations in a single
GoogleAdsService.Mutatecall, you would create aMutateOperationentity for each resource type and pass them together. -
This endpoint supports partial failure and validate-only features.
If you need to operate on different types of entities at the same time or prefer to write against a single endpoint rather than using a separate endpoint per resource type, then you can use the GoogleAdsService.Mutate endpoint for all supported mutate operations.
Mutate operations
Each MutateGoogleAdsRequest accepts a repeated MutateOperation, each of which can include a single operation for one resource type. To create one campaign and one ad group in a single GoogleAdsService.Mutate call, you would need to create two MutateOperation entities (one for the CampaignOperation, the other for the AdGroupOperation), and then pass both to 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]) Like other services, this endpoint supports partial failure and validate-only.