Thanks for the link to the "Automatic steps" document. The steps described there did not solve the problem, which seems to specifically stem from the setting for "Low" being the integer 0. However, I just figured out a way to make it work -- namely, instead of using the
client.copy_from() function that I used in the code I shared previously, I manually set the "paths" for the mutate request with a Python dictionary object specifying the fields in question, so that it wouldn't ignore the new value set for "campaign_priority". This is what the modified, successful mutate looks like (updated part is highlighted):
campaign_service = client.get_service("CampaignService")
campaign_operation = client.get_type("CampaignOperation")
campaign = campaign_operation.update
campaign.resource_name = campaign_service.campaign_path(
googleAdsId, campaignId
)
campaign.shopping_setting.campaign_priority = 0
campaign_operation.update_mask = {
'paths': ['resource_name', 'shopping_setting.campaign_priority']
}
response = campaign_service.mutate_campaigns(
customer_id=googleAdsId,
operations=[campaign_operation]
)