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 a FeedItem
, you would pass a
FeedItemOperation
containing the
mutated FeedItem
to the
FeedItemService.MutateFeedItems
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.