Resource Service Mutates

  • The most straightforward way to mutate a resource is by using its individual service and corresponding operations (create, update, or remove).

  • Each mutable resource has a dedicated service with specific endpoints for mutation, like CampaignService.MutateCampaigns for Campaign resources.

  • A single mutate request to a resource-specific service can handle multiple operations, but each operation is treated independently.

  • Resource-specific mutation differs from bulk mutation (GoogleAdsService.Mutate) where operations can cross-reference each other within the same request.

Using a resource's individual service is the most straightforward way to mutate it, but also the least flexible.

Mutate Endpoints

Using a resource-specific service is the most straightforward way to mutate. Each mutable resource has a corresponding service and a set of operations that enable you to create, update, or remove the resource.

Suppose you want to create a new Campaign. You would create a new Campaign object, put it inside a CampaignOperation, and then send it to the CampaignService.MutateCampaigns endpoint.

You can do this for any of the Google Ads API services. So for example, if you wanted to mutate an AdGroup, you would pass an AdGroupOperation containing the mutated AdGroup to the AdGroupService.MutateAdGroups endpoint.

Similarly, if you want to modify a CampaignCriterion, you would use a CampaignCriterionOperation and send it to the CampaignCriterionService.MutateCampaignCriteria endpoint.

Since the operations field of the request can be repeated, a single mutate request can contain multiple operations. However, each operation is treated independently from all others, so no cross-referencing is allowed.

This is in contrast to the bulk mutate method (GoogleAdsService.Mutate), where operations within the same request can reference entities from other operations.