1919import six
2020import sys
2121
22- import google .ads .google_ads .client
2322from google .api_core import protobuf_helpers
23+ from google .ads .google_ads .client import GoogleAdsClient
24+ from google .ads .google_ads .util import ResourceName
2425
2526
2627def main (client , customer_id , ad_group_id , ad_id ):
@@ -30,7 +31,7 @@ def main(client, customer_id, ad_group_id, ad_id):
3031
3132 ad_group_ad = ad_group_ad_operation .update
3233 ad_group_ad .resource_name = ad_group_ad_service .ad_group_ad_path (
33- customer_id , '%s_%s' % (ad_group_id , ad_id ))
34+ customer_id , ResourceName . format_composite (ad_group_id , ad_id ))
3435 ad_group_ad .status = client .get_type ('AdGroupStatusEnum' ,
3536 version = 'v1' ).PAUSED
3637 fm = protobuf_helpers .field_mask (None , ad_group_ad )
@@ -56,9 +57,7 @@ def main(client, customer_id, ad_group_id, ad_id):
5657if __name__ == '__main__' :
5758 # GoogleAdsClient will read the google-ads.yaml configuration file in the
5859 # home directory if none is specified.
59- google_ads_client = (google .ads .google_ads .client .GoogleAdsClient
60- .load_from_storage ())
61-
60+ google_ads_client = GoogleAdsClient .load_from_storage ()
6261 parser = argparse .ArgumentParser (
6362 description = ('Pauses an ad in the specified customer\' s ad group.' ))
6463 # The following argument(s) should be provided to run the example.
0 commit comments