AI-generated Key Takeaways
-
Using a resource's individual service is the most straightforward way to mutate it, although it is the least flexible.
-
Each mutable resource has a corresponding service and a set of operations to create, update, or remove the resource.
-
To mutate a resource, you create an object, put it inside a corresponding operation object, and send it to the resource-specific mutate endpoint.
-
A single mutate request can contain multiple operations, but each operation is treated independently and cross-referencing is not allowed.
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.