Unable to clear portrait_marketing_images under discovery_multi_asset_ad
celeray opened this issue · 1 comments
celeray commented
Unable to clear portrait_marketing_images under discovery_multi_asset_ad,running the library version 24.0.0:
I have tried portrait_marketing_images =[] or portrait_marketing_images =None, but it still exists. What is the specific implementation code for clearing portrait_marketing_images?
def update_image_ad_portrait():
ad_service = client.get_service("AdService")
ad_operation = client.get_type("AdOperation")
ad = ad_operation.update
ad.resource_name = 'xxxxxx'
image_ad = ad.discovery_multi_asset_ad
image_ad.portrait_marketing_images = []
client.copy_from(
ad_operation.update_mask,
protobuf_helpers.field_mask(None, ad._pb),
)
try:
ad_service.mutate_ads(
customer_id=str(xxxxx), operations=[ad_operation]
)
logger.info("update image portrait success")
except GoogleAdsException as ex:
raise ex