From 13a96ee8665763a62df13b81371190ea481f4ead Mon Sep 17 00:00:00 2001 From: David Wihl Date: Thu, 21 Nov 2019 18:08:22 -0500 Subject: [PATCH] Removal of Python 2 support (#188) --- ChangeLog | 3 +++ README.rst | 4 ++-- examples/account_management/create_customer.py | 4 +--- examples/account_management/get_account_changes.py | 4 +--- .../account_management/get_account_information.py | 4 +--- .../account_management/link_manager_to_client.py | 6 ++---- .../account_management/list_accessible_customers.py | 1 - .../advanced_operations/add_ad_group_bid_modifier.py | 6 ++---- .../advanced_operations/add_dynamic_page_feed.py | 8 +++----- .../add_dynamic_search_ads_campaign.py | 4 +--- .../add_expanded_text_ad_with_upgraded_urls.py | 6 ++---- examples/advanced_operations/add_gmail_ad.py | 6 ++---- examples/advanced_operations/add_sitelink.py | 4 +--- .../create_and_attach_shared_keyword_set.py | 6 ++---- .../find_and_remove_criteria_from_shared_set.py | 6 ++---- .../get_ad_group_bid_modifiers.py | 6 ++---- .../use_portfolio_bidding_strategy.py | 4 +--- .../authenticate_in_standalone_application.py | 1 - .../authenticate_in_web_application.py | 1 - examples/basic_operations/add_ad_groups.py | 6 ++---- examples/basic_operations/add_campaigns.py | 4 +--- examples/basic_operations/add_expanded_text_ads.py | 6 ++---- examples/basic_operations/add_keywords.py | 8 +++----- examples/basic_operations/get_ad_groups.py | 6 ++---- examples/basic_operations/get_artifact_metadata.py | 4 +--- examples/basic_operations/get_campaigns.py | 4 +--- examples/basic_operations/get_expanded_text_ads.py | 6 ++---- examples/basic_operations/get_keywords.py | 6 ++---- examples/basic_operations/pause_ad.py | 8 +++----- examples/basic_operations/remove_ad.py | 8 +++----- examples/basic_operations/remove_ad_group.py | 6 ++---- examples/basic_operations/remove_campaign.py | 6 ++---- examples/basic_operations/remove_keyword.py | 8 +++----- examples/basic_operations/update_ad_group.py | 6 ++---- examples/basic_operations/update_campaign.py | 6 ++---- examples/basic_operations/update_keyword.py | 8 +++----- examples/billing/add_account_budget_proposal.py | 6 ++---- examples/billing/get_account_budget_proposals.py | 4 +--- examples/billing/get_account_budgets.py | 4 +--- examples/billing/get_billing_setup.py | 4 +--- examples/billing/remove_billing_setup.py | 6 ++---- .../campaign_management/add_campaign_bid_modifier.py | 6 ++---- .../create_campaign_experiment.py | 6 ++---- .../campaign_management/get_all_disapproved_ads.py | 6 ++---- .../campaign_management/get_campaigns_by_label.py | 6 ++---- examples/campaign_management/set_ad_parameters.py | 8 +++----- examples/error_handling/handle_partial_failure.py | 6 ++---- examples/hotel_ads/add_hotel_ad.py | 6 ++---- .../hotel_ads/add_hotel_ad_group_bid_modifiers.py | 6 ++---- .../create_complete_campaign_both_apis_phase_1.py | 3 +-- .../create_complete_campaign_both_apis_phase_2.py | 3 +-- .../create_complete_campaign_both_apis_phase_3.py | 3 +-- .../create_complete_campaign_both_apis_phase_4.py | 3 +-- .../create_complete_campaign_google_ads_api_only.py | 3 +-- examples/planning/add_keyword_plan.py | 4 +--- examples/planning/forecast_reach.py | 4 +--- examples/planning/generate_forecast_metrics.py | 6 ++---- examples/planning/generate_keyword_ideas.py | 12 +++++------- examples/recommendations/apply_recommendation.py | 6 ++---- examples/recommendations/dismiss_recommendation.py | 6 ++---- .../recommendations/get_text_ad_recommendations.py | 4 +--- examples/remarketing/add_conversion_action.py | 4 +--- examples/reporting/get_hotel_ads_performance.py | 4 +--- examples/reporting/get_keyword_stats.py | 4 +--- examples/shopping/add_shopping_product_ad.py | 4 +--- .../get_product_bidding_category_constant.py | 4 +--- .../targeting/add_campaign_targeting_criteria.py | 10 ++++------ .../targeting/get_campaign_targeting_criteria.py | 6 ++---- .../targeting/get_geo_target_constant_by_names.py | 1 - google/ads/google_ads/__init__.py | 1 - google/ads/google_ads/v1/__init__.py | 1 - google/ads/google_ads/v1/types.py | 1 - google/ads/google_ads/v2/__init__.py | 1 - google/ads/google_ads/v2/types.py | 1 - setup.py | 8 ++------ 75 files changed, 120 insertions(+), 251 deletions(-) diff --git a/ChangeLog b/ChangeLog index bcad595bd..e90caea5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +* 4.0.0: +- Removing support for Python 2 + * 3.3.0: - Google ads v2_2 release diff --git a/README.rst b/README.rst index 6a2870445..9e7e3c202 100644 --- a/README.rst +++ b/README.rst @@ -15,8 +15,8 @@ Features Requirements ------------ -* Python 2.7.13+ / 3.5.3+ - - **NOTE:** Python 2 support will cease by the end of 2019. See this `blog post`_ for more detail. +* Python 3.6.7+ + - **NOTE:** Python 2 support has ceased as of v4.0. See this `blog post`_ for more detail. * `pip`_ diff --git a/examples/account_management/create_customer.py b/examples/account_management/create_customer.py index ac23c57d0..182c9b362 100755 --- a/examples/account_management/create_customer.py +++ b/examples/account_management/create_customer.py @@ -20,10 +20,8 @@ account. """ -from __future__ import absolute_import import argparse -import six import sys from datetime import datetime @@ -73,7 +71,7 @@ def main(client, manager_customer_id): parser = argparse.ArgumentParser( description=('Creates a new client under the given manager.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-m', '--manager_customer_id', type=six.text_type, + parser.add_argument('-m', '--manager_customer_id', type=str, required=True, help='A Google Ads customer ID for the ' 'manager account under which the new customer will ' 'be created.') diff --git a/examples/account_management/get_account_changes.py b/examples/account_management/get_account_changes.py index 6d70cd324..9a4ac71c1 100755 --- a/examples/account_management/get_account_changes.py +++ b/examples/account_management/get_account_changes.py @@ -16,12 +16,10 @@ """This example gets the changes in the account made in the last 7 days.""" -from __future__ import absolute_import import argparse import sys -import six import google.ads.google_ads.client @@ -113,7 +111,7 @@ def main(client, customer_id): parser = argparse.ArgumentParser( description=('Displays account changes that occurred in the last 7 days.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/account_management/get_account_information.py b/examples/account_management/get_account_information.py index f1576a7cb..87bc0c56e 100755 --- a/examples/account_management/get_account_information.py +++ b/examples/account_management/get_account_information.py @@ -17,10 +17,8 @@ For example, its name, currency, time zone, etc. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -61,7 +59,7 @@ def main(client, customer_id): description=('Displays basic information about the specified ' 'customer\'s advertising account.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/account_management/link_manager_to_client.py b/examples/account_management/link_manager_to_client.py index e92da11db..ff1936899 100755 --- a/examples/account_management/link_manager_to_client.py +++ b/examples/account_management/link_manager_to_client.py @@ -14,10 +14,8 @@ # limitations under the License. """This example shows how to link a manager customer to a client customer.""" -from __future__ import absolute_import import argparse -import six import sys import uuid from datetime import datetime, timedelta @@ -104,9 +102,9 @@ def main(client, customer_id, manager_customer_id): description= ('Links and existing manager customer to an existing' 'client customer')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The customer ID.') - parser.add_argument('-m', '--manager_customer_id', type=six.text_type, + parser.add_argument('-m', '--manager_customer_id', type=str, required=True, help='The manager customer ID.') args = parser.parse_args() diff --git a/examples/account_management/list_accessible_customers.py b/examples/account_management/list_accessible_customers.py index 986ddf3fe..d6c71293b 100755 --- a/examples/account_management/list_accessible_customers.py +++ b/examples/account_management/list_accessible_customers.py @@ -20,7 +20,6 @@ documentation: https://developers.google.com/google-ads/api/docs/concepts/call-structure#login-customer-id """ -from __future__ import absolute_import import sys diff --git a/examples/advanced_operations/add_ad_group_bid_modifier.py b/examples/advanced_operations/add_ad_group_bid_modifier.py index 4882b939f..d7ffbd080 100755 --- a/examples/advanced_operations/add_ad_group_bid_modifier.py +++ b/examples/advanced_operations/add_ad_group_bid_modifier.py @@ -17,10 +17,8 @@ To get ad group bid modifiers, run get_ad_group_bid_modifiers.py """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -77,9 +75,9 @@ def main(client, customer_id, ad_group_id, bid_modifier_value): description=('Adds an ad group bid modifier to the specified ad group ' 'ID, for the given customer ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') parser.add_argument('-b', '--bid_modifier_value', type=float, required=False, default=1.5, diff --git a/examples/advanced_operations/add_dynamic_page_feed.py b/examples/advanced_operations/add_dynamic_page_feed.py index fbdcc1458..93aebc583 100755 --- a/examples/advanced_operations/add_dynamic_page_feed.py +++ b/examples/advanced_operations/add_dynamic_page_feed.py @@ -19,10 +19,8 @@ campaigns run basic_operations/get_campaigns.py. """ -from __future__ import absolute_import import argparse -import six import sys import uuid from datetime import datetime, timedelta @@ -351,11 +349,11 @@ def add_dsa_targeting(client, customer_id, ad_group_resource_name, label): description= ('Adds a page feed with URLs for a Dynamic Search Ads ' 'Campaign.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') args = parser.parse_args() diff --git a/examples/advanced_operations/add_dynamic_search_ads_campaign.py b/examples/advanced_operations/add_dynamic_search_ads_campaign.py index 7dbad8cb9..7171ad2c8 100755 --- a/examples/advanced_operations/add_dynamic_search_ads_campaign.py +++ b/examples/advanced_operations/add_dynamic_search_ads_campaign.py @@ -17,10 +17,8 @@ To get campaigns, run basic_operations/get_campaigns.py """ -from __future__ import absolute_import import argparse -import six import sys from uuid import uuid4 from datetime import datetime, timedelta @@ -266,7 +264,7 @@ def add_webpage_criteria(client, customer_id, ad_group_resource_name): description=('Adds a Dynamic Search Ad campaign under the specified ' 'customer ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/advanced_operations/add_expanded_text_ad_with_upgraded_urls.py b/examples/advanced_operations/add_expanded_text_ad_with_upgraded_urls.py index 3f43bba0d..c0dd1a4e3 100755 --- a/examples/advanced_operations/add_expanded_text_ad_with_upgraded_urls.py +++ b/examples/advanced_operations/add_expanded_text_ad_with_upgraded_urls.py @@ -14,10 +14,8 @@ # limitations under the License. """This adds an expanded text ad using advanced features of upgraded URLs.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -102,9 +100,9 @@ def main(client, customer_id, ad_group_id): description=('Adds an expanded text ad to the specified ad group ID, ' 'for the given customer ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') args = parser.parse_args() diff --git a/examples/advanced_operations/add_gmail_ad.py b/examples/advanced_operations/add_gmail_ad.py index 18c606143..f788068cc 100755 --- a/examples/advanced_operations/add_gmail_ad.py +++ b/examples/advanced_operations/add_gmail_ad.py @@ -18,10 +18,8 @@ DISPLAY_GMAIL_AD. To get ad groups, run basic_operations/get_ad_groups.py """ -from __future__ import absolute_import import argparse -import six import sys from uuid import uuid4 import requests @@ -124,9 +122,9 @@ def get_image(url): description=('Adds a gmail ad to the specified ad group ID, ' 'for the given customer ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') args = parser.parse_args() diff --git a/examples/advanced_operations/add_sitelink.py b/examples/advanced_operations/add_sitelink.py index 601d759b2..ca01acb44 100755 --- a/examples/advanced_operations/add_sitelink.py +++ b/examples/advanced_operations/add_sitelink.py @@ -14,10 +14,8 @@ # limitations under the License. """Demonstrates how to create a sitelink extension.""" -from __future__ import absolute_import import argparse -import six import sys from google.ads.google_ads.client import GoogleAdsClient @@ -62,7 +60,7 @@ def main(client, customer_id): parser = argparse.ArgumentParser( description='Creates sitelink for the specified customer id') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID') args = parser.parse_args() diff --git a/examples/advanced_operations/create_and_attach_shared_keyword_set.py b/examples/advanced_operations/create_and_attach_shared_keyword_set.py index 5ecd95890..f4ab09e33 100755 --- a/examples/advanced_operations/create_and_attach_shared_keyword_set.py +++ b/examples/advanced_operations/create_and_attach_shared_keyword_set.py @@ -17,10 +17,8 @@ Note that the keywords will be attached to the specified campaign. """ -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -123,9 +121,9 @@ def main(client, customer_id, campaign_id): description=('Adds a list of negative broad match keywords to the ' 'provided campaign, for the specified customer.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') args = parser.parse_args() diff --git a/examples/advanced_operations/find_and_remove_criteria_from_shared_set.py b/examples/advanced_operations/find_and_remove_criteria_from_shared_set.py index 9de5a2938..29147813f 100755 --- a/examples/advanced_operations/find_and_remove_criteria_from_shared_set.py +++ b/examples/advanced_operations/find_and_remove_criteria_from_shared_set.py @@ -14,10 +14,8 @@ # limitations under the License. """Demonstrates how to find and remove shared sets, and shared set criteria.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -130,9 +128,9 @@ def main(client, customer_id, page_size, campaign_id): description=('Finds shared sets, then finds and removes shared set ' 'criteria under them.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') args = parser.parse_args() diff --git a/examples/advanced_operations/get_ad_group_bid_modifiers.py b/examples/advanced_operations/get_ad_group_bid_modifiers.py index e13740263..23c9fd7a3 100755 --- a/examples/advanced_operations/get_ad_group_bid_modifiers.py +++ b/examples/advanced_operations/get_ad_group_bid_modifiers.py @@ -14,10 +14,8 @@ # limitations under the License. """This example illustrates how to retrieve ad group bid modifiers.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -70,9 +68,9 @@ def main(client, customer_id, page_size, ad_group_id=None): parser = argparse.ArgumentParser( description='List ad group bid modifiers for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=False, help=('The ad group ID. Specify this to list ad group ' 'bid modifiers solely for this ad group ID.')) diff --git a/examples/advanced_operations/use_portfolio_bidding_strategy.py b/examples/advanced_operations/use_portfolio_bidding_strategy.py index 394f468bb..22bdf2aa7 100755 --- a/examples/advanced_operations/use_portfolio_bidding_strategy.py +++ b/examples/advanced_operations/use_portfolio_bidding_strategy.py @@ -14,10 +14,8 @@ # limitations under the License. """This example constructs a campaign with a Portfolio Bidding Strategy.""" -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -137,7 +135,7 @@ def main(client, customer_id): parser = argparse.ArgumentParser( description='Adds a campaign for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/authentication/authenticate_in_standalone_application.py b/examples/authentication/authenticate_in_standalone_application.py index dfd4e14d0..a14d98242 100755 --- a/examples/authentication/authenticate_in_standalone_application.py +++ b/examples/authentication/authenticate_in_standalone_application.py @@ -20,7 +20,6 @@ It is intended to be run from the command line and requires user input. """ -from __future__ import absolute_import import argparse diff --git a/examples/authentication/authenticate_in_web_application.py b/examples/authentication/authenticate_in_web_application.py index a0e61a539..0239d4b94 100755 --- a/examples/authentication/authenticate_in_web_application.py +++ b/examples/authentication/authenticate_in_web_application.py @@ -20,7 +20,6 @@ It is intended to be run from the command line and requires user input. """ -from __future__ import absolute_import import argparse diff --git a/examples/basic_operations/add_ad_groups.py b/examples/basic_operations/add_ad_groups.py index b0cf15500..96d98cdbc 100755 --- a/examples/basic_operations/add_ad_groups.py +++ b/examples/basic_operations/add_ad_groups.py @@ -17,10 +17,8 @@ To get ad groups, run get_ad_groups.py. """ -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -68,9 +66,9 @@ def main(client, customer_id, campaign_id): parser = argparse.ArgumentParser( description='Adds an ad group for specified customer and campaign id.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') args = parser.parse_args() diff --git a/examples/basic_operations/add_campaigns.py b/examples/basic_operations/add_campaigns.py index 35b07b8e6..b2aa97e1c 100755 --- a/examples/basic_operations/add_campaigns.py +++ b/examples/basic_operations/add_campaigns.py @@ -17,11 +17,9 @@ To get campaigns, run get_campaigns.py. """ -from __future__ import absolute_import import argparse import datetime -import six import sys import uuid @@ -118,7 +116,7 @@ def main(client, customer_id): parser = argparse.ArgumentParser( description='Adds a campaign for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/basic_operations/add_expanded_text_ads.py b/examples/basic_operations/add_expanded_text_ads.py index 7e2a006f8..9bffac6e1 100755 --- a/examples/basic_operations/add_expanded_text_ads.py +++ b/examples/basic_operations/add_expanded_text_ads.py @@ -17,10 +17,8 @@ To get expanded text ads, run get_expanded_text_ads.py. """ -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -83,9 +81,9 @@ def main(client, customer_id, ad_group_id, number_of_ads): description=('Adds an expanded text ad to the specified ad group ID, ' 'for the given customer ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') parser.add_argument('-n', '--number_of_ads', type=int, required=False, default=1, help='The number of ads.') diff --git a/examples/basic_operations/add_keywords.py b/examples/basic_operations/add_keywords.py index bcf62f0de..e0f702415 100755 --- a/examples/basic_operations/add_keywords.py +++ b/examples/basic_operations/add_keywords.py @@ -14,10 +14,8 @@ # limitations under the License. """This example demonstrates how to add a keyword to an ad group.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -79,11 +77,11 @@ def main(client, customer_id, ad_group_id, keyword): description=('Adds a keyword to the provided ad group, for the ' 'specified customer.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') - parser.add_argument('-k', '--keyword', type=six.text_type, required=False, + parser.add_argument('-k', '--keyword', type=str, required=False, default='mars cruise', help=('The keyword to be added to the ad group. Note ' 'that you will receive an error response if you ' diff --git a/examples/basic_operations/get_ad_groups.py b/examples/basic_operations/get_ad_groups.py index dc9c3d90c..4d487fb56 100755 --- a/examples/basic_operations/get_ad_groups.py +++ b/examples/basic_operations/get_ad_groups.py @@ -14,10 +14,8 @@ # limitations under the License. """This example illustrates how to retrieve ad groups.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -61,9 +59,9 @@ def main(client, customer_id, page_size, campaign_id=None): parser = argparse.ArgumentParser( description='List ad groups for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=False, help=('The campaign ID. Specify this to list ad groups ' 'solely for this campaign ID.')) diff --git a/examples/basic_operations/get_artifact_metadata.py b/examples/basic_operations/get_artifact_metadata.py index 5a55af700..a1a328636 100755 --- a/examples/basic_operations/get_artifact_metadata.py +++ b/examples/basic_operations/get_artifact_metadata.py @@ -21,10 +21,8 @@ that are selectable with the artifact. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -108,7 +106,7 @@ def main(client, artifact_name, page_size): parser = argparse.ArgumentParser( description='Lists metadata for the specified artifact.') # The following argument(s) should be provided to run the example. - parser.add_argument('-a', '--artifact_name', type=six.text_type, + parser.add_argument('-a', '--artifact_name', type=str, required=True, help='The name of the artifact for which we are ' 'retrieving metadata.') diff --git a/examples/basic_operations/get_campaigns.py b/examples/basic_operations/get_campaigns.py index 649969735..4e62b86a9 100755 --- a/examples/basic_operations/get_campaigns.py +++ b/examples/basic_operations/get_campaigns.py @@ -17,10 +17,8 @@ To add campaigns, run add_campaigns.py. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -61,7 +59,7 @@ def main(client, customer_id, page_size): parser = argparse.ArgumentParser( description='Lists all campaigns for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/basic_operations/get_expanded_text_ads.py b/examples/basic_operations/get_expanded_text_ads.py index 053236e14..01776127d 100755 --- a/examples/basic_operations/get_expanded_text_ads.py +++ b/examples/basic_operations/get_expanded_text_ads.py @@ -14,10 +14,8 @@ # limitations under the License. """This example illustrates how to retrieve expanded text ads.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -73,9 +71,9 @@ def main(client, customer_id, page_size, ad_group_id=None): parser = argparse.ArgumentParser( description='List ad groups for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=False, help='The ad group ID. ') args = parser.parse_args() diff --git a/examples/basic_operations/get_keywords.py b/examples/basic_operations/get_keywords.py index 0b1a420b8..d15ca9acd 100755 --- a/examples/basic_operations/get_keywords.py +++ b/examples/basic_operations/get_keywords.py @@ -14,10 +14,8 @@ # limitations under the License. """This example retrieves keywords for a customer.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -72,9 +70,9 @@ def main(client, customer_id, page_size, ad_group_id=None): description=('Retrieves keywords for the specified customer, or ' 'optionally for a specific ad group.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=False, help='The ad group ID.') args = parser.parse_args() diff --git a/examples/basic_operations/pause_ad.py b/examples/basic_operations/pause_ad.py index d01c1954b..1c4294ab8 100755 --- a/examples/basic_operations/pause_ad.py +++ b/examples/basic_operations/pause_ad.py @@ -14,10 +14,8 @@ # limitations under the License. """This example pauses an ad.""" -from __future__ import absolute_import import argparse -import six import sys from google.api_core import protobuf_helpers @@ -62,11 +60,11 @@ def main(client, customer_id, ad_group_id, ad_id): parser = argparse.ArgumentParser( description=('Pauses an ad in the specified customer\'s ad group.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') - parser.add_argument('-i', '--ad_id', type=six.text_type, required=True, + parser.add_argument('-i', '--ad_id', type=str, required=True, help='The ad ID.') args = parser.parse_args() diff --git a/examples/basic_operations/remove_ad.py b/examples/basic_operations/remove_ad.py index 4d3ec294c..129eacfc6 100755 --- a/examples/basic_operations/remove_ad.py +++ b/examples/basic_operations/remove_ad.py @@ -14,10 +14,8 @@ # limitations under the License. """This example removes an existing ad.""" -from __future__ import absolute_import import argparse -import six import sys from google.ads.google_ads.client import GoogleAdsClient @@ -55,11 +53,11 @@ def main(client, customer_id, ad_group_id, ad_id): parser = argparse.ArgumentParser( description=('Removes an ad from the specified customer\'s ad group.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') - parser.add_argument('-i', '--ad_id', type=six.text_type, required=True, + parser.add_argument('-i', '--ad_id', type=str, required=True, help='The ad ID.') args = parser.parse_args() diff --git a/examples/basic_operations/remove_ad_group.py b/examples/basic_operations/remove_ad_group.py index 85c919d35..bd5ac6130 100755 --- a/examples/basic_operations/remove_ad_group.py +++ b/examples/basic_operations/remove_ad_group.py @@ -14,10 +14,8 @@ # limitations under the License. """This example removes an existing ad group.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -55,9 +53,9 @@ def main(client, customer_id, ad_group_id): parser = argparse.ArgumentParser( description=('Removes an ad group for the specified customer.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') args = parser.parse_args() diff --git a/examples/basic_operations/remove_campaign.py b/examples/basic_operations/remove_campaign.py index 6a6e209c6..de7816cb2 100755 --- a/examples/basic_operations/remove_campaign.py +++ b/examples/basic_operations/remove_campaign.py @@ -14,10 +14,8 @@ # limitations under the License. """This example removes an existing campaign.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -55,9 +53,9 @@ def main(client, customer_id, campaign_id): parser = argparse.ArgumentParser( description=('Removes given campaign for the specified customer.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') args = parser.parse_args() diff --git a/examples/basic_operations/remove_keyword.py b/examples/basic_operations/remove_keyword.py index 3bf6647af..de4b28501 100755 --- a/examples/basic_operations/remove_keyword.py +++ b/examples/basic_operations/remove_keyword.py @@ -14,10 +14,8 @@ # limitations under the License. """This example removes an existing keyword from an ad group.""" -from __future__ import absolute_import import argparse -import six import sys from google.ads.google_ads.client import GoogleAdsClient @@ -55,11 +53,11 @@ def main(client, customer_id, ad_group_id, criteria_id): parser = argparse.ArgumentParser( description=('Removes given campaign for the specified customer.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') - parser.add_argument('-k', '--criteria_id', type=six.text_type, + parser.add_argument('-k', '--criteria_id', type=str, required=True, help='The criteria ID, or keyword ID.') args = parser.parse_args() diff --git a/examples/basic_operations/update_ad_group.py b/examples/basic_operations/update_ad_group.py index 6121f7753..32a87fdc4 100755 --- a/examples/basic_operations/update_ad_group.py +++ b/examples/basic_operations/update_ad_group.py @@ -17,10 +17,8 @@ To get ad groups, run get_ad_groups.py. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -67,9 +65,9 @@ def main(client, customer_id, ad_group_id, bid_micro_amount): description=('Updates an ad group for specified customer and campaign ' 'id with the given bid micro amount.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') parser.add_argument('-b', '--bid_micro_amount', type=int, required=True, help='The bid micro amount.') diff --git a/examples/basic_operations/update_campaign.py b/examples/basic_operations/update_campaign.py index d9f6cb588..1ce6b06ba 100755 --- a/examples/basic_operations/update_campaign.py +++ b/examples/basic_operations/update_campaign.py @@ -17,10 +17,8 @@ To get campaigns, run get_campaigns.py. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.errors @@ -67,9 +65,9 @@ def main(client, customer_id, campaign_id): parser = argparse.ArgumentParser( description='Updates the given campaign for the specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') args = parser.parse_args() diff --git a/examples/basic_operations/update_keyword.py b/examples/basic_operations/update_keyword.py index 9424db2a9..0c091b26b 100755 --- a/examples/basic_operations/update_keyword.py +++ b/examples/basic_operations/update_keyword.py @@ -14,10 +14,8 @@ # limitations under the License. """This example updates a keyword for the specified ad group.""" -from __future__ import absolute_import import argparse -import six import sys from google.api_core import protobuf_helpers @@ -65,11 +63,11 @@ def main(client, customer_id, ad_group_id, criterion_id): parser = argparse.ArgumentParser( description=('Pauses an ad in the specified customer\'s ad group.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') - parser.add_argument('-k', '--criterion_id', type=six.text_type, + parser.add_argument('-k', '--criterion_id', type=str, required=True, help='The criterion ID, or keyword ID.') args = parser.parse_args() diff --git a/examples/billing/add_account_budget_proposal.py b/examples/billing/add_account_budget_proposal.py index eed29a6d8..ce3baa094 100755 --- a/examples/billing/add_account_budget_proposal.py +++ b/examples/billing/add_account_budget_proposal.py @@ -17,12 +17,10 @@ To get account budget proposal, run get_account_budget_proposals.py """ -from __future__ import absolute_import import argparse import sys -import six import google.ads.google_ads.client @@ -93,9 +91,9 @@ def main(client, customer_id, billing_setup_id): parser = argparse.ArgumentParser( description='Creates an account budget proposal.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Ads customer ID.') - parser.add_argument('-b', '--billing_setup_id', type=six.text_type, + parser.add_argument('-b', '--billing_setup_id', type=str, required=True, help='The billing setup ID.') args = parser.parse_args() diff --git a/examples/billing/get_account_budget_proposals.py b/examples/billing/get_account_budget_proposals.py index a12fd1bb7..c66212d99 100755 --- a/examples/billing/get_account_budget_proposals.py +++ b/examples/billing/get_account_budget_proposals.py @@ -17,12 +17,10 @@ To add an account budget proposal, run add_account_budget_proposal.py """ -from __future__ import absolute_import import argparse import sys -import six import google.ads.google_ads.client @@ -92,7 +90,7 @@ def main(client, customer_id, page_size): parser = argparse.ArgumentParser( description='Lists all account budget proposals.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/billing/get_account_budgets.py b/examples/billing/get_account_budgets.py index 9014a90ae..116a449f7 100755 --- a/examples/billing/get_account_budgets.py +++ b/examples/billing/get_account_budgets.py @@ -14,12 +14,10 @@ # limitations under the License. """This illustrates how to get all account budgets for a Google Ads customer.""" -from __future__ import absolute_import import argparse import sys -import six import google.ads.google_ads.client @@ -111,7 +109,7 @@ def micros_to_currency(micros): description=('Lists all account budgets for given Google Ads customer ' 'ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/billing/get_billing_setup.py b/examples/billing/get_billing_setup.py index 16bace4aa..34f1109f8 100755 --- a/examples/billing/get_billing_setup.py +++ b/examples/billing/get_billing_setup.py @@ -14,10 +14,8 @@ # limitations under the License. """Gets all billing setup objects available for the specified customer ID.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -84,7 +82,7 @@ def main(client, customer_id, page_size): parser = argparse.ArgumentParser( description='Lists all billing setup objects for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/billing/remove_billing_setup.py b/examples/billing/remove_billing_setup.py index 87d65e57a..85e6c133b 100755 --- a/examples/billing/remove_billing_setup.py +++ b/examples/billing/remove_billing_setup.py @@ -17,10 +17,8 @@ To get available billing setups, run get_billing_setups.py. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -64,9 +62,9 @@ def main(client, customer_id, billing_setup_id): description=('Removes billing setup for specified customer and billing ' 'setup ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-b', '--billing_setup_id', type=six.text_type, + parser.add_argument('-b', '--billing_setup_id', type=str, required=True, help='The billing setup ID.') args = parser.parse_args() diff --git a/examples/campaign_management/add_campaign_bid_modifier.py b/examples/campaign_management/add_campaign_bid_modifier.py index d4cf1bee0..a9abab1c1 100755 --- a/examples/campaign_management/add_campaign_bid_modifier.py +++ b/examples/campaign_management/add_campaign_bid_modifier.py @@ -15,10 +15,8 @@ """Demonstrates how to add a campaign-level bid modifier for call interactions. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -75,9 +73,9 @@ def main(client, customer_id, campaign_id, bid_modifier_value): description=('Adds a bid modifier to the specified campaign ID, for ' 'the given customer ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') parser.add_argument('-b', '--bid_modifier_value', type=float, required=False, default=1.5, diff --git a/examples/campaign_management/create_campaign_experiment.py b/examples/campaign_management/create_campaign_experiment.py index cfee8147e..a9f6c6e99 100644 --- a/examples/campaign_management/create_campaign_experiment.py +++ b/examples/campaign_management/create_campaign_experiment.py @@ -17,10 +17,8 @@ It requests the creation based on a draft and waits for completion. """ -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -97,10 +95,10 @@ def main(client, customer_id, campaign_draft_resource_name): parser = argparse.ArgumentParser( description=('Create a campaign experiment based on a campaign draft.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') parser.add_argument('-n', '--campaign_draft_resource_name', - type=six.text_type, required=True, + type=str, required=True, help='The campaign draft resource name.') args = parser.parse_args() diff --git a/examples/campaign_management/get_all_disapproved_ads.py b/examples/campaign_management/get_all_disapproved_ads.py index ff64a089b..f395d56ab 100755 --- a/examples/campaign_management/get_all_disapproved_ads.py +++ b/examples/campaign_management/get_all_disapproved_ads.py @@ -14,10 +14,8 @@ # limitations under the License. """This illustrates how to retrieve disapproved ads in a given campaign.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -92,9 +90,9 @@ def main(client, customer_id, campaign_id, page_size): description=('Lists disapproved ads for a given customer\'s specified ' 'campaign.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') args = parser.parse_args() diff --git a/examples/campaign_management/get_campaigns_by_label.py b/examples/campaign_management/get_campaigns_by_label.py index 97551e506..a658dbcd2 100755 --- a/examples/campaign_management/get_campaigns_by_label.py +++ b/examples/campaign_management/get_campaigns_by_label.py @@ -17,10 +17,8 @@ To add campaigns, run add_campaigns.py. """ -from __future__ import absolute_import import argparse -import six import sys from google.ads.google_ads.client import GoogleAdsClient @@ -98,9 +96,9 @@ def print_error_and_exit_process(error): parser = argparse.ArgumentParser( description='Lists all campaigns for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-l', '--label_id', type=six.text_type, required=True, + parser.add_argument('-l', '--label_id', type=str, required=True, help='A label ID associated with a campaign.') args = parser.parse_args() diff --git a/examples/campaign_management/set_ad_parameters.py b/examples/campaign_management/set_ad_parameters.py index 3c7530893..e057af99e 100755 --- a/examples/campaign_management/set_ad_parameters.py +++ b/examples/campaign_management/set_ad_parameters.py @@ -14,10 +14,8 @@ # limitations under the License. """This example sets ad parameters for an ad group criterion.""" -from __future__ import absolute_import import argparse -import six import sys from google.ads.google_ads.client import GoogleAdsClient @@ -102,11 +100,11 @@ def create_ad_parameter(client, resource_name, parameter_index, insertion_text): description='Adds an ad group for specified customer and campaign id.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID.') - parser.add_argument('-k', '--criterion_id', type=six.text_type, + parser.add_argument('-k', '--criterion_id', type=str, required=True, help='The criterion ID.') args = parser.parse_args() diff --git a/examples/error_handling/handle_partial_failure.py b/examples/error_handling/handle_partial_failure.py index 810d98909..59068700e 100755 --- a/examples/error_handling/handle_partial_failure.py +++ b/examples/error_handling/handle_partial_failure.py @@ -15,10 +15,8 @@ """This shows how to handle responses that may include partial_failure errors. """ -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -201,9 +199,9 @@ def print_results(client, response): parser = argparse.ArgumentParser( description='Adds an ad group for specified customer and campaign id.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') args = parser.parse_args() diff --git a/examples/hotel_ads/add_hotel_ad.py b/examples/hotel_ads/add_hotel_ad.py index d568dfd56..ebb01f106 100755 --- a/examples/hotel_ads/add_hotel_ad.py +++ b/examples/hotel_ads/add_hotel_ad.py @@ -20,10 +20,8 @@ https://support.google.com/hotelprices/answer/6101897. """ -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -215,12 +213,12 @@ def add_hotel_campaign(client, customer_id, budget_resource_name, description=('Adds an expanded text ad to the specified ad group ID, ' 'for the given customer ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') parser.add_argument('-b', '--bid_ceiling_micro_amount', type=int, required=True, help=('The bid ceiling micro amount for ' 'the hotel campaign.')) - parser.add_argument('-h', '--hotel_center_account_id', type=six.text_type, + parser.add_argument('-h', '--hotel_center_account_id', type=str, required=True, help='The hotel center account ID.') args = parser.parse_args() diff --git a/examples/hotel_ads/add_hotel_ad_group_bid_modifiers.py b/examples/hotel_ads/add_hotel_ad_group_bid_modifiers.py index e316e04f8..8bf6e81b5 100755 --- a/examples/hotel_ads/add_hotel_ad_group_bid_modifiers.py +++ b/examples/hotel_ads/add_hotel_ad_group_bid_modifiers.py @@ -17,10 +17,8 @@ The bid modifiers will be based on hotel check-in day and length of stay. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -86,9 +84,9 @@ def main(client, customer_id, ad_group_id): parser = argparse.ArgumentParser( description=('Adds an ad group bid modifier to a hotel ad group.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-a', '--ad_group_id', type=six.text_type, + parser.add_argument('-a', '--ad_group_id', type=str, required=True, help='The ad group ID of the hotel ad group.') args = parser.parse_args() diff --git a/examples/migration/create_complete_campaign_both_apis_phase_1.py b/examples/migration/create_complete_campaign_both_apis_phase_1.py index b9c9fcfa2..3cd306841 100755 --- a/examples/migration/create_complete_campaign_both_apis_phase_1.py +++ b/examples/migration/create_complete_campaign_both_apis_phase_1.py @@ -35,7 +35,6 @@ import uuid from googleads import adwords -import six from google.ads.google_ads.client import GoogleAdsClient from google.ads.google_ads.errors import GoogleAdsException @@ -272,7 +271,7 @@ def create_keywords(client, ad_group_id, keywords_to_add): parser = argparse.ArgumentParser( description='Lists all campaigns for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() budget = create_campaign_budget(google_ads_client, args.customer_id) diff --git a/examples/migration/create_complete_campaign_both_apis_phase_2.py b/examples/migration/create_complete_campaign_both_apis_phase_2.py index 42ad5a6b3..18e2954dd 100755 --- a/examples/migration/create_complete_campaign_both_apis_phase_2.py +++ b/examples/migration/create_complete_campaign_both_apis_phase_2.py @@ -34,7 +34,6 @@ import uuid from googleads import adwords -import six from google.ads.google_ads.client import GoogleAdsClient from google.ads.google_ads.errors import GoogleAdsException @@ -284,7 +283,7 @@ def create_keywords(client, ad_group_id, keywords_to_add): parser = argparse.ArgumentParser( description='Lists all campaigns for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() budget = create_campaign_budget(google_ads_client, args.customer_id) diff --git a/examples/migration/create_complete_campaign_both_apis_phase_3.py b/examples/migration/create_complete_campaign_both_apis_phase_3.py index 0fb4118c2..379c1a11d 100755 --- a/examples/migration/create_complete_campaign_both_apis_phase_3.py +++ b/examples/migration/create_complete_campaign_both_apis_phase_3.py @@ -34,7 +34,6 @@ import uuid from googleads import adwords -import six from google.ads.google_ads.client import GoogleAdsClient from google.ads.google_ads.errors import GoogleAdsException @@ -298,7 +297,7 @@ def create_keywords(client, ad_group_id, keywords_to_add): parser = argparse.ArgumentParser( description='Lists all campaigns for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() budget = create_campaign_budget(google_ads_client, args.customer_id) diff --git a/examples/migration/create_complete_campaign_both_apis_phase_4.py b/examples/migration/create_complete_campaign_both_apis_phase_4.py index 2d5044de1..3d952f240 100755 --- a/examples/migration/create_complete_campaign_both_apis_phase_4.py +++ b/examples/migration/create_complete_campaign_both_apis_phase_4.py @@ -34,7 +34,6 @@ import uuid from googleads import adwords -import six from google.ads.google_ads.client import GoogleAdsClient from google.ads.google_ads.errors import GoogleAdsException @@ -349,7 +348,7 @@ def create_keywords(client, ad_group_id, keywords_to_add): parser = argparse.ArgumentParser( description='Lists all campaigns for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() budget = create_campaign_budget(google_ads_client, args.customer_id) diff --git a/examples/migration/create_complete_campaign_google_ads_api_only.py b/examples/migration/create_complete_campaign_google_ads_api_only.py index 3b143686d..51a8049b1 100755 --- a/examples/migration/create_complete_campaign_google_ads_api_only.py +++ b/examples/migration/create_complete_campaign_google_ads_api_only.py @@ -32,7 +32,6 @@ import urllib.parse import uuid -import six from google.ads.google_ads.client import GoogleAdsClient from google.ads.google_ads.errors import GoogleAdsException @@ -399,7 +398,7 @@ def formatter(given_string): parser = argparse.ArgumentParser( description='Lists all campaigns for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() budget = create_campaign_budget(google_ads_client, args.customer_id) diff --git a/examples/planning/add_keyword_plan.py b/examples/planning/add_keyword_plan.py index 0b1d077d3..590cdc3c5 100755 --- a/examples/planning/add_keyword_plan.py +++ b/examples/planning/add_keyword_plan.py @@ -18,10 +18,8 @@ metrics. """ -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -283,7 +281,7 @@ def create_keyword_plan_negative_keywords(client, customer_id, plan_campaign): parser = argparse.ArgumentParser( description='Creates a keyword plan for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/planning/forecast_reach.py b/examples/planning/forecast_reach.py index 9a7c36fcc..baed51ff4 100755 --- a/examples/planning/forecast_reach.py +++ b/examples/planning/forecast_reach.py @@ -15,13 +15,11 @@ """This code example generates a video ads reach forecast. """ -from __future__ import absolute_import import argparse import math import sys -import six from google.ads.google_ads.client import GoogleAdsClient from google.ads.google_ads.errors import GoogleAdsException @@ -294,7 +292,7 @@ def main(client, customer_id): parser = argparse.ArgumentParser( description='Generates video ads reach forecast.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/planning/generate_forecast_metrics.py b/examples/planning/generate_forecast_metrics.py index 038db4a85..556c74da4 100755 --- a/examples/planning/generate_forecast_metrics.py +++ b/examples/planning/generate_forecast_metrics.py @@ -17,10 +17,8 @@ To create a keyword plan, run the add_keyword_plan.py example. """ -from __future__ import absolute_import import argparse -import six import sys from google.ads.google_ads.client import GoogleAdsClient @@ -71,9 +69,9 @@ def main(client, customer_id, keyword_plan_id): parser = argparse.ArgumentParser( description='Generates forecast metrics for a keyword plan.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-k', '--keyword_plan_id', type=six.text_type, + parser.add_argument('-k', '--keyword_plan_id', type=str, required=True, help='A Keyword Plan ID.') args = parser.parse_args() diff --git a/examples/planning/generate_keyword_ideas.py b/examples/planning/generate_keyword_ideas.py index 20c2eb0a5..11b656b5d 100755 --- a/examples/planning/generate_keyword_ideas.py +++ b/examples/planning/generate_keyword_ideas.py @@ -14,10 +14,8 @@ # limitations under the License. """This example generates keyword ideas from a list of seed keywords.""" -from __future__ import absolute_import import argparse -import six import sys from google.ads.google_ads.client import GoogleAdsClient from google.ads.google_ads.errors import GoogleAdsException @@ -141,21 +139,21 @@ def map_language_to_string_value(client, language_id): description='Generates keyword ideas from a list of seed keywords.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') # For more information on determining location IDs, see: - parser.add_argument('-k', '--keywords', type=six.text_type, required=False, + parser.add_argument('-k', '--keywords', type=str, required=False, help='Comma-delimited starter keywords') # https://developers.google.com/adwords/api/docs/appendix/geotargeting. - parser.add_argument('-l', '--location_ids', type=six.text_type, + parser.add_argument('-l', '--location_ids', type=str, required=False, help='Comma-delimited list of location ' 'criteria IDs') # https://developers.google.com/adwords/api/docs/appendix/codes-formats#languages. - parser.add_argument('-i', '--language_id', type=six.text_type, + parser.add_argument('-i', '--language_id', type=str, required=False, help='Comma-delimited list of language ' 'criterion IDs') # Optional: Specify a URL string related to your business to generate ideas. - parser.add_argument('-p', '--page_url', type=six.text_type, required=False, + parser.add_argument('-p', '--page_url', type=str, required=False, help='A URL string related to your business') parser.set_defaults(location_ids=_DEFAULT_LOCATION_IDS, diff --git a/examples/recommendations/apply_recommendation.py b/examples/recommendations/apply_recommendation.py index eae4c41b3..872beb73e 100755 --- a/examples/recommendations/apply_recommendation.py +++ b/examples/recommendations/apply_recommendation.py @@ -17,10 +17,8 @@ To retrieve recommendations for text ads, run get_text_ad_recommendations.py. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -64,9 +62,9 @@ def main(client, customer_id, recommendation_id): parser = argparse.ArgumentParser( description=('Pauses an ad in the specified customer\'s ad group.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-r', '--recommendation_id', type=six.text_type, + parser.add_argument('-r', '--recommendation_id', type=str, required=True, help='The recommendation ID.') args = parser.parse_args() diff --git a/examples/recommendations/dismiss_recommendation.py b/examples/recommendations/dismiss_recommendation.py index 558e2836f..9a7c998dd 100755 --- a/examples/recommendations/dismiss_recommendation.py +++ b/examples/recommendations/dismiss_recommendation.py @@ -17,10 +17,8 @@ To retrieve recommendations for text ads, run get_text_ad_recommendations.py. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -66,9 +64,9 @@ def main(client, customer_id, recommendation_id): parser = argparse.ArgumentParser( description=('Dismisses a recommendation with the given ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-r', '--recommendation_id', type=six.text_type, + parser.add_argument('-r', '--recommendation_id', type=str, required=True, help='The recommendation ID.') args = parser.parse_args() diff --git a/examples/recommendations/get_text_ad_recommendations.py b/examples/recommendations/get_text_ad_recommendations.py index 271cbc879..186e36124 100755 --- a/examples/recommendations/get_text_ad_recommendations.py +++ b/examples/recommendations/get_text_ad_recommendations.py @@ -17,10 +17,8 @@ To add campaigns, run add_campaigns.py. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -73,7 +71,7 @@ def main(client, customer_id, page_size): parser = argparse.ArgumentParser( description='Lists TEXT_AD recommendations for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/remarketing/add_conversion_action.py b/examples/remarketing/add_conversion_action.py index d083efa01..9d467116e 100755 --- a/examples/remarketing/add_conversion_action.py +++ b/examples/remarketing/add_conversion_action.py @@ -14,10 +14,8 @@ # limitations under the License. """This example illustrates adding a conversion action.""" -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -77,7 +75,7 @@ def main(client, customer_id): parser = argparse.ArgumentParser( description='Adds a conversion action for specified customer.') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/reporting/get_hotel_ads_performance.py b/examples/reporting/get_hotel_ads_performance.py index d50d70bc1..3bcab701b 100755 --- a/examples/reporting/get_hotel_ads_performance.py +++ b/examples/reporting/get_hotel_ads_performance.py @@ -16,10 +16,8 @@ groups with the most impressions over the last 7 days. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -81,7 +79,7 @@ def main(client, customer_id, page_size): parser = argparse.ArgumentParser( description=('Retrieves Hotel-ads performance statistics.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/reporting/get_keyword_stats.py b/examples/reporting/get_keyword_stats.py index 1f301d87e..3a856d851 100755 --- a/examples/reporting/get_keyword_stats.py +++ b/examples/reporting/get_keyword_stats.py @@ -17,10 +17,8 @@ Retrieves negative keywords in a campaign. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -83,7 +81,7 @@ def main(client, customer_id, page_size): parser = argparse.ArgumentParser( description=('Retrieves a campaign\'s negative keywords.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/shopping/add_shopping_product_ad.py b/examples/shopping/add_shopping_product_ad.py index 4cdb8f235..9fe7e1b6e 100755 --- a/examples/shopping/add_shopping_product_ad.py +++ b/examples/shopping/add_shopping_product_ad.py @@ -24,10 +24,8 @@ This account must be linked to your Google Ads account. """ -from __future__ import absolute_import import argparse -import six import sys import uuid @@ -288,7 +286,7 @@ def add_default_shopping_listing_group(client, customer_id, 'group and a shopping product ad to the specified ' 'merchant account.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') parser.add_argument('-m', '--merchant_center_account_id', type=int, required=True, help='The merchant center account ID.') diff --git a/examples/shopping/get_product_bidding_category_constant.py b/examples/shopping/get_product_bidding_category_constant.py index c94c59585..6f0699256 100755 --- a/examples/shopping/get_product_bidding_category_constant.py +++ b/examples/shopping/get_product_bidding_category_constant.py @@ -15,11 +15,9 @@ """This example fetches the set of valid ProductBiddingCategories.""" -from __future__ import absolute_import import argparse import collections import sys -import six from google.ads.google_ads.client import GoogleAdsClient from google.ads.google_ads.errors import GoogleAdsException @@ -85,7 +83,7 @@ def __init__(self, name=None, id=None, children=[]): parser = argparse.ArgumentParser( description='Get Product Bidding Category Constant') # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') args = parser.parse_args() diff --git a/examples/targeting/add_campaign_targeting_criteria.py b/examples/targeting/add_campaign_targeting_criteria.py index ec7c88bad..e1a769c9a 100755 --- a/examples/targeting/add_campaign_targeting_criteria.py +++ b/examples/targeting/add_campaign_targeting_criteria.py @@ -14,10 +14,8 @@ # limitations under the License. """This example adds campaign targeting criteria.""" -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -123,14 +121,14 @@ def create_proximity_op(client, customer_id, campaign_id): description=('Adds campaign targeting criteria for the specified ' 'campaign under the given customer ID.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') - parser.add_argument('-k', '--keyword', type=six.text_type, required=True, + parser.add_argument('-k', '--keyword', type=str, required=True, help='The keyword to be added to the campaign.') parser.add_argument( - '-l', '--location_id', type=six.text_type, required=False, + '-l', '--location_id', type=str, required=False, default='21167', # New York help=('A location criterion ID, this field is optional. If not ' 'specified, will default to New York. For more information on ' diff --git a/examples/targeting/get_campaign_targeting_criteria.py b/examples/targeting/get_campaign_targeting_criteria.py index 49452b009..2e511f671 100755 --- a/examples/targeting/get_campaign_targeting_criteria.py +++ b/examples/targeting/get_campaign_targeting_criteria.py @@ -15,10 +15,8 @@ """This example illustrates how to get campaign criteria, or negative keywords. """ -from __future__ import absolute_import import argparse -import six import sys import google.ads.google_ads.client @@ -74,9 +72,9 @@ def main(client, customer_id, campaign_id, page_size): description=('List campaign criteria, or negative keywords, for a ' 'given campaign.')) # The following argument(s) should be provided to run the example. - parser.add_argument('-c', '--customer_id', type=six.text_type, + parser.add_argument('-c', '--customer_id', type=str, required=True, help='The Google Ads customer ID.') - parser.add_argument('-i', '--campaign_id', type=six.text_type, + parser.add_argument('-i', '--campaign_id', type=str, required=True, help='The campaign ID.') args = parser.parse_args() diff --git a/examples/targeting/get_geo_target_constant_by_names.py b/examples/targeting/get_geo_target_constant_by_names.py index 56dd943f9..e9eab6fff 100755 --- a/examples/targeting/get_geo_target_constant_by_names.py +++ b/examples/targeting/get_geo_target_constant_by_names.py @@ -15,7 +15,6 @@ """This example illustrates getting GeoTargetConstants by given location names. """ -from __future__ import absolute_import import sys diff --git a/google/ads/google_ads/__init__.py b/google/ads/google_ads/__init__.py index b1365e1ae..b078f43dc 100644 --- a/google/ads/google_ads/__init__.py +++ b/google/ads/google_ads/__init__.py @@ -13,7 +13,6 @@ # limitations under the License. -from __future__ import absolute_import import google.ads.google_ads.client diff --git a/google/ads/google_ads/v1/__init__.py b/google/ads/google_ads/v1/__init__.py index 488e1312d..e1843b044 100644 --- a/google/ads/google_ads/v1/__init__.py +++ b/google/ads/google_ads/v1/__init__.py @@ -13,7 +13,6 @@ # limitations under the License. -from __future__ import absolute_import from google.ads.google_ads.v1 import types diff --git a/google/ads/google_ads/v1/types.py b/google/ads/google_ads/v1/types.py index 05a9d6b7c..e0d801a98 100644 --- a/google/ads/google_ads/v1/types.py +++ b/google/ads/google_ads/v1/types.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import import sys from google.api_core.protobuf_helpers import get_messages diff --git a/google/ads/google_ads/v2/__init__.py b/google/ads/google_ads/v2/__init__.py index ef0307f95..d94c67a42 100644 --- a/google/ads/google_ads/v2/__init__.py +++ b/google/ads/google_ads/v2/__init__.py @@ -13,7 +13,6 @@ # limitations under the License. -from __future__ import absolute_import from google.ads.google_ads.v2 import types diff --git a/google/ads/google_ads/v2/types.py b/google/ads/google_ads/v2/types.py index e34653bd7..190613029 100644 --- a/google/ads/google_ads/v2/types.py +++ b/google/ads/google_ads/v2/types.py @@ -15,7 +15,6 @@ # limitations under the License. -from __future__ import absolute_import import sys from google.api_core.protobuf_helpers import get_messages diff --git a/setup.py b/setup.py index 94eaa91e5..e4605fa37 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,6 @@ import io install_requires = [ - 'enum34; python_version < "3.4"', 'google-auth-oauthlib >= 0.0.1, < 1.0.0', 'google-api-core >= 1.7.0, < 2.0.0', 'googleapis-common-protos >= 1.5.8, < 2.0.0', @@ -35,7 +34,7 @@ setup( name='google-ads', - version='3.3.0', + version='4.0.0', author='Google LLC', author_email='googleapis-packages@google.com', classifiers=[ @@ -44,15 +43,12 @@ 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], description='Client library for the Google Ads API', include_package_data=True, + python_requires='>=3.6', long_description=long_description, install_requires=install_requires, tests_require=tests_require,