As follows, I use the following code to update:

```python
ad_group_ad_operation = client.get_type("AdGroupAdOperation")
ad_group_ad = ad_group_ad_operation.update

ad_group_ad.resource_name = ad_group_ad_resource_name

ad_headlines = []
for headline in headlines:
headline_text = headline['text']
if headline['pinned_field'] == 'UNSPECIFIED':
headline_pinned_field = None
else:
headline_pinned_field = 
client.enums.ServedAssetFieldTypeEnum[headline['pinned_field']]
ad_headlines.append(create_ad_text_asset(client, headline_text, 
headline_pinned_field))

ad_group_ad.ad.responsive_search_ad.headlines.extend(ad_headlines)

client.copy_from(
ad_group_ad_operation.update_mask,
protobuf_helpers.field_mask(None, ad_group_ad._pb),
)
```

But I got the following response:
```
status {
code: 3
message: "Field \'ad.responsive_search_ad.headlines\' cannot be modified by 
\'UPDATE\' operation., at 
mutate_operations[61].ad_group_ad_operation.update.ad.responsive_search_ad.headlines"
details {
type_url: 
"type.googleapis.com/google.ads.googleads.v18.errors.GoogleAdsFailure"
value: "\n\300\001\n\002\010\013\022SField 
'ad.responsive_search_ad.headlines' cannot be modified by 'UPDATE' 
operation."e\022\025\n\021mutate_operations\030=\022\027\n\025ad_group_ad_operation\022\010\n\006update\022\004\n\002ad\022\026\n\024responsive_search_ad\022\013\n\theadlines"
}
}
```

How do I update the headlines?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/adwords-api/576a0a60-ab89-45ab-8868-fcd2475486d5n%40googlegroups.com.

Reply via email to