diff --git a/ChangeLog b/ChangeLog index 300b47143..daa6dc51b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +* 18.1.0 +- Google Ads API v11_1 release. +- Bump protobuf dependency to version 4.21.5. +- Bump proto-plus dependency to version 1.22.0. +- Update examples to remove references to expanded text ads. +- Fix bug preventing https protocol in proxy URLs. +- Various example updates. + * 18.0.0 - Remove support for Google Ads API v9. - Added "pb" user agent key/value pair. diff --git a/examples/account_management/approve_merchant_center_link.py b/examples/account_management/approve_merchant_center_link.py index aad87d7f7..44cee978c 100644 --- a/examples/account_management/approve_merchant_center_link.py +++ b/examples/account_management/approve_merchant_center_link.py @@ -71,7 +71,7 @@ def main(client, customer_id, merchant_center_account_id): == merchant_center_link_status_enum.PENDING and str(merchant_center_link.id) == merchant_center_account_id ): - _update_merchant_center_link_status( + update_merchant_center_link_status( client, customer_id, merchant_center_link_service, @@ -81,7 +81,7 @@ def main(client, customer_id, merchant_center_account_id): # [START approve_merchant_center_link_2] -def _update_merchant_center_link_status( +def update_merchant_center_link_status( client, customer_id, merchant_center_link_service, diff --git a/examples/account_management/get_account_hierarchy.py b/examples/account_management/get_account_hierarchy.py index 149552b18..4a68d46c1 100755 --- a/examples/account_management/get_account_hierarchy.py +++ b/examples/account_management/get_account_hierarchy.py @@ -133,7 +133,7 @@ def main(client, login_customer_id=None): "The hierarchy of customer ID " f"{root_customer_client.id} is printed below:" ) - _print_account_hierarchy( + print_account_hierarchy( root_customer_client, customer_ids_to_child_accounts, 0 ) else: @@ -144,7 +144,7 @@ def main(client, login_customer_id=None): ) -def _print_account_hierarchy( +def print_account_hierarchy( customer_client, customer_ids_to_child_accounts, depth ): """Prints the specified account's hierarchy using recursion. @@ -171,7 +171,7 @@ def _print_account_hierarchy( # Recursively call this function for all child accounts of customer_client. if customer_id in customer_ids_to_child_accounts: for child_account in customer_ids_to_child_accounts[customer_id]: - _print_account_hierarchy( + print_account_hierarchy( child_account, customer_ids_to_child_accounts, depth + 1 ) diff --git a/examples/account_management/link_manager_to_client.py b/examples/account_management/link_manager_to_client.py index a979864d9..bcae1ab2b 100755 --- a/examples/account_management/link_manager_to_client.py +++ b/examples/account_management/link_manager_to_client.py @@ -78,7 +78,7 @@ def main(client, customer_id, manager_customer_id): for row in response.result: manager_link_id = row.customer_client_link.manager_link_id except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) customer_manager_link_service = client.get_service( "CustomerManagerLinkService" diff --git a/examples/account_management/reject_merchant_center_link.py b/examples/account_management/reject_merchant_center_link.py index 13a53dc31..19b12d09b 100644 --- a/examples/account_management/reject_merchant_center_link.py +++ b/examples/account_management/reject_merchant_center_link.py @@ -79,7 +79,7 @@ def main(client, customer_id, merchant_center_account_id): if merchant_center_link.id == merchant_center_account_id: # A Merchant Center link can be pending or enabled; in both # cases, we reject it by removing the link. - _remove_merchant_center_link( + remove_merchant_center_link( client, merchant_center_link_service, customer_id, @@ -99,7 +99,7 @@ def main(client, customer_id, merchant_center_account_id): # [START reject_merchant_center_link] -def _remove_merchant_center_link( +def remove_merchant_center_link( client, merchant_center_link_service, customer_id, merchant_center_link ): """Removes a Merchant Center link from a Google Ads client customer account. diff --git a/examples/account_management/update_user_access.py b/examples/account_management/update_user_access.py index 5664f9240..5bcc6f73e 100755 --- a/examples/account_management/update_user_access.py +++ b/examples/account_management/update_user_access.py @@ -43,13 +43,13 @@ def main(client, customer_id, email_address, access_role): access_role: The updated access role. """ - user_id = _get_user_access(client, customer_id, email_address) + user_id = get_user_access(client, customer_id, email_address) if user_id: - _modify_user_access(client, customer_id, user_id, access_role) + modify_user_access(client, customer_id, user_id, access_role) -def _get_user_access(client, customer_id, email_address): +def get_user_access(client, customer_id, email_address): """Gets the customer user access given an email address. Args: @@ -98,7 +98,7 @@ def _get_user_access(client, customer_id, email_address): return None -def _modify_user_access(client, customer_id, user_id, access_role): +def modify_user_access(client, customer_id, user_id, access_role): """Modifies the user access role to a specified value. Args: diff --git a/examples/advanced_operations/add_ad_customizer.py b/examples/advanced_operations/add_ad_customizer.py index c4ad6a1ff..2c7445df0 100755 --- a/examples/advanced_operations/add_ad_customizer.py +++ b/examples/advanced_operations/add_ad_customizer.py @@ -12,9 +12,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Adds an ad customizer feed and associates it with a given customer. +"""This code example adds two ad customizer attributes. -It then adds an ad that uses the feed to populate dynamic data. +It then associates them with the given ad group and adds an ad that uses the ad +customizer attributes to populate dynamic data. """ @@ -27,375 +28,236 @@ from google.ads.googleads.errors import GoogleAdsException -def main(client, customer_id, ad_group_ids): +def main(client, customer_id, ad_group_id): """The main method that creates all necessary entities for the example. Args: client: an initialized GoogleAdsClient instance. customer_id: a client customer ID. - ad_group_ids: a list of ad group IDs. + ad_group_id: an ad group ID. """ - feed_name = f"Ad customizer example feed {uuid4()}" - ad_customizer_feed_resource_name = _create_add_customizer_feed( - client, customer_id, feed_name + text_customizer_name = f"Planet_{uuid4().hex[:8]}" + price_customizer_name = f"Price_{uuid4().hex[:8]}" + + text_customizer_resource_name = create_text_customizer_attribute( + client, customer_id, text_customizer_name ) - ad_customizer_feed_attributes = _get_feed_attributes( - client, customer_id, ad_customizer_feed_resource_name + price_customizer_resource_name = create_price_customizer_attribute( + client, customer_id, price_customizer_name ) - - _create_ad_customizer_mapping( + link_customizer_attributes( client, customer_id, - ad_customizer_feed_resource_name, - ad_customizer_feed_attributes, + ad_group_id, + text_customizer_resource_name, + price_customizer_resource_name, ) - - feed_item_resource_names = _create_feed_items( + create_ad_with_customizations( client, customer_id, - ad_customizer_feed_resource_name, - ad_customizer_feed_attributes, - ) - - _create_feed_item_targets( - client, customer_id, ad_group_ids, feed_item_resource_names - ) - - _create_ads_with_customizations( - client, customer_id, ad_group_ids, feed_name + ad_group_id, + text_customizer_name, + price_customizer_name, ) # [START add_ad_customizer] -def _create_add_customizer_feed(client, customer_id, feed_name): - """Creates a feed to be used for ad customization. +def create_text_customizer_attribute(client, customer_id, customizer_name): + """Creates a text customizer attribute and returns its resource name. Args: client: an initialized GoogleAdsClient instance. customer_id: a client customer ID. - feed_name: the name of the feed to create. + customizer_name: the name of the customizer to create. Returns: - A str of a resource name for the newly created feed. + a resource name for a text customizer attribute. """ - # Creates three feed attributes: a name, a price and a date. - # The attribute names are arbitrary choices and will be used as - # placeholders in the ad text fields. - feed_attr_type_enum = client.enums.FeedAttributeTypeEnum - - name_attr = client.get_type("FeedAttribute") - name_attr.type_ = feed_attr_type_enum.STRING - name_attr.name = "Name" - - price_attr = client.get_type("FeedAttribute") - price_attr.type_ = feed_attr_type_enum.STRING - price_attr.name = "Price" - - date_attr = client.get_type("FeedAttribute") - date_attr.type_ = feed_attr_type_enum.DATE_TIME - date_attr.name = "Date" - - feed_operation = client.get_type("FeedOperation") - feed = feed_operation.create - - feed.name = feed_name - feed.attributes.extend([name_attr, price_attr, date_attr]) - feed.origin = client.enums.FeedOriginEnum.USER + customizer_attribute_service = client.get_service( + "CustomizerAttributeService" + ) - feed_service = client.get_service("FeedService") + # Creates a text customizer attribute. The customizer attribute name is + # arbitrary and will be used as a placeholder in the ad text fields. + operation = client.get_type("CustomizerAttributeOperation") + text_attribute = operation.create + text_attribute.name = customizer_name + text_attribute.type_ = client.enums.CustomizerAttributeTypeEnum.TEXT - response = feed_service.mutate_feeds( - customer_id=customer_id, operations=[feed_operation] + response = customizer_attribute_service.mutate_customizer_attributes( + customer_id=customer_id, operations=[operation] ) + resource_name = response.results[0].resource_name - print(f"Added feed with resource name {resource_name}") + print( + f"Added text customizer attribute with resource name '{resource_name}'" + ) return resource_name # [END add_ad_customizer] # [START add_ad_customizer_1] -def _get_feed_attributes(client, customer_id, feed_resource_name): - """Retrieves attributes for a feed. +def create_price_customizer_attribute(client, customer_id, customizer_name): + """Creates a price customizer attribute and returns its resource name. Args: client: an initialized GoogleAdsClient instance. customer_id: a client customer ID. - feed_resource_name: the resource name of the feed. + customizer_name: the name of the customizer to create. Returns: - A dict of feed attributes, keyed by attribute name. + a resource name for a text customizer attribute. """ - query = f""" - SELECT - feed.attributes, - feed.name - FROM feed - WHERE - feed.resource_name = "{feed_resource_name}" - """ - ga_service = client.get_service("GoogleAdsService") - search_request = client.get_type("SearchGoogleAdsRequest") - search_request.customer_id = customer_id - search_request.query = query - search_request.page_size = 1 - - results = ga_service.search(request=search_request) - feed = list(results)[0].feed - print(f"Found the following attributes for feed with name {feed.name}") - - feed_details = {} - for feed_attribute in feed.attributes: - name = feed_attribute.name - feed_attr_id = feed_attribute.id - feed_type = feed_attribute.type_.name - feed_details[name] = feed_attr_id - print(f"\t{name} with id {feed_attr_id} and type {feed_type}.") - - return feed_details + customizer_attribute_service = client.get_service( + "CustomizerAttributeService" + ) + + # Creates a price customizer attribute. The customizer attribute name is + # arbitrary and will be used as a placeholder in the ad text fields. + operation = client.get_type("CustomizerAttributeOperation") + price_attribute = operation.create + price_attribute.name = customizer_name + price_attribute.type_ = client.enums.CustomizerAttributeTypeEnum.PRICE + + response = customizer_attribute_service.mutate_customizer_attributes( + customer_id=customer_id, operations=[operation] + ) + + resource_name = response.results[0].resource_name + print( + f"Added price customizer attribute with resource name '{resource_name}'" + ) + return resource_name # [END add_ad_customizer_1] # [START add_ad_customizer_2] -def _create_ad_customizer_mapping( +def link_customizer_attributes( client, customer_id, - ad_customizer_feed_resource_name, - feed_details, + ad_group_id, + text_customizer_resource_name, + price_customizer_resource_name, ): - """Creates a feed mapping for a given feed. + """Restricts the ad customizer attributes to work with a specific ad group. + + This prevents the customizer attributes from being used elsewhere and makes + sure they are used only for customizing a specific ad group. Args: client: an initialized GoogleAdsClient instance. customer_id: a client customer ID. - ad_customizer_feed_resource_name: the resource name of the ad customizer - feed. - feed_details: a dict mapping feed attribute names to their IDs. + ad_group_id: the ad group ID to bind the customizer attributes to. + text_customizer_resource_name: the resource name of the text customizer attribute. + price_customizer_resource_name: the resource name of the price customizer attribute. """ - placeholder_field_enum = client.enums.AdCustomizerPlaceholderFieldEnum - - # Map the feed attributes to ad customizer placeholder fields. For a full - # list of ad customizer placeholder fields, see: - # https://developers.google.com/google-ads/api/reference/rpc/latest/AdCustomizerPlaceholderFieldEnum.AdCustomizerPlaceholderField - name_field_mapping = client.get_type("AttributeFieldMapping") - name_field_mapping.feed_attribute_id = feed_details["Name"] - name_field_mapping.ad_customizer_field = placeholder_field_enum.STRING - - price_field_mapping = client.get_type("AttributeFieldMapping") - price_field_mapping.feed_attribute_id = feed_details["Price"] - price_field_mapping.ad_customizer_field = placeholder_field_enum.PRICE - - date_field_mapping = client.get_type("AttributeFieldMapping") - date_field_mapping.feed_attribute_id = feed_details["Date"] - date_field_mapping.ad_customizer_field = placeholder_field_enum.DATE - - feed_mapping_op = client.get_type("FeedMappingOperation") - feed_mapping = feed_mapping_op.create - feed_mapping.feed = ad_customizer_feed_resource_name - feed_mapping.placeholder_type = ( - client.enums.PlaceholderTypeEnum.AD_CUSTOMIZER - ) - feed_mapping.attribute_field_mappings.extend( - [name_field_mapping, price_field_mapping, date_field_mapping] + googleads_service = client.get_service("GoogleAdsService") + ad_group_customizer_service = client.get_service("AdGroupCustomizerService") + + # Binds the text attribute customizer to a specific ad group to make sure + # it will only be used to customize ads inside that ad group. + mars_operation = client.get_type("AdGroupCustomizerOperation") + mars_customizer = mars_operation.create + mars_customizer.customizer_attribute = text_customizer_resource_name + mars_customizer.value.type_ = client.enums.CustomizerAttributeTypeEnum.TEXT + mars_customizer.value.string_value = "Mars" + mars_customizer.ad_group = googleads_service.ad_group_path( + customer_id, ad_group_id ) - feed_mapping_service = client.get_service("FeedMappingService") + # Binds the price attribute customizer to a specific ad group to make sure + # it will only be used to customize ads inside that ad group. + price_operation = client.get_type("AdGroupCustomizerOperation") + price_customizer = price_operation.create + price_customizer.customizer_attribute = price_customizer_resource_name + price_customizer.value.type_ = ( + client.enums.CustomizerAttributeTypeEnum.PRICE + ) + price_customizer.value.string_value = "100.0€" + price_customizer.ad_group = googleads_service.ad_group_path( + customer_id, ad_group_id + ) - response = feed_mapping_service.mutate_feed_mappings( - customer_id=customer_id, operations=[feed_mapping_op] + response = ad_group_customizer_service.mutate_ad_group_customizers( + customer_id=customer_id, operations=[mars_operation, price_operation] ) + for result in response.results: print( - "Created feed mapping with resource name " f"{result.resource_name}" + "Added an ad group customizer with resource name " + f"'{result.resource_name}'" ) # [END add_ad_customizer_2] # [START add_ad_customizer_3] -def _create_feed_items( +def create_ad_with_customizations( client, customer_id, - ad_customizer_feed_resource_name, - ad_customizer_feed_attributes, + ad_group_id, + text_customizer_name, + price_customizer_name, ): - """Creates two feed items to enable two different ad customizations. + """Creates a responsive search ad (RSA). + + The RSA uses the ad customizer attributes to populate the placeholders. Args: client: an initialized GoogleAdsClient instance. customer_id: a client customer ID. - ad_customizer_feed_resource_name: the resource name of the ad customizer - feed. - ad_customizer_feed_attributes: a dict mapping feed attribute names to - their IDs. - - Returns: - A list of feed item resource name strs. + ad_group_id: the ad group ID to bind the customizer attributes to. + text_customizer_name: name of the text customizer. + price_customizer_name: name of the price customizer. """ - feed_item_operations = [] - feed_item_operations.append( - _create_feed_item_operation( - client, - "Mars", - "$1234.56", - # Set the date to the 1st of the current month. - datetime.now().replace(day=1).strftime("%Y%m%d %H%M%S"), - ad_customizer_feed_resource_name, - ad_customizer_feed_attributes, - ) - ) - feed_item_operations.append( - _create_feed_item_operation( - client, - "Venus", - "$6543.21", - # Set the date to the 15th of the current month. - datetime.now().replace(day=15).strftime("%Y%m%d %H%M%S"), - ad_customizer_feed_resource_name, - ad_customizer_feed_attributes, - ) - ) - - feed_item_service = client.get_service("FeedItemService") + googleads_service = client.get_service("GoogleAdsService") + ad_group_ad_service = client.get_service("AdGroupAdService") - response = feed_item_service.mutate_feed_items( - customer_id=customer_id, operations=feed_item_operations + # Creates a responsive search ad using the attribute customizer names as + # placeholders and default values to be used in case there are no attribute + # customizer values. + operation = client.get_type("AdGroupAdOperation") + ad_group_ad = operation.create + ad_group_ad.ad.final_urls.append("https://www.example.com") + ad_group_ad.ad_group = googleads_service.ad_group_path( + customer_id, ad_group_id ) - return [feed_item.resource_name for feed_item in response.results] - # [END add_ad_customizer_3] - -# [START add_ad_customizer_4] -def _create_feed_item_operation( - client, - name, - price, - date, - ad_customizer_feed_resource_name, - ad_customizer_feed_attributes, -): - """Creates a FeedItemOperation. - - Args: - client: an initialized GoogleAdsClient instance. - name: a str value for the name attribute of the feed_item - price: a str value for the price attribute of the feed_item - date: a str value for the date attribute of the feed_item - ad_customizer_feed_resource_name: the resource name of the ad customizer - feed. - ad_customizer_feed_attributes: a dict mapping feed attribute names to - their IDs. - - Returns: - A FeedItemOperation that creates a FeedItem - """ - name_attr_value = client.get_type("FeedItemAttributeValue") - name_attr_value.feed_attribute_id = ad_customizer_feed_attributes["Name"] - name_attr_value.string_value = name - - price_attr_value = client.get_type("FeedItemAttributeValue") - price_attr_value.feed_attribute_id = ad_customizer_feed_attributes["Price"] - price_attr_value.string_value = price - - date_attr_value = client.get_type("FeedItemAttributeValue") - date_attr_value.feed_attribute_id = ad_customizer_feed_attributes["Date"] - date_attr_value.string_value = date - - feed_item_op = client.get_type("FeedItemOperation") - feed_item = feed_item_op.create - feed_item.feed = ad_customizer_feed_resource_name - feed_item.attribute_values.extend( - [name_attr_value, price_attr_value, date_attr_value] + headline_1 = client.get_type("AdTextAsset") + headline_1.text = ( + f"Luxury cruise to {{CUSTOMIZER.{text_customizer_name}:Venus}}" ) + headline_1.pinned_field = client.enums.ServedAssetFieldTypeEnum.HEADLINE_1 - return feed_item_op - # [END add_ad_customizer_4] - - -# [START add_ad_customizer_5] -def _create_feed_item_targets( - client, customer_id, ad_group_ids, feed_item_resource_names -): - """Restricts the feed items to work only with a specific ad group. - - This prevents the feed items from being used elsewhere and makes sure they - are used only for customizing a specific ad group. - - Args: - client: an initialized GoogleAdsClient instance. - customer_id: a client customer ID. - ad_group_ids: a list of ad group IDs. - feed_item_resource_names: a list of feed item resource name strs. - """ - ad_group_service = client.get_service("AdGroupService") - feed_item_target_service = client.get_service("FeedItemTargetService") - # Bind each feed item to a specific ad group to make sure it will only be - # used to customize ads inside that ad group; using the feed item elsewhere - # will result in an error. - for i, resource_name in enumerate(feed_item_resource_names): - ad_group_id = ad_group_ids[i] - - feed_item_target_op = client.get_type("FeedItemTargetOperation") - feed_item_target = feed_item_target_op.create - feed_item_target.feed_item = resource_name - feed_item_target.ad_group = ad_group_service.ad_group_path( - customer_id, ad_group_id - ) - - response = feed_item_target_service.mutate_feed_item_targets( - customer_id=customer_id, operations=[feed_item_target_op] - ) - print( - "Added feed item target with resource name " - f"{response.results[0].resource_name}" - ) - # [END add_ad_customizer_5] + headline_2 = client.get_type("AdTextAsset") + headline_2.text = f"Only {{CUSTOMIZER.{price_customizer_name}:10.0€}}" + headline_3 = client.get_type("AdTextAsset") + headline_3.text = f"Cruise to {{CUSTOMIZER.{text_customizer_name}:Venus}} for {{CUSTOMIZER.{price_customizer_name}:10.0€}}" -# [START add_ad_customizer_6] -def _create_ads_with_customizations( - client, customer_id, ad_group_ids, feed_name -): - """Creates expanded text ads that use the ad customizer feed. + ad_group_ad.ad.responsive_search_ad.headlines.extend( + [headline_1, headline_2, headline_3] + ) - The expanded text ads use the ad customizer feed to populate the - placeholders. + description_1 = client.get_type("AdTextAsset") + description_1.text = ( + f"Tickets are only {{CUSTOMIZER.{price_customizer_name}:10.0€}}!" + ) - Args: - client: an initialized GoogleAdsClient instance. - customer_id: a client customer ID. - ad_group_ids: a list of ad group IDs. - feed_name: the name of the feed to create. - """ - ad_group_service = client.get_service("AdGroupService") - ad_group_ad_service = client.get_service("AdGroupAdService") - ad_group_ad_operations = [] + description_2 = client.get_type("AdTextAsset") + description_2.text = ( + f"Buy your tickets to {{CUSTOMIZER.{text_customizer_name}:Venus}} now!" + ) - for ad_group_id in ad_group_ids: - ad_group_ad_operation = client.get_type("AdGroupAdOperation") - ad_group_ad = ad_group_ad_operation.create - ad_group_ad.ad_group = ad_group_service.ad_group_path( - customer_id, ad_group_id - ) - ad_group_ad.ad.final_urls.append("http://www.example.com") - ad_group_ad.ad.expanded_text_ad.headline_part1 = ( - f"Luxury cruise to {{={feed_name}.Name}}" - ) - ad_group_ad.ad.expanded_text_ad.headline_part2 = ( - f"Only {{={feed_name}.Price}}" - ) - # See this documentation for an explanation of how countdown ad - # customizers work: https://support.google.com/google-ads/answer/6193743?hl=en - ad_group_ad.ad.expanded_text_ad.description = ( - f"Offer ends in {{=countdown({feed_name}.Date)}}!" - ) - ad_group_ad_operations.append(ad_group_ad_operation) + ad_group_ad.ad.responsive_search_ad.descriptions.extend( + [description_1, description_2] + ) response = ad_group_ad_service.mutate_ad_group_ads( - customer_id=customer_id, operations=ad_group_ad_operations + customer_id=customer_id, operations=[operation] ) - print(f"Added {len(response.results)} ads:") - for ad in response.results: - print(f"Added an ad with resource name {ad.resource_name}") - # [END add_ad_customizer_6] + resource_name = response.results[0].resource_name + print(f"Added an ad with resource name '{resource_name}'") + # [END add_ad_customizer_3] if __name__ == "__main__": @@ -405,7 +267,9 @@ def _create_ads_with_customizations( parser = argparse.ArgumentParser( description=( - "Adds an ad customizer feed and associates it with a customer." + "This code example adds two ad customizer attributes and " + "associates them with the ad group. Then it adds an ad that uses " + "the customizer attributes to populate dynamic data." ) ) # The following argument(s) should be provided to run the example. @@ -417,17 +281,12 @@ def _create_ads_with_customizations( help="The Google Ads customer ID.", ) parser.add_argument( - "-a", - "--ad_group_ids", - nargs=2, - type=str, - required=True, - help="Space-delimited list of ad group IDs.", + "-a", "--ad_group_id", type=str, required=True, help="An ad group ID.", ) args = parser.parse_args() try: - main(googleads_client, args.customer_id, args.ad_group_ids) + main(googleads_client, args.customer_id, args.ad_group_id) except GoogleAdsException as ex: print( f'Request with ID "{ex.request_id}" failed with status ' diff --git a/examples/advanced_operations/add_app_campaign.py b/examples/advanced_operations/add_app_campaign.py index c3e6a5e8f..0733bd1ba 100755 --- a/examples/advanced_operations/add_app_campaign.py +++ b/examples/advanced_operations/add_app_campaign.py @@ -34,28 +34,28 @@ def main(client, customer_id): """Main function for running this example.""" # Creates the budget for the campaign. - budget_resource_name = _create_budget(client, customer_id) + budget_resource_name = create_budget(client, customer_id) # Creates the campaign. - campaign_resource_name = _create_campaign( + campaign_resource_name = create_campaign( client, customer_id, budget_resource_name ) # Sets campaign targeting. - _set_campaign_targeting_criteria( + set_campaign_targeting_criteria( client, customer_id, campaign_resource_name ) # Creates an Ad Group. - ad_group_resource_name = _create_ad_group( + ad_group_resource_name = create_ad_group( client, customer_id, campaign_resource_name ) # Creates an App Ad. - _create_app_ad(client, customer_id, ad_group_resource_name) + create_app_ad(client, customer_id, ad_group_resource_name) -def _create_budget(client, customer_id): +def create_budget(client, customer_id): """Creates a budget under the given customer ID. Args: @@ -89,7 +89,7 @@ def _create_budget(client, customer_id): return resource_name -def _create_campaign(client, customer_id, budget_resource_name): +def create_campaign(client, customer_id, budget_resource_name): """Creates an app campaign under the given customer ID. Args: @@ -157,7 +157,7 @@ def _create_campaign(client, customer_id, budget_resource_name): return resource_name -def _set_campaign_targeting_criteria( +def set_campaign_targeting_criteria( client, customer_id, campaign_resource_name ): """Sets campaign targeting criteria for a given campaign. @@ -212,7 +212,7 @@ def _set_campaign_targeting_criteria( ) -def _create_ad_group(client, customer_id, campaign_resource_name): +def create_ad_group(client, customer_id, campaign_resource_name): """Creates an ad group for a given campaign. Args: @@ -245,7 +245,7 @@ def _create_ad_group(client, customer_id, campaign_resource_name): return ad_group_resource_name -def _create_app_ad(client, customer_id, ad_group_resource_name): +def create_app_ad(client, customer_id, ad_group_resource_name): """Creates an App ad for a given ad group. Args: @@ -264,14 +264,14 @@ def _create_app_ad(client, customer_id, ad_group_resource_name): # text_ad, gmail_ad, etc. ad_group_ad.ad.app_ad.headlines.extend( [ - _create_ad_text_asset(client, "A cool puzzle game"), - _create_ad_text_asset(client, "Remove connected blocks"), + create_ad_text_asset(client, "A cool puzzle game"), + create_ad_text_asset(client, "Remove connected blocks"), ] ) ad_group_ad.ad.app_ad.descriptions.extend( [ - _create_ad_text_asset(client, "3 difficulty levels"), - _create_ad_text_asset(client, "4 colorful fun skins"), + create_ad_text_asset(client, "3 difficulty levels"), + create_ad_text_asset(client, "4 colorful fun skins"), ] ) # Optional: You can set up to 20 image assets for your campaign. @@ -288,7 +288,7 @@ def _create_app_ad(client, customer_id, ad_group_resource_name): ) -def _create_ad_text_asset(client, text): +def create_ad_text_asset(client, text): ad_text_asset = client.get_type("AdTextAsset") ad_text_asset.text = text return ad_text_asset diff --git a/examples/advanced_operations/add_display_upload_ad.py b/examples/advanced_operations/add_display_upload_ad.py index a6d1b42a2..288fcb7dc 100644 --- a/examples/advanced_operations/add_display_upload_ad.py +++ b/examples/advanced_operations/add_display_upload_ad.py @@ -46,16 +46,16 @@ def main(client, customer_id, ad_group_id): # https://developers.google.com/google-ads/api/reference/rpc/latest/DisplayUploadAdInfo # Creates a new media bundle asset and returns the resource name. - ad_asset_resource_name = _create_media_bundle_asset(client, customer_id) + ad_asset_resource_name = create_media_bundle_asset(client, customer_id) # Creates a new display upload ad and associates it with the specified # ad group. - _create_display_upload_ad_group_ad( + create_display_upload_ad_group_ad( client, customer_id, ad_group_id, ad_asset_resource_name ) -def _create_media_bundle_asset(client, customer_id): +def create_media_bundle_asset(client, customer_id): """Creates a media bundle from the assets in a zip file. The zip file contains the HTML5 components. @@ -96,7 +96,7 @@ def _create_media_bundle_asset(client, customer_id): return uploaded_asset_resource_name -def _create_display_upload_ad_group_ad( +def create_display_upload_ad_group_ad( client, customer_id, ad_group_id, ad_asset_resource_name ): """Creates a new HTML5 display upload ad and adds it to the given ad group. diff --git a/examples/advanced_operations/add_dynamic_page_feed.py b/examples/advanced_operations/add_dynamic_page_feed.py index 871c5bed2..e5cbfff12 100755 --- a/examples/advanced_operations/add_dynamic_page_feed.py +++ b/examples/advanced_operations/add_dynamic_page_feed.py @@ -57,29 +57,29 @@ def main(client, customer_id, campaign_id, ad_group_id): # Get the page feed resource name. This code example creates a new feed, # but you can fetch and re-use an existing feed. - feed_resource_name = _create_feed(client, customer_id) + feed_resource_name = create_feed(client, customer_id) # We need to look up the attribute name and ID for the feed we just # created so that we can give them back to the API for construction of # feed mappings in the next function. - feed_details = _get_feed_details(client, customer_id, feed_resource_name) - _create_feed_mapping(client, customer_id, feed_details) - _create_feed_items(client, customer_id, feed_details, dsa_page_url_label) + feed_details = get_feed_details(client, customer_id, feed_resource_name) + create_feed_mapping(client, customer_id, feed_details) + create_feed_items(client, customer_id, feed_details, dsa_page_url_label) # Associate the page feed with the campaign. - _update_campaign_dsa_setting(client, customer_id, campaign_id, feed_details) + update_campaign_dsa_setting(client, customer_id, campaign_id, feed_details) ad_group_service = client.get_service("AdGroupService") ad_group_resource_name = ad_group_service.ad_group_path( customer_id, ad_group_id ) # Optional: Target web pages matching the feed's label in the ad group. - _add_dsa_targeting( + add_dsa_targeting( client, customer_id, ad_group_resource_name, dsa_page_url_label ) -def _create_feed(client, customer_id): +def create_feed(client, customer_id): """Creates a page feed with URLs Args: @@ -119,7 +119,7 @@ def _create_feed(client, customer_id): return response.results[0].resource_name -def _get_feed_details(client, customer_id, resource_name): +def get_feed_details(client, customer_id, resource_name): """Makes a search request to retrieve the attributes of a single feed. Args: @@ -161,7 +161,7 @@ def _get_feed_details(client, customer_id, resource_name): ) -def _create_feed_mapping(client, customer_id, feed_details): +def create_feed_mapping(client, customer_id, feed_details): """Creates feed mapping using the given feed details Args: @@ -201,7 +201,7 @@ def _create_feed_mapping(client, customer_id, feed_details): print(f"Feed mapping created with resource_name: '{resource_name}'") -def _create_feed_items(client, customer_id, feed_details, label): +def create_feed_items(client, customer_id, feed_details, label): """Creates feed items with the given feed_details and label Args: @@ -255,9 +255,7 @@ def map_feed_urls(url): # [START add_dynamic_page_feed] -def _update_campaign_dsa_setting( - client, customer_id, campaign_id, feed_details -): +def update_campaign_dsa_setting(client, customer_id, campaign_id, feed_details): """Updates the given campaign with the given feed details. Args: @@ -323,7 +321,7 @@ def _update_campaign_dsa_setting( # [START add_dynamic_page_feed_2] -def _add_dsa_targeting(client, customer_id, ad_group_resource_name, label): +def add_dsa_targeting(client, customer_id, ad_group_resource_name, label): """Adds Dynamic Search Ad targeting criteria to the given ad group. Args: diff --git a/examples/advanced_operations/add_dynamic_page_feed_asset.py b/examples/advanced_operations/add_dynamic_page_feed_asset.py index 4706e072a..a425560f6 100755 --- a/examples/advanced_operations/add_dynamic_page_feed_asset.py +++ b/examples/advanced_operations/add_dynamic_page_feed_asset.py @@ -36,31 +36,31 @@ def main(client, customer_id, campaign_id, ad_group_id): dsa_page_url_label = "discounts" # Creates a list of assets. - asset_resource_names = _create_assets( + asset_resource_names = create_assets( client, dsa_page_url_label, customer_id ) # Creates an AssetSet - this is a collection of assets that can be # associated with a campaign. Note: do not confuse this with an AssetGroup. # An AssetGroup replaces AdGroups in some types of campaigns. - asset_set_resource_name = _create_asset_set(client, customer_id) + asset_set_resource_name = create_asset_set(client, customer_id) # Adds the Assets to the AssetSet. - _add_assets_to_asset_set( + add_assets_to_asset_set( client, asset_resource_names, asset_set_resource_name, customer_id ) # Links the AssetSet to the Campaign. - _link_asset_set_to_campaign( + link_asset_set_to_campaign( client, asset_set_resource_name, customer_id, campaign_id ) # Optional: Targets web pages matching the feed's label in the ad group. - _add_dsa_target(client, dsa_page_url_label, customer_id, ad_group_id) + add_dsa_target(client, dsa_page_url_label, customer_id, ad_group_id) # [START add_asset] -def _create_assets(client, dsa_page_url_label, customer_id): +def create_assets(client, dsa_page_url_label, customer_id): """Creates Assets to be used in a DSA page feed. Args: @@ -101,7 +101,7 @@ def _create_assets(client, dsa_page_url_label, customer_id): # [START add_asset_set] -def _create_asset_set(client, customer_id): +def create_asset_set(client, customer_id): """Creates an AssetSet. The AssetSet will be used to link the dynamic page feed assets to a @@ -131,7 +131,7 @@ def _create_asset_set(client, customer_id): # [START add_asset_set_asset] -def _add_assets_to_asset_set( +def add_assets_to_asset_set( client, asset_resource_names, asset_set_resource_name, customer_id ): """Adds an Asset to an AssetSet by creating an AssetSetAsset link. @@ -160,7 +160,7 @@ def _add_assets_to_asset_set( # [START add_campaign_asset_set] -def _link_asset_set_to_campaign( +def link_asset_set_to_campaign( client, asset_set_resource_name, customer_id, campaign_id ): """Links an AssetSet to a Campaign by creating a CampaignAssetSet. @@ -189,7 +189,7 @@ def _link_asset_set_to_campaign( # [START add_dsa_target] -def _add_dsa_target(client, dsa_page_url_label, customer_id, ad_group_id): +def add_dsa_target(client, dsa_page_url_label, customer_id, ad_group_id): """Creates an ad group criterion targeting the DSA label. Args: diff --git a/examples/advanced_operations/add_dynamic_search_ads.py b/examples/advanced_operations/add_dynamic_search_ads.py index 1992cc45b..fc04c9f82 100755 --- a/examples/advanced_operations/add_dynamic_search_ads.py +++ b/examples/advanced_operations/add_dynamic_search_ads.py @@ -34,18 +34,18 @@ def main(client, customer_id): client: an initialized GoogleAdsClient instance. customer_id: a client customer ID str. """ - budget_resource_name = _create_budget(client, customer_id) - campaign_resource_name = _create_campaign( + budget_resource_name = create_budget(client, customer_id) + campaign_resource_name = create_campaign( client, customer_id, budget_resource_name ) - ad_group_resource_name = _create_ad_group( + ad_group_resource_name = create_ad_group( client, customer_id, campaign_resource_name ) - _create_expanded_dsa(client, customer_id, ad_group_resource_name) - _add_webpage_criterion(client, customer_id, ad_group_resource_name) + create_expanded_dsa(client, customer_id, ad_group_resource_name) + add_webpage_criterion(client, customer_id, ad_group_resource_name) -def _create_budget(client, customer_id): +def create_budget(client, customer_id): """Creates a budget under the given customer ID. Args: @@ -79,7 +79,7 @@ def _create_budget(client, customer_id): # [START add_dynamic_search_ads] -def _create_campaign(client, customer_id, budget_resource_name): +def create_campaign(client, customer_id, budget_resource_name): """Creates a Dynamic Search Ad Campaign under the given customer ID. Args: @@ -130,7 +130,7 @@ def _create_campaign(client, customer_id, budget_resource_name): # [START add_dynamic_search_ads_1] -def _create_ad_group(client, customer_id, campaign_resource_name): +def create_ad_group(client, customer_id, campaign_resource_name): """Creates a Dynamic Search Ad Group under the given Campaign. Args: @@ -174,7 +174,7 @@ def _create_ad_group(client, customer_id, campaign_resource_name): # [START add_dynamic_search_ads_2] -def _create_expanded_dsa(client, customer_id, ad_group_resource_name): +def create_expanded_dsa(client, customer_id, ad_group_resource_name): """Creates a dynamic search ad under the given ad group. Args: @@ -208,7 +208,7 @@ def _create_expanded_dsa(client, customer_id, ad_group_resource_name): # [END add_dynamic_search_ads_2] -def _add_webpage_criterion(client, customer_id, ad_group_resource_name): +def add_webpage_criterion(client, customer_id, ad_group_resource_name): """Creates a web page criterion to the given ad group. 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 deleted file mode 100755 index 1caa3c044..000000000 --- a/examples/advanced_operations/add_expanded_text_ad_with_upgraded_urls.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""This adds an expanded text ad using advanced features of upgraded URLs.""" - - -import argparse -import sys - -from google.ads.googleads.client import GoogleAdsClient -from google.ads.googleads.errors import GoogleAdsException - - -def main(client, customer_id, ad_group_id): - ad_group_ad_service = client.get_service("AdGroupAdService") - ad_group_service = client.get_service("AdGroupService") - - # Create ad group ad. - ad_group_ad_operation = client.get_type("AdGroupAdOperation") - ad_group_ad = ad_group_ad_operation.create - ad_group_ad.ad_group = ad_group_service.ad_group_path( - customer_id, ad_group_id - ) - ad_group_ad.status = client.enums.AdGroupAdStatusEnum.PAUSED - - # Set expanded text ad info - ad_group_ad.ad.final_urls.extend( - [ - "http://www.example.com/cruise/space/", - "http://www.example.com/locations/mars/", - ] - ) - - ad_group_ad.ad.expanded_text_ad.description = ( - "Low-gravity fun for everyone!" - ) - ad_group_ad.ad.expanded_text_ad.headline_part1 = "Luxury cruise to Mars" - ad_group_ad.ad.expanded_text_ad.headline_part2 = ( - "Visit the Red Planet in Style." - ) - - # Specify a tracking URL for 3rd party tracking provider. You may specify - # one at customer, campaign, ad group, ad, criterion, or feed item levels. - ad_group_ad.ad.tracking_url_template = ( - "http://tracker.example.com/?season={_season}&promocode={_promocode}&" - "u={lpurl}" - ) - - # Since your tracking URL has two custom parameters, provide their values - # too. This can be provided at campaign, ad group, ad, criterion, or feed - # item levels. - param_1 = client.get_type("CustomParameter") - param_1.key = "season" - param_1.value = "easter123" - - param_2 = client.get_type("CustomParameter") - param_2.key = "promocode" - param_2.value = "nj123" - ad_group_ad.ad.url_custom_parameters.extend([param_1, param_2]) - - # Specify a list of final mobile URLs. This field cannot be set if URL field - # is set, or finalUrls is unset. This may be specified at ad, criterion, and - # feed item levels. - ad_group_ad.ad.final_mobile_urls.extend( - [ - "http://mobile.example.com/cruise/space/", - "http://mobile.example.com/locations/mars/", - ] - ) - - # Add the ad group ad. - ad_group_ad_response = ad_group_ad_service.mutate_ad_group_ads( - customer_id=customer_id, operations=[ad_group_ad_operation] - ) - - print( - f'Created expanded text ad "{ad_group_ad_response.results[0].resource_name}".' - ) - - -if __name__ == "__main__": - # GoogleAdsClient will read the google-ads.yaml configuration file in the - # home directory if none is specified. - googleads_client = GoogleAdsClient.load_from_storage(version="v11") - - parser = argparse.ArgumentParser( - 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=str, - required=True, - help="The Google Ads customer ID.", - ) - parser.add_argument( - "-a", "--ad_group_id", type=str, required=True, help="The ad group ID." - ) - args = parser.parse_args() - - try: - main(googleads_client, args.customer_id, args.ad_group_id) - except GoogleAdsException as ex: - print( - f'Request with ID "{ex.request_id}" failed with status ' - f'"{ex.error.code().name}" and includes the following errors:' - ) - for error in ex.failure.errors: - print(f'\tError with message "{error.message}".') - if error.location: - for field_path_element in error.location.field_path_elements: - print(f"\t\tOn field: {field_path_element.field_name}") - sys.exit(1) diff --git a/examples/advanced_operations/add_local_campaign.py b/examples/advanced_operations/add_local_campaign.py index 3a2995647..b5e231dce 100755 --- a/examples/advanced_operations/add_local_campaign.py +++ b/examples/advanced_operations/add_local_campaign.py @@ -43,20 +43,18 @@ def main(client, customer_id): client: an initialized GoogleAdsClient instance. customer_id: a client customer ID str. """ - budget_resource_name = _create_campaign_budget(client, customer_id) - campaign_resource_name = _create_campaign( + budget_resource_name = create_campaign_budget(client, customer_id) + campaign_resource_name = create_campaign( client, customer_id, budget_resource_name ) - ad_group_resource_name = _create_ad_group( + ad_group_resource_name = create_ad_group( client, customer_id, campaign_resource_name ) - create_local_ad = _create_local_ad( - client, customer_id, ad_group_resource_name - ) + create_local_ad(client, customer_id, ad_group_resource_name) # [START add_local_campaign] -def _create_campaign_budget(client, customer_id): +def create_campaign_budget(client, customer_id): """Adds a campaign budget to the given client account. Args: @@ -89,7 +87,7 @@ def _create_campaign_budget(client, customer_id): # [START add_local_campaign_1] -def _create_campaign(client, customer_id, budget_resource_name): +def create_campaign(client, customer_id, budget_resource_name): """Adds a Local campaign to the given client account using the given budget. Args: @@ -154,7 +152,7 @@ def _create_campaign(client, customer_id, budget_resource_name): # [START add_local_campaign_2] -def _create_ad_group(client, customer_id, campaign_resource_name): +def create_ad_group(client, customer_id, campaign_resource_name): """Adds an ad group to the given client account under the given campaign. Args: @@ -186,7 +184,7 @@ def _create_ad_group(client, customer_id, campaign_resource_name): # [START add_local_campaign_3] -def _create_local_ad(client, customer_id, ad_group_resource_name): +def create_local_ad(client, customer_id, ad_group_resource_name): """Adds a local ad to the given client account under the given ad group. Args: @@ -201,33 +199,33 @@ def _create_local_ad(client, customer_id, ad_group_resource_name): ad_group_ad.ad.final_urls.append("https://www.example.com") ad_group_ad.ad.local_ad.headlines.extend( [ - _create_ad_text_asset(client, "Best Space Cruise Line"), - _create_ad_text_asset(client, "Experience the Stars"), + create_ad_text_asset(client, "Best Space Cruise Line"), + create_ad_text_asset(client, "Experience the Stars"), ] ) ad_group_ad.ad.local_ad.descriptions.extend( [ - _create_ad_text_asset(client, "Buy your tickets now"), - _create_ad_text_asset(client, "Visit the Red Planet"), + create_ad_text_asset(client, "Buy your tickets now"), + create_ad_text_asset(client, "Visit the Red Planet"), ] ) ad_group_ad.ad.local_ad.call_to_actions.append( - _create_ad_text_asset(client, "Shop Now") + create_ad_text_asset(client, "Shop Now") ) marketing_image = client.get_type("AdImageAsset") - marketing_image.asset = _create_image_asset( + marketing_image.asset = create_image_asset( client, customer_id, _MARKETING_IMAGE_URL, "Marketing Image" ) ad_group_ad.ad.local_ad.marketing_images.append(marketing_image) logo_image = client.get_type("AdImageAsset") - logo_image.asset = _create_image_asset( + logo_image.asset = create_image_asset( client, customer_id, _LOGO_IMAGE_URL, "Square Marketing Image" ) ad_group_ad.ad.local_ad.logo_images.append(logo_image) video = client.get_type("AdVideoAsset") - video.asset = _create_youtube_video_asset( + video.asset = create_youtube_video_asset( client, customer_id, _YOUTUBE_VIDEO_ID, "Local Campaigns" ) ad_group_ad.ad.local_ad.videos.append(video) @@ -240,7 +238,7 @@ def _create_local_ad(client, customer_id, ad_group_resource_name): print(f"Created ad group ad with resource name: '{resource_name}'") -def _create_ad_text_asset(client, text): +def create_ad_text_asset(client, text): """Creates an ad text asset with the given text value. Args: @@ -257,7 +255,7 @@ def _create_ad_text_asset(client, text): # [START add_local_campaign_4] -def _create_image_asset(client, customer_id, image_url, image_name): +def create_image_asset(client, customer_id, image_url, image_name): """Creates an asset with the given image URL and name. Args: @@ -273,7 +271,7 @@ def _create_image_asset(client, customer_id, image_url, image_name): asset = asset_operation.create asset.name = image_name asset.type_ = client.enums.AssetTypeEnum.IMAGE - asset.image_asset.data = _get_image_bytes(image_url) + asset.image_asset.data = get_image_bytes(image_url) asset_service = client.get_service("AssetService") response = asset_service.mutate_assets( customer_id=customer_id, operations=[asset_operation] @@ -286,7 +284,7 @@ def _create_image_asset(client, customer_id, image_url, image_name): return resource_name -def _get_image_bytes(url): +def get_image_bytes(url): """Loads image data from a URL. Args: @@ -301,7 +299,7 @@ def _get_image_bytes(url): # [START add_local_campaign_5] -def _create_youtube_video_asset( +def create_youtube_video_asset( client, customer_id, youtube_video_id, youtube_video_name ): """Creates a asset with the given YouTube video ID and name. diff --git a/examples/advanced_operations/add_performance_max_campaign.py b/examples/advanced_operations/add_performance_max_campaign.py index c6a3f6b42..563adb4eb 100644 --- a/examples/advanced_operations/add_performance_max_campaign.py +++ b/examples/advanced_operations/add_performance_max_campaign.py @@ -74,7 +74,7 @@ def main(client, customer_id, audience_id): # https://developers.google.com/google-ads/api/docs/performance-max/assets # # Create the headlines. - headline_asset_resource_names = _create_multiple_text_assets( + headline_asset_resource_names = create_multiple_text_assets( client, customer_id, [ @@ -84,7 +84,7 @@ def main(client, customer_id, audience_id): ], ) # Create the descriptions. - description_asset_resource_names = _create_multiple_text_assets( + description_asset_resource_names = create_multiple_text_assets( client, customer_id, [ @@ -100,21 +100,21 @@ def main(client, customer_id, audience_id): # to create them in a single Mutate request so they all complete # successfully or fail entirely, leaving no orphaned entities. See: # https://developers.google.com/google-ads/api/docs/mutating/overview - campaign_budget_operation = _create_campaign_budget_operation( + campaign_budget_operation = create_campaign_budget_operation( client, customer_id, ) performance_max_campaign_operation = ( - _create_performance_max_campaign_operation( + create_performance_max_campaign_operation( client, customer_id, ) ) - campaign_criterion_operations = _create_campaign_criterion_operations( + campaign_criterion_operations = create_campaign_criterion_operations( client, customer_id, ) - asset_group_operations = _create_asset_group_operation( + asset_group_operations = create_asset_group_operation( client, customer_id, headline_asset_resource_names, @@ -135,7 +135,7 @@ def main(client, customer_id, audience_id): # Append an asset group signal operation is an audience ID is given. if audience_id: mutate_operations.append( - _create_asset_group_signal_operation( + create_asset_group_signal_operation( client, customer_id, audience_id ) ) @@ -145,12 +145,12 @@ def main(client, customer_id, audience_id): customer_id=customer_id, mutate_operations=mutate_operations ) - _print_response_details(response) + print_response_details(response) # [END add_performance_max_campaign_1] # [START add_performance_max_campaign_2] -def _create_campaign_budget_operation( +def create_campaign_budget_operation( client, customer_id, ): @@ -189,7 +189,7 @@ def _create_campaign_budget_operation( # [START add_performance_max_campaign_3] -def _create_performance_max_campaign_operation( +def create_performance_max_campaign_operation( client, customer_id, ): @@ -259,7 +259,7 @@ def _create_performance_max_campaign_operation( # [START add_performance_max_campaign_4] -def _create_campaign_criterion_operations( +def create_campaign_criterion_operations( client, customer_id, ): @@ -329,7 +329,7 @@ def _create_campaign_criterion_operations( # [START add_performance_max_campaign_5] -def _create_multiple_text_assets(client, customer_id, texts): +def create_multiple_text_assets(client, customer_id, texts): """Creates multiple text assets and returns the list of resource names. Args: @@ -361,13 +361,13 @@ def _create_multiple_text_assets(client, customer_id, texts): for result in response.mutate_operation_responses: if result._pb.HasField("asset_result"): asset_resource_names.append(result.asset_result.resource_name) - _print_response_details(response) + print_response_details(response) return asset_resource_names # [END add_performance_max_campaign_5] # [START add_performance_max_campaign_6] -def _create_asset_group_operation( +def create_asset_group_operation( client, customer_id, headline_asset_resource_names, @@ -449,7 +449,7 @@ def _create_asset_group_operation( operations.append(mutate_operation) # Create and link the long headline text asset. - mutate_operations = _create_and_link_text_asset( + mutate_operations = create_and_link_text_asset( client, customer_id, "Travel the World", @@ -458,7 +458,7 @@ def _create_asset_group_operation( operations.extend(mutate_operations) # Create and link the business name text asset. - mutate_operations = _create_and_link_text_asset( + mutate_operations = create_and_link_text_asset( client, customer_id, "Interplanetary Cruises", @@ -469,7 +469,7 @@ def _create_asset_group_operation( # Create and link the image assets. # Create and link the Logo Asset. - mutate_operations = _create_and_link_image_asset( + mutate_operations = create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/bjYi", @@ -479,7 +479,7 @@ def _create_asset_group_operation( operations.extend(mutate_operations) # Create and link the Marketing Image Asset. - mutate_operations = _create_and_link_image_asset( + mutate_operations = create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/Eit5", @@ -489,7 +489,7 @@ def _create_asset_group_operation( operations.extend(mutate_operations) # Create and link the Square Marketing Image Asset. - mutate_operations = _create_and_link_image_asset( + mutate_operations = create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/bjYi", @@ -502,7 +502,7 @@ def _create_asset_group_operation( # [START add_performance_max_campaign_7] -def _create_and_link_text_asset(client, customer_id, text, field_type): +def create_and_link_text_asset(client, customer_id, text, field_type): """Creates a list of MutateOperations that create a new linked text asset. Args: @@ -545,7 +545,7 @@ def _create_and_link_text_asset(client, customer_id, text, field_type): # [START add_performance_max_campaign_8] -def _create_and_link_image_asset( +def create_and_link_image_asset( client, customer_id, url, field_type, asset_name ): """Creates a list of MutateOperations that create a new linked image asset. @@ -574,7 +574,7 @@ def _create_and_link_image_asset( # name, the new name will be dropped silently. asset.name = asset_name asset.type_ = client.enums.AssetTypeEnum.IMAGE - asset.image_asset.data = _get_image_bytes(url) + asset.image_asset.data = get_image_bytes(url) operations.append(mutate_operation) # Create an AssetGroupAsset to link the Asset to the AssetGroup. @@ -595,7 +595,7 @@ def _create_and_link_image_asset( # [END add_performance_max_campaign_8] -def _get_image_bytes(url): +def get_image_bytes(url): """Loads image data from a URL. Args: @@ -608,7 +608,7 @@ def _get_image_bytes(url): return response.content -def _print_response_details(response): +def print_response_details(response): """Prints the details of a MutateGoogleAdsResponse. Parses the "response" oneof field name and uses it to extract the new @@ -633,7 +633,7 @@ def _print_response_details(response): # [START add_performance_max_campaign_9] -def _create_asset_group_signal_operation(client, customer_id, audience_id): +def create_asset_group_signal_operation(client, customer_id, audience_id): """Creates a list of MutateOperations that may create asset group signals. Args: diff --git a/examples/advanced_operations/add_responsive_search_ad_with_ad_customizer.py b/examples/advanced_operations/add_responsive_search_ad_with_ad_customizer.py index affc8b500..420a09a56 100755 --- a/examples/advanced_operations/add_responsive_search_ad_with_ad_customizer.py +++ b/examples/advanced_operations/add_responsive_search_ad_with_ad_customizer.py @@ -49,21 +49,21 @@ def main(client, customer_id, ad_group_id, customizer_attribute_name): ad_group_id: an ad group ID. customizer_attribute_name: the name for the customizer attribute. """ - customizer_attribute_resource_name = _create_customizer_attribute( + customizer_attribute_resource_name = create_customizer_attribute( client, customer_id, customizer_attribute_name ) - _link_customizer_attribute_to_customer( + link_customizer_attribute_to_customer( client, customer_id, customizer_attribute_resource_name ) - _create_responsive_search_ad_with_customization( + create_responsive_search_ad_with_customization( client, customer_id, ad_group_id, customizer_attribute_name ) # [START add_responsive_search_ad_with_ad_customizer_1] -def _create_customizer_attribute( +def create_customizer_attribute( client, customer_id, customizer_attribute_name ): """Creates a customizer attribute with the given customizer attribute name. @@ -104,7 +104,7 @@ def _create_customizer_attribute( # [START add_responsive_search_ad_with_ad_customizer_2] -def _link_customizer_attribute_to_customer( +def link_customizer_attribute_to_customer( client, customer_id, customizer_attribute_resource_name ): """Links the customizer attribute to the customer. @@ -148,7 +148,7 @@ def _link_customizer_attribute_to_customer( # [START add_responsive_search_ad_with_ad_customizer_3] -def _create_responsive_search_ad_with_customization( +def create_responsive_search_ad_with_customization( client, customer_id, ad_group_id, customizer_attribute_name ): """Creates a responsive search ad using the specified customizer attribute. diff --git a/examples/advanced_operations/add_smart_campaign.py b/examples/advanced_operations/add_smart_campaign.py index e247ea2e8..5fd6da0ce 100755 --- a/examples/advanced_operations/add_smart_campaign.py +++ b/examples/advanced_operations/add_smart_campaign.py @@ -71,7 +71,7 @@ def main( # entities necessary to create a Smart campaign. It will be reused a number # of times to retrieve suggestions for keyword themes, budget amount, # ad creatives, and campaign criteria. - suggestion_info = _get_smart_campaign_suggestion_info( + suggestion_info = get_smart_campaign_suggestion_info( client, business_profile_location, business_name ) @@ -79,7 +79,7 @@ def main( # generate a list of keyword themes using the SuggestKeywordThemes method # on the SmartCampaignSuggestService. It is strongly recommended that you # use this strategy for generating keyword themes. - keyword_theme_constants = _get_keyword_theme_suggestions( + keyword_theme_constants = get_keyword_theme_suggestions( client, customer_id, suggestion_info ) @@ -87,12 +87,12 @@ def main( # from the KeywordThemeConstantService and append them to the existing list. if keyword_text: keyword_theme_constants.extend( - _get_keyword_text_auto_completions(client, keyword_text) + get_keyword_text_auto_completions(client, keyword_text) ) # Map the KeywordThemeConstants retrieved by the previous two steps to # KeywordThemeInfo instances. - keyword_theme_infos = _map_keyword_theme_constants_to_infos( + keyword_theme_infos = map_keyword_theme_constants_to_infos( client, keyword_theme_constants ) @@ -100,7 +100,7 @@ def main( # from it and add it to the existing list. if freeform_keyword_text: keyword_theme_infos.append( - _get_freeform_keyword_theme_info(client, freeform_keyword_text) + get_freeform_keyword_theme_info(client, freeform_keyword_text) ) # Now add the generated keyword themes to the suggestion info instance. @@ -108,12 +108,12 @@ def main( # [END add_smart_campaign_12] # Retrieve a budget amount suggestion. - suggested_budget_amount = _get_budget_suggestion( + suggested_budget_amount = get_budget_suggestion( client, customer_id, suggestion_info ) # Retrieve Smart campaign ad creative suggestions. - ad_suggestions = _get_ad_suggestions(client, customer_id, suggestion_info) + ad_suggestions = get_ad_suggestions(client, customer_id, suggestion_info) # [START add_smart_campaign_7] # The below methods create and return MutateOperations that we later @@ -123,20 +123,20 @@ def main( # create them in a single Mutate request so they all complete successfully # or fail entirely, leaving no orphaned entities. See: # https://developers.google.com/google-ads/api/docs/mutating/overview - campaign_budget_operation = _create_campaign_budget_operation( + campaign_budget_operation = create_campaign_budget_operation( client, customer_id, suggested_budget_amount ) - smart_campaign_operation = _create_smart_campaign_operation( + smart_campaign_operation = create_smart_campaign_operation( client, customer_id ) - smart_campaign_setting_operation = _create_smart_campaign_setting_operation( + smart_campaign_setting_operation = create_smart_campaign_setting_operation( client, customer_id, business_profile_location, business_name ) - campaign_criterion_operations = _create_campaign_criterion_operations( + campaign_criterion_operations = create_campaign_criterion_operations( client, customer_id, keyword_theme_infos, suggestion_info ) - ad_group_operation = _create_ad_group_operation(client, customer_id) - ad_group_ad_operation = _create_ad_group_ad_operation( + ad_group_operation = create_ad_group_operation(client, customer_id) + ad_group_ad_operation = create_ad_group_ad_operation( client, customer_id, ad_suggestions ) @@ -161,12 +161,12 @@ def main( ], ) - _print_response_details(response) + print_response_details(response) # [END add_smart_campaign_7] # [START add_smart_campaign_11] -def _get_keyword_theme_suggestions(client, customer_id, suggestion_info): +def get_keyword_theme_suggestions(client, customer_id, suggestion_info): """Retrieves KeywordThemeConstants using the given suggestion info. Here we use the SuggestKeywordThemes method, which uses all of the business @@ -204,7 +204,7 @@ def _get_keyword_theme_suggestions(client, customer_id, suggestion_info): # [START add_smart_campaign] -def _get_keyword_text_auto_completions(client, keyword_text): +def get_keyword_text_auto_completions(client, keyword_text): """Retrieves KeywordThemeConstants for the given keyword text. These KeywordThemeConstants are derived from autocomplete data for the @@ -238,7 +238,7 @@ def _get_keyword_text_auto_completions(client, keyword_text): # [START add_smart_campaign_13] -def _get_freeform_keyword_theme_info(client, freeform_keyword_text): +def get_freeform_keyword_theme_info(client, freeform_keyword_text): """Creates a KeywordThemeInfo using the given free-form keyword text. Args: @@ -255,7 +255,7 @@ def _get_freeform_keyword_theme_info(client, freeform_keyword_text): # [END add_smart_campaign_13] -def _map_keyword_theme_constants_to_infos(client, keyword_theme_constants): +def map_keyword_theme_constants_to_infos(client, keyword_theme_constants): """Maps a list of KeywordThemeConstants to KeywordThemeInfos. Args: @@ -275,7 +275,7 @@ def _map_keyword_theme_constants_to_infos(client, keyword_theme_constants): # [START add_smart_campaign_9] -def _get_smart_campaign_suggestion_info( +def get_smart_campaign_suggestion_info( client, business_profile_location, business_name ): """Builds a SmartCampaignSuggestionInfo object with business details. @@ -358,7 +358,7 @@ def _get_smart_campaign_suggestion_info( # [START add_smart_campaign_1] -def _get_budget_suggestion(client, customer_id, suggestion_info): +def get_budget_suggestion(client, customer_id, suggestion_info): """Retrieves a suggested budget amount for a new budget. Using the SmartCampaignSuggestService to determine a daily budget for new @@ -407,7 +407,7 @@ def _get_budget_suggestion(client, customer_id, suggestion_info): # [START add_smart_campaign_10] -def _get_ad_suggestions(client, customer_id, suggestion_info): +def get_ad_suggestions(client, customer_id, suggestion_info): """Retrieves creative suggestions for a Smart campaign ad. Using the SmartCampaignSuggestService to suggest creatives for new and @@ -454,7 +454,7 @@ def _get_ad_suggestions(client, customer_id, suggestion_info): # [START add_smart_campaign_2] -def _create_campaign_budget_operation( +def create_campaign_budget_operation( client, customer_id, suggested_budget_amount ): """Creates a MutateOperation that creates a new CampaignBudget. @@ -493,7 +493,7 @@ def _create_campaign_budget_operation( # [START add_smart_campaign_3] -def _create_smart_campaign_operation(client, customer_id): +def create_smart_campaign_operation(client, customer_id): """Creates a MutateOperation that creates a new Smart campaign. A temporary ID will be assigned to this campaign so that it can @@ -535,7 +535,7 @@ def _create_smart_campaign_operation(client, customer_id): # [START add_smart_campaign_4] -def _create_smart_campaign_setting_operation( +def create_smart_campaign_setting_operation( client, customer_id, business_profile_location, business_name ): """Creates a MutateOperation to create a new SmartCampaignSetting. @@ -594,7 +594,7 @@ def _create_smart_campaign_setting_operation( # [START add_smart_campaign_8] -def _create_campaign_criterion_operations( +def create_campaign_criterion_operations( client, customer_id, keyword_theme_infos, suggestion_info ): """Creates a list of MutateOperations that create new campaign criteria. @@ -646,7 +646,7 @@ def _create_campaign_criterion_operations( # [START add_smart_campaign_5] -def _create_ad_group_operation(client, customer_id): +def create_ad_group_operation(client, customer_id): """Creates a MutateOperation that creates a new ad group. A temporary ID will be used in the campaign resource name for this @@ -682,7 +682,7 @@ def _create_ad_group_operation(client, customer_id): # [START add_smart_campaign_6] -def _create_ad_group_ad_operation(client, customer_id, ad_suggestions): +def create_ad_group_ad_operation(client, customer_id, ad_suggestions): """Creates a MutateOperation that creates a new ad group ad. A temporary ID will be used in the ad group resource name for this @@ -743,7 +743,7 @@ def _create_ad_group_ad_operation(client, customer_id, ad_suggestions): # [END add_smart_campaign_6] -def _print_response_details(response): +def print_response_details(response): """Prints the details of a MutateGoogleAdsResponse. Parses the "response" oneof field name and uses it to extract the new diff --git a/examples/advanced_operations/add_smart_display_ad.py b/examples/advanced_operations/add_smart_display_ad.py index b888c85b8..057eb81d7 100755 --- a/examples/advanced_operations/add_smart_display_ad.py +++ b/examples/advanced_operations/add_smart_display_ad.py @@ -53,10 +53,10 @@ def main( marketing_image_asset_id=None, square_marketing_image_asset_id=None, ): - budget_resource_name = _create_budget(client, customer_id) + budget_resource_name = create_budget(client, customer_id) print(f'Created budget with resource name "{budget_resource_name}".') - campaign_resource_name = _create_smart_display_campaign( + campaign_resource_name = create_smart_display_campaign( client, customer_id, budget_resource_name ) print( @@ -64,7 +64,7 @@ def main( f'"{campaign_resource_name}".' ) - ad_group_resource_name = _create_ad_group( + ad_group_resource_name = create_ad_group( client, customer_id, campaign_resource_name ) print(f'Created ad group with resource name "{ad_group_resource_name}"') @@ -75,7 +75,7 @@ def main( f'"{marketing_image_asset_id}".' ) else: - marketing_image_asset_id = _upload_image_asset( + marketing_image_asset_id = upload_image_asset( client, customer_id, _MARKETING_IMAGE_URL, @@ -94,7 +94,7 @@ def main( f'"{square_marketing_image_asset_id}".' ) else: - square_marketing_image_asset_id = _upload_image_asset( + square_marketing_image_asset_id = upload_image_asset( client, customer_id, _SQUARE_MARKETING_IMAGE_URL, @@ -107,7 +107,7 @@ def main( f'"{square_marketing_image_asset_id}".' ) - responsive_display_ad_resource_name = _create_responsive_display_ad( + responsive_display_ad_resource_name = create_responsive_display_ad( client, customer_id, ad_group_resource_name, @@ -126,7 +126,7 @@ def main( # [START add_smart_display_ad] -def _create_budget(client, customer_id): +def create_budget(client, customer_id): campaign_budget_operation = client.get_type("CampaignBudgetOperation") campaign_budget = campaign_budget_operation.create campaign_budget.name = f"Interplanetary Cruise Budget #{uuid4()}" @@ -144,14 +144,14 @@ def _create_budget(client, customer_id): ) ) except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) return campaign_budget_response.results[0].resource_name # [END add_smart_display_ad] # [START add_smart_display_ad_1] -def _create_smart_display_campaign(client, customer_id, budget_resource_name): +def create_smart_display_campaign(client, customer_id, budget_resource_name): campaign_service = client.get_service("CampaignService") campaign_operation = client.get_type("CampaignOperation") campaign = campaign_operation.create @@ -182,14 +182,14 @@ def _create_smart_display_campaign(client, customer_id, budget_resource_name): customer_id=customer_id, operations=[campaign_operation] ) except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) return campaign_response.results[0].resource_name # [END add_smart_display_ad_1] # [START add_smart_display_ad_4] -def _create_ad_group(client, customer_id, campaign_resource_name): +def create_ad_group(client, customer_id, campaign_resource_name): ad_group_service = client.get_service("AdGroupService") ad_group_operation = client.get_type("AdGroupOperation") ad_group = ad_group_operation.create @@ -203,14 +203,14 @@ def _create_ad_group(client, customer_id, campaign_resource_name): customer_id=customer_id, operations=[ad_group_operation] ) except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) return ad_group_response.results[0].resource_name # [END add_smart_display_ad_4] # [START add_smart_display_ad_3] -def _upload_image_asset( +def upload_image_asset( client, customer_id, image_url, image_width, image_height, image_name ): # Download image from URL @@ -248,12 +248,12 @@ def _upload_image_asset( mutate_asset_response = asset_service.mutate_assets(request=request) return mutate_asset_response.results[0].asset.id except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) # [END add_smart_display_ad_3] # [START add_smart_display_ad_2] -def _create_responsive_display_ad( +def create_responsive_display_ad( client, customer_id, ad_group_resource_name, @@ -314,13 +314,13 @@ def _create_responsive_display_ad( customer_id=customer_id, operations=[ad_group_ad_operation] ) except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) return ad_group_ad_response.results[0].resource_name # [END add_smart_display_ad_2] -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' 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 10154f74a..270ac31a8 100755 --- a/examples/advanced_operations/create_and_attach_shared_keyword_set.py +++ b/examples/advanced_operations/create_and_attach_shared_keyword_set.py @@ -46,7 +46,7 @@ def main(client, customer_id, campaign_id): print(f'Created shared set "{shared_set_resource_name}".') except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) # Keywords to create a shared set of. keywords = ["mars cruise", "mars hotels"] @@ -71,7 +71,7 @@ def main(client, customer_id, campaign_id): f'"{shared_criterion.resource_name}".' ) except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) campaign_set_operation = client.get_type("CampaignSharedSetOperation") campaign_set = campaign_set_operation.create @@ -92,10 +92,10 @@ def main(client, customer_id, campaign_id): '"{campaign_shared_set_resource_name.results[0].resource_name}".' ) except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' 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 2c68c2d4e..000df09a0 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 @@ -56,7 +56,7 @@ def main(client, customer_id, page_size, campaign_id): f'"{shared_set.name}" was found.' ) except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) # Next, retrieve shared criteria for all found shared sets. ids = ", ".join(shared_set_ids) @@ -81,7 +81,7 @@ def main(client, customer_id, page_size, campaign_id): request=shared_criteria_search_request ) except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) criterion_type_enum = client.enums.CriterionTypeEnum criterion_ids = [] @@ -116,10 +116,10 @@ def main(client, customer_id, page_size, campaign_id): for result in response.results: print(f'Removed shared criterion "{result.resource_name}".') except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' diff --git a/examples/advanced_operations/use_cross_account_bidding_strategy.py b/examples/advanced_operations/use_cross_account_bidding_strategy.py index 2317f9303..78ac9b56f 100755 --- a/examples/advanced_operations/use_cross_account_bidding_strategy.py +++ b/examples/advanced_operations/use_cross_account_bidding_strategy.py @@ -39,18 +39,18 @@ def main(client, customer_id, manager_customer_id, campaign_id): campaign_id: The ID of an existing campaign in the client customer's account. """ - bidding_strategy_resource_name = _create_bidding_strategy( + bidding_strategy_resource_name = create_bidding_strategy( client, manager_customer_id ) - _list_manager_owned_bidding_strategies(client, manager_customer_id) - _list_customer_accessible_bidding_strategies(client, customer_id) - _attach_cross_account_bidding_strategy_to_campaign( + list_manager_owned_bidding_strategies(client, manager_customer_id) + list_customer_accessible_bidding_strategies(client, customer_id) + attach_cross_account_bidding_strategy_to_campaign( client, customer_id, campaign_id, bidding_strategy_resource_name ) # [START create_cross_account_strategy] -def _create_bidding_strategy(client, manager_customer_id): +def create_bidding_strategy(client, manager_customer_id): """Creates a new cross-account bidding strategy in the manager account. The cross-account bidding strategy is of type TargetSpend (Maximize Clicks). @@ -91,7 +91,7 @@ def _create_bidding_strategy(client, manager_customer_id): # [START list_manager_strategies] -def _list_manager_owned_bidding_strategies(client, manager_customer_id): +def list_manager_owned_bidding_strategies(client, manager_customer_id): """List all cross-account bidding strategies in the manager account. Args: @@ -131,7 +131,7 @@ def _list_manager_owned_bidding_strategies(client, manager_customer_id): # [START list_accessible_strategies] -def _list_customer_accessible_bidding_strategies(client, customer_id): +def list_customer_accessible_bidding_strategies(client, customer_id): """Lists all bidding strategies available to the client account. This includes both portfolio bidding strategies owned by account and @@ -179,7 +179,7 @@ def _list_customer_accessible_bidding_strategies(client, customer_id): # [START attach_strategy] -def _attach_cross_account_bidding_strategy_to_campaign( +def attach_cross_account_bidding_strategy_to_campaign( client, customer_id, campaign_id, bidding_strategy_resource_name ): """Attaches the cross-account bidding strategy to the given campaign. diff --git a/examples/advanced_operations/use_portfolio_bidding_strategy.py b/examples/advanced_operations/use_portfolio_bidding_strategy.py index e37cb7d68..56f69d11d 100755 --- a/examples/advanced_operations/use_portfolio_bidding_strategy.py +++ b/examples/advanced_operations/use_portfolio_bidding_strategy.py @@ -49,7 +49,7 @@ def main(client, customer_id): campaign_budget_id = campaign_budget_response.results[0].resource_name print(f'Budget "{campaign_budget_id}" was created.') except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) # [END use_portfolio_bidding_strategy] # [START use_portfolio_bidding_strategy_1] @@ -70,7 +70,7 @@ def main(client, customer_id): bidding_strategy_id = bidding_strategy_response.results[0].resource_name print(f'Created portfolio bidding strategy "{bidding_strategy_id}".') except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) # [END use_portfolio_bidding_strategy_1] # [START use_portfolio_bidding_strategy_2] @@ -106,10 +106,10 @@ def main(client, customer_id): ) print(f"Created campaign {campaign_response.results[0].resource_name}.") except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' diff --git a/examples/authentication/authenticate_in_web_application.py b/examples/authentication/authenticate_in_web_application.py deleted file mode 100755 index b5834e762..000000000 --- a/examples/authentication/authenticate_in_web_application.py +++ /dev/null @@ -1,203 +0,0 @@ -#!/usr/bin/env python -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""This example creates an OAuth2 refresh token using the Web application flow. - -To retrieve the necessary client_secrets JSON file, first generate OAuth 2.0 -credentials of type 'Web application' in the Google Cloud Console: - -https://console.cloud.google.com - -Make sure 'http://localhost:8080' is included the list of authorized redirect -URIs for this client ID. If you choose a different port, make sure to update the -hardcoded _PORT variable below. - -Once complete, download the credentials and save the file path so it can be -passed into this example. - -This example is a very simple implementation, for a more detailed example see: -https://developers.google.com/identity/protocols/oauth2/web-server#python -""" - - -import argparse -import hashlib -import os -import re -import socket -import sys - -from google_auth_oauthlib.flow import Flow - - -_SCOPE = "https://www.googleapis.com/auth/adwords" -_PORT = 8080 -_REDIRECT_URI = f"http://localhost:{_PORT}" - - -def main(client_secrets_path, scopes): - """The main method, starts a basic server and initializes an auth request. - - Args: - client_secrets_path: a path to where the client secrets JSON file is - located on the machine running this example. - scopes: a list of API scopes to include in the auth request, see: - https://developers.google.com/identity/protocols/oauth2/scopes - """ - flow = Flow.from_client_secrets_file(client_secrets_path, scopes=scopes) - flow.redirect_uri = _REDIRECT_URI - - # Create an anti-forgery state token as described here: - # https://developers.google.com/identity/protocols/OpenIDConnect#createxsrftoken - passthrough_val = hashlib.sha256(os.urandom(1024)).hexdigest() - - authorization_url, state = flow.authorization_url( - access_type="offline", - state=passthrough_val, - include_granted_scopes="true", - ) - - # Prints the authorization URL so you can paste into your browser. In a - # typical web application you would redirect the user to this URL, and they - # would be redirected back to "redirect_url" provided earlier after - # granting permission. - print("Paste this URL into your browser: ") - print(authorization_url) - print(f"\nWaiting for authorization and callback to: {_REDIRECT_URI}...") - - # Retrieves an authorization code by opening a socket to receive the - # redirect request and parsing the query parameters set in the URL. - code = _get_authorization_code(passthrough_val) - - # Pass the code back into the OAuth module to get a refresh token. - flow.fetch_token(code=code) - refresh_token = flow.credentials.refresh_token - - print(f"\nYour refresh token is: {refresh_token}\n") - print( - "Add your refresh token to your client library configuration as " - "described here: " - "https://developers.google.com/google-ads/api/docs/client-libs/python/configuration" - ) - - -def _get_authorization_code(passthrough_val): - """Opens a socket to handle a single HTTP request containing auth tokens. - - Args: - passthrough_val: an anti-forgery token used to verify the request - received by the socket. - - Returns: - a str access token from the Google Auth service. - """ - # Open a socket at localhost:PORT and listen for a request - sock = socket.socket() - sock.bind(("localhost", _PORT)) - sock.listen(1) - connection, address = sock.accept() - data = connection.recv(1024) - # Parse the raw request to retrieve the URL query parameters. - params = _parse_raw_query_params(data) - - try: - if not params.get("code"): - # If no code is present in the query params then there will be an - # error message with more details. - error = params.get("error") - message = f"Failed to retrieve authorization code. Error: {error}" - raise ValueError(message) - elif params.get("state") != passthrough_val: - message = "State token does not match the expected state." - raise ValueError(message) - else: - message = "Authorization code was successfully retrieved." - except ValueError as error: - print(error) - sys.exit(1) - finally: - response = ( - "HTTP/1.1 200 OK\n" - "Content-Type: text/html\n\n" - f"{message}" - "

Please check the console output.

\n" - ) - - connection.sendall(response.encode()) - connection.close() - - return params.get("code") - - -def _parse_raw_query_params(data): - """Parses a raw HTTP request to extract its query params as a dict. - - Note that this logic is likely irrelevant if you're building OAuth logic - into a complete web application, where response parsing is handled by a - framework. - - Args: - data: raw request data as bytes. - - Returns: - a dict of query parameter key value pairs. - """ - # Decode the request into a utf-8 encoded string - decoded = data.decode("utf-8") - # Use a regular expression to extract the URL query parameters string - match = re.search("GET\s\/\?(.*) ", decoded) - params = match.group(1) - # Split the parameters to isolate the key/value pairs - pairs = [pair.split("=") for pair in params.split("&")] - # Convert pairs to a dict to make it easy to access the values - return {key: val for key, val in pairs} - - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description=( - "Generates OAuth2 refresh token using the Web application flow. " - "To retrieve the necessary client_secrets JSON file, first " - "generate OAuth 2.0 credentials of type Web application in the " - "Google Cloud Console (https://console.cloud.google.com). " - "Make sure 'http://localhost:PORT' is included the list of " - "'Authorized redirect URIs' for this client ID." - ), - ) - # The following argument(s) should be provided to run the example. - parser.add_argument( - "--client_secrets_path", - required=True, - type=str, - help=( - "Path to the client secrets JSON file from the Google Developers " - "Console that contains your client ID, client secret, and " - "redirect URIs." - ), - ) - parser.add_argument( - "--additional_scopes", - default=None, - type=str, - nargs="+", - help="Additional scopes to apply when generating the refresh token.", - ) - args = parser.parse_args() - - configured_scopes = [_SCOPE] - - if args.additional_scopes: - configured_scopes.extend(args.additional_scopes) - - main(args.client_secrets_path, configured_scopes) diff --git a/examples/authentication/generate_user_credentials.py b/examples/authentication/generate_user_credentials.py index bee9912cc..eec26a74b 100755 --- a/examples/authentication/generate_user_credentials.py +++ b/examples/authentication/generate_user_credentials.py @@ -96,7 +96,7 @@ def main(client_secrets_path, scopes): ) -def _get_authorization_code(passthrough_val): +def get_authorization_code(passthrough_val): """Opens a socket to handle a single HTTP request containing auth tokens. Args: @@ -114,7 +114,7 @@ def _get_authorization_code(passthrough_val): connection, address = sock.accept() data = connection.recv(1024) # Parse the raw request to retrieve the URL query parameters. - params = _parse_raw_query_params(data) + params = parse_raw_query_params(data) try: if not params.get("code"): @@ -145,7 +145,7 @@ def _get_authorization_code(passthrough_val): return params.get("code") -def _parse_raw_query_params(data): +def parse_raw_query_params(data): """Parses a raw HTTP request to extract its query params as a dict. Note that this logic is likely irrelevant if you're building OAuth logic diff --git a/examples/basic_operations/add_campaigns.py b/examples/basic_operations/add_campaigns.py index 08f091280..2365da8a5 100755 --- a/examples/basic_operations/add_campaigns.py +++ b/examples/basic_operations/add_campaigns.py @@ -52,7 +52,7 @@ def main(client, customer_id): ) ) except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) # [END add_campaigns] # [START add_campaigns_1] @@ -97,10 +97,10 @@ def main(client, customer_id): ) print(f"Created campaign {campaign_response.results[0].resource_name}.") except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' diff --git a/examples/basic_operations/add_expanded_text_ads.py b/examples/basic_operations/add_expanded_text_ads.py deleted file mode 100755 index 13f48287c..000000000 --- a/examples/basic_operations/add_expanded_text_ads.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""This example adds an expanded text ad. - -To get expanded text ads, run get_expanded_text_ads.py. -""" - - -import argparse -import sys -import uuid - -from google.ads.googleads.client import GoogleAdsClient -from google.ads.googleads.errors import GoogleAdsException - - -# [START add_expanded_text_ads] -def main(client, customer_id, ad_group_id, number_of_ads): - ad_group_ad_service = client.get_service("AdGroupAdService") - ad_group_service = client.get_service("AdGroupService") - - ad_group_ad_operations = [] - for i in range(number_of_ads): - # Create ad group ad. - ad_group_ad_operation = client.get_type("AdGroupAdOperation") - ad_group_ad = ad_group_ad_operation.create - ad_group_ad.ad_group = ad_group_service.ad_group_path( - customer_id, ad_group_id - ) - ad_group_ad.status = client.enums.AdGroupAdStatusEnum.PAUSED - - # Set expanded text ad info - ad_group_ad.ad.final_urls.append("http://www.example.com") - ad_group_ad.ad.expanded_text_ad.description = "Buy your tickets now!" - ad_group_ad.ad.expanded_text_ad.headline_part1 = ( - f"Cruise {i} to Mars {str(uuid.uuid4())[:8]}" - ) - ad_group_ad.ad.expanded_text_ad.headline_part2 = ( - "Best space cruise line" - ) - ad_group_ad.ad.expanded_text_ad.path1 = "all-inclusive" - ad_group_ad.ad.expanded_text_ad.path2 = "deals" - - ad_group_ad_operations.append(ad_group_ad_operation) - - ad_group_ad_response = ad_group_ad_service.mutate_ad_group_ads( - customer_id=customer_id, operations=ad_group_ad_operations - ) - - for result in ad_group_ad_response.results: - print(f'Created ad group ad "{result.resource_name}".') - # [END add_expanded_text_ads] - - -if __name__ == "__main__": - # GoogleAdsClient will read the google-ads.yaml configuration file in the - # home directory if none is specified. - googleads_client = GoogleAdsClient.load_from_storage(version="v11") - - parser = argparse.ArgumentParser( - 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=str, - required=True, - help="The Google Ads customer ID.", - ) - 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.", - ) - args = parser.parse_args() - - try: - main( - googleads_client, - args.customer_id, - args.ad_group_id, - args.number_of_ads, - ) - except GoogleAdsException as ex: - print( - f'Request with ID "{ex.request_id}" failed with status ' - f'"{ex.error.code().name}" and includes the following errors:' - ) - for error in ex.failure.errors: - print(f'\tError with message "{error.message}".') - if error.location: - for field_path_element in error.location.field_path_elements: - print(f"\t\tOn field: {field_path_element.field_name}") - sys.exit(1) diff --git a/examples/basic_operations/add_responsive_search_ad.py b/examples/basic_operations/add_responsive_search_ad.py index d6cad34a2..c99b8b87a 100755 --- a/examples/basic_operations/add_responsive_search_ad.py +++ b/examples/basic_operations/add_responsive_search_ad.py @@ -45,21 +45,21 @@ def main(client, customer_id, ad_group_id): # optional; if no pinning is set, then headlines and descriptions will be # rotated and the ones that perform best will be used more often. served_asset_enum = client.enums.ServedAssetFieldTypeEnum.HEADLINE_1 - pinned_headline = _create_ad_text_asset( + pinned_headline = create_ad_text_asset( client, f"Cruise to Mars #{str(uuid4())[:8]}", served_asset_enum ) ad_group_ad.ad.responsive_search_ad.headlines.extend( [ pinned_headline, - _create_ad_text_asset(client, "Best Space Cruise Line"), - _create_ad_text_asset(client, "Experience the Stars"), + create_ad_text_asset(client, "Best Space Cruise Line"), + create_ad_text_asset(client, "Experience the Stars"), ] ) ad_group_ad.ad.responsive_search_ad.descriptions.extend( [ - _create_ad_text_asset(client, "Buy your tickets now"), - _create_ad_text_asset(client, "Visit the Red Planet"), + create_ad_text_asset(client, "Buy your tickets now"), + create_ad_text_asset(client, "Visit the Red Planet"), ] ) ad_group_ad.ad.responsive_search_ad.path1 = "all-inclusive" @@ -77,7 +77,7 @@ def main(client, customer_id, ad_group_id): ) -def _create_ad_text_asset(client, text, pinned_field=None): +def create_ad_text_asset(client, text, pinned_field=None): """Create an AdTextAsset.""" ad_text_asset = client.get_type("AdTextAsset") ad_text_asset.text = text diff --git a/examples/basic_operations/get_responsive_search_ads.py b/examples/basic_operations/get_responsive_search_ads.py index 2d42facbd..3482d9222 100755 --- a/examples/basic_operations/get_responsive_search_ads.py +++ b/examples/basic_operations/get_responsive_search_ads.py @@ -61,10 +61,10 @@ def main(client, customer_id, page_size, ad_group_id=None): "was found." ) headlines = "\n".join( - _ad_text_assets_to_strs(ad.responsive_search_ad.headlines) + ad_text_assets_to_strs(ad.responsive_search_ad.headlines) ) descriptions = "\n".join( - _ad_text_assets_to_strs(ad.responsive_search_ad.descriptions) + ad_text_assets_to_strs(ad.responsive_search_ad.descriptions) ) print(f"Headlines:\n{headlines}\nDescriptions:\n{descriptions}\n") @@ -72,7 +72,7 @@ def main(client, customer_id, page_size, ad_group_id=None): print("No responsive search ads were found.") -def _ad_text_assets_to_strs(assets): +def ad_text_assets_to_strs(assets): """Converts a list of AdTextAssets to a list of user-friendly strings.""" s = [] for asset in assets: diff --git a/examples/basic_operations/update_expanded_text_ad.py b/examples/basic_operations/update_responsive_search_ad.py similarity index 68% rename from examples/basic_operations/update_expanded_text_ad.py rename to examples/basic_operations/update_responsive_search_ad.py index 65ceb24ca..5c4f90484 100755 --- a/examples/basic_operations/update_expanded_text_ad.py +++ b/examples/basic_operations/update_responsive_search_ad.py @@ -12,22 +12,22 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""This example updates an expanded text ad. +"""This example updates a responsive search ad. -To get expanded text ads, run get_expanded_text_ads.py. +To get responsive search ads, run get_responsive_search_ads.py. """ import argparse import sys -import uuid +from uuid import uuid4 from google.ads.googleads.client import GoogleAdsClient from google.ads.googleads.errors import GoogleAdsException from google.api_core import protobuf_helpers -# [START update_expanded_text_ad] +# [START update_responsive_search_ad] def main(client, customer_id, ad_id): ad_service = client.get_service("AdService") ad_operation = client.get_type("AdOperation") @@ -35,13 +35,32 @@ def main(client, customer_id, ad_id): # Update ad operation. ad = ad_operation.update ad.resource_name = ad_service.ad_path(customer_id, ad_id) - ad.expanded_text_ad.headline_part1 = ( - f"Cruise to Pluto {str(uuid.uuid4())[:8]}" + + # Update some properties of the responsive search ad. + headline_1 = client.get_type("AdTextAsset") + headline_1.text = f"Cruise to Pluto #{uuid4().hex[:8]}" + headline_1.pinned_field = client.enums.ServedAssetFieldTypeEnum.HEADLINE_1 + + headline_2 = client.get_type("AdTextAsset") + headline_2.text = "Tickets on sale now" + + headline_3 = client.get_type("AdTextAsset") + headline_3.text = "Buy your tickets now" + + ad.responsive_search_ad.headlines.extend( + [headline_1, headline_2, headline_3] ) - ad.expanded_text_ad.headline_part2 = "Tickets on sale now" - ad.expanded_text_ad.description = "Best space cruise ever." - ad.final_urls.append("http://www.example.com") - ad.final_mobile_urls.append("http://www.example.com/mobile") + + description_1 = client.get_type("AdTextAsset") + description_1.text = "Best space cruise ever." + + description_2 = client.get_type("AdTextAsset") + description_2.text = ( + "The most wonderful space experience you will ever have." + ) + + ad.final_urls.append("https://www.example.com") + ad.final_mobile_urls.append("https://www.example.com/mobile") client.copy_from( ad_operation.update_mask, protobuf_helpers.field_mask(None, ad._pb) ) @@ -54,7 +73,7 @@ def main(client, customer_id, ad_id): f'Ad with resource name "{ad_response.results[0].resource_name}" ' "was updated." ) - # [END update_expanded_text_ad] + # [END update_responsive_search_ad] if __name__ == "__main__": @@ -64,8 +83,8 @@ def main(client, customer_id, ad_id): parser = argparse.ArgumentParser( description=( - "Updates the specified expanded text ad, " - "for the given customer ID." + "Updates the specified responsive search ad, for the given " + "customer ID." ) ) # The following argument(s) should be provided to run the example. diff --git a/examples/billing/add_billing_setup.py b/examples/billing/add_billing_setup.py index df5adbf5c..d69ed37a3 100755 --- a/examples/billing/add_billing_setup.py +++ b/examples/billing/add_billing_setup.py @@ -47,10 +47,10 @@ def main( account and to the new billing setup. If provided it must be formatted as "1234-5678-9012". """ - billing_setup = _create_billing_setup( + billing_setup = create_billing_setup( client, customer_id, payments_account_id, payments_profile_id ) - _set_billing_setup_date_times(client, customer_id, billing_setup) + set_billing_setup_date_times(client, customer_id, billing_setup) billing_setup_operation = client.get_type("BillingSetupOperation") client.copy_from(billing_setup_operation.create, billing_setup) billing_setup_service = client.get_service("BillingSetupService") @@ -63,7 +63,7 @@ def main( ) -def _create_billing_setup( +def create_billing_setup( client, customer_id, payments_account_id=None, payments_profile_id=None ): """Creates and returns a new billing setup instance. @@ -109,7 +109,7 @@ def _create_billing_setup( return billing_setup -def _set_billing_setup_date_times(client, customer_id, billing_setup): +def set_billing_setup_date_times(client, customer_id, billing_setup): """Sets the starting and ending date times for the new billing setup. Queries the customer's account to see if there are any approved billing diff --git a/examples/billing/get_account_budgets.py b/examples/billing/get_account_budgets.py index 4ec8cf53b..5164a9c2b 100755 --- a/examples/billing/get_account_budgets.py +++ b/examples/billing/get_account_budgets.py @@ -53,17 +53,17 @@ def main(client, customer_id): # name of the Enum as a default if the numeric value for the # monetary or date fields is not present. approved_spending_limit = ( - _micros_to_currency(budget.approved_spending_limit_micros) + micros_to_currency(budget.approved_spending_limit_micros) or budget.approved_spending_limit_type.name ) proposed_spending_limit = ( - _micros_to_currency(budget.proposed_spending_limit_micros) + micros_to_currency(budget.proposed_spending_limit_micros) or budget.proposed_spending_limit_type.name ) adjusted_spending_limit = ( - _micros_to_currency(budget.adjusted_spending_limit_micros) + micros_to_currency(budget.adjusted_spending_limit_micros) or budget.adjusted_spending_limit_type.name ) @@ -78,11 +78,11 @@ def main(client, customer_id): ) amount_served = ( - _micros_to_currency(budget.amount_served_micros) or 0.0 + micros_to_currency(budget.amount_served_micros) or 0.0 ) total_adjustments = ( - _micros_to_currency(budget.total_adjustments_micros) or 0.0 + micros_to_currency(budget.total_adjustments_micros) or 0.0 ) print( @@ -101,7 +101,7 @@ def main(client, customer_id): ) -def _micros_to_currency(micros): +def micros_to_currency(micros): return micros / 1000000.0 if micros is not None else None diff --git a/examples/billing/get_invoices.py b/examples/billing/get_invoices.py index fa86d9756..863ec3227 100755 --- a/examples/billing/get_invoices.py +++ b/examples/billing/get_invoices.py @@ -100,7 +100,7 @@ def main(client, customer_id, billing_setup_id): # [END get_invoices_1] -def _micros_to_currency(micros): +def micros_to_currency(micros): return micros / 1000000.0 if micros is not None else None diff --git a/examples/campaign_management/add_complete_campaigns_using_batch_job.py b/examples/campaign_management/add_complete_campaigns_using_batch_job.py index 2bdd100ea..48eac14f1 100755 --- a/examples/campaign_management/add_complete_campaigns_using_batch_job.py +++ b/examples/campaign_management/add_complete_campaigns_using_batch_job.py @@ -35,7 +35,7 @@ _temporary_id = 0 -def _get_next_temporary_id(): +def get_next_temporary_id(): """Returns the next temporary ID to use in batch job operations. Decrements the temporary ID by one before returning it. The first value @@ -48,7 +48,7 @@ def _get_next_temporary_id(): return _temporary_id -def _build_mutate_operation(client, operation_type, operation): +def build_mutate_operation(client, operation_type, operation): """Builds a mutate operation with the given operation type and operation. Args: @@ -74,29 +74,29 @@ async def main(client, customer_id): customer_id: a str of a customer ID. """ batch_job_service = client.get_service("BatchJobService") - batch_job_operation = _create_batch_job_operation(client) - resource_name = _create_batch_job( + batch_job_operation = create_batch_job_operation(client) + resource_name = create_batch_job( batch_job_service, customer_id, batch_job_operation ) - operations = _build_all_operations(client, customer_id) - _add_all_batch_job_operations(batch_job_service, operations, resource_name) - operations_response = _run_batch_job(batch_job_service, resource_name) + operations = build_all_operations(client, customer_id) + add_all_batch_job_operations(batch_job_service, operations, resource_name) + operations_response = run_batch_job(batch_job_service, resource_name) # Create an asyncio.Event instance to control execution during the # asyncronous steps in _poll_batch_job. Note that this is not important # for polling asyncronously, it simply helps with execution control so we # can run _fetch_and_print_results after the asyncronous operations have # completed. - _done_event = asyncio.Event() - _poll_batch_job(operations_response, _done_event) + done_event = asyncio.Event() + poll_batch_job(operations_response, done_event) # Execution will stop here and wait for the asyncronous steps in # _poll_batch_job to complete before proceeding. - await _done_event.wait() + await done_event.wait() - _fetch_and_print_results(client, batch_job_service, resource_name) + fetch_and_print_results(client, batch_job_service, resource_name) -def _create_batch_job_operation(client): +def create_batch_job_operation(client): """Created a BatchJobOperation and sets an empty BatchJob instance to the "create" property in order to tell the Google Ads API that we're creating a new BatchJob. @@ -114,7 +114,7 @@ def _create_batch_job_operation(client): # [START add_complete_campaigns_using_batch_job] -def _create_batch_job(batch_job_service, customer_id, batch_job_operation): +def create_batch_job(batch_job_service, customer_id, batch_job_operation): """Creates a batch job for the specified customer ID. Args: @@ -132,12 +132,12 @@ def _create_batch_job(batch_job_service, customer_id, batch_job_operation): print(f'Created a batch job with resource name "{resource_name}"') return resource_name except GoogleAdsException as exception: - _handle_googleads_exception(exception) + handle_googleads_exception(exception) # [END add_complete_campaigns_using_batch_job] # [START add_complete_campaigns_using_batch_job_1] -def _add_all_batch_job_operations(batch_job_service, operations, resource_name): +def add_all_batch_job_operations(batch_job_service, operations, resource_name): """Adds all mutate operations to the batch job. As this is the first time for this batch job, we pass null as a sequence @@ -168,11 +168,11 @@ def _add_all_batch_job_operations(batch_job_service, operations, resource_name): f"{response.next_sequence_token}" ) except GoogleAdsException as exception: - _handle_googleads_exception(exception) + handle_googleads_exception(exception) # [END add_complete_campaigns_using_batch_job_1] -def _build_all_operations(client, customer_id): +def build_all_operations(client, customer_id): """Builds all operations for creating a complete campaign. Args: @@ -185,30 +185,30 @@ def _build_all_operations(client, customer_id): # Creates a new campaign budget operation and adds it to the list of # mutate operations. - campaign_budget_op = _build_campaign_budget_operation(client, customer_id) + campaign_budget_op = build_campaign_budget_operation(client, customer_id) operations.append( - _build_mutate_operation( + build_mutate_operation( client, "campaign_budget_operation", campaign_budget_op ) ) # Creates new campaign operations and adds them to the list of # mutate operations. - campaign_operations = _build_campaign_operations( + campaign_operations = build_campaign_operations( client, customer_id, campaign_budget_op.create.resource_name ) operations = operations + [ - _build_mutate_operation(client, "campaign_operation", operation) + build_mutate_operation(client, "campaign_operation", operation) for operation in campaign_operations ] # Creates new campaign criterion operations and adds them to the list of # mutate operations. - campaign_criterion_operations = _build_campaign_criterion_operations( + campaign_criterion_operations = build_campaign_criterion_operations( client, campaign_operations ) operations = operations + [ - _build_mutate_operation( + build_mutate_operation( client, "campaign_criterion_operation", operation ) for operation in campaign_criterion_operations @@ -216,21 +216,21 @@ def _build_all_operations(client, customer_id): # Creates new ad group operations and adds them to the list of # mutate operations. - ad_group_operations = _build_ad_group_operations( + ad_group_operations = build_ad_group_operations( client, customer_id, campaign_operations ) operations = operations + [ - _build_mutate_operation(client, "ad_group_operation", operation) + build_mutate_operation(client, "ad_group_operation", operation) for operation in ad_group_operations ] # Creates new ad group criterion operations and add them to the list of # mutate operations. - ad_group_criterion_operations = _build_ad_group_criterion_operations( + ad_group_criterion_operations = build_ad_group_criterion_operations( client, ad_group_operations ) operations = operations + [ - _build_mutate_operation( + build_mutate_operation( client, "ad_group_criterion_operation", operation ) for operation in ad_group_criterion_operations @@ -238,18 +238,18 @@ def _build_all_operations(client, customer_id): # Creates new ad group ad operations and adds them to the list of # mutate operations. - ad_group_ad_operations = _build_ad_group_ad_operations( + ad_group_ad_operations = build_ad_group_ad_operations( client, ad_group_operations ) operations = operations + [ - _build_mutate_operation(client, "ad_group_ad_operation", operation) + build_mutate_operation(client, "ad_group_ad_operation", operation) for operation in ad_group_ad_operations ] return operations -def _build_campaign_budget_operation(client, customer_id): +def build_campaign_budget_operation(client, customer_id): """Builds a new campaign budget operation for the given customer ID. Args: @@ -262,7 +262,7 @@ def _build_campaign_budget_operation(client, customer_id): campaign_budget_operation = client.get_type("CampaignBudgetOperation") campaign_budget = campaign_budget_operation.create resource_name = campaign_budget_service.campaign_budget_path( - customer_id, _get_next_temporary_id() + customer_id, get_next_temporary_id() ) campaign_budget.resource_name = resource_name campaign_budget.name = f"Interplanetary Cruise Budget #{uuid4()}" @@ -274,7 +274,7 @@ def _build_campaign_budget_operation(client, customer_id): return campaign_budget_operation -def _build_campaign_operations( +def build_campaign_operations( client, customer_id, campaign_budget_resource_name ): """Builds new campaign operations for the specified customer ID. @@ -288,14 +288,14 @@ def _build_campaign_operations( Returns: a list of CampaignOperation instances. """ return [ - _build_campaign_operation( + build_campaign_operation( client, customer_id, campaign_budget_resource_name ) for i in range(NUMBER_OF_CAMPAIGNS_TO_ADD) ] -def _build_campaign_operation( +def build_campaign_operation( client, customer_id, campaign_budget_resource_name ): """Builds new campaign operation for the specified customer ID. @@ -312,7 +312,7 @@ def _build_campaign_operation( campaign_service = client.get_service("CampaignService") # Creates a campaign. campaign = campaign_operation.create - campaign_id = _get_next_temporary_id() + campaign_id = get_next_temporary_id() # Creates a resource name using the temporary ID. campaign.resource_name = campaign_service.campaign_path( customer_id, campaign_id @@ -333,7 +333,7 @@ def _build_campaign_operation( return campaign_operation -def _build_campaign_criterion_operations(client, campaign_operations): +def build_campaign_criterion_operations(client, campaign_operations): """Builds new campaign criterion operations for negative keyword criteria. Args: @@ -343,12 +343,12 @@ def _build_campaign_criterion_operations(client, campaign_operations): Returns: a list of CampaignCriterionOperation instances. """ return [ - _build_campaign_criterion_operation(client, campaign_operation) + build_campaign_criterion_operation(client, campaign_operation) for campaign_operation in campaign_operations ] -def _build_campaign_criterion_operation(client, campaign_operation): +def build_campaign_criterion_operation(client, campaign_operation): """Builds a new campaign criterion operation for negative keyword criterion. Args: @@ -371,7 +371,7 @@ def _build_campaign_criterion_operation(client, campaign_operation): return campaign_criterion_operation -def _build_ad_group_operations(client, customer_id, campaign_operations): +def build_ad_group_operations(client, customer_id, campaign_operations): """Builds new ad group operations for the specified customer ID. Args: @@ -386,7 +386,7 @@ def _build_ad_group_operations(client, customer_id, campaign_operations): for campaign_operation in campaign_operations: for i in range(NUMBER_OF_AD_GROUPS_TO_ADD): operations.append( - _build_ad_group_operation( + build_ad_group_operation( client, customer_id, campaign_operation ) ) @@ -394,7 +394,7 @@ def _build_ad_group_operations(client, customer_id, campaign_operations): return operations -def _build_ad_group_operation(client, customer_id, campaign_operation): +def build_ad_group_operation(client, customer_id, campaign_operation): """Builds a new ad group operation for the specified customer ID. Args: @@ -408,7 +408,7 @@ def _build_ad_group_operation(client, customer_id, campaign_operation): ad_group_service = client.get_service("AdGroupService") # Creates an ad group. ad_group = ad_group_operation.create - ad_group_id = _get_next_temporary_id() + ad_group_id = get_next_temporary_id() # Creates a resource name using the temporary ID. ad_group.resource_name = ad_group_service.ad_group_path( customer_id, ad_group_id @@ -421,7 +421,7 @@ def _build_ad_group_operation(client, customer_id, campaign_operation): return ad_group_operation -def _build_ad_group_criterion_operations(client, ad_group_operations): +def build_ad_group_criterion_operations(client, ad_group_operations): """Builds new ad group criterion operations for creating keywords. 50% of keywords are created with some invalid characters to demonstrate @@ -438,7 +438,7 @@ def _build_ad_group_criterion_operations(client, ad_group_operations): for ad_group_operation in ad_group_operations: for i in range(NUMBER_OF_KEYWORDS_TO_ADD): operations.append( - _build_ad_group_criterion_operation( + build_ad_group_criterion_operation( # Create a keyword text by making 50% of keywords invalid # to demonstrate error handling. client, @@ -451,7 +451,7 @@ def _build_ad_group_criterion_operations(client, ad_group_operations): return operations -def _build_ad_group_criterion_operation( +def build_ad_group_criterion_operation( client, ad_group_operation, number, is_valid=True ): """Builds new ad group criterion operation for creating keywords. @@ -486,7 +486,7 @@ def _build_ad_group_criterion_operation( return ad_group_criterion_operation -def _build_ad_group_ad_operations(client, ad_group_operations): +def build_ad_group_ad_operations(client, ad_group_operations): """Builds new ad group ad operations. Args: @@ -496,12 +496,12 @@ def _build_ad_group_ad_operations(client, ad_group_operations): Returns: a list of AdGroupAdOperation instances. """ return [ - _build_ad_group_ad_operation(client, ad_group_operation) + build_ad_group_ad_operation(client, ad_group_operation) for ad_group_operation in ad_group_operations ] -def _build_ad_group_ad_operation(client, ad_group_operation): +def build_ad_group_ad_operation(client, ad_group_operation): """Builds a new ad group ad operation. Args: @@ -527,7 +527,7 @@ def _build_ad_group_ad_operation(client, ad_group_operation): # [START add_complete_campaigns_using_batch_job_2] -def _run_batch_job(batch_job_service, resource_name): +def run_batch_job(batch_job_service, resource_name): """Runs the batch job for executing all uploaded mutate operations. Args: @@ -544,12 +544,12 @@ def _run_batch_job(batch_job_service, resource_name): ) return response except GoogleAdsException as exception: - _handle_googleads_exception(exception) + handle_googleads_exception(exception) # [END add_complete_campaigns_using_batch_job_2] # [START add_complete_campaigns_using_batch_job_3] -def _poll_batch_job(operations_response, event): +def poll_batch_job(operations_response, event): """Polls the server until the batch job execution finishes. Sets the initial poll delay time and the total time to wait before time-out. @@ -561,7 +561,7 @@ def _poll_batch_job(operations_response, event): """ loop = asyncio.get_event_loop() - def _done_callback(future): + def done_callback(future): # The operations_response object will call callbacks from a daemon # thread so we must use a threadsafe method of setting the event here # otherwise it will not trigger the awaiting code. @@ -572,12 +572,12 @@ def _done_callback(future): # complete. Below we use the asynchronous interface, but there's also a # synchronous interface that uses the Operation.result method. # See: https://googleapis.dev/python/google-api-core/latest/operation.html - operations_response.add_done_callback(_done_callback) + operations_response.add_done_callback(done_callback) # [END add_complete_campaigns_using_batch_job_3] # [START add_complete_campaigns_using_batch_job_4] -def _fetch_and_print_results(client, batch_job_service, resource_name): +def fetch_and_print_results(client, batch_job_service, resource_name): """Prints all the results from running the batch job. Args: @@ -610,7 +610,7 @@ def _fetch_and_print_results(client, batch_job_service, resource_name): # [END add_complete_campaigns_using_batch_job_4] -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): """Prints the details of a GoogleAdsException object. Args: diff --git a/examples/campaign_management/set_ad_parameters.py b/examples/campaign_management/set_ad_parameters.py index 7d0b75cd8..c9ca1827d 100755 --- a/examples/campaign_management/set_ad_parameters.py +++ b/examples/campaign_management/set_ad_parameters.py @@ -38,8 +38,8 @@ def main(client, customer_id, ad_group_id, criterion_id): ) operations = [ - _create_ad_parameter(client, resource_name, 1, "100"), - _create_ad_parameter(client, resource_name, 2, "$40"), + create_ad_parameter(client, resource_name, 1, "100"), + create_ad_parameter(client, resource_name, 2, "$40"), ] ad_parameter_service = client.get_service("AdParameterService") @@ -70,7 +70,7 @@ def main(client, customer_id, ad_group_id, criterion_id): ) -def _create_ad_parameter( +def create_ad_parameter( client, resource_name, parameter_index, insertion_text ): """Creates a new ad parameter create operation and returns it. diff --git a/examples/custom_logging_interceptor/cloud_logging_interceptor.py b/examples/custom_logging_interceptor/cloud_logging_interceptor.py index 6aae721b6..e22faade4 100644 --- a/examples/custom_logging_interceptor/cloud_logging_interceptor.py +++ b/examples/custom_logging_interceptor/cloud_logging_interceptor.py @@ -40,7 +40,7 @@ class CloudLoggingInterceptor(LoggingInterceptor): this is to inherit from the Interceptor class instead, and selectively copy whatever logic is needed from the LoggingInterceptor class.""" - def __init__(self, api_version): + def _init__(self, api_version): """Initializer for the CloudLoggingInterceptor. Args: diff --git a/examples/error_handling/handle_expanded_text_ad_policy_violations.py b/examples/error_handling/handle_expanded_text_ad_policy_violations.py index 9f1c083c7..e75f132d4 100755 --- a/examples/error_handling/handle_expanded_text_ad_policy_violations.py +++ b/examples/error_handling/handle_expanded_text_ad_policy_violations.py @@ -37,12 +37,12 @@ def main(client, customer_id, ad_group_id): ad_group_ad_service_client = client.get_service("AdGroupAdService") - ad_group_ad_operation, ignorable_policy_topics = _create_expanded_text_ad( + ad_group_ad_operation, ignorable_policy_topics = create_expanded_text_ad( client, ad_group_ad_service_client, customer_id, ad_group_id ) try: - _request_exemption( + request_exemption( customer_id, ad_group_ad_service_client, ad_group_ad_operation, @@ -61,7 +61,7 @@ def main(client, customer_id, ad_group_id): sys.exit(1) -def _create_expanded_text_ad( +def create_expanded_text_ad( client, ad_group_ad_service_client, customer_id, ad_group_id ): """Create an expanded text ad that includes a policy violation. @@ -107,7 +107,7 @@ def _create_expanded_text_ad( except GoogleAdsException as googleads_exception: # The request will always fail due to the policy violation in the # ad's description. - ignorable_policy_topics = _fetch_ignorable_policy_topics( + ignorable_policy_topics = fetch_ignorable_policy_topics( client, googleads_exception ) @@ -115,7 +115,7 @@ def _create_expanded_text_ad( # [START handle_expanded_text_ad_policy_violations] -def _fetch_ignorable_policy_topics(client, googleads_exception): +def fetch_ignorable_policy_topics(client, googleads_exception): """Collects all ignorable policy topics to be sent for exemption request. Args: @@ -170,7 +170,7 @@ def _fetch_ignorable_policy_topics(client, googleads_exception): # [START handle_expanded_text_ad_policy_violations_1] -def _request_exemption( +def request_exemption( customer_id, ad_group_ad_service_client, ad_group_ad_operation, diff --git a/examples/error_handling/handle_keyword_policy_violations.py b/examples/error_handling/handle_keyword_policy_violations.py index eb7b1a226..7a0cddb4b 100755 --- a/examples/error_handling/handle_keyword_policy_violations.py +++ b/examples/error_handling/handle_keyword_policy_violations.py @@ -47,7 +47,7 @@ def main(client, customer_id, ad_group_id, keyword_text): ( googleads_exception, ad_group_criterion_operation, - ) = _create_keyword_criterion( + ) = create_keyword_criterion( client, ad_group_criterion_service, customer_id, @@ -60,10 +60,10 @@ def main(client, customer_id, ad_group_id, keyword_text): # your keyword contains many policy violations, but not all of them are # exemptible, the request will not be sent. if googleads_exception is not None: - exempt_policy_violation_keys = _fetch_exempt_policy_violation_keys( + exempt_policy_violation_keys = fetch_exempt_policy_violation_keys( googleads_exception ) - _request_exemption( + request_exemption( customer_id, ad_group_criterion_service, ad_group_criterion_operation, @@ -82,7 +82,7 @@ def main(client, customer_id, ad_group_id, keyword_text): sys.exit(1) -def _create_keyword_criterion( +def create_keyword_criterion( client, ad_group_criterion_service, customer_id, ad_group_id, keyword_text ): """Attempts to add a keyword criterion to an ad group. @@ -129,7 +129,7 @@ def _create_keyword_criterion( # [START handle_keyword_policy_violations] -def _fetch_exempt_policy_violation_keys(googleads_exception): +def fetch_exempt_policy_violation_keys(googleads_exception): """Collects all policy violation keys that can be exempted. Args: @@ -190,7 +190,7 @@ def _fetch_exempt_policy_violation_keys(googleads_exception): # [START handle_keyword_policy_violations_1] -def _request_exemption( +def request_exemption( customer_id, ad_group_criterion_service, ad_group_criterion_operation, diff --git a/examples/error_handling/handle_partial_failure.py b/examples/error_handling/handle_partial_failure.py index 393d52325..c377d1bff 100755 --- a/examples/error_handling/handle_partial_failure.py +++ b/examples/error_handling/handle_partial_failure.py @@ -37,7 +37,7 @@ def main(client, customer_id, campaign_id): campaign_id: The ID for a campaign to create Ad Groups under. """ try: - ad_group_response = _create_ad_groups(client, customer_id, campaign_id) + ad_group_response = create_ad_groups(client, customer_id, campaign_id) except GoogleAdsException as ex: print( f'Request with ID "{ex.request_id}" failed with status ' @@ -50,11 +50,11 @@ def main(client, customer_id, campaign_id): print(f"\t\tOn field: {field_path_element.field_name}") sys.exit(1) else: - _print_results(client, ad_group_response) + print_results(client, ad_group_response) # [START handle_partial_failure] -def _create_ad_groups(client, customer_id, campaign_id): +def create_ad_groups(client, customer_id, campaign_id): """Creates three Ad Groups, two of which intentionally generate errors. Args: @@ -101,7 +101,7 @@ def _create_ad_groups(client, customer_id, campaign_id): # [START handle_partial_failure_1] -def _is_partial_failure_error_present(response): +def is_partial_failure_error_present(response): """Checks whether a response message has a partial failure error. In Python the partial_failure_error attr is always present on a response @@ -123,7 +123,7 @@ def _is_partial_failure_error_present(response): # [START handle_partial_failure_2] -def _print_results(client, response): +def print_results(client, response): """Prints partial failure errors and success messages from a response. This function shows how to retrieve partial_failure errors from a response @@ -161,7 +161,7 @@ def _print_results(client, response): response: a MutateAdGroupsResponse instance. """ # Check for existence of any partial failures in the response. - if _is_partial_failure_error_present(response): + if is_partial_failure_error_present(response): print("Partial failures occurred. Details will be shown below.\n") # Prints the details of the partial failure errors. partial_failure = getattr(response, "partial_failure_error", None) diff --git a/examples/error_handling/handle_rate_exceeded_error.py b/examples/error_handling/handle_rate_exceeded_error.py index a58f5fc6a..49a84edee 100755 --- a/examples/error_handling/handle_rate_exceeded_error.py +++ b/examples/error_handling/handle_rate_exceeded_error.py @@ -52,7 +52,7 @@ def main(client, customer_id, ad_group_id): temp_resource_exhausted = quota_error_enum.RESOURCE_TEMPORARILY_EXHAUSTED for i in range(NUM_REQUESTS): - operations = _create_ad_group_criterion_operations( + operations = create_ad_group_criterion_operations( client, customer_id, ad_group_id, i ) @@ -62,7 +62,7 @@ def main(client, customer_id, ad_group_id): while retry_count < NUM_RETRIES: try: - _request_mutate_and_display_result( + request_mutate_and_display_result( client, customer_id, operations ) break @@ -105,7 +105,7 @@ def main(client, customer_id, ad_group_id): raise ex -def _create_ad_group_criterion_operations( +def create_ad_group_criterion_operations( client, customer_id, ad_group_id, request_index ): """Creates ad group criterion operations. @@ -147,7 +147,7 @@ def _create_ad_group_criterion_operations( return operations -def _request_mutate_and_display_result(client, customer_id, operations): +def request_mutate_and_display_result(client, customer_id, operations): """Mutates a set of ad group criteria as a dry-run and displays the results. The request is sent with validate_only set to true, so no actual mutations diff --git a/examples/extensions/add_affiliate_location_extensions.py b/examples/extensions/add_affiliate_location_extensions.py index 7ae48bcc6..a0396818a 100644 --- a/examples/extensions/add_affiliate_location_extensions.py +++ b/examples/extensions/add_affiliate_location_extensions.py @@ -45,17 +45,17 @@ def main(client, customer_id, chain_id, campaign_id): campaign_id: The campaign ID for which the affiliate location extensions will be added. """ - feed_resource_name = _create_affiliate_location_extension_feed( + feed_resource_name = create_affiliate_location_extension_feed( client, customer_id, chain_id ) # After the completion of the feed creation operation above, the added # feed will not be available for usage in a campaign feed until the feed # mappings are created. We will wait with an exponential back-off policy # until the feed mappings have been created. - feed_mapping = _wait_for_feed_to_be_ready( + feed_mapping = wait_for_feed_to_be_ready( client, customer_id, feed_resource_name ) - _create_campaign_feed( + create_campaign_feed( client, customer_id, campaign_id, @@ -66,7 +66,7 @@ def main(client, customer_id, chain_id, campaign_id): # [START add_affiliate_location_extensions] -def _create_affiliate_location_extension_feed(client, customer_id, chain_id): +def create_affiliate_location_extension_feed(client, customer_id, chain_id): """Creates the Affiliate Location Extension feed. Args: @@ -84,7 +84,7 @@ def _create_affiliate_location_extension_feed(client, customer_id, chain_id): # This is because Google Ads only allows one location extension feed per # email address, and a Google Ads account cannot have a location extension # feed and an affiliate location extension feed at the same time. - _remove_location_extension_feeds(client, customer_id) + remove_location_extension_feeds(client, customer_id) # Get the FeedServiceClient. feed_service = client.get_service("FeedService") @@ -118,7 +118,7 @@ def _create_affiliate_location_extension_feed(client, customer_id, chain_id): # [END add_affiliate_location_extensions] -def _remove_location_extension_feeds(client, customer_id): +def remove_location_extension_feeds(client, customer_id): """Removes the old location extension feeds. Args: @@ -131,20 +131,20 @@ def _remove_location_extension_feeds(client, customer_id): # 2. Remove the feed so that Google Ads will no longer sync from the # Business Profile account. # Optional: You may also want to remove the CampaignFeeds and AdGroupFeeds. - old_customer_feeds = _get_location_extension_customer_feeds( + old_customer_feeds = get_location_extension_customer_feeds( client, customer_id ) if old_customer_feeds: - _remove_customer_feeds(client, customer_id, old_customer_feeds) + remove_customer_feeds(client, customer_id, old_customer_feeds) - feeds = _get_location_extension_feeds(client, customer_id) + feeds = get_location_extension_feeds(client, customer_id) if feeds: - _remove_feeds(client, customer_id, feeds) + remove_feeds(client, customer_id, feeds) -def _get_location_extension_feeds(client, customer_id): +def get_location_extension_feeds(client, customer_id): """Gets the location extension feeds. Args: @@ -181,7 +181,7 @@ def _get_location_extension_feeds(client, customer_id): ] -def _remove_feeds(client, customer_id, feeds): +def remove_feeds(client, customer_id, feeds): """Removes the feeds. Args: @@ -200,7 +200,7 @@ def _remove_feeds(client, customer_id, feeds): feed_service.mutate_feeds(customer_id=customer_id, operations=operations) -def _get_location_extension_customer_feeds(client, customer_id): +def get_location_extension_customer_feeds(client, customer_id): """Gets the location extension customer feeds. Args: @@ -233,7 +233,7 @@ def _get_location_extension_customer_feeds(client, customer_id): return [row.customer_feed for row in search_results] -def _remove_customer_feeds(client, customer_id, customer_feeds): +def remove_customer_feeds(client, customer_id, customer_feeds): """Removes the customer feeds. Args: @@ -255,7 +255,7 @@ def _remove_customer_feeds(client, customer_id, customer_feeds): # [START add_affiliate_location_extensions_1] -def _get_affiliate_location_extension_feed_mapping( +def get_affiliate_location_extension_feed_mapping( client, customer_id, feed_resource_name ): """Gets the Affiliate Location Extension feed mapping. @@ -301,7 +301,7 @@ def _get_affiliate_location_extension_feed_mapping( # [START add_affiliate_location_extensions_2] -def _wait_for_feed_to_be_ready(client, customer_id, feed_resource_name): +def wait_for_feed_to_be_ready(client, customer_id, feed_resource_name): """Waits for the Affiliate location extension feed to be ready. Args: @@ -325,7 +325,7 @@ def _wait_for_feed_to_be_ready(client, customer_id, feed_resource_name): # created, it is ready to be used for creating customer feed. # This process is asynchronous, so we wait until the feed mapping is # created, performing exponential backoff. - feed_mapping = _get_affiliate_location_extension_feed_mapping( + feed_mapping = get_affiliate_location_extension_feed_mapping( client, customer_id, feed_resource_name ) @@ -349,7 +349,7 @@ def _wait_for_feed_to_be_ready(client, customer_id, feed_resource_name): # [START add_affiliate_location_extensions_3] -def _create_campaign_feed( +def create_campaign_feed( client, customer_id, campaign_id, feed_mapping, feed_resource_name, chain_id ): """Creates the campaign feed. @@ -368,7 +368,7 @@ def _create_campaign_feed( campaign_feed_service = client.get_service("CampaignFeedService") feed_service = client.get_service("FeedService") - attribute_id_for_chain_id = _get_attribute_id_for_chain_id( + attribute_id_for_chain_id = get_attribute_id_for_chain_id( client, feed_mapping ) feed_id = feed_service.parse_feed_path(feed_resource_name)["feed_id"] @@ -405,7 +405,7 @@ def _create_campaign_feed( # [START add_affiliate_location_extensions_4] -def _get_attribute_id_for_chain_id(client, feed_mapping): +def get_attribute_id_for_chain_id(client, feed_mapping): """Gets the feed attribute ID for the retail chain ID. Args: diff --git a/examples/extensions/add_business_profile_location_extensions.py b/examples/extensions/add_business_profile_location_extensions.py index 2f44bde86..c932a57a3 100644 --- a/examples/extensions/add_business_profile_location_extensions.py +++ b/examples/extensions/add_business_profile_location_extensions.py @@ -103,7 +103,7 @@ def main( # per email address, and a Google Ads account cannot have a location # extension feed and an affiliate location extension feed at the same # time. - _delete_location_extension_feeds(client, customer_id) + delete_location_extension_feeds(client, customer_id) # [START add_business_profile_location_extensions_1] # Add the feed. Since it is a system generated feed, Google Ads will @@ -132,7 +132,7 @@ def main( number_of_attempts = 0 while number_of_attempts < MAX_CUSTOMER_FEED_ADD_ATTEMPTS: - feed_mapping = _get_business_profile_feed_mapping( + feed_mapping = get_business_profile_feed_mapping( client, customer_id, feed_resource_name ) @@ -195,7 +195,7 @@ def main( # [END add_business_profile_location_extensions_3] -def _delete_location_extension_feeds(client, customer_id): +def delete_location_extension_feeds(client, customer_id): """Deletes the existing location extension feeds. Args: @@ -207,18 +207,18 @@ def _delete_location_extension_feeds(client, customer_id): # stop serving. # 2. Delete the feed so that Google Ads will no longer sync from the # Business Profile account. - old_customer_feeds = _get_location_extension_customer_feeds( + old_customer_feeds = get_location_extension_customer_feeds( client, customer_id ) if old_customer_feeds: - _delete_customer_feeds(client, customer_id, old_customer_feeds) + delete_customer_feeds(client, customer_id, old_customer_feeds) - old_feeds = _get_location_extension_feeds(client, customer_id) + old_feeds = get_location_extension_feeds(client, customer_id) if old_feeds: - _delete_feeds(client, customer_id, old_feeds) + delete_feeds(client, customer_id, old_feeds) -def _get_location_extension_customer_feeds(client, customer_id): +def get_location_extension_customer_feeds(client, customer_id): """Gets the existing location extension customer feeds. Args: @@ -249,7 +249,7 @@ def _get_location_extension_customer_feeds(client, customer_id): return [row.customer_feed for row in result] -def _get_location_extension_feeds(client, customer_id): +def get_location_extension_feeds(client, customer_id): """Gets the existing location extension feeds. Args: @@ -284,7 +284,7 @@ def _get_location_extension_feeds(client, customer_id): ] -def _delete_customer_feeds(client, customer_id, old_customer_feeds): +def delete_customer_feeds(client, customer_id, old_customer_feeds): """Removes the customer feeds. Args: @@ -305,7 +305,7 @@ def _delete_customer_feeds(client, customer_id, old_customer_feeds): ) -def _delete_feeds(client, customer_id, old_feeds): +def delete_feeds(client, customer_id, old_feeds): """Removes the specified feeds. Args: @@ -324,7 +324,7 @@ def _delete_feeds(client, customer_id, old_feeds): feed_service.mutate_feeds(customer_id=customer_id, operations=operations) -def _get_business_profile_feed_mapping(client, customer_id, feed_resource_name): +def get_business_profile_feed_mapping(client, customer_id, feed_resource_name): """Gets a Business Profile Feed mapping. Args: diff --git a/examples/extensions/add_call.py b/examples/extensions/add_call.py index 4fea13e9a..c31d0cb36 100755 --- a/examples/extensions/add_call.py +++ b/examples/extensions/add_call.py @@ -38,13 +38,13 @@ def main( phone_country: a two-letter ISO-3166 code. conversion_action_id: an ID for a conversion action. """ - asset_resource_name = _add_extension_asset( + asset_resource_name = add_extension_asset( client, customer_id, phone_number, phone_country, conversion_action_id ) - _link_asset_to_account(client, customer_id, asset_resource_name) + link_asset_to_account(client, customer_id, asset_resource_name) -def _add_extension_asset( +def add_extension_asset( client, customer_id, phone_number, phone_country, conversion_action_id ): """Creates a new asset for the call. @@ -99,7 +99,7 @@ def _add_extension_asset( return resource_name -def _link_asset_to_account(client, customer_id, asset_resource_name): +def link_asset_to_account(client, customer_id, asset_resource_name): """Links the call asset at the account level to serve in eligible campaigns. Args: diff --git a/examples/extensions/add_hotel_callout.py b/examples/extensions/add_hotel_callout.py index fd9833f90..d667d04ff 100755 --- a/examples/extensions/add_hotel_callout.py +++ b/examples/extensions/add_hotel_callout.py @@ -32,16 +32,16 @@ def main(client, customer_id, language_code): language_code: the language of the hotel callout feed item text. """ # Creates assets for the hotel callout extensions. - asset_resource_names = _add_extension_assets( + asset_resource_names = add_extension_assets( client, customer_id, language_code ) # Adds the extensions at the account level, so these will serve in all # eligible campaigns. - _link_asset_to_account(client, customer_id, asset_resource_names) + link_asset_to_account(client, customer_id, asset_resource_names) -def _add_extension_assets(client, customer_id, language_code): +def add_extension_assets(client, customer_id, language_code): """Creates new assets for the hotel callout. Args: @@ -78,7 +78,7 @@ def _add_extension_assets(client, customer_id, language_code): return resource_names -def _link_asset_to_account(client, customer_id, resource_names): +def link_asset_to_account(client, customer_id, resource_names): """Links Asset at the Customer level to serve in all eligible campaigns. Args: diff --git a/examples/extensions/add_lead_form_extension.py b/examples/extensions/add_lead_form_extension.py index 227f42b02..2e1101493 100755 --- a/examples/extensions/add_lead_form_extension.py +++ b/examples/extensions/add_lead_form_extension.py @@ -34,14 +34,14 @@ def main(client, customer_id, campaign_id): customer_id: The Google Ads customer ID. campaign_id: The ID for a Campaign belonging to the given customer. """ - lead_form_asset_resource_name = _create_lead_form_asset(client, customer_id) - _create_lead_form_extension( + lead_form_asset_resource_name = create_lead_form_asset(client, customer_id) + create_lead_form_extension( client, customer_id, campaign_id, lead_form_asset_resource_name ) # [START add_lead_form_extension] -def _create_lead_form_asset(client, customer_id): +def create_lead_form_asset(client, customer_id): """Creates a lead form asset using the given customer ID. Args: @@ -139,7 +139,7 @@ def _create_lead_form_asset(client, customer_id): # [START add_lead_form_extension_1] -def _create_lead_form_extension( +def create_lead_form_extension( client, customer_id, campaign_id, lead_form_asset_resource_name ): """Creates the lead form extension. diff --git a/examples/extensions/add_prices.py b/examples/extensions/add_prices.py index b3f0e7ea1..7dc00dc1f 100644 --- a/examples/extensions/add_prices.py +++ b/examples/extensions/add_prices.py @@ -31,13 +31,13 @@ def main(client, customer_id): customer_id: a client customer ID. """ # Create a new price asset. - price_asset_resource_name = _create_price_asset(client, customer_id) + price_asset_resource_name = create_price_asset(client, customer_id) # Add the new price asset to the account. - _add_asset_to_account(client, customer_id, price_asset_resource_name) + add_asset_to_account(client, customer_id, price_asset_resource_name) -def _create_price_asset(client, customer_id): +def create_price_asset(client, customer_id): """Creates a price asset and returns its resource name. Args: @@ -64,7 +64,7 @@ def _create_price_asset(client, customer_id): price_asset.language_code = "en" price_asset.price_offerings.extend( [ - _create_price_offering( + create_price_offering( client, "Scrubs", "Body Scrub, Salt Scrub", @@ -74,7 +74,7 @@ def _create_price_asset(client, customer_id): "USD", client.enums.PriceExtensionPriceUnitEnum.PER_HOUR, ), - _create_price_offering( + create_price_offering( client, "Hair Cuts", "Once a month", @@ -84,7 +84,7 @@ def _create_price_asset(client, customer_id): "USD", client.enums.PriceExtensionPriceUnitEnum.PER_MONTH, ), - _create_price_offering( + create_price_offering( client, "Skin Care Package", "Four times a month", @@ -109,7 +109,7 @@ def _create_price_asset(client, customer_id): return resource_name -def _create_price_offering( +def create_price_offering( client, header, description, @@ -149,7 +149,7 @@ def _create_price_offering( return price_offering -def _add_asset_to_account(client, customer_id, price_asset_resource_name): +def add_asset_to_account(client, customer_id, price_asset_resource_name): """Adds a new Asset to the given user account. Adding the Asset to an account allows it to serve in all campaigns under diff --git a/examples/extensions/add_sitelinks.py b/examples/extensions/add_sitelinks.py index 555affa4e..ec62c1780 100755 --- a/examples/extensions/add_sitelinks.py +++ b/examples/extensions/add_sitelinks.py @@ -48,7 +48,7 @@ def main(client, customer_id, campaign_id): customer_id, campaign_id ) - feed_item_resource_names = _create_extension_feed_items( + feed_item_resource_names = create_extension_feed_items( client, customer_id, campaign_resource_name ) @@ -76,7 +76,7 @@ def main(client, customer_id, campaign_id): # [START add_sitelinks] -def _create_extension_feed_items(client, customer_id, campaign_resource_name): +def create_extension_feed_items(client, customer_id, campaign_resource_name): """Helper method that creates extension feed items. Args: @@ -110,7 +110,7 @@ def _create_extension_feed_items(client, customer_id, campaign_resource_name): extension_feed_item_operation2 = client.get_type( "ExtensionFeedItemOperation" ) - date_range = _get_thanksgiving_string_date_range() + date_range = get_thanksgiving_string_date_range() extension_feed_item2 = extension_feed_item_operation2.create extension_feed_item2.extension_type = extension_type_enum.SITELINK extension_feed_item2.sitelink_feed_item.link_text = "Thanksgiving Specials" @@ -157,7 +157,7 @@ def _create_extension_feed_items(client, customer_id, campaign_resource_name): day_of_week_enum.FRIDAY, ]: ad_schedule = client.get_type("AdScheduleInfo") - _populate_ad_schedule( + populate_ad_schedule( ad_schedule, day_of_week, 18, @@ -186,7 +186,7 @@ def _create_extension_feed_items(client, customer_id, campaign_resource_name): # [END add_sitelinks] -def _get_thanksgiving_string_date_range(): +def get_thanksgiving_string_date_range(): """Retrieves a _DateRange with formatted datetime start/end strings.""" now = datetime.datetime.now() start_dt = datetime.datetime(now.year, 11, 20, 0, 0, 0) @@ -197,12 +197,12 @@ def _get_thanksgiving_string_date_range(): end_dt = datetime.datetime(start_dt.year, 11, 27, 23, 59, 59) - return _DateRange( + return DateRange( start_dt.strftime(_date_format), end_dt.strftime(_date_format) ) -def _populate_ad_schedule( +def populate_ad_schedule( ad_schedule, day_of_week, start_hour, start_minute, end_hour, end_minute ): """Helper method to populate a given AdScheduleInfo instance.""" diff --git a/examples/extensions/add_sitelinks_using_assets.py b/examples/extensions/add_sitelinks_using_assets.py index c4f47727d..d894cd474 100755 --- a/examples/extensions/add_sitelinks_using_assets.py +++ b/examples/extensions/add_sitelinks_using_assets.py @@ -34,14 +34,14 @@ def main(client, customer_id, campaign_id): campaign_id: The campaign to which sitelinks will be added. """ # Creates sitelink assets. - resource_names = _create_sitelink_assets(client, customer_id, campaign_id) + resource_names = create_sitelink_assets(client, customer_id, campaign_id) # Associates the sitelinks at the campaign level. - _link_sitelinks_to_campaign( + link_sitelinks_to_campaign( client, customer_id, campaign_id, resource_names ) -def _create_sitelink_assets(client, customer_id, campaign_id): +def create_sitelink_assets(client, customer_id, campaign_id): """Creates sitelink assets, which can be added to campaigns. Args: @@ -104,7 +104,7 @@ def _create_sitelink_assets(client, customer_id, campaign_id): return resource_names -def _link_sitelinks_to_campaign( +def link_sitelinks_to_campaign( client, customer_id, campaign_id, resource_names ): """Creates sitelink assets, which can be added to campaigns. diff --git a/examples/extensions/migrate_promotion_feed_to_asset.py b/examples/extensions/migrate_promotion_feed_to_asset.py index 47c613c5a..23020072f 100755 --- a/examples/extensions/migrate_promotion_feed_to_asset.py +++ b/examples/extensions/migrate_promotion_feed_to_asset.py @@ -42,37 +42,37 @@ def main(client, customer_id, feed_item_id): ) # Get the target extension feed item - extension_feed_item = _get_extension_feed_item( + extension_feed_item = get_extension_feed_item( client, customer_id, feed_item_id ) # Get all campaign IDs associated with the extension feed item. - campaign_ids = _get_targeted_campaign_ids( + campaign_ids = get_targeted_campaign_ids( client, customer_id, resource_name ) # Get all ad group IDs associated with the extension feed item. - ad_group_ids = _get_targeted_ad_group_ids( + ad_group_ids = get_targeted_ad_group_ids( client, customer_id, resource_name ) # Create a new Promotion asset that matches the target extension feed item. - promotion_asset_resource_name = _create_promotion_asset_from_feed( + promotion_asset_resource_name = create_promotion_asset_from_feed( client, customer_id, extension_feed_item ) # Associate the new Promotion asset with the same campaigns as the original. - _associate_asset_with_campaigns( + associate_asset_with_campaigns( client, customer_id, promotion_asset_resource_name, campaign_ids ) # Associate the new Promotion asset with the same ad groups as the original. - _associate_asset_with_ad_groups( + associate_asset_with_ad_groups( client, customer_id, promotion_asset_resource_name, ad_group_ids ) -def _get_extension_feed_item(client, customer_id, feed_item_id): +def get_extension_feed_item(client, customer_id, feed_item_id): """Gets the requested Promotion-type extension feed item. Note that extension feed items pertain to feeds that were created by Google. @@ -167,7 +167,7 @@ def _get_extension_feed_item(client, customer_id, feed_item_id): # [START migrate_promotion_feed_to_asset_1] -def _get_targeted_campaign_ids(client, customer_id, resource_name): +def get_targeted_campaign_ids(client, customer_id, resource_name): """Retrieves all campaigns associated with the given FeedItem resource name. Args: @@ -206,7 +206,7 @@ def _get_targeted_campaign_ids(client, customer_id, resource_name): # [END migrate_promotion_feed_to_asset_1] -def _get_targeted_ad_group_ids(client, customer_id, resource_name): +def get_targeted_ad_group_ids(client, customer_id, resource_name): """Retrieves all ad groups associated with the given FeedItem resource name. Args: @@ -243,7 +243,7 @@ def _get_targeted_ad_group_ids(client, customer_id, resource_name): # [START migrate_promotion_feed_to_asset] -def _create_promotion_asset_from_feed(client, customer_id, extension_feed_item): +def create_promotion_asset_from_feed(client, customer_id, extension_feed_item): """Retrieves all campaigns associated with the given FeedItem resource name. Args: @@ -325,7 +325,7 @@ def _create_promotion_asset_from_feed(client, customer_id, extension_feed_item): # [START migrate_promotion_feed_to_asset_2] -def _associate_asset_with_campaigns( +def associate_asset_with_campaigns( client, customer_id, promotion_asset_resource_name, campaign_ids ): """Associates the specified promotion asset with the specified campaigns. @@ -369,7 +369,7 @@ def _associate_asset_with_campaigns( # [END migrate_promotion_feed_to_asset_2] -def _associate_asset_with_ad_groups( +def associate_asset_with_ad_groups( client, customer_id, promotion_asset_resource_name, ad_group_ids ): """Associates the specified promotion asset with the specified campaigns. diff --git a/examples/extensions/remove_entire_sitelink_campaign_extension_setting.py b/examples/extensions/remove_entire_sitelink_campaign_extension_setting.py index 8dbab56b7..c9dff79db 100644 --- a/examples/extensions/remove_entire_sitelink_campaign_extension_setting.py +++ b/examples/extensions/remove_entire_sitelink_campaign_extension_setting.py @@ -44,7 +44,7 @@ def main(client, customer_id, campaign_id): # Initialize an array of MutateOperations mutate_operations = [] sitelink_campaign_extension_setting_mutate_operation = ( - _create_sitelink_campaign_extension_setting_mutate_operation( + create_sitelink_campaign_extension_setting_mutate_operation( client, customer_id, campaign_id ) ) @@ -53,11 +53,11 @@ def main(client, customer_id, campaign_id): ) ga_service = client.get_service("GoogleAdsService") - extension_feed_item_resource_names = _get_all_sitelink_extension_feed_items( + extension_feed_item_resource_names = get_all_sitelink_extension_feed_items( client, ga_service, customer_id, campaign_id ) extension_feed_item_mutate_operations = ( - _create_extension_feed_item_mutate_operations( + create_extension_feed_item_mutate_operations( client, extension_feed_item_resource_names ) ) @@ -88,7 +88,7 @@ def main(client, customer_id, campaign_id): # [END remove_entire_sitelink_campaign_extension_setting] -def _create_sitelink_campaign_extension_setting_mutate_operation( +def create_sitelink_campaign_extension_setting_mutate_operation( client, customer_id, campaign_id ): """Creates a MutateOperation for the sitelink campaign extension setting @@ -119,7 +119,7 @@ def _create_sitelink_campaign_extension_setting_mutate_operation( # [START remove_entire_sitelink_campaign_extension_setting_1] -def _get_all_sitelink_extension_feed_items( +def get_all_sitelink_extension_feed_items( client, ga_service, customer_id, campaign_id ): """Gets all sitelink extension feed items associated to the specified @@ -174,7 +174,7 @@ def _get_all_sitelink_extension_feed_items( # [END remove_entire_sitelink_campaign_extension_setting_1] -def _create_extension_feed_item_mutate_operations( +def create_extension_feed_item_mutate_operations( client, extension_feed_item_resource_names ): """Creates MutateOperations for the sitelink extension feed items that will diff --git a/examples/feeds/remove_flights_feed_item_attribute_value.py b/examples/feeds/remove_flights_feed_item_attribute_value.py index 2cc01b7f4..694db7b13 100644 --- a/examples/feeds/remove_flights_feed_item_attribute_value.py +++ b/examples/feeds/remove_flights_feed_item_attribute_value.py @@ -56,7 +56,7 @@ def main( feed_item_operation = client.get_type("FeedItemOperation") # Get a map of the FlightPlaceholderFields to FeedAttributes. - placeholders_to_feed_attributes_map = _get_feed( + placeholders_to_feed_attributes_map = get_feed( client, customer_id, feed_id ) @@ -64,7 +64,7 @@ def main( flight_placeholder_field = client.enums.FlightPlaceholderFieldEnum[ flight_placeholder_field_name ].value - feed_item = _remove_attribute_value_from_feed_item( + feed_item = remove_attribute_value_from_feed_item( client, customer_id, feed_id, @@ -92,7 +92,7 @@ def main( ) -def _get_feed(client, customer_id, feed_id): +def get_feed(client, customer_id, feed_id): """Retrieves details about a feed. Args: @@ -158,7 +158,7 @@ def _get_feed(client, customer_id, feed_id): return feed_attributes -def _remove_attribute_value_from_feed_item( +def remove_attribute_value_from_feed_item( client, customer_id, feed_id, @@ -186,7 +186,7 @@ def _remove_attribute_value_from_feed_item( # Retrieve the feed item and its associated attributes based on its resource # name. - feed_item = _get_feed_item(client, customer_id, feed_id, feed_item_id) + feed_item = get_feed_item(client, customer_id, feed_id, feed_item_id) # Create the FeedItemAttributeValue that will be updated. feed_item_attribute_value = client.get_type("FeedItemAttributeValue") @@ -218,7 +218,7 @@ def _remove_attribute_value_from_feed_item( # [END remove_flights_feed_item_attribute_value_1] -def _get_feed_item(client, customer_id, feed_id, feed_item_id): +def get_feed_item(client, customer_id, feed_id, feed_item_id): """Retrieves a feed item and its attribute values given a resource name. Args: diff --git a/examples/feeds/update_flights_feed_item_string_attribute_value.py b/examples/feeds/update_flights_feed_item_string_attribute_value.py index 78ced1542..0407768b9 100755 --- a/examples/feeds/update_flights_feed_item_string_attribute_value.py +++ b/examples/feeds/update_flights_feed_item_string_attribute_value.py @@ -61,7 +61,7 @@ def main( """ feed_service = client.get_service("FeedService") # Gets a map of the placeholder values to feed attributes. - placeholders_to_feed_attribute_map = _flight_placeholder_fields_map( + placeholders_to_feed_attribute_map = flight_placeholder_fields_map( client, customer_id, feed_service.feed_path(customer_id, feed_id) ) # Gets the ID of the feed attribute for the placeholder field. This is @@ -85,7 +85,7 @@ def main( # Retrieves the feed item and its associated attributes based on the # resource name. feed_item_service = client.get_service("FeedItemService") - feed_item = _get_feed_item( + feed_item = get_feed_item( client, customer_id, feed_item_service.feed_item_path(customer_id, feed_id, feed_item_id), @@ -93,7 +93,7 @@ def main( # Gets the index of the attribute value that will be updated in the # feed item. - attribute_index = _get_attribute_index( + attribute_index = get_attribute_index( updated_feed_item_attribute_value, feed_item ) # Any feed item attribute values that are not included in the updated @@ -124,7 +124,7 @@ def main( # [END update_flights_feed_item_string_attribute_value] -def _flight_placeholder_fields_map(client, customer_id, feed_resource_name): +def flight_placeholder_fields_map(client, customer_id, feed_resource_name): """Maps place holder fields and feed attributes for a flights feed. See FlightPlaceholderField.php for all available placeholder field values. @@ -139,7 +139,7 @@ def _flight_placeholder_fields_map(client, customer_id, feed_resource_name): """ flight_placeholder_field_enum = client.enums.FlightPlaceholderFieldEnum - return _placeholder_field_maps( + return placeholder_field_maps( client, customer_id, feed_resource_name, @@ -153,7 +153,7 @@ def _flight_placeholder_fields_map(client, customer_id, feed_resource_name): ) -def _placeholder_field_maps( +def placeholder_field_maps( client, customer_id, feed_resource_name, feed_attribute_names_map ): """Retrieves the placeholder fields to feed attributes map for a feed. @@ -204,7 +204,7 @@ def _placeholder_field_maps( } -def _get_feed_item(client, customer_id, feed_item_resource_name): +def get_feed_item(client, customer_id, feed_item_resource_name): """Retrieves a feed item and its attribute values given a resource name. Args: @@ -235,7 +235,7 @@ def _get_feed_item(client, customer_id, feed_item_resource_name): return list(response)[0].feed_item -def _get_attribute_index(target_feed_item_attribute_value, feed_item): +def get_attribute_index(target_feed_item_attribute_value, feed_item): """Gets the index of the target feed item attribute value. This is needed to specify which feed item attribute value will be updated diff --git a/examples/google-ads-account-analyzer-demo/analyzer.py b/examples/google-ads-account-analyzer-demo/analyzer.py index ac8459012..3c7470964 100644 --- a/examples/google-ads-account-analyzer-demo/analyzer.py +++ b/examples/google-ads-account-analyzer-demo/analyzer.py @@ -121,14 +121,14 @@ def account_hierarchy_module(google_ads_client, customer_id): "\nThe hierarchy of customer ID " f"{root_customer_client.id} is printed below:" ) - _print_account_hierarchy( + print_account_hierarchy( root_customer_client, customer_ids_to_child_accounts, 0 ) else: print(f"No hierarchy info was found for Customer ID {customer_id}.") -def _print_account_hierarchy( +def print_account_hierarchy( customer_client, customer_ids_to_child_accounts, depth ): """Prints the specified account's hierarchy using recursion. @@ -152,7 +152,7 @@ def _print_account_hierarchy( # Recursively call this function for all child accounts of customer_client. if customer_id in customer_ids_to_child_accounts: for child_account in customer_ids_to_child_accounts[customer_id]: - _print_account_hierarchy( + print_account_hierarchy( child_account, customer_ids_to_child_accounts, depth + 1 ) diff --git a/examples/hotel_ads/add_hotel_ad.py b/examples/hotel_ads/add_hotel_ad.py index 0047e7477..da112b82b 100755 --- a/examples/hotel_ads/add_hotel_ad.py +++ b/examples/hotel_ads/add_hotel_ad.py @@ -32,9 +32,9 @@ def main( client, customer_id, hotel_center_account_id, cpc_bid_ceiling_micro_amount ): - budget_resource_name = _add_budget(client, customer_id) + budget_resource_name = add_budget(client, customer_id) - campaign_resource_name = _add_hotel_campaign( + campaign_resource_name = add_hotel_campaign( client, customer_id, budget_resource_name, @@ -42,14 +42,14 @@ def main( cpc_bid_ceiling_micro_amount, ) - ad_group_resource_name = _add_hotel_ad_group( + ad_group_resource_name = add_hotel_ad_group( client, customer_id, campaign_resource_name ) - _add_hotel_ad(client, customer_id, ad_group_resource_name) + add_hotel_ad(client, customer_id, ad_group_resource_name) -def _add_budget(client, customer_id): +def add_budget(client, customer_id): campaign_budget_service = client.get_service("CampaignBudgetService") # Create a budget, which can be shared by multiple campaigns. @@ -74,7 +74,7 @@ def _add_budget(client, customer_id): # [START add_hotel_ad_3] -def _add_hotel_ad(client, customer_id, ad_group_resource_name): +def add_hotel_ad(client, customer_id, ad_group_resource_name): ad_group_ad_service = client.get_service("AdGroupAdService") # Creates a new ad group ad and sets the hotel ad to it. @@ -101,7 +101,7 @@ def _add_hotel_ad(client, customer_id, ad_group_resource_name): # [START add_hotel_ad_2] -def _add_hotel_ad_group(client, customer_id, campaign_resource_name): +def add_hotel_ad_group(client, customer_id, campaign_resource_name): ad_group_service = client.get_service("AdGroupService") # Create ad group. @@ -130,7 +130,7 @@ def _add_hotel_ad_group(client, customer_id, campaign_resource_name): # [START add_hotel_ad] -def _add_hotel_campaign( +def add_hotel_campaign( client, customer_id, budget_resource_name, diff --git a/examples/hotel_ads/add_hotel_listing_group_tree.py b/examples/hotel_ads/add_hotel_listing_group_tree.py index 0114270a6..fd095f121 100755 --- a/examples/hotel_ads/add_hotel_listing_group_tree.py +++ b/examples/hotel_ads/add_hotel_listing_group_tree.py @@ -67,7 +67,7 @@ def main(client, customer_id, ad_group_id, percent_cpc_bid_micro_amount): operations = [] # Creates the root of the tree as a SUBDIVISION node. - root_resource_name = _add_root_node( + root_resource_name = add_root_node( client, customer_id, ad_group_id, @@ -76,7 +76,7 @@ def main(client, customer_id, ad_group_id, percent_cpc_bid_micro_amount): ) # Creates child nodes of level 1, partitioned by the hotel class info. - other_hotel_resource_name = _add_level1_nodes( + other_hotel_resource_name = add_level1_nodes( client, customer_id, ad_group_id, @@ -87,7 +87,7 @@ def main(client, customer_id, ad_group_id, percent_cpc_bid_micro_amount): # Creates child nodes of level 2, partitioned by the hotel country # region info. - _add_level2_nodes( + add_level2_nodes( client, customer_id, ad_group_id, @@ -111,7 +111,7 @@ def main(client, customer_id, ad_group_id, percent_cpc_bid_micro_amount): print(f"\t'{ad_group_criterion_result.resource_name}'") -def _add_root_node( +def add_root_node( client, customer_id, ad_group_id, operations, percent_cpc_bid_micro_amount ): """Creates the root node of the listing group tree. @@ -133,12 +133,12 @@ def _add_root_node( global next_temp_id # Create the root of the tree as a SUBDIVISION node. - root_listing_group_info = _create_listing_group_info( + root_listing_group_info = create_listing_group_info( client, client.enums.ListingGroupTypeEnum.SUBDIVISION, ) - root_ad_group_criterion = _create_ad_group_criterion( + root_ad_group_criterion = create_ad_group_criterion( client, customer_id, ad_group_id, @@ -162,7 +162,7 @@ def _add_root_node( # [START add_hotel_listing_group_tree] -def _add_level1_nodes( +def add_level1_nodes( client, customer_id, ad_group_id, @@ -196,7 +196,7 @@ def _add_level1_nodes( five_starred_listing_dimension_info.hotel_class.value = 5 # Create a listing group info for 5-star hotels as a UNIT node. - five_starred_unit = _create_listing_group_info( + five_starred_unit = create_listing_group_info( client, client.enums.ListingGroupTypeEnum.UNIT, root_resource_name, @@ -204,7 +204,7 @@ def _add_level1_nodes( ) # Create an ad group criterion for 5-star hotels. - five_starred_ad_group_criterion = _create_ad_group_criterion( + five_starred_ad_group_criterion = create_ad_group_criterion( client, customer_id, ad_group_id, @@ -245,7 +245,7 @@ def _add_level1_nodes( # Create listing group info for other hotel classes as a SUBDIVISION node, # which will be used as a parent node for children nodes of the next level. - other_hotels_subdivision_listing_group_info = _create_listing_group_info( + other_hotels_subdivision_listing_group_info = create_listing_group_info( client, client.enums.ListingGroupTypeEnum.SUBDIVISION, root_resource_name, @@ -253,7 +253,7 @@ def _add_level1_nodes( ) # Create an ad group criterion for other hotel classes. - other_hotels_ad_group_criterion = _create_ad_group_criterion( + other_hotels_ad_group_criterion = create_ad_group_criterion( client, customer_id, ad_group_id, @@ -278,7 +278,7 @@ def _add_level1_nodes( # [END add_hotel_listing_group_tree] -def _add_level2_nodes( +def add_level2_nodes( client, customer_id, ad_group_id, @@ -316,7 +316,7 @@ def _add_level2_nodes( ) # Create listing group info for hotels in Japan as a UNIT node. - japan_hotels_unit = _create_listing_group_info( + japan_hotels_unit = create_listing_group_info( client, client.enums.ListingGroupTypeEnum.UNIT, parent_resource_name, @@ -324,7 +324,7 @@ def _add_level2_nodes( ) # Create an ad group criterion for hotels in Japan. - japan_hotels_ad_group_criterion = _create_ad_group_criterion( + japan_hotels_ad_group_criterion = create_ad_group_criterion( client, customer_id, ad_group_id, @@ -359,7 +359,7 @@ def _add_level2_nodes( # Create listing group info for hotels in other regions as a UNIT node. # The "others" node is always required for every level of the tree. - other_hotel_regions_unit = _create_listing_group_info( + other_hotel_regions_unit = create_listing_group_info( client, client.enums.ListingGroupTypeEnum.UNIT, parent_resource_name, @@ -367,7 +367,7 @@ def _add_level2_nodes( ) # Create an ad group criterion for other hotel country regions. - other_hotel_regions_ad_group_criterion = _create_ad_group_criterion( + other_hotel_regions_ad_group_criterion = create_ad_group_criterion( client, customer_id, ad_group_id, @@ -389,7 +389,7 @@ def _add_level2_nodes( next_temp_id -= 1 -def _create_listing_group_info( +def create_listing_group_info( client, listing_group_type, parent_criterion_resource_name=None, @@ -418,7 +418,7 @@ def _create_listing_group_info( return listing_group_info -def _create_ad_group_criterion( +def create_ad_group_criterion( client, customer_id, ad_group_id, diff --git a/examples/migration/campaign_management/create_complete_campaign_adwords_api_only.py b/examples/migration/campaign_management/create_complete_campaign_adwords_api_only.py index bc1f49903..e079285da 100755 --- a/examples/migration/campaign_management/create_complete_campaign_adwords_api_only.py +++ b/examples/migration/campaign_management/create_complete_campaign_adwords_api_only.py @@ -38,7 +38,7 @@ KEYWORDS_TO_ADD = ["mars cruise", "space hotel"] -def _create_campaign_budget(client): +def create_campaign_budget(client): """Creates a new budget and returns the newly created budget ID. Args: @@ -66,7 +66,7 @@ def _create_campaign_budget(client): return created_budget["budgetId"] -def _create_campaign(client, budget_id): +def create_campaign(client, budget_id): """Creates a new campaign and returns the newly created campaign ID. Args: @@ -111,7 +111,7 @@ def _create_campaign(client, budget_id): return created_campaign["id"] -def _create_ad_group(client, campaign_id): +def create_ad_group(client, campaign_id): """Creates a new ad group and returns the new created ad group ID. Args: @@ -152,7 +152,7 @@ def _create_ad_group(client, campaign_id): return created_ad_group["id"] -def _create_text_ads(client, ad_group_id): +def create_text_ads(client, ad_group_id): """Creates text ads using the given ad group ID. Args: @@ -195,7 +195,7 @@ def _create_text_ads(client, ad_group_id): ) -def _create_keywords(client, ad_group_id, keywords_to_add): +def create_keywords(client, ad_group_id, keywords_to_add): """Populates keywords on a given ad group ID. Args: @@ -244,8 +244,8 @@ def _create_keywords(client, ad_group_id, keywords_to_add): # Initialize the client object. # By default, it will read the config file from the Home Directory. adwords_client = adwords.AdWordsClient.LoadFromStorage() - budget_id = _create_campaign_budget(adwords_client) - campaign_id = _create_campaign(adwords_client, budget_id) - ad_group_id = _create_ad_group(adwords_client, campaign_id) - _create_text_ads(adwords_client, ad_group_id) - _create_keywords(adwords_client, ad_group_id, KEYWORDS_TO_ADD) + budget_id = create_campaign_budget(adwords_client) + campaign_id = create_campaign(adwords_client, budget_id) + ad_group_id = create_ad_group(adwords_client, campaign_id) + create_text_ads(adwords_client, ad_group_id) + create_keywords(adwords_client, ad_group_id, KEYWORDS_TO_ADD) diff --git a/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_1.py b/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_1.py index e60f13b9d..e2b727656 100755 --- a/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_1.py +++ b/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_1.py @@ -44,7 +44,7 @@ PAGE_SIZE = 1000 -def _create_campaign_budget(client, customer_id): +def create_campaign_budget(client, customer_id): """Creates a new campaign budget and returns it. Args: @@ -66,16 +66,16 @@ def _create_campaign_budget(client, customer_id): customer_id=customer_id, operations=[operation] ) campaign_budget_resource_name = response.results[0].resource_name - new_campaign_budget = _get_campaign_budget( + new_campaign_budget = get_campaign_budget( client, customer_id, campaign_budget_resource_name ) print(f"Added budget named {new_campaign_budget.name}") return new_campaign_budget except GoogleAdsClient as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_campaign_budget(client, customer_id, resource_name): +def get_campaign_budget(client, customer_id, resource_name): """Retrieves the CampaignBudget associated with the given resource name. Args: @@ -106,10 +106,10 @@ def _get_campaign_budget(client, customer_id, resource_name): budget = list(response)[0].campaign_budget return budget except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_campaign(client, budget_id): +def create_campaign(client, budget_id): """Creates a new campaign and returns the newly created campaign ID. Args: @@ -153,7 +153,7 @@ def _create_campaign(client, budget_id): return created_campaign["id"] -def _create_ad_group(client, campaign_id): +def create_ad_group(client, campaign_id): """Creates a new ad group and returns the newly created ad group id. Args: @@ -192,7 +192,7 @@ def _create_ad_group(client, campaign_id): return created_ad_group["id"] -def _create_text_ads(client, ad_group_id): +def create_text_ads(client, ad_group_id): """Creates text ads using the given ad group ID. Args: @@ -230,7 +230,7 @@ def _create_text_ads(client, ad_group_id): ) -def _create_keywords(client, ad_group_id, keywords_to_add): +def create_keywords(client, ad_group_id, keywords_to_add): """Populates keywords on a given ad group ID. Args: @@ -273,7 +273,7 @@ def _create_keywords(client, ad_group_id, keywords_to_add): ) -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' @@ -304,8 +304,8 @@ def _handle_googleads_exception(exception): help="The Google Ads customer ID.", ) args = parser.parse_args() - budget = _create_campaign_budget(googleads_client, args.customer_id) - campaign_id = _create_campaign(adwords_client, budget.id) - ad_group_id = _create_ad_group(adwords_client, campaign_id) - _create_text_ads(adwords_client, ad_group_id) - _create_keywords(adwords_client, ad_group_id, KEYWORDS_TO_ADD) + budget = create_campaign_budget(googleads_client, args.customer_id) + campaign_id = create_campaign(adwords_client, budget.id) + ad_group_id = create_ad_group(adwords_client, campaign_id) + create_text_ads(adwords_client, ad_group_id) + create_keywords(adwords_client, ad_group_id, KEYWORDS_TO_ADD) diff --git a/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_2.py b/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_2.py index d7299f032..8de8b8c90 100755 --- a/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_2.py +++ b/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_2.py @@ -44,7 +44,7 @@ PAGE_SIZE = 1000 -def _create_campaign_budget(client, customer_id): +def create_campaign_budget(client, customer_id): """Creates a new campaign budget and returns it. Args: @@ -66,16 +66,16 @@ def _create_campaign_budget(client, customer_id): customer_id=customer_id, operations=[operation] ) campaign_budget_resource_name = response.results[0].resource_name - new_campaign_budget = _get_campaign_budget( + new_campaign_budget = get_campaign_budget( client, customer_id, campaign_budget_resource_name ) print(f"Added budget named {new_campaign_budget.name}") return new_campaign_budget except GoogleAdsClient as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_campaign_budget(client, customer_id, resource_name): +def get_campaign_budget(client, customer_id, resource_name): """Retrieves the CampaignBudget associated with the given resource name. Args: @@ -106,10 +106,10 @@ def _get_campaign_budget(client, customer_id, resource_name): budget = list(response)[0].campaign_budget return budget except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_campaign(client, customer_id, campaign_budget): +def create_campaign(client, customer_id, campaign_budget): """Creates a new campaign and returns it. Args: @@ -149,16 +149,16 @@ def _create_campaign(client, customer_id, campaign_budget): customer_id=customer_id, operations=[operation] ) campaign_resource_name = response.results[0].resource_name - new_campaign = _get_campaign( + new_campaign = get_campaign( client, customer_id, campaign_resource_name ) print(f"Added campaign named {new_campaign.name}") return new_campaign except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_campaign(client, customer_id, campaign_resource_name): +def get_campaign(client, customer_id, campaign_resource_name): """Retrieves the Campaign associated with the given resource name. Args: @@ -189,10 +189,10 @@ def _get_campaign(client, customer_id, campaign_resource_name): campaign = list(response)[0].campaign return campaign except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_ad_group(client, campaign_id): +def create_ad_group(client, campaign_id): """Creates a new ad group and returns the newly created ad group id. Args: @@ -231,7 +231,7 @@ def _create_ad_group(client, campaign_id): return created_ad_group["id"] -def _create_text_ads(client, ad_group_id): +def create_text_ads(client, ad_group_id): """Creates text ads using the given ad group ID. Args: @@ -269,7 +269,7 @@ def _create_text_ads(client, ad_group_id): ) -def _create_keywords(client, ad_group_id, keywords_to_add): +def create_keywords(client, ad_group_id, keywords_to_add): """Populates keywords on a given ad group ID. Args: @@ -311,7 +311,7 @@ def _create_keywords(client, ad_group_id, keywords_to_add): ) -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' @@ -342,8 +342,8 @@ def _handle_googleads_exception(exception): help="The Google Ads customer ID.", ) args = parser.parse_args() - budget = _create_campaign_budget(googleads_client, args.customer_id) - campaign = _create_campaign(googleads_client, args.customer_id, budget) - ad_group_id = _create_ad_group(adwords_client, campaign.id) - _create_text_ads(adwords_client, ad_group_id) - _create_keywords(adwords_client, ad_group_id, KEYWORDS_TO_ADD) + budget = create_campaign_budget(googleads_client, args.customer_id) + campaign = create_campaign(googleads_client, args.customer_id, budget) + ad_group_id = create_ad_group(adwords_client, campaign.id) + create_text_ads(adwords_client, ad_group_id) + create_keywords(adwords_client, ad_group_id, KEYWORDS_TO_ADD) diff --git a/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_3.py b/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_3.py index f91e593ca..fd69347d6 100755 --- a/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_3.py +++ b/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_3.py @@ -44,7 +44,7 @@ PAGE_SIZE = 1000 -def _create_campaign_budget(client, customer_id): +def create_campaign_budget(client, customer_id): """Creates a new campaign budget and returns it. Args: @@ -66,16 +66,16 @@ def _create_campaign_budget(client, customer_id): customer_id=customer_id, operations=[operation] ) campaign_budget_resource_name = response.results[0].resource_name - new_campaign_budget = _get_campaign_budget( + new_campaign_budget = get_campaign_budget( client, customer_id, campaign_budget_resource_name ) print(f"Added budget named {new_campaign_budget.name}") return new_campaign_budget except GoogleAdsClient as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_campaign_budget(client, customer_id, resource_name): +def get_campaign_budget(client, customer_id, resource_name): """Retrieves the CampaignBudget associated with the given resource name. Args: @@ -106,10 +106,10 @@ def _get_campaign_budget(client, customer_id, resource_name): budget = list(response)[0].campaign_budget return budget except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_campaign(client, customer_id, campaign_budget): +def create_campaign(client, customer_id, campaign_budget): """Creates a new campaign and returns it. Args: @@ -149,16 +149,16 @@ def _create_campaign(client, customer_id, campaign_budget): customer_id=customer_id, operations=[operation] ) campaign_resource_name = response.results[0].resource_name - new_campaign = _get_campaign( + new_campaign = get_campaign( client, customer_id, campaign_resource_name ) print(f"Added campaign named {new_campaign.name}") return new_campaign except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_campaign(client, customer_id, campaign_resource_name): +def get_campaign(client, customer_id, campaign_resource_name): """Retrieves the Campaign associated with the given resource name. Args: @@ -189,10 +189,10 @@ def _get_campaign(client, customer_id, campaign_resource_name): campaign = list(response)[0].campaign return campaign except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_ad_group(client, customer_id, campaign): +def create_ad_group(client, customer_id, campaign): """Creates a new ad group and returns it. Args: @@ -217,14 +217,14 @@ def _create_ad_group(client, customer_id, campaign): customer_id=customer_id, operations=[operation] ) ad_group_resource_name = response.results[0].resource_name - ad_group = _get_ad_group(client, customer_id, ad_group_resource_name) + ad_group = get_ad_group(client, customer_id, ad_group_resource_name) print(f"Added AdGroup named {ad_group.name}") return ad_group except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_ad_group(client, customer_id, ad_group_resource_name): +def get_ad_group(client, customer_id, ad_group_resource_name): """Retrieves an AdGroup associated with the given resource name. Args: @@ -255,10 +255,10 @@ def _get_ad_group(client, customer_id, ad_group_resource_name): adGroup = list(response)[0].ad_group return adGroup except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_text_ads(client, ad_group_id): +def create_text_ads(client, ad_group_id): """Creates text ads using the given ad group ID. Args: @@ -296,7 +296,7 @@ def _create_text_ads(client, ad_group_id): ) -def _create_keywords(client, ad_group_id, keywords_to_add): +def create_keywords(client, ad_group_id, keywords_to_add): """Populates keywords on a given ad group ID. Args: @@ -339,7 +339,7 @@ def _create_keywords(client, ad_group_id, keywords_to_add): ) -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' @@ -370,8 +370,8 @@ def _handle_googleads_exception(exception): help="The Google Ads customer ID.", ) args = parser.parse_args() - budget = _create_campaign_budget(googleads_client, args.customer_id) - campaign = _create_campaign(googleads_client, args.customer_id, budget) - ad_group = _create_ad_group(googleads_client, args.customer_id, campaign) - _create_text_ads(adwords_client, ad_group.id) - _create_keywords(adwords_client, ad_group.id, KEYWORDS_TO_ADD) + budget = create_campaign_budget(googleads_client, args.customer_id) + campaign = create_campaign(googleads_client, args.customer_id, budget) + ad_group = create_ad_group(googleads_client, args.customer_id, campaign) + create_text_ads(adwords_client, ad_group.id) + create_keywords(adwords_client, ad_group.id, KEYWORDS_TO_ADD) diff --git a/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_4.py b/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_4.py index e4e482b3a..aab9e459f 100755 --- a/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_4.py +++ b/examples/migration/campaign_management/create_complete_campaign_both_apis_phase_4.py @@ -44,7 +44,7 @@ PAGE_SIZE = 1000 -def _create_campaign_budget(client, customer_id): +def create_campaign_budget(client, customer_id): """Creates a new campaign budget and returns it. Args: @@ -66,16 +66,16 @@ def _create_campaign_budget(client, customer_id): customer_id=customer_id, operations=[operation] ) campaign_budget_resource_name = response.results[0].resource_name - new_campaign_budget = _get_campaign_budget( + new_campaign_budget = get_campaign_budget( client, customer_id, campaign_budget_resource_name ) print(f"Added budget named {new_campaign_budget.name}") return new_campaign_budget except GoogleAdsClient as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_campaign_budget(client, customer_id, resource_name): +def get_campaign_budget(client, customer_id, resource_name): """Retrieves the CampaignBudget associated with the given resource name. Args: @@ -106,10 +106,10 @@ def _get_campaign_budget(client, customer_id, resource_name): budget = list(response)[0].campaign_budget return budget except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_campaign(client, customer_id, campaign_budget): +def create_campaign(client, customer_id, campaign_budget): """Creates a new campaign and returns it. Args: @@ -149,16 +149,16 @@ def _create_campaign(client, customer_id, campaign_budget): customer_id=customer_id, operations=[operation] ) campaign_resource_name = response.results[0].resource_name - new_campaign = _get_campaign( + new_campaign = get_campaign( client, customer_id, campaign_resource_name ) print(f"Added campaign named {new_campaign.name}") return new_campaign except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_campaign(client, customer_id, campaign_resource_name): +def get_campaign(client, customer_id, campaign_resource_name): """Retrieves the Campaign associated with the given resource name. Args: @@ -189,10 +189,10 @@ def _get_campaign(client, customer_id, campaign_resource_name): campaign = list(response)[0].campaign return campaign except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_ad_group(client, customer_id, campaign): +def create_ad_group(client, customer_id, campaign): """Creates a new ad group and returns it. Args: @@ -217,14 +217,14 @@ def _create_ad_group(client, customer_id, campaign): customer_id=customer_id, operations=[operation] ) ad_group_resource_name = response.results[0].resource_name - ad_group = _get_ad_group(client, customer_id, ad_group_resource_name) + ad_group = get_ad_group(client, customer_id, ad_group_resource_name) print(f"Added AdGroup named {ad_group.name}") return ad_group except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_ad_group(client, customer_id, ad_group_resource_name): +def get_ad_group(client, customer_id, ad_group_resource_name): """Retrieves an AdGroup associated with the given resource name. Args: @@ -255,10 +255,10 @@ def _get_ad_group(client, customer_id, ad_group_resource_name): adGroup = list(response)[0].ad_group return adGroup except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_text_ads(client, customer_id, ad_group): +def create_text_ads(client, customer_id, ad_group): """Creates new text ads in a given ad group. Args: @@ -294,9 +294,9 @@ def _create_text_ads(client, customer_id, ad_group): row.resource_name for row in ad_group_ad_response.results ] except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) - new_ads = _get_ads(client, customer_id, new_ad_resource_names) + new_ads = get_ads(client, customer_id, new_ad_resource_names) for new_ad in new_ads: print( f"Created expanded text ad with ID {new_ad.ad.id}, status " @@ -306,7 +306,7 @@ def _create_text_ads(client, customer_id, ad_group): ) -def _get_ads(client, customer_id, new_ad_resource_names): +def get_ads(client, customer_id, new_ad_resource_names): """Retrieves a list of AdGroupAds. Args: @@ -318,7 +318,7 @@ def _get_ads(client, customer_id, new_ad_resource_names): A list of AdGroupAds. """ - def _formatter(given_string): + def formatter(given_string): """Assigns ' ' to names of resources. This produces a formatted string that can be used within an IN clause. @@ -332,7 +332,7 @@ def _formatter(given_string): results.append(repr(i)) return ",".join(results) - resource_names = _formatter(new_ad_resource_names) + resource_names = formatter(new_ad_resource_names) ga_service = client.get_service("GoogleAdsService") query = f""" @@ -355,10 +355,10 @@ def _formatter(given_string): response = ga_service.search(request=request) return [row.ad_group_ad for row in response.results] except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_keywords(client, ad_group_id, keywords_to_add): +def create_keywords(client, ad_group_id, keywords_to_add): """Populates keywords on a given ad group ID. Args: @@ -401,7 +401,7 @@ def _create_keywords(client, ad_group_id, keywords_to_add): ) -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' @@ -432,8 +432,8 @@ def _handle_googleads_exception(exception): help="The Google Ads customer ID.", ) args = parser.parse_args() - budget = _create_campaign_budget(googleads_client, args.customer_id) - campaign = _create_campaign(googleads_client, args.customer_id, budget) - ad_group = _create_ad_group(googleads_client, args.customer_id, campaign) - _create_text_ads(googleads_client, args.customer_id, ad_group) - _create_keywords(adwords_client, ad_group.id, KEYWORDS_TO_ADD) + budget = create_campaign_budget(googleads_client, args.customer_id) + campaign = create_campaign(googleads_client, args.customer_id, budget) + ad_group = create_ad_group(googleads_client, args.customer_id, campaign) + create_text_ads(googleads_client, args.customer_id, ad_group) + create_keywords(adwords_client, ad_group.id, KEYWORDS_TO_ADD) diff --git a/examples/migration/campaign_management/create_complete_campaign_googleads_api_only.py b/examples/migration/campaign_management/create_complete_campaign_googleads_api_only.py index 6c3e648fa..02fa5db21 100755 --- a/examples/migration/campaign_management/create_complete_campaign_googleads_api_only.py +++ b/examples/migration/campaign_management/create_complete_campaign_googleads_api_only.py @@ -41,7 +41,7 @@ PAGE_SIZE = 1000 -def _create_campaign_budget(client, customer_id): +def create_campaign_budget(client, customer_id): """Creates a new campaign budget and returns it. Args: @@ -63,16 +63,16 @@ def _create_campaign_budget(client, customer_id): customer_id=customer_id, operations=[operation] ) campaign_budget_resource_name = response.results[0].resource_name - new_campaign_budget = _get_campaign_budget( + new_campaign_budget = get_campaign_budget( client, customer_id, campaign_budget_resource_name ) print(f"Added budget named {new_campaign_budget.name}") return new_campaign_budget except GoogleAdsClient as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_campaign_budget(client, customer_id, resource_name): +def get_campaign_budget(client, customer_id, resource_name): """Retrieves the CampaignBudget associated with the given resource name. Args: @@ -103,10 +103,10 @@ def _get_campaign_budget(client, customer_id, resource_name): budget = list(response)[0].campaign_budget return budget except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_campaign(client, customer_id, campaign_budget): +def create_campaign(client, customer_id, campaign_budget): """Creates a new campaign and returns it. Args: @@ -146,16 +146,16 @@ def _create_campaign(client, customer_id, campaign_budget): customer_id=customer_id, operations=[operation] ) campaign_resource_name = response.results[0].resource_name - new_campaign = _get_campaign( + new_campaign = get_campaign( client, customer_id, campaign_resource_name ) print(f"Added campaign named {new_campaign.name}") return new_campaign except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_campaign(client, customer_id, campaign_resource_name): +def get_campaign(client, customer_id, campaign_resource_name): """Retrieves the Campaign associated with the given resource name. Args: @@ -186,10 +186,10 @@ def _get_campaign(client, customer_id, campaign_resource_name): campaign = list(response)[0].campaign return campaign except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_ad_group(client, customer_id, campaign): +def create_ad_group(client, customer_id, campaign): """Creates a new ad group and returns it. Args: @@ -214,14 +214,14 @@ def _create_ad_group(client, customer_id, campaign): customer_id=customer_id, operations=[operation] ) ad_group_resource_name = response.results[0].resource_name - ad_group = _get_ad_group(client, customer_id, ad_group_resource_name) + ad_group = get_ad_group(client, customer_id, ad_group_resource_name) print(f"Added AdGroup named {ad_group.name}") return ad_group except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _get_ad_group(client, customer_id, ad_group_resource_name): +def get_ad_group(client, customer_id, ad_group_resource_name): """Retrieves an AdGroup associated with the given resource name. Args: @@ -252,10 +252,10 @@ def _get_ad_group(client, customer_id, ad_group_resource_name): adGroup = list(response)[0].ad_group return adGroup except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_text_ads(client, customer_id, ad_group): +def create_text_ads(client, customer_id, ad_group): """Creates new text ads in a given ad group. Args: @@ -291,9 +291,9 @@ def _create_text_ads(client, customer_id, ad_group): row.resource_name for row in ad_group_ad_response.results ] except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) - new_ads = _get_ads(client, customer_id, new_ad_resource_names) + new_ads = get_ads(client, customer_id, new_ad_resource_names) for new_ad in new_ads: print( f"Created expanded text ad with ID {new_ad.ad.id}, status " @@ -303,7 +303,7 @@ def _create_text_ads(client, customer_id, ad_group): ) -def _get_ads(client, customer_id, new_ad_resource_names): +def get_ads(client, customer_id, new_ad_resource_names): """Retrieves a list of AdGroupAds. Args: @@ -315,7 +315,7 @@ def _get_ads(client, customer_id, new_ad_resource_names): A list of AdGroupAds. """ - def _formatter(given_string): + def formatter(given_string): """Assigns ' ' to names of resources. This produces a formatted string that can be used within an IN clause. @@ -329,7 +329,7 @@ def _formatter(given_string): results.append(repr(i)) return ",".join(results) - resource_names = _formatter(new_ad_resource_names) + resource_names = formatter(new_ad_resource_names) ga_service = client.get_service("GoogleAdsService") query = f""" @@ -352,10 +352,10 @@ def _formatter(given_string): response = ga_service.search(request=request) return [row.ad_group_ad for row in response.results] except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _create_keywords(client, customer_id, ad_group, keywords_to_add): +def create_keywords(client, customer_id, ad_group, keywords_to_add): """Creates new keywords on a given ad group. Args: @@ -394,9 +394,9 @@ def _create_keywords(client, customer_id, ad_group, keywords_to_add): row.resource_name for row in ad_group_criterion_response.results ] except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) - new_keywords = _get_keywords(client, customer_id, new_ad_resource_names) + new_keywords = get_keywords(client, customer_id, new_ad_resource_names) for criterion in new_keywords: print( @@ -406,7 +406,7 @@ def _create_keywords(client, customer_id, ad_group, keywords_to_add): ) -def _get_keywords(client, customer_id, keyword_resource_names): +def get_keywords(client, customer_id, keyword_resource_names): """Retrieves a list of AdGroupCriterion. Args: @@ -418,7 +418,7 @@ def _get_keywords(client, customer_id, keyword_resource_names): Returns: A list of AdGroupCriterion. """ - resource_names = _formatter(keyword_resource_names) + resource_names = formatter(keyword_resource_names) ga_service = client.get_service("GoogleAdsService", version="v4") query = f""" SELECT @@ -442,10 +442,10 @@ def _get_keywords(client, customer_id, keyword_resource_names): response = ga_service.search(request=request) return [row.ad_group_criterion for row in response.results] except GoogleAdsException as ex: - _handle_googleads_exception(ex) + handle_googleads_exception(ex) -def _formatter(given_string): +def formatter(given_string): """This helper function is used to assign ' ' to names of resources so that this formatted string can be used within an IN clause. @@ -458,7 +458,7 @@ def _formatter(given_string): return ",".join(results) -def _handle_googleads_exception(exception): +def handle_googleads_exception(exception): print( f'Request with ID "{exception.request_id}" failed with status ' f'"{exception.error.code().name}" and includes the following errors:' @@ -488,10 +488,10 @@ def _handle_googleads_exception(exception): help="The Google Ads customer ID.", ) args = parser.parse_args() - budget = _create_campaign_budget(googleads_client, args.customer_id) - campaign = _create_campaign(googleads_client, args.customer_id, budget) - ad_group = _create_ad_group(googleads_client, args.customer_id, campaign) - _create_text_ads(googleads_client, args.customer_id, ad_group) - _create_keywords( + budget = create_campaign_budget(googleads_client, args.customer_id) + campaign = create_campaign(googleads_client, args.customer_id, budget) + ad_group = create_ad_group(googleads_client, args.customer_id, campaign) + create_text_ads(googleads_client, args.customer_id, ad_group) + create_keywords( googleads_client, args.customer_id, ad_group, KEYWORDS_TO_ADD ) diff --git a/examples/misc/navigate_search_result_pages_caching_tokens.py b/examples/misc/navigate_search_result_pages_caching_tokens.py index 535c2bf27..2a6c6c6a9 100755 --- a/examples/misc/navigate_search_result_pages_caching_tokens.py +++ b/examples/misc/navigate_search_result_pages_caching_tokens.py @@ -76,7 +76,7 @@ def main(client, customer_id): googleads_service = client.get_service("GoogleAdsService") response = googleads_service.search(request=request) - _cache_next_page_token(page_tokens, response, 1) + cache_next_page_token(page_tokens, response, 1) # Determines the total number of results and prints it. The total results # count does not take into consideration the LIMIT clause of the query so @@ -97,13 +97,13 @@ def main(client, customer_id): # the page tokens will be cached. middle_page_number = math.ceil(total_number_of_pages / 2) print(f"\n--- 1. Print results of the page {middle_page_number}\n") - _fetch_and_print_results( + fetch_and_print_results( client, customer_id, query, middle_page_number, page_tokens ) # [START navigate_search_result_pages_caching_tokens] -def _fetch_and_print_results( +def fetch_and_print_results( client, customer_id, query, page_number, page_tokens ): """Fetches and prints the results of a page using a cache of page tokens. @@ -147,7 +147,7 @@ def _fetch_and_print_results( request.page_token = page_tokens[current_page_number] response = googleads_service.search(request=request) - _cache_next_page_token(page_tokens, response, current_page_number) + cache_next_page_token(page_tokens, response, current_page_number) current_page_number += 1 # Prints the results of the requested page. @@ -160,7 +160,7 @@ def _fetch_and_print_results( # [END navigate_search_result_pages_caching_tokens] -def _cache_next_page_token(page_tokens, page, page_number): +def cache_next_page_token(page_tokens, page, page_number): """Updates the cache of page tokens based on a page that was retrieved. Args: diff --git a/examples/misc/set_custom_client_timeouts.py b/examples/misc/set_custom_client_timeouts.py index 75176a36d..e5575f505 100755 --- a/examples/misc/set_custom_client_timeouts.py +++ b/examples/misc/set_custom_client_timeouts.py @@ -38,11 +38,12 @@ def main(client, customer_id): """Main method, to run this code example as a standalone application.""" - _make_server_streaming_call(client, customer_id) - _make_unary_call(client, customer_id) + make_server_streaming_call(client, customer_id) + make_unary_call(client, customer_id) -def _make_server_streaming_call(client, customer_id): +# [START set_custom_client_timeouts] +def make_server_streaming_call(client, customer_id): """Makes a server streaming call using a custom client timeout. Args: @@ -87,9 +88,11 @@ def _make_server_streaming_call(client, customer_id): sys.exit(1) print(f"Total # of campaign IDs retrieved: {len(campaign_ids)}") + # [END set_custom_client_timeouts] -def _make_unary_call(client, customer_id): +# [START set_custom_client_timeouts_1] +def make_unary_call(client, customer_id): """Makes a unary call using a custom client timeout. Args: @@ -115,6 +118,9 @@ def _make_unary_call(client, customer_id): deadline=_CLIENT_TIMEOUT_SECONDS, # Sets the timeout that is used for the first try to one tenth # of the maximum accumulative timeout of the call. + # Note: This overrides the default value and can lead to + # RequestError.RPC_DEADLINE_TOO_SHORT errors when too small. We + # recommend changing the value only if necessary. initial=_CLIENT_TIMEOUT_SECONDS / 10, # Sets the maximum timeout that can be used for any given try # to one fifth of the maximum accumulative timeout of the call @@ -144,6 +150,7 @@ def _make_unary_call(client, customer_id): sys.exit(1) print(f"Total # of campaign IDs retrieved: {len(campaign_ids)}") + # [END set_custom_client_timeouts_1] if __name__ == "__main__": diff --git a/examples/planning/add_keyword_plan.py b/examples/planning/add_keyword_plan.py index 02675a0fe..2731ccf6c 100755 --- a/examples/planning/add_keyword_plan.py +++ b/examples/planning/add_keyword_plan.py @@ -37,10 +37,10 @@ def main(client, customer_id): client: An initialized instance of GoogleAdsClient customer_id: A str of the customer_id to use in requests. """ - _add_keyword_plan(client, customer_id) + add_keyword_plan(client, customer_id) -def _add_keyword_plan(client, customer_id): +def add_keyword_plan(client, customer_id): """Adds a keyword plan, campaign, ad group, etc. to the customer account. Args: @@ -50,22 +50,22 @@ def _add_keyword_plan(client, customer_id): Raises: GoogleAdsException: If an error is returned from the API. """ - keyword_plan = _create_keyword_plan(client, customer_id) - keyword_plan_campaign = _create_keyword_plan_campaign( + keyword_plan = create_keyword_plan(client, customer_id) + keyword_plan_campaign = create_keyword_plan_campaign( client, customer_id, keyword_plan ) - keyword_plan_ad_group = _create_keyword_plan_ad_group( + keyword_plan_ad_group = create_keyword_plan_ad_group( client, customer_id, keyword_plan_campaign ) - _create_keyword_plan_ad_group_keywords( + create_keyword_plan_ad_group_keywords( client, customer_id, keyword_plan_ad_group ) - _create_keyword_plan_negative_campaign_keywords( + create_keyword_plan_negative_campaign_keywords( client, customer_id, keyword_plan_campaign ) -def _create_keyword_plan(client, customer_id): +def create_keyword_plan(client, customer_id): """Adds a keyword plan to the given customer account. Args: @@ -99,7 +99,7 @@ def _create_keyword_plan(client, customer_id): return resource_name -def _create_keyword_plan_campaign(client, customer_id, keyword_plan): +def create_keyword_plan_campaign(client, customer_id, keyword_plan): """Adds a keyword plan campaign to the given keyword plan. Args: @@ -148,7 +148,7 @@ def _create_keyword_plan_campaign(client, customer_id, keyword_plan): return resource_name -def _create_keyword_plan_ad_group(client, customer_id, keyword_plan_campaign): +def create_keyword_plan_ad_group(client, customer_id, keyword_plan_campaign): """Adds a keyword plan ad group to the given keyword plan campaign. Args: @@ -184,7 +184,7 @@ def _create_keyword_plan_ad_group(client, customer_id, keyword_plan_campaign): return resource_name -def _create_keyword_plan_ad_group_keywords(client, customer_id, plan_ad_group): +def create_keyword_plan_ad_group_keywords(client, customer_id, plan_ad_group): """Adds keyword plan ad group keywords to the given keyword plan ad group. Args: @@ -243,7 +243,7 @@ def _create_keyword_plan_ad_group_keywords(client, customer_id, plan_ad_group): ) -def _create_keyword_plan_negative_campaign_keywords( +def create_keyword_plan_negative_campaign_keywords( client, customer_id, plan_campaign ): """Adds a keyword plan negative campaign keyword to the given campaign. diff --git a/examples/planning/forecast_reach.py b/examples/planning/forecast_reach.py index ae8ab52ca..98820ce5c 100755 --- a/examples/planning/forecast_reach.py +++ b/examples/planning/forecast_reach.py @@ -41,17 +41,17 @@ def main(client, customer_id): currency_code = "USD" budget = 500000 - _show_plannable_locations(client) - _show_plannable_products(client, location_id) - _forecast_manual_mix( + show_plannable_locations(client) + show_plannable_products(client, location_id) + forecast_manual_mix( client, customer_id, location_id, currency_code, budget ) - _forecast_suggested_mix( + forecast_suggested_mix( client, customer_id, location_id, currency_code, budget ) -def _show_plannable_locations(client): +def show_plannable_locations(client): """Shows map of plannable locations to their IDs. Args: @@ -69,7 +69,7 @@ def _show_plannable_locations(client): # [START forecast_reach_2] -def _show_plannable_products(client, location_id): +def show_plannable_products(client, location_id): """Lists plannable products for a given location. Args: @@ -103,7 +103,7 @@ def _show_plannable_products(client, location_id): # [START forecast_reach] -def _request_reach_curve( +def request_reach_curve( client, customer_id, product_mix, location_id, currency_code ): """Creates a sample request for a given product mix. @@ -178,7 +178,7 @@ def _request_reach_curve( # [START forecast_reach_3] -def _forecast_manual_mix( +def forecast_manual_mix( client, customer_id, location_id, currency_code, budget ): """Pulls a forecast for product mix created manually. @@ -204,14 +204,14 @@ def _forecast_manual_mix( planned_product.budget_micros = math.trunc(budget * ONE_MILLION * split) product_mix.append(planned_product) - _request_reach_curve( + request_reach_curve( client, customer_id, product_mix, location_id, currency_code ) # [END forecast_reach_3] # [START forecast_reach_1] -def _forecast_suggested_mix( +def forecast_suggested_mix( client, customer_id, location_id, currency_code, budget ): """Pulls a forecast for a product mix based on your set of preferences. @@ -251,7 +251,7 @@ def _forecast_suggested_mix( planned_product.budget_micros = product.budget_micros product_mix.append(planned_product) - _request_reach_curve( + request_reach_curve( client, customer_id, product_mix, location_id, currency_code ) # [END forecast_reach_1] diff --git a/examples/planning/generate_keyword_ideas.py b/examples/planning/generate_keyword_ideas.py index 77f328260..ab11fee53 100755 --- a/examples/planning/generate_keyword_ideas.py +++ b/examples/planning/generate_keyword_ideas.py @@ -42,7 +42,7 @@ def main( keyword_plan_network = ( client.enums.KeywordPlanNetworkEnum.GOOGLE_SEARCH_AND_PARTNERS ) - location_rns = _map_locations_ids_to_resource_names(client, location_ids) + location_rns = map_locations_ids_to_resource_names(client, location_ids) language_rn = client.get_service("GoogleAdsService").language_constant_path( language_id ) @@ -98,16 +98,7 @@ def main( # [END generate_keyword_ideas] -def map_keywords_to_string_values(client, keyword_texts): - keyword_protos = [] - for keyword in keyword_texts: - string_val = client.get_type("StringValue") - string_val.value = keyword - keyword_protos.append(string_val) - return keyword_protos - - -def _map_locations_ids_to_resource_names(client, location_ids): +def map_locations_ids_to_resource_names(client, location_ids): """Converts a list of location IDs to resource names. Args: diff --git a/examples/remarketing/add_combined_rule_user_list.py b/examples/remarketing/add_combined_rule_user_list.py index 6c3233f94..dc3fc9a51 100644 --- a/examples/remarketing/add_combined_rule_user_list.py +++ b/examples/remarketing/add_combined_rule_user_list.py @@ -45,7 +45,7 @@ def main(client, customer_id): # Create rules targeting any user that visits "http://example.com/example1" # and "http://example.com/example2". for url in ["http://example.com/example1", "http://example.com/example2"]: - rule_infos.append(_build_visited_site_rule_info(client, url)) + rule_infos.append(build_visited_site_rule_info(client, url)) # The two rules are combined by joining the first AND second URLs. See # https://developers.google.com/google-ads/api/reference/rpc/latest/CombinedRuleUserListInfo @@ -98,7 +98,7 @@ def main(client, customer_id): ) -def _build_visited_site_rule_info(client, url): +def build_visited_site_rule_info(client, url): """Creates a UserListRuleInfo object targeting a visit to a specified URL. Args: diff --git a/examples/remarketing/add_custom_audience.py b/examples/remarketing/add_custom_audience.py index 1708e9a0b..845d479eb 100755 --- a/examples/remarketing/add_custom_audience.py +++ b/examples/remarketing/add_custom_audience.py @@ -56,23 +56,23 @@ def main(client, customer_id): # meet any of the membership conditions will be reached. member_type_enum = client.enums.CustomAudienceMemberTypeEnum - member1 = _create_custom_audience_member( + member1 = create_custom_audience_member( client, member_type_enum.KEYWORD, "mars cruise" ) - member2 = _create_custom_audience_member( + member2 = create_custom_audience_member( client, member_type_enum.KEYWORD, "jupiter cruise" ) - member3 = _create_custom_audience_member( + member3 = create_custom_audience_member( client, member_type_enum.URL, "http://www.example.com/locations/mars" ) - member4 = _create_custom_audience_member( + member4 = create_custom_audience_member( client, member_type_enum.URL, "http://www.example.com/locations/jupiter" ) - member5 = _create_custom_audience_member( + member5 = create_custom_audience_member( client, member_type_enum.APP, "com.google.android.apps.adwords" ) @@ -91,7 +91,7 @@ def main(client, customer_id): ) -def _create_custom_audience_member(client, member_type, value): +def create_custom_audience_member(client, member_type, value): """Creates a custom audience member for a given member type and value. Args: diff --git a/examples/remarketing/add_customer_match_user_list.py b/examples/remarketing/add_customer_match_user_list.py index a0781ae31..bfd541586 100755 --- a/examples/remarketing/add_customer_match_user_list.py +++ b/examples/remarketing/add_customer_match_user_list.py @@ -37,15 +37,15 @@ def main(client, customer_id): client: The Google Ads client. customer_id: The customer ID for which to add the user list. """ - user_list_resource_name = _create_customer_match_user_list( + user_list_resource_name = create_customer_match_user_list( client, customer_id ) - _add_users_to_customer_match_user_list( + add_users_to_customer_match_user_list( client, customer_id, user_list_resource_name ) -def _create_customer_match_user_list(client, customer_id): +def create_customer_match_user_list(client, customer_id): """Creates a Customer Match user list. Args: @@ -89,7 +89,7 @@ def _create_customer_match_user_list(client, customer_id): # [START add_customer_match_user_list] -def _add_users_to_customer_match_user_list( +def add_users_to_customer_match_user_list( client, customer_id, user_list_resource_name ): """Uses Customer Match to create and add users to a new user list. @@ -130,7 +130,7 @@ def _add_users_to_customer_match_user_list( request = client.get_type("AddOfflineUserDataJobOperationsRequest") request.resource_name = offline_user_data_job_resource_name - request.operations = _build_offline_user_data_job_operations(client) + request.operations = build_offline_user_data_job_operations(client) request.enable_partial_failure = True # Issues a request to add the operations to the offline user data job. @@ -176,7 +176,7 @@ def _add_users_to_customer_match_user_list( # once. If the job is completed successfully, prints information about the # user list. Otherwise, prints the query to use to check the job again # later. - _check_job_status( + check_job_status( client, customer_id, offline_user_data_job_resource_name, @@ -186,7 +186,7 @@ def _add_users_to_customer_match_user_list( # [START add_customer_match_user_list_2] -def _build_offline_user_data_job_operations(client): +def build_offline_user_data_job_operations(client): """Builds and returns two sample offline user data job operations. Args: @@ -202,7 +202,7 @@ def _build_offline_user_data_job_operations(client): user_data_with_email_address = user_data_with_email_address_operation.create user_identifier_with_hashed_email = client.get_type("UserIdentifier") # Hash normalized email addresses based on SHA-256 hashing algorithm. - user_identifier_with_hashed_email.hashed_email = _normalize_and_hash( + user_identifier_with_hashed_email.hashed_email = normalize_and_hash( "customer@example.com" ) user_data_with_email_address.user_identifiers.append( @@ -219,10 +219,10 @@ def _build_offline_user_data_job_operations(client): user_identifier_with_address = client.get_type("UserIdentifier") # First and last name must be normalized and hashed. user_identifier_with_address.address_info.hashed_first_name = ( - _normalize_and_hash("John") + normalize_and_hash("John") ) user_identifier_with_address.address_info.hashed_last_name = ( - _normalize_and_hash("Doe") + normalize_and_hash("Doe") ) # Country and zip codes are sent in plain text. user_identifier_with_address.address_info.country_code = "US" @@ -238,7 +238,7 @@ def _build_offline_user_data_job_operations(client): # [END add_customer_match_user_list_2] -def _check_job_status( +def check_job_status( client, customer_id, offline_user_data_job_resource_name, @@ -278,7 +278,7 @@ def _check_job_status( ) if status_name == "SUCCESS": - _print_customer_match_user_list_info( + print_customer_match_user_list_info( client, customer_id, user_list_resource_name ) elif status_name == "FAILED": @@ -290,7 +290,7 @@ def _check_job_status( ) -def _print_customer_match_user_list_info( +def print_customer_match_user_list_info( client, customer_id, user_list_resource_name ): """Prints information about the Customer Match user list. @@ -330,7 +330,7 @@ def _print_customer_match_user_list_info( ) -def _normalize_and_hash(s): +def normalize_and_hash(s): """Normalizes and hashes a string with SHA-256. Args: diff --git a/examples/remarketing/add_dynamic_remarketing_asset.py b/examples/remarketing/add_dynamic_remarketing_asset.py index 062bf1677..6da9fa956 100755 --- a/examples/remarketing/add_dynamic_remarketing_asset.py +++ b/examples/remarketing/add_dynamic_remarketing_asset.py @@ -33,18 +33,18 @@ def main(client, customer_id, campaign_id): campaign_id: the ID for a campaign of a type that supports dynamic remarketing, such as Display. """ - asset_resource_name = _create_asset(client, customer_id) - asset_set_resource_name = _create_asset_set(client, customer_id) - _add_assets_to_asset_set( + asset_resource_name = create_asset(client, customer_id) + asset_set_resource_name = create_asset_set(client, customer_id) + add_assets_to_asset_set( client, asset_resource_name, asset_set_resource_name, customer_id ) - _link_asset_set_to_campaign( + link_asset_set_to_campaign( client, asset_set_resource_name, customer_id, campaign_id ) # [START add_asset] -def _create_asset(client, customer_id): +def create_asset(client, customer_id): """Creates a DynamicEducationAsset. See https://support.google.com/google-ads/answer/6053288?#zippy=%2Ceducation @@ -96,7 +96,7 @@ def _create_asset(client, customer_id): # [START add_asset_set] -def _create_asset_set(client, customer_id): +def create_asset_set(client, customer_id): """Creates an AssetSet. The AssetSet will be used to link the dynamic remarketing assets to a @@ -127,7 +127,7 @@ def _create_asset_set(client, customer_id): # [START add_asset_set_asset] -def _add_assets_to_asset_set( +def add_assets_to_asset_set( client, asset_resource_name, asset_set_resource_name, customer_id ): """Adds an Asset to an AssetSet by creating an AssetSetAsset link. @@ -158,7 +158,7 @@ def _add_assets_to_asset_set( # [START add_campaign_asset_set] -def _link_asset_set_to_campaign( +def link_asset_set_to_campaign( client, asset_set_resource_name, customer_id, campaign_id ): """Creates a CampaignAssetSet. diff --git a/examples/remarketing/add_expression_rule_user_list.py b/examples/remarketing/add_expression_rule_user_list.py index 069878f62..f3369b8c9 100644 --- a/examples/remarketing/add_expression_rule_user_list.py +++ b/examples/remarketing/add_expression_rule_user_list.py @@ -54,7 +54,7 @@ def main(client, customer_id): # Create rules targeting any user that visits the URLs in URL_LIST. for url in URL_LIST: user_list_rule_item_group_info.rule_items.append( - _build_visited_site_rule_info(client, url) + build_visited_site_rule_info(client, url) ) user_list_rule_info.rule_item_groups.append(user_list_rule_item_group_info) @@ -100,7 +100,7 @@ def main(client, customer_id): ) -def _build_visited_site_rule_info(client, url): +def build_visited_site_rule_info(client, url): """Creates a UserListRuleItemInfo object targeting a visit to a given URL. Args: diff --git a/examples/remarketing/add_flights_feed.py b/examples/remarketing/add_flights_feed.py index e48023cf5..c90ae8dc3 100755 --- a/examples/remarketing/add_flights_feed.py +++ b/examples/remarketing/add_flights_feed.py @@ -34,18 +34,18 @@ def main(client, customer_id): customer_id: a client customer ID. """ # Creates a new flights feed. - feed_resource_name = _create_feed(client, customer_id) + feed_resource_name = create_feed(client, customer_id) print(f"Feed with resource name '{feed_resource_name}' was created.") # Gets the newly created feed's attributes and packages them into a map. # This read operation is required to retrieve the attribute IDs. - placeholders_to_feed_attributes_map = _get_placeholder_fields_map( + placeholders_to_feed_attributes_map = get_placeholder_fields_map( client, customer_id, feed_resource_name ) # Creates the feed mapping. - feed_mapping_resource_name = _create_feed_mapping( + feed_mapping_resource_name = create_feed_mapping( client, customer_id, feed_resource_name, @@ -58,7 +58,7 @@ def main(client, customer_id): ) # Creates a feed item. - feed_item_resource_name = _create_feed_item( + feed_item_resource_name = create_feed_item( client, customer_id, feed_resource_name, @@ -71,7 +71,7 @@ def main(client, customer_id): ) -def _create_feed(client, customer_id): +def create_feed(client, customer_id): """Creates a feed that will be used as a flight feed. Args: @@ -146,7 +146,7 @@ def _create_feed(client, customer_id): return feed_response.results[0].resource_name -def _create_feed_mapping( +def create_feed_mapping( client, customer_id, feed_resource_name, placeholders_to_feed_attribute_map ): """Creates a feed mapping for a given feed. @@ -241,7 +241,7 @@ def _create_feed_mapping( return feed_mapping_response.results[0].resource_name -def _create_feed_item( +def create_feed_item( client, customer_id, feed_resource_name, placeholders_to_feed_attribute_map ): """Adds a new item to the feed. @@ -344,7 +344,7 @@ def _create_feed_item( return feed_item_response.results[0].resource_name -def _get_placeholder_fields_map(client, customer_id, feed_resource_name): +def get_placeholder_fields_map(client, customer_id, feed_resource_name): """Get mapping of placeholder fields to feed attributes for a flights feed. Args: diff --git a/examples/remarketing/add_merchant_center_dynamic_remarketing_campaign.py b/examples/remarketing/add_merchant_center_dynamic_remarketing_campaign.py index 61c950b8d..e1b6ea347 100644 --- a/examples/remarketing/add_merchant_center_dynamic_remarketing_campaign.py +++ b/examples/remarketing/add_merchant_center_dynamic_remarketing_campaign.py @@ -46,24 +46,24 @@ def main( """ # Create a shopping campaign associated with a given Merchant Center # account. - campaign_resource_name = _create_campaign( + campaign_resource_name = create_campaign( client, customer_id, merchant_center_account_id, campaign_budget_id ) # Create an ad group for the campaign. - ad_group_resource_name = _create_ad_group( + ad_group_resource_name = create_ad_group( client, customer_id, campaign_resource_name ) # Create a dynamic display ad in the ad group. - _create_ad(client, customer_id, ad_group_resource_name) + create_ad(client, customer_id, ad_group_resource_name) # Target a specific user list for remarketing. - _attach_user_list(client, customer_id, ad_group_resource_name, user_list_id) + attach_user_list(client, customer_id, ad_group_resource_name, user_list_id) # [START add_merchant_center_dynamic_remarketing_campaign_2] -def _create_campaign( +def create_campaign( client, customer_id, merchant_center_account_id, campaign_budget_id ): """Creates a campaign linked to a Merchant Center product feed. @@ -116,7 +116,7 @@ def _create_campaign( # [START add_merchant_center_dynamic_remarketing_campaign_1] -def _create_ad_group(client, customer_id, campaign_resource_name): +def create_ad_group(client, customer_id, campaign_resource_name): """Creates an ad group for the remarketing campaign. Args: @@ -147,7 +147,7 @@ def _create_ad_group(client, customer_id, campaign_resource_name): # [START add_merchant_center_dynamic_remarketing_campaign] -def _create_ad(client, customer_id, ad_group_resource_name): +def create_ad(client, customer_id, ad_group_resource_name): """Creates the responsive display ad. Args: @@ -159,10 +159,10 @@ def _create_ad(client, customer_id, ad_group_resource_name): ad_group_ad_service = client.get_service("AdGroupAdService") # Upload image assets for the ad. - marketing_image_resource_name = _upload_image_asset( + marketing_image_resource_name = upload_image_asset( client, customer_id, "https://gaagl.page.link/Eit5", "Marketing Image" ) - square_marketing_image_resource_name = _upload_image_asset( + square_marketing_image_resource_name = upload_image_asset( client, customer_id, "https://gaagl.page.link/bjYi", @@ -227,7 +227,7 @@ def _create_ad(client, customer_id, ad_group_resource_name): # [END add_merchant_center_dynamic_remarketing_campaign] -def _upload_image_asset(client, customer_id, image_url, asset_name): +def upload_image_asset(client, customer_id, image_url, asset_name): """Adds an image asset to the Google Ads account. Args: @@ -264,7 +264,7 @@ def _upload_image_asset(client, customer_id, image_url, asset_name): # [START add_merchant_center_dynamic_remarketing_campaign_3] -def _attach_user_list( +def attach_user_list( client, customer_id, ad_group_resource_name, user_list_id ): """Targets a user list with an ad group. diff --git a/examples/remarketing/add_real_estate_feed.py b/examples/remarketing/add_real_estate_feed.py index 7aadfb16b..1bf08822a 100644 --- a/examples/remarketing/add_real_estate_feed.py +++ b/examples/remarketing/add_real_estate_feed.py @@ -36,18 +36,18 @@ def main(client, customer_id): # Creates a new feed, but you can fetch and re-use an existing feed by # skipping the _create_feed method and inserting the feed resource name of # the existing feed. - feed_resource_name = _create_feed(client, customer_id) + feed_resource_name = create_feed(client, customer_id) print(f"Feed with resource name '{feed_resource_name}' was created.") # Gets the newly created feed's attributes and packages them into a map. # This read operation is required to retrieve the attribute IDs. - placeholders_to_feed_attributes_map = _get_placeholder_fields_map( + placeholders_to_feed_attributes_map = get_placeholder_fields_map( client, customer_id, feed_resource_name ) # Creates the feed mapping. - feed_mapping_resource_name = _create_feed_mapping( + feed_mapping_resource_name = create_feed_mapping( client, customer_id, feed_resource_name, @@ -60,7 +60,7 @@ def main(client, customer_id): ) # Creates the feed item and adds it to the feed. - feed_item_resource_name = _create_feed_item( + feed_item_resource_name = create_feed_item( client, customer_id, feed_resource_name, @@ -73,7 +73,7 @@ def main(client, customer_id): ) -def _create_feed(client, customer_id): +def create_feed(client, customer_id): """Creates a feed that will be used as a real estate feed. Args: @@ -149,7 +149,7 @@ def _create_feed(client, customer_id): return feed_response.results[0].resource_name -def _create_feed_mapping( +def create_feed_mapping( client, customer_id, feed_resource_name, placeholders_to_feed_attribute_map ): """Creates a feed mapping for a given real estate feed. @@ -258,7 +258,7 @@ def _create_feed_mapping( # [START add_real_estate_feed_1] -def _create_feed_item( +def create_feed_item( client, customer_id, feed_resource_name, placeholders_to_feed_attribute_map ): """Adds a new item to the feed. @@ -360,7 +360,7 @@ def _create_feed_item( # [START add_real_estate_feed] -def _get_placeholder_fields_map(client, customer_id, feed_resource_name): +def get_placeholder_fields_map(client, customer_id, feed_resource_name): """Get mapping of placeholder fields to feed attributes. Note that this is only intended to produce a mapping for real estate feeds. diff --git a/examples/remarketing/add_remarketing_action.py b/examples/remarketing/add_remarketing_action.py index f44569954..d8e345f1d 100755 --- a/examples/remarketing/add_remarketing_action.py +++ b/examples/remarketing/add_remarketing_action.py @@ -28,21 +28,21 @@ def main(client, customer_id, page_size): - remarketing_action_resource_name = _add_remarketing_action( + remarketing_action_resource_name = add_remarketing_action( client, customer_id ) print(f'Created remarketing action "{remarketing_action_resource_name}".') - queried_remarketing_action = _query_remarketing_action( + queried_remarketing_action = query_remarketing_action( client, customer_id, remarketing_action_resource_name, page_size ) - _print_remarketing_action_attributes(queried_remarketing_action) + print_remarketing_action_attributes(queried_remarketing_action) # [START add_remarketing_action] -def _add_remarketing_action(client, customer_id): +def add_remarketing_action(client, customer_id): remarketing_action_service = client.get_service("RemarketingActionService") remarketing_action_operation = client.get_type("RemarketingActionOperation") @@ -72,7 +72,7 @@ def _add_remarketing_action(client, customer_id): # [END add_remarketing_action] -def _query_remarketing_action(client, customer_id, resource_name, page_size): +def query_remarketing_action(client, customer_id, resource_name, page_size): """Retrieves the previously created remarketing action with tag snippets. Args: @@ -118,7 +118,7 @@ def _query_remarketing_action(client, customer_id, resource_name, page_size): sys.exit(1) -def _print_remarketing_action_attributes(remarketing_action): +def print_remarketing_action_attributes(remarketing_action): print( f"Remarketing action has ID {remarketing_action.id} and name " f'"{remarketing_action.name}". \nIt has the following ' diff --git a/examples/remarketing/set_up_remarketing.py b/examples/remarketing/set_up_remarketing.py index a5ae725c2..c117a4a13 100755 --- a/examples/remarketing/set_up_remarketing.py +++ b/examples/remarketing/set_up_remarketing.py @@ -52,21 +52,21 @@ def main(client, customer_id, campaign_id, ad_group_id, bid_modifier_value): bid_modifier_value: a float that specifies a modifier on the bid amount for newly created ad group criterion. """ - user_list_resource_name = _create_user_list(client, customer_id) - ad_group_criterion_resource_name = _target_ads_in_ad_group_to_user_list( + user_list_resource_name = create_user_list(client, customer_id) + ad_group_criterion_resource_name = target_ads_in_ad_group_to_user_list( client, customer_id, ad_group_id, user_list_resource_name ) - _modify_ad_group_bids( + modify_ad_group_bids( client, customer_id, ad_group_criterion_resource_name, bid_modifier_value, ) - _remove_existing_criteria_from_ad_group(client, customer_id, campaign_id) - campaign_criterion_resource_name = _target_ads_in_campaign_to_user_list( + remove_existing_criteria_from_ad_group(client, customer_id, campaign_id) + campaign_criterion_resource_name = target_ads_in_campaign_to_user_list( client, customer_id, campaign_id, user_list_resource_name ) - _modify_campaign_bids( + modify_campaign_bids( client, customer_id, campaign_criterion_resource_name, @@ -75,7 +75,7 @@ def main(client, customer_id, campaign_id, ad_group_id, bid_modifier_value): # [START setup_remarketing] -def _create_user_list(client, customer_id): +def create_user_list(client, customer_id): """Creates a user list targeting users that have visited a given URL. Args: @@ -126,7 +126,7 @@ def _create_user_list(client, customer_id): # [START setup_remarketing_1] -def _target_ads_in_ad_group_to_user_list( +def target_ads_in_ad_group_to_user_list( client, customer_id, ad_group_id, user_list_resource_name ): """Creates an ad group criterion that targets a user list with an ad group. @@ -165,7 +165,7 @@ def _target_ads_in_ad_group_to_user_list( # [END setup_remarketing_1] -def _modify_ad_group_bids( +def modify_ad_group_bids( client, customer_id, ad_group_criterion_resource_name, bid_modifier_value ): """Updates the bid modifier on an ad group criterion. @@ -203,7 +203,7 @@ def _modify_ad_group_bids( # [START setup_remarketing_3] -def _remove_existing_criteria_from_ad_group(client, customer_id, campaign_id): +def remove_existing_criteria_from_ad_group(client, customer_id, campaign_id): """Removes all ad group criteria targeting a user list under a campaign. This is a necessary step before targeting a user list at the campaign level. @@ -215,7 +215,7 @@ def _remove_existing_criteria_from_ad_group(client, customer_id, campaign_id): criteria that targets user lists removed. """ # Retrieves all of the ad group criteria under a campaign. - all_ad_group_criteria = _get_user_list_ad_group_criteria( + all_ad_group_criteria = get_user_list_ad_group_criteria( client, customer_id, campaign_id ) @@ -238,7 +238,7 @@ def _remove_existing_criteria_from_ad_group(client, customer_id, campaign_id): # [START setup_remarketing_2] -def _get_user_list_ad_group_criteria(client, customer_id, campaign_id): +def get_user_list_ad_group_criteria(client, customer_id, campaign_id): """Finds all of user list ad group criteria under a campaign. Args: @@ -281,7 +281,7 @@ def _get_user_list_ad_group_criteria(client, customer_id, campaign_id): # [START setup_remarketing_4] -def _target_ads_in_campaign_to_user_list( +def target_ads_in_campaign_to_user_list( client, customer_id, campaign_id, user_list_resource_name ): """Creates a campaign criterion that targets a user list with a campaign. @@ -318,7 +318,7 @@ def _target_ads_in_campaign_to_user_list( # [END setup_remarketing_4] -def _modify_campaign_bids( +def modify_campaign_bids( client, customer_id, campaign_criterion_resource_name, bid_modifier_value ): """Updates the bid modifier on a campaign criterion. diff --git a/examples/remarketing/update_audience_target_restriction.py b/examples/remarketing/update_audience_target_restriction.py index 95b73292f..63b07e978 100644 --- a/examples/remarketing/update_audience_target_restriction.py +++ b/examples/remarketing/update_audience_target_restriction.py @@ -111,7 +111,7 @@ def main(client, customer_id, ad_group_id): # Only update the TargetSetting on the ad group if there is an audience # TargetRestriction with bid_only set to false. if should_update_targeting_setting: - _update_targeting_setting( + update_targeting_setting( client, customer_id, ad_group_id, targeting_setting ) else: @@ -119,7 +119,7 @@ def main(client, customer_id, ad_group_id): # [START update_audience_target_restriction_2] -def _update_targeting_setting( +def update_targeting_setting( client, customer_id, ad_group_id, targeting_setting ): """Updates the given TargetingSetting of an ad group. diff --git a/examples/remarketing/upload_conversion_enhancement.py b/examples/remarketing/upload_conversion_enhancement.py index 818a18a87..58d13ec9d 100644 --- a/examples/remarketing/upload_conversion_enhancement.py +++ b/examples/remarketing/upload_conversion_enhancement.py @@ -71,13 +71,13 @@ def main( # Creates a user identifier using sample values for the user address, # hashing where required. address_identifier = client.get_type("UserIdentifier") - address_identifier.address_info.hashed_first_name = _normalize_and_hash( + address_identifier.address_info.hashed_first_name = normalize_and_hash( "Joanna" ) - address_identifier.address_info.hashed_last_name = _normalize_and_hash( + address_identifier.address_info.hashed_last_name = normalize_and_hash( "Joanna" ) - address_identifier.address_info.hashed_street_address = _normalize_and_hash( + address_identifier.address_info.hashed_street_address = normalize_and_hash( "1600 Amphitheatre Pkwy" ) address_identifier.address_info.city = "Mountain View" @@ -96,7 +96,7 @@ def main( client.enums.UserIdentifierSourceEnum.FIRST_PARTY ) # Uses the normalize and hash method specifically for email addresses. - email_identifier.hashed_email = _normalize_and_hash_email_address( + email_identifier.hashed_email = normalize_and_hash_email_address( "joannasmith@gmail.com" ) @@ -160,7 +160,7 @@ def main( # [START normalize_and_hash] -def _normalize_and_hash_email_address(email_address): +def normalize_and_hash_email_address(email_address): """Returns the result of normalizing and hashing an email address. For this use case, Google Ads requires removal of any '.' characters @@ -187,10 +187,10 @@ def _normalize_and_hash_email_address(email_address): email_parts[0] = email_parts[0].replace(".", "") normalized_email = "@".join(email_parts) - return _normalize_and_hash(normalized_email) + return normalize_and_hash(normalized_email) -def _normalize_and_hash(s): +def normalize_and_hash(s): """Normalizes and hashes a string with SHA-256. Private customer data must be hashed during upload, as described at: diff --git a/examples/remarketing/upload_conversion_with_identifiers.py b/examples/remarketing/upload_conversion_with_identifiers.py index ea5ed066b..94725c6e8 100644 --- a/examples/remarketing/upload_conversion_with_identifiers.py +++ b/examples/remarketing/upload_conversion_with_identifiers.py @@ -69,7 +69,7 @@ def main( user_identifier = client.get_type("UserIdentifier") # Creates a SHA256 hashed string using the given email address, as # described at https://support.google.com/google-ads/answer/9888656. - user_identifier.hashed_email = _normalize_and_hash_email_address( + user_identifier.hashed_email = normalize_and_hash_email_address( email_address ) # Optional: Specifies the user identifier source. @@ -112,7 +112,7 @@ def main( # [START normalize_and_hash] -def _normalize_and_hash_email_address(email_address): +def normalize_and_hash_email_address(email_address): """Returns the result of normalizing and hashing an email address. For this use case, Google Ads requires removal of any '.' characters @@ -139,10 +139,10 @@ def _normalize_and_hash_email_address(email_address): email_parts[0] = email_parts[0].replace(".", "") normalized_email = "@".join(email_parts) - return _normalize_and_hash(normalized_email) + return normalize_and_hash(normalized_email) -def _normalize_and_hash(s): +def normalize_and_hash(s): """Normalizes and hashes a string with SHA-256. Private customer data must be hashed during upload, as described at: diff --git a/examples/remarketing/upload_store_sales_transactions.py b/examples/remarketing/upload_store_sales_transactions.py index 5bd481a5a..e22f1698d 100644 --- a/examples/remarketing/upload_store_sales_transactions.py +++ b/examples/remarketing/upload_store_sales_transactions.py @@ -90,7 +90,7 @@ def main( ) # Create an offline user data job for uploading transactions. - offline_user_data_job_resource_name = _create_offline_user_data_job( + offline_user_data_job_resource_name = create_offline_user_data_job( client, offline_user_data_job_service, customer_id, @@ -103,7 +103,7 @@ def main( ) # Add transactions to the job. - _add_transactions_to_offline_user_data_job( + add_transactions_to_offline_user_data_job( client, offline_user_data_job_service, customer_id, @@ -121,10 +121,10 @@ def main( # instead of waiting for the job to complete, retrieves and displays # the job status once and then prints the query to use to check the job # again later. - _check_job_status(client, customer_id, offline_user_data_job_resource_name) + check_job_status(client, customer_id, offline_user_data_job_resource_name) -def _create_offline_user_data_job( +def create_offline_user_data_job( client, offline_user_data_job_service, customer_id, @@ -245,7 +245,7 @@ def _create_offline_user_data_job( return offline_user_data_job_resource_name -def _add_transactions_to_offline_user_data_job( +def add_transactions_to_offline_user_data_job( client, offline_user_data_job_service, customer_id, @@ -285,7 +285,7 @@ def _add_transactions_to_offline_user_data_job( item attributes. """ # Construct some sample transactions. - operations = _build_offline_user_data_job_operations( + operations = build_offline_user_data_job_operations( client, customer_id, conversion_action_id, @@ -315,7 +315,7 @@ def _add_transactions_to_offline_user_data_job( # Print the error message for any partial failure error that is returned. if response.partial_failure_error: - _print_google_ads_failures(response.partial_failure_error) + print_google_ads_failures(response.partial_failure_error) else: print( f"Successfully added {len(operations)} to the offline user data " @@ -324,11 +324,11 @@ def _add_transactions_to_offline_user_data_job( # Print the message for any warnings that are returned. if response.warning: - _print_google_ads_failures(response.warning) + print_google_ads_failures(response.warning) # [START enable_warnings_2] -def _print_google_ads_failures(client, status): +def print_google_ads_failures(client, status): """Prints the details for partial failure errors and warnings. Both partial failure errors and warnings are returned as Status instances, @@ -355,7 +355,7 @@ def _print_google_ads_failures(client, status): # [END enable_warnings_2] -def _build_offline_user_data_job_operations( +def build_offline_user_data_job_operations( client, customer_id, conversion_action_id, @@ -399,7 +399,7 @@ def _build_offline_user_data_job_operations( user_data_with_email_address = user_data_with_email_address_operation.create email_identifier = client.get_type("UserIdentifier") # Hash normalized email addresses based on SHA-256 hashing algorithm. - email_identifier.hashed_email = _normalize_and_hash("customer@example.com") + email_identifier.hashed_email = normalize_and_hash("customer@example.com") state_identifier = client.get_type("UserIdentifier") state_identifier.address_info.state = "NY" user_data_with_email_address.user_identifiers.extend( @@ -433,10 +433,10 @@ def _build_offline_user_data_job_operations( ) address_identifier = client.get_type("UserIdentifier") # First and last name must be normalized and hashed. - address_identifier.address_info.hashed_first_name = _normalize_and_hash( + address_identifier.address_info.hashed_first_name = normalize_and_hash( "John" ) - address_identifier.address_info.hashed_last_name = _normalize_and_hash( + address_identifier.address_info.hashed_last_name = normalize_and_hash( "Doe" ) # Country and zip codes are sent in plain text. @@ -489,7 +489,7 @@ def _build_offline_user_data_job_operations( ] -def _normalize_and_hash(s): +def normalize_and_hash(s): """Normalizes and hashes a string with SHA-256. Args: @@ -501,7 +501,7 @@ def _normalize_and_hash(s): return hashlib.sha256(s.strip().lower().encode()).hexdigest() -def _check_job_status(client, customer_id, offline_user_data_job_resource_name): +def check_job_status(client, customer_id, offline_user_data_job_resource_name): """Retrieves, checks, and prints the status of the offline user data job. Args: diff --git a/examples/reporting/parallel_report_download.py b/examples/reporting/parallel_report_download.py index ff7f26ebf..f51bd0b14 100644 --- a/examples/reporting/parallel_report_download.py +++ b/examples/reporting/parallel_report_download.py @@ -53,13 +53,13 @@ def main(client, customer_ids): FROM ad_group WHERE segments.date DURING LAST_30_DAYS""" - inputs = _generate_inputs( + inputs = generate_inputs( client, customer_ids, [campaign_query, ad_group_query] ) with multiprocessing.Pool(MAX_PROCESSES) as pool: - # Call _issue_search_request on each input, parallelizing the work + # Call issue_search_request on each input, parallelizing the work # across processes in the pool. - results = pool.starmap(_issue_search_request, inputs) + results = pool.starmap(issue_search_request, inputs) # Partition our results into successful and failed results. successes = [] @@ -101,7 +101,7 @@ def main(client, customer_ids): print(f"\t\tOn field: {field_path_element.field_name}") -def _issue_search_request(client, customer_id, query): +def issue_search_request(client, customer_id, query): """Issues a search request using streaming. Retries if a GoogleAdsException is caught, until MAX_RETRIES is reached. @@ -157,7 +157,7 @@ def _issue_search_request(client, customer_id, query): ) -def _generate_inputs(client, customer_ids, queries): +def generate_inputs(client, customer_ids, queries): """Generates all inputs to feed into search requests. A GoogleAdsService instance cannot be serialized with pickle for parallel diff --git a/examples/shopping_ads/add_performance_max_product_listing_group_tree.py b/examples/shopping_ads/add_performance_max_product_listing_group_tree.py index f12c6a672..c5ec3bd3c 100644 --- a/examples/shopping_ads/add_performance_max_product_listing_group_tree.py +++ b/examples/shopping_ads/add_performance_max_product_listing_group_tree.py @@ -189,15 +189,11 @@ def create_root(self): mutate_operation.asset_group_listing_group_filter_operation.create ) - asset_group_listing_group_filter.resource_name = ( - googleads_service.asset_group_listing_group_filter_path( - self.customer_id, self.asset_group_id, self.root_listing_id - ) + asset_group_listing_group_filter.resource_name = googleads_service.asset_group_listing_group_filter_path( + self.customer_id, self.asset_group_id, self.root_listing_id ) - asset_group_listing_group_filter.asset_group = ( - googleads_service.asset_group_path( - self.customer_id, self.asset_group_id - ) + asset_group_listing_group_filter.asset_group = googleads_service.asset_group_path( + self.customer_id, self.asset_group_id ) # Since this is the root node, do not set the # parent_listing_group_filter field. For all other nodes, this would @@ -243,20 +239,14 @@ def create_subdivision(self, parent_id, temporary_id, dimension): mutate_operation.asset_group_listing_group_filter_operation.create ) - asset_group_listing_group_filter.resource_name = ( - googleads_service.asset_group_listing_group_filter_path( - self.customer_id, self.asset_group_id, temporary_id - ) + asset_group_listing_group_filter.resource_name = googleads_service.asset_group_listing_group_filter_path( + self.customer_id, self.asset_group_id, temporary_id ) - asset_group_listing_group_filter.asset_group = ( - googleads_service.asset_group_path( - self.customer_id, self.asset_group_id - ) + asset_group_listing_group_filter.asset_group = googleads_service.asset_group_path( + self.customer_id, self.asset_group_id ) - asset_group_listing_group_filter.parent_listing_group_filter = ( - googleads_service.asset_group_listing_group_filter_path( - self.customer_id, self.asset_group_id, parent_id - ) + asset_group_listing_group_filter.parent_listing_group_filter = googleads_service.asset_group_listing_group_filter_path( + self.customer_id, self.asset_group_id, parent_id ) asset_group_listing_group_filter.type_ = ( self.client.enums.ListingGroupFilterTypeEnum.SUBDIVISION @@ -291,20 +281,14 @@ def create_unit(self, parent_id, temporary_id, dimension): mutate_operation.asset_group_listing_group_filter_operation.create ) - asset_group_listing_group_filter.resource_name = ( - googleads_service.asset_group_listing_group_filter_path( - self.customer_id, self.asset_group_id, temporary_id - ) + asset_group_listing_group_filter.resource_name = googleads_service.asset_group_listing_group_filter_path( + self.customer_id, self.asset_group_id, temporary_id ) - asset_group_listing_group_filter.asset_group = ( - googleads_service.asset_group_path( - self.customer_id, self.asset_group_id - ) + asset_group_listing_group_filter.asset_group = googleads_service.asset_group_path( + self.customer_id, self.asset_group_id ) - asset_group_listing_group_filter.parent_listing_group_filter = ( - googleads_service.asset_group_listing_group_filter_path( - self.customer_id, self.asset_group_id, parent_id - ) + asset_group_listing_group_filter.parent_listing_group_filter = googleads_service.asset_group_listing_group_filter_path( + self.customer_id, self.asset_group_id, parent_id ) # We must use the UnitIncluded type to indicate that the # AssetGroupListingGroupFilter won't have children. @@ -341,29 +325,20 @@ def main(client, customer_id, asset_group_id, replace_existing_tree): if replace_existing_tree: # Retrieve a list of existing AssetGroupListingGroupFilters - existing_listing_group_filters = ( - _get_all_existing_listing_group_filter_assets_in_asset_group( - client, customer_id, asset_group_resource_name - ) + existing_listing_group_filters = get_all_existing_listing_group_filter_assets_in_asset_group( + client, customer_id, asset_group_resource_name ) # If present, create MutateOperations to remove each # AssetGroupListingGroupFilter and add them to the list of operations. if existing_listing_group_filters: - remove_operation_factory = ( - AssetGroupListingGroupFilterRemoveOperationFactory( - client, existing_listing_group_filters - ) + remove_operation_factory = AssetGroupListingGroupFilterRemoveOperationFactory( + client, existing_listing_group_filters ) operations.extend(remove_operation_factory.remove_all()) - create_operation_factory = ( - AssetGroupListingGroupFilterCreateOperationFactory( - client, - customer_id, - asset_group_id, - _TEMPORARY_ID_LISTING_GROUP_ROOT, - ) + create_operation_factory = AssetGroupListingGroupFilterCreateOperationFactory( + client, customer_id, asset_group_id, _TEMPORARY_ID_LISTING_GROUP_ROOT, ) operations.append(create_operation_factory.create_root()) @@ -449,12 +424,12 @@ def main(client, customer_id, asset_group_id, replace_existing_tree): customer_id=customer_id, mutate_operations=operations ) - _print_response_details(operations, response) + print_response_details(operations, response) # [END add_performance_max_product_listing_group_tree] # [START add_performance_max_product_listing_group_tree_7] -def _get_all_existing_listing_group_filter_assets_in_asset_group( +def get_all_existing_listing_group_filter_assets_in_asset_group( client, customer_id, asset_group_resource_name ): """Fetches all of the listing group filters in an asset group. @@ -487,7 +462,7 @@ def _get_all_existing_listing_group_filter_assets_in_asset_group( # [END add_performance_max_product_listing_group_tree_7] -def _print_response_details(mutate_operations, response): +def print_response_details(mutate_operations, response): """Prints the details of the GoogleAdsService.Mutate request. This uses the original list of mutate operations to map the operation diff --git a/examples/shopping_ads/add_performance_max_retail_campaign.py b/examples/shopping_ads/add_performance_max_retail_campaign.py index 5407f4cf7..b6dfcfc77 100644 --- a/examples/shopping_ads/add_performance_max_retail_campaign.py +++ b/examples/shopping_ads/add_performance_max_retail_campaign.py @@ -86,7 +86,7 @@ def main( # This campaign will override the customer conversion goals. # Retrieve the current list of customer conversion goals. - customer_conversion_goals = _get_customer_conversion_goals( + customer_conversion_goals = get_customer_conversion_goals( client, customer_id ) @@ -96,7 +96,7 @@ def main( # https://developers.google.com/google-ads/api/docs/performance-max/assets # # Create the headlines. - headline_asset_resource_names = _create_multiple_text_assets( + headline_asset_resource_names = create_multiple_text_assets( client, customer_id, [ @@ -106,7 +106,7 @@ def main( ], ) # Create the descriptions. - description_asset_resource_names = _create_multiple_text_assets( + description_asset_resource_names = create_multiple_text_assets( client, customer_id, [ @@ -122,30 +122,30 @@ def main( # to create them in a single Mutate request so they all complete # successfully or fail entirely, leaving no orphaned entities. See: # https://developers.google.com/google-ads/api/docs/mutating/overview - campaign_budget_operation = _create_campaign_budget_operation( + campaign_budget_operation = create_campaign_budget_operation( client, customer_id, ) performance_max_campaign_operation = ( - _create_performance_max_campaign_operation( + create_performance_max_campaign_operation( client, customer_id, merchant_center_account_id, sales_country, ) ) - campaign_criterion_operations = _create_campaign_criterion_operations( + campaign_criterion_operations = create_campaign_criterion_operations( client, customer_id, ) - asset_group_operations = _create_asset_group_operation( + asset_group_operations = create_asset_group_operation( client, customer_id, final_url, headline_asset_resource_names, description_asset_resource_names, ) - conversion_goal_operations = _create_conversion_goal_operations( + conversion_goal_operations = create_conversion_goal_operations( client, customer_id, customer_conversion_goals, @@ -166,12 +166,12 @@ def main( *conversion_goal_operations, ], ) - _print_response_details(response) + print_response_details(response) # [END add_performance_max_retail_campaign_1] # [START add_performance_max_retail_campaign_2] -def _create_campaign_budget_operation( +def create_campaign_budget_operation( client, customer_id, ): @@ -210,7 +210,7 @@ def _create_campaign_budget_operation( # [START add_performance_max_retail_campaign_3] -def _create_performance_max_campaign_operation( +def create_performance_max_campaign_operation( client, customer_id, merchant_center_account_id, @@ -294,7 +294,7 @@ def _create_performance_max_campaign_operation( # [START add_performance_max_retail_campaign_4] -def _create_campaign_criterion_operations( +def create_campaign_criterion_operations( client, customer_id, ): @@ -364,7 +364,7 @@ def _create_campaign_criterion_operations( # [START add_performance_max_retail_campaign_5] -def _create_multiple_text_assets(client, customer_id, texts): +def create_multiple_text_assets(client, customer_id, texts): """Creates multiple text assets and returns the list of resource names. Args: @@ -396,13 +396,13 @@ def _create_multiple_text_assets(client, customer_id, texts): for result in response.mutate_operation_responses: if result._pb.HasField("asset_result"): asset_resource_names.append(result.asset_result.resource_name) - _print_response_details(response) + print_response_details(response) return asset_resource_names # [END add_performance_max_retail_campaign_5] # [START add_performance_max_retail_campaign_6] -def _create_asset_group_operation( +def create_asset_group_operation( client, customer_id, final_url, @@ -508,7 +508,7 @@ def _create_asset_group_operation( operations.append(mutate_operation) # Create and link the long headline text asset. - mutate_operations = _create_and_link_text_asset( + mutate_operations = create_and_link_text_asset( client, customer_id, "Travel the World", @@ -517,7 +517,7 @@ def _create_asset_group_operation( operations.extend(mutate_operations) # Create and link the business name text asset. - mutate_operations = _create_and_link_text_asset( + mutate_operations = create_and_link_text_asset( client, customer_id, "Interplanetary Cruises", @@ -528,7 +528,7 @@ def _create_asset_group_operation( # Create and link the image assets. # Create and link the Logo Asset. - mutate_operations = _create_and_link_image_asset( + mutate_operations = create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/bjYi", @@ -538,7 +538,7 @@ def _create_asset_group_operation( operations.extend(mutate_operations) # Create and link the Marketing Image Asset. - mutate_operations = _create_and_link_image_asset( + mutate_operations = create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/Eit5", @@ -548,7 +548,7 @@ def _create_asset_group_operation( operations.extend(mutate_operations) # Create and link the Square Marketing Image Asset. - mutate_operations = _create_and_link_image_asset( + mutate_operations = create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/bjYi", @@ -561,7 +561,7 @@ def _create_asset_group_operation( # [START add_performance_max_retail_campaign_7] -def _create_and_link_text_asset(client, customer_id, text, field_type): +def create_and_link_text_asset(client, customer_id, text, field_type): """Creates a list of MutateOperations that create a new linked text asset. Args: @@ -604,7 +604,7 @@ def _create_and_link_text_asset(client, customer_id, text, field_type): # [START add_performance_max_retail_campaign_8] -def _create_and_link_image_asset( +def create_and_link_image_asset( client, customer_id, url, field_type, asset_name ): """Creates a list of MutateOperations that create a new linked image asset. @@ -633,7 +633,7 @@ def _create_and_link_image_asset( # When there is an existing image asset with the same content but a different # name, the new name will be dropped silently. asset.name = asset_name - asset.image_asset.data = _get_image_bytes(url) + asset.image_asset.data = get_image_bytes(url) operations.append(mutate_operation) # Create an AssetGroupAsset to link the Asset to the AssetGroup. @@ -655,7 +655,7 @@ def _create_and_link_image_asset( # [START add_performance_max_retail_campaign_9] -def _get_customer_conversion_goals(client, customer_id): +def get_customer_conversion_goals(client, customer_id): """Retrieves the list of customer conversion goals. Args: @@ -693,7 +693,7 @@ def _get_customer_conversion_goals(client, customer_id): return customer_conversion_goals -def _create_conversion_goal_operations( +def create_conversion_goal_operations( client, customer_id, customer_conversion_goals, @@ -762,7 +762,7 @@ def _create_conversion_goal_operations( # [END add_performance_max_retail_campaign_9] -def _get_image_bytes(url): +def get_image_bytes(url): """Loads image data from a URL. Args: @@ -775,7 +775,7 @@ def _get_image_bytes(url): return response.content -def _print_response_details(response): +def print_response_details(response): """Prints the details of a MutateGoogleAdsResponse. Parses the "response" oneof field name and uses it to extract the new diff --git a/examples/shopping_ads/add_shopping_product_ad.py b/examples/shopping_ads/add_shopping_product_ad.py index 6357c5282..a537681f0 100755 --- a/examples/shopping_ads/add_shopping_product_ad.py +++ b/examples/shopping_ads/add_shopping_product_ad.py @@ -40,20 +40,20 @@ def main( create_default_listing_group, ): # Creates a budget to be used by the campaign that will be created below. - budget_resource_name = _add_campaign_budget(client, customer_id) + budget_resource_name = add_campaign_budget(client, customer_id) # Create a standard shopping campaign. - campaign_resource_name = _add_standard_shopping_campaign( + campaign_resource_name = add_standard_shopping_campaign( client, customer_id, budget_resource_name, merchant_center_account_id ) # Create a shopping product ad group. - ad_group_resource_name = _add_shopping_product_ad_group( + ad_group_resource_name = add_shopping_product_ad_group( client, customer_id, campaign_resource_name ) # Create a shopping product ad group ad. - _add_shopping_product_ad_group_ad( + add_shopping_product_ad_group_ad( client, customer_id, ad_group_resource_name ) @@ -61,12 +61,12 @@ def main( # Creates an ad group criterion containing a listing group. # This will be the listing group tree for 'All products' and will # contain a single biddable unit node. - _add_default_shopping_listing_group( + add_default_shopping_listing_group( client, customer_id, ad_group_resource_name ) -def _add_campaign_budget(client, customer_id): +def add_campaign_budget(client, customer_id): """Creates a new campaign budget in the specified client account.""" campaign_budget_service = client.get_service("CampaignBudgetService") @@ -92,7 +92,7 @@ def _add_campaign_budget(client, customer_id): # [START add_shopping_product_ad] -def _add_shopping_product_ad_group_ad( +def add_shopping_product_ad_group_ad( client, customer_id, ad_group_resource_name ): """Creates a new shopping product ad group ad in the specified ad group.""" @@ -124,7 +124,7 @@ def _add_shopping_product_ad_group_ad( # [START add_shopping_product_ad_1] -def _add_shopping_product_ad_group(client, customer_id, campaign_resource_name): +def add_shopping_product_ad_group(client, customer_id, campaign_resource_name): """Creates a new shopping product ad group in the specified campaign.""" ad_group_service = client.get_service("AdGroupService") @@ -156,7 +156,7 @@ def _add_shopping_product_ad_group(client, customer_id, campaign_resource_name): # [START add_shopping_product_ad_2] -def _add_standard_shopping_campaign( +def add_standard_shopping_campaign( client, customer_id, budget_resource_name, merchant_center_account_id ): """Creates a new standard shopping campaign in the specified client account.""" @@ -215,7 +215,7 @@ def _add_standard_shopping_campaign( # [END add_shopping_product_ad_2] -def _add_default_shopping_listing_group( +def add_default_shopping_listing_group( client, customer_id, ad_group_resource_name ): """Creates a new default shopping listing group for the specified ad group. diff --git a/examples/shopping_ads/add_shopping_product_listing_group_tree.py b/examples/shopping_ads/add_shopping_product_listing_group_tree.py index 3b15a39e3..1b8adc71c 100644 --- a/examples/shopping_ads/add_shopping_product_listing_group_tree.py +++ b/examples/shopping_ads/add_shopping_product_listing_group_tree.py @@ -34,7 +34,7 @@ last_criterion_id = 0 -def _next_id(): +def next_id(): """Returns a decreasing negative number for temporary ad group criteria IDs. The ad group criteria will get real IDs when created on the server. @@ -67,14 +67,14 @@ def main(client, customer_id, ad_group_id, replace_existing_tree): # error if a listing group tree already exists and this option is not # set to true. if replace_existing_tree: - _remove_listing_group_tree(client, customer_id, ad_group_id) + remove_listing_group_tree(client, customer_id, ad_group_id) # Create a list of ad group criteria operations. operations = [] # Construct the listing group tree "root" node. # Subdivision node: (Root node) - ad_group_criterion_root_operation = _create_listing_group_subdivision( + ad_group_criterion_root_operation = create_listing_group_subdivision( client, customer_id, ad_group_id ) @@ -97,7 +97,7 @@ def main(client, customer_id, ad_group_id, replace_existing_tree): product_condition_enum.NEW ) operations.append( - _create_listing_group_unit_biddable( + create_listing_group_unit_biddable( client, customer_id, ad_group_id, @@ -114,7 +114,7 @@ def main(client, customer_id, ad_group_id, replace_existing_tree): product_condition_enum.USED ) operations.append( - _create_listing_group_unit_biddable( + create_listing_group_unit_biddable( client, customer_id, ad_group_id, @@ -132,7 +132,7 @@ def main(client, customer_id, ad_group_id, replace_existing_tree): condition_dimension_info.product_condition, client.get_type("ProductConditionInfo"), ) - ad_group_criterion_other_operation = _create_listing_group_subdivision( + ad_group_criterion_other_operation = create_listing_group_subdivision( client, customer_id, ad_group_id, @@ -155,7 +155,7 @@ def main(client, customer_id, ad_group_id, replace_existing_tree): # * CPC bid: $0.90 brand_dimension_info.product_brand.value = "CoolBrand" operations.append( - _create_listing_group_unit_biddable( + create_listing_group_unit_biddable( client, customer_id, ad_group_id, @@ -170,7 +170,7 @@ def main(client, customer_id, ad_group_id, replace_existing_tree): # * CPC bid: $0.01 brand_dimension_info.product_brand.value = "CheapBrand" operations.append( - _create_listing_group_unit_biddable( + create_listing_group_unit_biddable( client, customer_id, ad_group_id, @@ -187,7 +187,7 @@ def main(client, customer_id, ad_group_id, replace_existing_tree): client.get_type("ProductBrandInfo"), ) operations.append( - _create_listing_group_unit_biddable( + create_listing_group_unit_biddable( client, customer_id, ad_group_id, @@ -216,7 +216,7 @@ def main(client, customer_id, ad_group_id, replace_existing_tree): # [END add_shopping_product_listing_group_tree] -def _remove_listing_group_tree(client, customer_id, ad_group_id): +def remove_listing_group_tree(client, customer_id, ad_group_id): """Removes ad group criteria for an ad group's existing listing group tree. Args: @@ -267,7 +267,7 @@ def _remove_listing_group_tree(client, customer_id, ad_group_id): print(f"Removed {len(response.results)} ad group criteria.") -def _create_listing_group_subdivision( +def create_listing_group_subdivision( client, customer_id, ad_group_id, @@ -298,7 +298,7 @@ def _create_listing_group_subdivision( # the ID for the ad group criterion. ad_group_criterion.resource_name = client.get_service( "AdGroupCriterionService" - ).ad_group_criterion_path(customer_id, ad_group_id, _next_id()) + ).ad_group_criterion_path(customer_id, ad_group_id, next_id()) ad_group_criterion.status = client.enums.AdGroupCriterionStatusEnum.ENABLED listing_group_info = ad_group_criterion.listing_group @@ -325,7 +325,7 @@ def _create_listing_group_subdivision( return operation -def _create_listing_group_unit_biddable( +def create_listing_group_unit_biddable( client, customer_id, ad_group_id, diff --git a/examples/shopping_ads/add_shopping_smart_ad.py b/examples/shopping_ads/add_shopping_smart_ad.py index 094d88a8c..02d346505 100644 --- a/examples/shopping_ads/add_shopping_smart_ad.py +++ b/examples/shopping_ads/add_shopping_smart_ad.py @@ -53,10 +53,10 @@ def main( listing group. """ # Create a budget to be used by the campaign that will be created below. - budget_resource_name = _add_campaign_budget(client, customer_id) + budget_resource_name = add_campaign_budget(client, customer_id) # Create a smart shopping campaign. - campaign_resource_name = _add_smart_shopping_campaign( + campaign_resource_name = add_smart_shopping_campaign( client, customer_id, budget_resource_name, @@ -64,12 +64,12 @@ def main( ) # Create a smart shopping ad group. - ad_group_resource_name = _add_smart_shopping_ad_group( + ad_group_resource_name = add_smart_shopping_ad_group( client, customer_id, campaign_resource_name ) # Creates a smart shopping ad group ad. - _add_smart_shopping_ad_group_ad(client, customer_id, ad_group_resource_name) + add_smart_shopping_ad_group_ad(client, customer_id, ad_group_resource_name) if create_default_listing_group: # A product group is a subset of inventory. Listing groups are the @@ -77,10 +77,10 @@ def main( # the chosen group or exclude a group from bidding. # This method creates an ad group criterion containing a listing # group. - _add_shopping_listing_group(client, customer_id, ad_group_resource_name) + add_shopping_listing_group(client, customer_id, ad_group_resource_name) -def _add_campaign_budget(client, customer_id): +def add_campaign_budget(client, customer_id): """Creates a campaign budget in the specified client account. Args: @@ -124,7 +124,7 @@ def _add_campaign_budget(client, customer_id): # [START add_shopping_smart_ad_3] -def _add_smart_shopping_campaign( +def add_smart_shopping_campaign( client, customer_id, budget_resource_name, merchant_center_account_id ): """Creates a new shopping campaign for smart shopping ads. @@ -192,7 +192,7 @@ def _add_smart_shopping_campaign( # [START add_shopping_smart_ad_2] -def _add_smart_shopping_ad_group(client, customer_id, campaign_resource_name): +def add_smart_shopping_ad_group(client, customer_id, campaign_resource_name): """Creates a new ad group in the specified smart shopping campaign. Args: @@ -231,7 +231,7 @@ def _add_smart_shopping_ad_group(client, customer_id, campaign_resource_name): # [START add_shopping_smart_ad_1] -def _add_smart_shopping_ad_group_ad( +def add_smart_shopping_ad_group_ad( client, customer_id, ad_group_resource_name ): """Creates a new ad group ad in the specified smart shopping ad group. @@ -273,7 +273,7 @@ def _add_smart_shopping_ad_group_ad( # [END add_shopping_smart_ad_1] -def _add_shopping_listing_group(client, customer_id, ad_group_resource_name): +def add_shopping_listing_group(client, customer_id, ad_group_resource_name): """Creates a new shopping listing group for the specified ad group. This is known as a "product group" in the Google Ads user interface. The diff --git a/examples/shopping_ads/get_product_bidding_category_constant.py b/examples/shopping_ads/get_product_bidding_category_constant.py index 0b5f63e6b..163b660bc 100755 --- a/examples/shopping_ads/get_product_bidding_category_constant.py +++ b/examples/shopping_ads/get_product_bidding_category_constant.py @@ -22,7 +22,7 @@ from google.ads.googleads.errors import GoogleAdsException -def _display_categories(categories, prefix=""): +def display_categories(categories, prefix=""): """Recursively prints out each category and its children. Args: @@ -34,9 +34,7 @@ def _display_categories(categories, prefix=""): for category in categories: print(f"{prefix}{category.name} [{category.category_id}]") if not category.children: - _display_categories( - category.children, prefix=prefix + category.name - ) + display_categories(category.children, prefix=prefix + category.name) def main(client, customer_id): @@ -92,7 +90,7 @@ def __init__(self, name=None, category_id=None, children=None): # Otherwise adds the category as a root category. root_categories.append(category) - _display_categories(root_categories) + display_categories(root_categories) if __name__ == "__main__": diff --git a/examples/targeting/add_campaign_targeting_criteria.py b/examples/targeting/add_campaign_targeting_criteria.py index 553b2362a..b308c850b 100755 --- a/examples/targeting/add_campaign_targeting_criteria.py +++ b/examples/targeting/add_campaign_targeting_criteria.py @@ -26,11 +26,11 @@ def main(client, customer_id, campaign_id, keyword_text, location_id): campaign_criterion_service = client.get_service("CampaignCriterionService") operations = [ - _create_location_op(client, customer_id, campaign_id, location_id), - _create_negative_keyword_op( + create_location_op(client, customer_id, campaign_id, location_id), + create_negative_keyword_op( client, customer_id, campaign_id, keyword_text ), - _create_proximity_op(client, customer_id, campaign_id), + create_proximity_op(client, customer_id, campaign_id), ] campaign_criterion_response = ( @@ -44,7 +44,7 @@ def main(client, customer_id, campaign_id, keyword_text, location_id): # [START add_campaign_targeting_criteria] -def _create_location_op(client, customer_id, campaign_id, location_id): +def create_location_op(client, customer_id, campaign_id, location_id): campaign_service = client.get_service("CampaignService") geo_target_constant_service = client.get_service("GeoTargetConstantService") @@ -67,7 +67,7 @@ def _create_location_op(client, customer_id, campaign_id, location_id): # [END add_campaign_targeting_criteria] -def _create_negative_keyword_op(client, customer_id, campaign_id, keyword_text): +def create_negative_keyword_op(client, customer_id, campaign_id, keyword_text): campaign_service = client.get_service("CampaignService") # Create the campaign criterion. @@ -85,7 +85,7 @@ def _create_negative_keyword_op(client, customer_id, campaign_id, keyword_text): # [START add_campaign_targeting_criteria_1] -def _create_proximity_op(client, customer_id, campaign_id): +def create_proximity_op(client, customer_id, campaign_id): campaign_service = client.get_service("CampaignService") # Create the campaign criterion. diff --git a/examples/targeting/search_for_language_and_carrier_constants.py b/examples/targeting/search_for_language_and_carrier_constants.py index 49ec75649..e2bac1029 100644 --- a/examples/targeting/search_for_language_and_carrier_constants.py +++ b/examples/targeting/search_for_language_and_carrier_constants.py @@ -38,11 +38,11 @@ def main(client, customer_id, language_name, carrier_country_code): carrier_country_code: String code of the country where the mobile carriers are located. """ - _search_for_language_constants(client, customer_id, language_name) - _search_for_carrier_constants(client, customer_id, carrier_country_code) + search_for_language_constants(client, customer_id, language_name) + search_for_carrier_constants(client, customer_id, carrier_country_code) -def _search_for_language_constants(client, customer_id, language_name): +def search_for_language_constants(client, customer_id, language_name): """Searches for language constants where the name includes a given string. Args: @@ -81,7 +81,7 @@ def _search_for_language_constants(client, customer_id, language_name): ) -def _search_for_carrier_constants(client, customer_id, carrier_country_code): +def search_for_carrier_constants(client, customer_id, carrier_country_code): """Searches for mobile carrier constants with a given country code. Args: diff --git a/google/ads/googleads/__init__.py b/google/ads/googleads/__init__.py index ce138ebb9..539cbf5b8 100644 --- a/google/ads/googleads/__init__.py +++ b/google/ads/googleads/__init__.py @@ -16,4 +16,4 @@ import google.ads.googleads.errors import google.ads.googleads.util -VERSION = "18.0.0" +VERSION = "18.1.0" diff --git a/google/ads/googleads/v11/__init__.py b/google/ads/googleads/v11/__init__.py index fc62e0540..7942f42a7 100644 --- a/google/ads/googleads/v11/__init__.py +++ b/google/ads/googleads/v11/__init__.py @@ -102,12 +102,16 @@ "DynamicRealEstateAsset": "google.ads.googleads.v11.common.types.asset_types", "DynamicTravelAsset": "google.ads.googleads.v11.common.types.asset_types", "EnhancedCpc": "google.ads.googleads.v11.common.types.bidding", + "EventAttribute": "google.ads.googleads.v11.common.types.offline_user_data", + "EventItemAttribute": "google.ads.googleads.v11.common.types.offline_user_data", "ExclusionSegment": "google.ads.googleads.v11.common.types.audiences", "ExpandedDynamicSearchAdInfo": "google.ads.googleads.v11.common.types.ad_type_infos", "ExpandedTextAdInfo": "google.ads.googleads.v11.common.types.ad_type_infos", "ExplorerAutoOptimizerSetting": "google.ads.googleads.v11.common.types.explorer_auto_optimizer_setting", "ExpressionRuleUserListInfo": "google.ads.googleads.v11.common.types.user_lists", "FinalAppUrl": "google.ads.googleads.v11.common.types.final_app_url", + "FlexibleRuleOperandInfo": "google.ads.googleads.v11.common.types.user_lists", + "FlexibleRuleUserListInfo": "google.ads.googleads.v11.common.types.user_lists", "FrequencyCapEntry": "google.ads.googleads.v11.common.types.frequency_cap", "FrequencyCapKey": "google.ads.googleads.v11.common.types.frequency_cap", "GenderDimension": "google.ads.googleads.v11.common.types.audiences", @@ -341,6 +345,7 @@ "BatchJobStatusEnum": "google.ads.googleads.v11.enums.types.batch_job_status", "BiddingSourceEnum": "google.ads.googleads.v11.enums.types.bidding_source", "BiddingStrategyStatusEnum": "google.ads.googleads.v11.enums.types.bidding_strategy_status", + "BiddingStrategySystemStatusEnum": "google.ads.googleads.v11.enums.types.bidding_strategy_system_status", "BiddingStrategyTypeEnum": "google.ads.googleads.v11.enums.types.bidding_strategy_type", "BidModifierSourceEnum": "google.ads.googleads.v11.enums.types.bid_modifier_source", "BillingSetupStatusEnum": "google.ads.googleads.v11.enums.types.billing_setup_status", @@ -573,6 +578,7 @@ "UserListCombinedRuleOperatorEnum": "google.ads.googleads.v11.enums.types.user_list_combined_rule_operator", "UserListCrmDataSourceTypeEnum": "google.ads.googleads.v11.enums.types.user_list_crm_data_source_type", "UserListDateRuleItemOperatorEnum": "google.ads.googleads.v11.enums.types.user_list_date_rule_item_operator", + "UserListFlexibleRuleOperatorEnum": "google.ads.googleads.v11.enums.types.user_list_flexible_rule_operator", "UserListLogicalRuleOperatorEnum": "google.ads.googleads.v11.enums.types.user_list_logical_rule_operator", "UserListMembershipStatusEnum": "google.ads.googleads.v11.enums.types.user_list_membership_status", "UserListNumberRuleItemOperatorEnum": "google.ads.googleads.v11.enums.types.user_list_number_rule_item_operator", @@ -615,6 +621,7 @@ "AssetSetErrorEnum": "google.ads.googleads.v11.errors.types.asset_set_error", "AssetSetLinkErrorEnum": "google.ads.googleads.v11.errors.types.asset_set_link_error", "AudienceErrorEnum": "google.ads.googleads.v11.errors.types.audience_error", + "AudienceInsightsErrorEnum": "google.ads.googleads.v11.errors.types.audience_insights_error", "AuthenticationErrorEnum": "google.ads.googleads.v11.errors.types.authentication_error", "AuthorizationErrorEnum": "google.ads.googleads.v11.errors.types.authorization_error", "BatchJobErrorEnum": "google.ads.googleads.v11.errors.types.batch_job_error", @@ -943,6 +950,7 @@ "AdGroupOperation": "google.ads.googleads.v11.services.types.ad_group_service", "AdOperation": "google.ads.googleads.v11.services.types.ad_service", "AdParameterOperation": "google.ads.googleads.v11.services.types.ad_parameter_service", + "AdvancedProductTargeting": "google.ads.googleads.v11.services.types.reach_plan_service", "ApplyRecommendationOperation": "google.ads.googleads.v11.services.types.recommendation_service", "ApplyRecommendationRequest": "google.ads.googleads.v11.services.types.recommendation_service", "ApplyRecommendationResponse": "google.ads.googleads.v11.services.types.recommendation_service", @@ -954,12 +962,18 @@ "AssetOperation": "google.ads.googleads.v11.services.types.asset_service", "AssetSetAssetOperation": "google.ads.googleads.v11.services.types.asset_set_asset_service", "AssetSetOperation": "google.ads.googleads.v11.services.types.asset_set_service", + "AudienceCompositionAttribute": "google.ads.googleads.v11.services.types.audience_insights_service", + "AudienceCompositionAttributeCluster": "google.ads.googleads.v11.services.types.audience_insights_service", + "AudienceCompositionMetrics": "google.ads.googleads.v11.services.types.audience_insights_service", + "AudienceCompositionSection": "google.ads.googleads.v11.services.types.audience_insights_service", "AudienceInsightsAttribute": "google.ads.googleads.v11.services.types.audience_insights_service", "AudienceInsightsAttributeMetadata": "google.ads.googleads.v11.services.types.audience_insights_service", "AudienceInsightsCategory": "google.ads.googleads.v11.services.types.audience_insights_service", + "AudienceInsightsDynamicLineup": "google.ads.googleads.v11.services.types.audience_insights_service", "AudienceInsightsEntity": "google.ads.googleads.v11.services.types.audience_insights_service", "AudienceInsightsTopic": "google.ads.googleads.v11.services.types.audience_insights_service", "AudienceOperation": "google.ads.googleads.v11.services.types.audience_service", + "AudienceTargeting": "google.ads.googleads.v11.services.types.reach_plan_service", "BasicInsightsAudience": "google.ads.googleads.v11.services.types.audience_insights_service", "BatchJobOperation": "google.ads.googleads.v11.services.types.batch_job_service", "BatchJobResult": "google.ads.googleads.v11.services.types.batch_job_service", @@ -1023,6 +1037,7 @@ "CustomVariable": "google.ads.googleads.v11.services.types.conversion_upload_service", "DismissRecommendationRequest": "google.ads.googleads.v11.services.types.recommendation_service", "DismissRecommendationResponse": "google.ads.googleads.v11.services.types.recommendation_service", + "DynamicLineupAttributeMetadata": "google.ads.googleads.v11.services.types.audience_insights_service", "EffectiveFrequencyBreakdown": "google.ads.googleads.v11.services.types.reach_plan_service", "EffectiveFrequencyLimit": "google.ads.googleads.v11.services.types.reach_plan_service", "EndCampaignExperimentRequest": "google.ads.googleads.v11.services.types.campaign_experiment_service", @@ -1044,6 +1059,8 @@ "GclidDateTimePair": "google.ads.googleads.v11.services.types.conversion_adjustment_upload_service", "GenerateAdGroupThemesRequest": "google.ads.googleads.v11.services.types.keyword_plan_idea_service", "GenerateAdGroupThemesResponse": "google.ads.googleads.v11.services.types.keyword_plan_idea_service", + "GenerateAudienceCompositionInsightsRequest": "google.ads.googleads.v11.services.types.audience_insights_service", + "GenerateAudienceCompositionInsightsResponse": "google.ads.googleads.v11.services.types.audience_insights_service", "GenerateForecastCurveRequest": "google.ads.googleads.v11.services.types.keyword_plan_service", "GenerateForecastCurveResponse": "google.ads.googleads.v11.services.types.keyword_plan_service", "GenerateForecastMetricsRequest": "google.ads.googleads.v11.services.types.keyword_plan_service", @@ -1072,6 +1089,8 @@ "GraduateCampaignExperimentRequest": "google.ads.googleads.v11.services.types.campaign_experiment_service", "GraduateCampaignExperimentResponse": "google.ads.googleads.v11.services.types.campaign_experiment_service", "GraduateExperimentRequest": "google.ads.googleads.v11.services.types.experiment_service", + "InsightsAudience": "google.ads.googleads.v11.services.types.audience_insights_service", + "InsightsAudienceAttributeGroup": "google.ads.googleads.v11.services.types.audience_insights_service", "KeywordAndUrlSeed": "google.ads.googleads.v11.services.types.keyword_plan_idea_service", "KeywordPlanAdGroupForecast": "google.ads.googleads.v11.services.types.keyword_plan_service", "KeywordPlanAdGroupKeywordOperation": "google.ads.googleads.v11.services.types.keyword_plan_ad_group_keyword_service", @@ -1438,6 +1457,9 @@ "UrlSeed": "google.ads.googleads.v11.services.types.keyword_plan_idea_service", "UserDataOperation": "google.ads.googleads.v11.services.types.user_data_service", "UserListOperation": "google.ads.googleads.v11.services.types.user_list_service", + "YouTubeChannelAttributeMetadata": "google.ads.googleads.v11.services.types.audience_insights_service", + "YouTubeSelectLineUp": "google.ads.googleads.v11.services.types.reach_plan_service", + "YouTubeSelectSettings": "google.ads.googleads.v11.services.types.reach_plan_service", # Enum types # Client classes and transports "AccountBudgetProposalServiceClient": "google.ads.googleads.v11.services.services.account_budget_proposal_service", diff --git a/google/ads/googleads/v11/common/__init__.py b/google/ads/googleads/v11/common/__init__.py index 2c1bcc39c..492f5a504 100644 --- a/google/ads/googleads/v11/common/__init__.py +++ b/google/ads/googleads/v11/common/__init__.py @@ -94,12 +94,16 @@ "DynamicRealEstateAsset", "DynamicTravelAsset", "EnhancedCpc", + "EventAttribute", + "EventItemAttribute", "ExclusionSegment", "ExpandedDynamicSearchAdInfo", "ExpandedTextAdInfo", "ExplorerAutoOptimizerSetting", "ExpressionRuleUserListInfo", "FinalAppUrl", + "FlexibleRuleOperandInfo", + "FlexibleRuleUserListInfo", "FrequencyCapEntry", "FrequencyCapKey", "GenderDimension", diff --git a/google/ads/googleads/v11/common/types/ad_type_infos.py b/google/ads/googleads/v11/common/types/ad_type_infos.py index 182f764cf..432056bc3 100644 --- a/google/ads/googleads/v11/common/types/ad_type_infos.py +++ b/google/ads/googleads/v11/common/types/ad_type_infos.py @@ -289,7 +289,7 @@ class DisplayCallToAction(proto.Message): This field is a member of `oneof`_ ``_text``. text_color (str): Text color for the display-call-to-action in - hexadecimal, e.g. #ffffff for white. + hexadecimal, for example, # ffffff for white. This field is a member of `oneof`_ ``_text_color``. url_collection_id (str): @@ -592,9 +592,9 @@ class VideoResponsiveAdInfo(proto.Message): Attributes: headlines (Sequence[google.ads.googleads.v11.common.types.AdTextAsset]): List of text assets used for the short - headline, e.g. the "Call To Action" banner. - Currently, only a single value for the short - headline is supported. + headline, for example, the "Call To Action" + banner. Currently, only a single value for the + short headline is supported. long_headlines (Sequence[google.ads.googleads.v11.common.types.AdTextAsset]): List of text assets used for the long headline. Currently, only a single value for the @@ -604,9 +604,9 @@ class VideoResponsiveAdInfo(proto.Message): Currently, only a single value for the description is supported. call_to_actions (Sequence[google.ads.googleads.v11.common.types.AdTextAsset]): - List of text assets used for the button, e.g. - the "Call To Action" button. Currently, only a - single value for the button is supported. + List of text assets used for the button, for + example, the "Call To Action" button. Currently, + only a single value for the button is supported. videos (Sequence[google.ads.googleads.v11.common.types.AdVideoAsset]): List of YouTube video assets used for the ad. Currently, only a single value for the YouTube @@ -720,15 +720,15 @@ class LegacyResponsiveDisplayAdInfo(proto.Message): This field is a member of `oneof`_ ``_allow_flexible_color``. accent_color (str): - The accent color of the ad in hexadecimal, e.g. #ffffff for - white. If one of ``main_color`` and ``accent_color`` is set, - the other is required as well. + The accent color of the ad in hexadecimal, for example, + #ffffff for white. If one of ``main_color`` and + ``accent_color`` is set, the other is required as well. This field is a member of `oneof`_ ``_accent_color``. main_color (str): - The main color of the ad in hexadecimal, e.g. #ffffff for - white. If one of ``main_color`` and ``accent_color`` is set, - the other is required as well. + The main color of the ad in hexadecimal, for example, + #ffffff for white. If one of ``main_color`` and + ``accent_color`` is set, the other is required as well. This field is a member of `oneof`_ ``_main_color``. call_to_action_text (str): @@ -759,7 +759,8 @@ class LegacyResponsiveDisplayAdInfo(proto.Message): Specifies which format the ad will be served in. Default is ALL_FORMATS. price_prefix (str): - Prefix before price. E.g. 'as low as'. + Prefix before price. For example, 'as low + as'. This field is a member of `oneof`_ ``_price_prefix``. promo_text (str): @@ -997,15 +998,15 @@ class ResponsiveDisplayAdInfo(proto.Message): This field is a member of `oneof`_ ``_business_name``. main_color (str): - The main color of the ad in hexadecimal, e.g. #ffffff for - white. If one of ``main_color`` and ``accent_color`` is set, - the other is required as well. + The main color of the ad in hexadecimal, for example, + #ffffff for white. If one of ``main_color`` and + ``accent_color`` is set, the other is required as well. This field is a member of `oneof`_ ``_main_color``. accent_color (str): - The accent color of the ad in hexadecimal, e.g. #ffffff for - white. If one of ``main_color`` and ``accent_color`` is set, - the other is required as well. + The accent color of the ad in hexadecimal, for example, + #ffffff for white. If one of ``main_color`` and + ``accent_color`` is set, the other is required as well. This field is a member of `oneof`_ ``_accent_color``. allow_flexible_color (bool): @@ -1022,7 +1023,8 @@ class ResponsiveDisplayAdInfo(proto.Message): This field is a member of `oneof`_ ``_call_to_action_text``. price_prefix (str): - Prefix before price. E.g. 'as low as'. + Prefix before price. For example, 'as low + as'. This field is a member of `oneof`_ ``_price_prefix``. promo_text (str): @@ -1208,14 +1210,15 @@ class SmartCampaignAdInfo(proto.Message): Attributes: headlines (Sequence[google.ads.googleads.v11.common.types.AdTextAsset]): - List of text assets for headlines. When the - ad serves the headlines will be selected from - this list. 3 headlines must be specified. + List of text assets, each of which + corresponds to a headline when the ad serves. + This list consists of a minimum of 3 and up to + 15 text assets. descriptions (Sequence[google.ads.googleads.v11.common.types.AdTextAsset]): - List of text assets for descriptions. When - the ad serves the descriptions will be selected - from this list. 2 descriptions must be - specified. + List of text assets, each of which + corresponds to a description when the ad serves. + This list consists of a minimum of 2 and up to 4 + text assets. """ headlines = proto.RepeatedField( @@ -1343,7 +1346,7 @@ class DiscoveryMultiAssetAdInfo(proto.Message): This field is a member of `oneof`_ ``_call_to_action_text``. lead_form_only (bool): - Boolean flag that indicates if this ad must + Boolean option that indicates if this ad must be served with lead form. This field is a member of `oneof`_ ``_lead_form_only``. diff --git a/google/ads/googleads/v11/common/types/asset_types.py b/google/ads/googleads/v11/common/types/asset_types.py index f93301cd2..213a8e9c1 100644 --- a/google/ads/googleads/v11/common/types/asset_types.py +++ b/google/ads/googleads/v11/common/types/asset_types.py @@ -236,8 +236,8 @@ class LeadFormAsset(proto.Message): This field is a member of `oneof`_ ``_background_image_asset``. desired_intent (google.ads.googleads.v11.enums.types.LeadFormDesiredIntentEnum.LeadFormDesiredIntent): - Desired intent for the lead form, e.g. more - volume or more qualified. + Chosen intent for the lead form, for example, + more volume or more qualified. custom_disclosure (str): Custom disclosure shown along with Google disclaimer on the lead form. Accessible to @@ -324,8 +324,8 @@ class LeadFormCustomQuestionField(proto.Message): Attributes: custom_question_text (str): - The exact custom question field text (e.g. - "Do you own a car?"). + The exact custom question field text (for + example, "Do you own a car?"). single_choice_answers (google.ads.googleads.v11.common.types.LeadFormSingleChoiceAnswers): Answer configuration for a single choice question. Minimum of 2 answers and maximum of 12 @@ -633,33 +633,34 @@ class DynamicEducationAsset(proto.Message): Location ID which can be any sequence of letters and digits and must be unique. program_name (str): - Required. Program name, e.g. Nursing. + Required. Program name, for example, Nursing. Required. subject (str): - Subject of study, e.g. Health. + Subject of study, for example, Health. program_description (str): - Program description, e.g. Nursing + Program description, for example, Nursing Certification. school_name (str): - School name, e.g. Mountain View School of - Nursing. + School name, for example, Mountain View + School of Nursing. address (str): School address which can be specified in one of the following formats. (1) City, state, code, - country, e.g. Mountain View, CA, USA. (2) Full - address, e.g. 123 Boulevard St, Mountain View, - CA 94043. (3) Latitude-longitude in the DDD - format, e.g. 41.40338, 2.17403 + country, for example, Mountain View, CA, USA. + (2) Full address, for example, 123 Boulevard St, + Mountain View, CA 94043. (3) Latitude-longitude + in the DDD format, for example, 41.40338, + 2.17403 contextual_keywords (Sequence[str]): - Contextual keywords, e.g. Nursing + Contextual keywords, for example, Nursing certification, Health, Mountain View. android_app_link (str): - Android deep link, e.g. + Android deep link, for example, android-app://com.example.android/http/example.com/gizmos?1234. similar_program_ids (Sequence[str]): Similar program IDs. ios_app_link (str): - iOS deep link, e.g. + iOS deep link, for example, exampleApp://content/page. ios_app_store_id (int): iOS app store ID. This is used to check if the user has the @@ -667,12 +668,12 @@ class DynamicEducationAsset(proto.Message): field is set, then the ios_app_link field must also be present. thumbnail_image_url (str): - Thumbnail image url, e.g. + Thumbnail image url, for example, http://www.example.com/thumbnail.png. The thumbnail image will not be uploaded as image asset. image_url (str): - Image url, e.g. + Image url, for example, http://www.example.com/image.png. The image will not be uploaded as image asset. """ @@ -880,44 +881,47 @@ class DynamicRealEstateAsset(proto.Message): unique and match the values of remarketing tag. Required. listing_name (str): - Required. Listing name, e.g. Boulevard - Bungalow. Required. + Required. Listing name, for example, + Boulevard Bungalow. Required. city_name (str): - City name, e.g. Mountain View, California. + City name, for example, Mountain View, + California. description (str): - Description, e.g. 3 beds, 2 baths, 1568 sq. - ft. + Description, for example, 3 beds, 2 baths, + 1568 sq. ft. address (str): Address which can be specified in one of the following formats. (1) City, state, code, - country, e.g. Mountain View, CA, USA. (2) Full - address, e.g. 123 Boulevard St, Mountain View, - CA 94043. (3) Latitude-longitude in the DDD - format, e.g. 41.40338, 2.17403 + country, for example, Mountain View, CA, USA. + (2) Full address, for example, 123 Boulevard St, + Mountain View, CA 94043. (3) Latitude-longitude + in the DDD format, for example, 41.40338, + 2.17403 price (str): Price which can be number followed by the alphabetic currency code, ISO 4217 standard. Use - '.' as the decimal mark. e.g. 200,000.00 USD. + '.' as the decimal mark, for example, 200,000.00 + USD. image_url (str): - Image URL, e.g. + Image URL, for example, http://www.example.com/image.png. The image will not be uploaded as image asset. property_type (str): - Property type, e.g. House. + Property type, for example, House. listing_type (str): - Listing type, e.g. For sale. + Listing type, for example, For sale. contextual_keywords (Sequence[str]): - Contextual keywords, e.g. For sale; Houses - for sale. + Contextual keywords, for example, For sale; + Houses for sale. formatted_price (str): Formatted price which can be any characters. If set, this attribute will be used instead of - 'price', e.g. Starting at $200,000.00. + 'price', for example, Starting at $200,000.00. android_app_link (str): - Android deep link, e.g. + Android deep link, for example, android-app://com.example.android/http/example.com/gizmos?1234. ios_app_link (str): - iOS deep link, e.g. + iOS deep link, for example, exampleApp://content/page. ios_app_store_id (int): iOS app store ID. This is used to check if the user has the @@ -952,60 +956,63 @@ class DynamicCustomAsset(proto.Message): id (str): Required. ID which can be any sequence of letters and digits, and must be unique and match - the values of remarketing tag, e.g. sedan. - Required. + the values of remarketing tag, for example, + sedan. Required. id2 (str): ID2 which can be any sequence of letters and - digits, e.g. red. ID sequence (ID + ID2) must be - unique. + digits, for example, red. ID sequence (ID + ID2) + must be unique. item_title (str): - Required. Item title, e.g. Mid-size sedan. - Required. + Required. Item title, for example, Mid-size + sedan. Required. item_subtitle (str): - Item subtitle, e.g. At your Mountain View - dealership. + Item subtitle, for example, At your Mountain + View dealership. item_description (str): - Item description, e.g. Best selling mid-size - car. + Item description, for example, Best selling + mid-size car. item_address (str): Item address which can be specified in one of the following formats. (1) City, state, code, - country, e.g. Mountain View, CA, USA. (2) Full - address, e.g. 123 Boulevard St, Mountain View, - CA 94043. (3) Latitude-longitude in the DDD - format, e.g. 41.40338, 2.17403 + country, for example, Mountain View, CA, USA. + (2) Full address, for example, 123 Boulevard St, + Mountain View, CA 94043. (3) Latitude-longitude + in the DDD format, for example, 41.40338, + 2.17403 item_category (str): - Item category, e.g. Sedans. + Item category, for example, Sedans. price (str): Price which can be number followed by the alphabetic currency code, ISO 4217 standard. Use - '.' as the decimal mark, e.g. 20,000.00 USD. + '.' as the decimal mark, for example, 20,000.00 + USD. sale_price (str): Sale price which can be number followed by the alphabetic currency code, ISO 4217 standard. - Use '.' as the decimal mark, e.g. 15,000.00 USD. - Must be less than the 'price' field. + Use '.' as the decimal mark, for example, + 15,000.00 USD. Must be less than the 'price' + field. formatted_price (str): Formatted price which can be any characters. If set, this attribute will be used instead of - 'price', e.g. Starting at $20,000.00. + 'price', for example, Starting at $20,000.00. formatted_sale_price (str): Formatted sale price which can be any characters. If set, this attribute will be used - instead of 'sale price', e.g. On sale for - $15,000.00. + instead of 'sale price', for example, On sale + for $15,000.00. image_url (str): - Image URL, e.g. + Image URL, for example, http://www.example.com/image.png. The image will not be uploaded as image asset. contextual_keywords (Sequence[str]): - Contextual keywords, e.g. Sedans, 4 door - sedans. + Contextual keywords, for example, Sedans, 4 + door sedans. android_app_link (str): - Android deep link, e.g. + Android deep link, for example, android-app://com.example.android/http/example.com/gizmos?1234. ios_app_link (str): - iOS deep link, e.g. + iOS deep link, for example, exampleApp://content/page. ios_app_store_id (int): iOS app store ID. This is used to check if the user has the @@ -1045,45 +1052,48 @@ class DynamicHotelsAndRentalsAsset(proto.Message): unique and match the values of remarketing tag. Required. property_name (str): - Required. Property name, e.g. Mountain View - Hotel. Required. + Required. Property name, for example, + Mountain View Hotel. Required. image_url (str): - Image URL, e.g. + Image URL, for example, http://www.example.com/image.png. The image will not be uploaded as image asset. destination_name (str): - Destination name, e.g. Downtown Mountain - View. + Destination name, for example, Downtown + Mountain View. description (str): - Description, e.g. Close to SJC Airport. + Description, for example, Close to SJC + Airport. price (str): Price which can be number followed by the alphabetic currency code, ISO 4217 standard. Use - '.' as the decimal mark, e.g. 100.00 USD. + '.' as the decimal mark, for example, 100.00 + USD. sale_price (str): ISO 4217 standard. Use '.' as the decimal - mark, e.g. 80.00 USD. Must be less than the - 'price' field. + mark, for example, 80.00 USD. Must be less than + the 'price' field. star_rating (int): Star rating. Must be a number between 1 to 5, inclusive. category (str): - Category, e.g. Hotel suite. + Category, for example, Hotel suite. contextual_keywords (Sequence[str]): - Contextual keywords, e.g. Mountain View - "Hotels", South Bay hotels. + Contextual keywords, for example, Mountain + View "Hotels", South Bay hotels. address (str): Address which can be specified in one of the following formats. (1) City, state, code, - country, e.g. Mountain View, CA, USA. (2) Full - address, e.g. 123 Boulevard St, Mountain View, - CA 94043. (3) Latitude-longitude in the DDD - format, e.g. 41.40338, 2.17403 + country, for example, Mountain View, CA, USA. + (2) Full address, for example, 123 Boulevard St, + Mountain View, CA 94043. (3) Latitude-longitude + in the DDD format, for example, 41.40338, + 2.17403 android_app_link (str): - Android deep link, e.g. + Android deep link, for example, android-app://com.example.android/http/example.com/gizmos?1234. ios_app_link (str): - iOS deep link, e.g. + iOS deep link, for example, exampleApp://content/page. ios_app_store_id (int): iOS app store ID. This is used to check if the user has the @@ -1093,12 +1103,12 @@ class DynamicHotelsAndRentalsAsset(proto.Message): formatted_price (str): Formatted price which can be any characters. If set, this attribute will be used instead of - 'price', e.g. Starting at $100.00. + 'price', for example, Starting at $100.00. formatted_sale_price (str): Formatted sale price which can be any characters. If set, this attribute will be used - instead of 'sale price', e.g. On sale for - $80.00. + instead of 'sale price', for example, On sale + for $80.00. similar_property_ids (Sequence[str]): Similar property IDs. """ @@ -1136,39 +1146,40 @@ class DynamicFlightsAsset(proto.Message): letters and digits. The ID sequence (destination ID + origin ID) must be unique. flight_description (str): - Required. Flight description, e.g. Book your - ticket. Required. + Required. Flight description, for example, + Book your ticket. Required. image_url (str): - Image URL, e.g. + Image URL, for example, http://www.example.com/image.png. The image will not be uploaded as image asset. destination_name (str): - Destination name, e.g. Paris. + Destination name, for example, Paris. origin_name (str): - Origin name, e.g. London. + Origin name, for example, London. flight_price (str): Flight price which can be number followed by the alphabetic currency code, ISO 4217 standard. - Use '.' as the decimal mark. e.g. 100.00 USD. + Use '.' as the decimal mark, for example, 100.00 + USD. flight_sale_price (str): Flight sale price which can be number followed by the alphabetic currency code, ISO 4217 standard. Use '.' as the - decimal mark, e.g. 80.00 USD. Must be less than the + decimal mark, for example, 80.00 USD. Must be less than the 'flight_price' field. formatted_price (str): Formatted price which can be any characters. If set, this attribute will be used instead of - 'price', e.g. Starting at $100.00. + 'price', for example, Starting at $100.00. formatted_sale_price (str): Formatted sale price which can be any characters. If set, this attribute will be used - instead of 'sale price', e.g. On sale for - $80.00. + instead of 'sale price', for example, On sale + for $80.00. android_app_link (str): - Android deep link, e.g. + Android deep link, for example, android-app://com.example.android/http/example.com/gizmos?1234. ios_app_link (str): - iOS deep link, e.g. + iOS deep link, for example, exampleApp://content/page. ios_app_store_id (int): iOS app store ID. This is used to check if the user has the @@ -1176,13 +1187,14 @@ class DynamicFlightsAsset(proto.Message): field is set, then the ios_app_link field must also be present. similar_destination_ids (Sequence[str]): - Similar destination IDs, e.g. PAR,LON. + Similar destination IDs, for example, + PAR,LON. custom_mapping (str): A custom field which can be multiple key to values mapping separated by delimiters (",", "|" and ":"), in the forms of ": , , ... , \| : , ... , \| ... \| : , ... - ," e.g. wifi: most \| aircraft: 320, 77W \| + ," for example, wifi: most \| aircraft: 320, 77W \| flights: 42 \| legroom: 32". """ @@ -1245,52 +1257,55 @@ class DynamicTravelAsset(proto.Message): letters and digits. The ID sequence (destination ID + origin ID) must be unique. title (str): - Required. Title, e.g. Book your train ticket. - Required. + Required. Title, for example, Book your train + ticket. Required. destination_name (str): - Destination name, e.g. Paris. + Destination name, for example, Paris. destination_address (str): Destination address which can be specified in one of the following formats. (1) City, state, - code, country, e.g. Mountain View, CA, USA. (2) - Full address, e.g. 123 Boulevard St, Mountain - View, CA 94043. (3) Latitude-longitude in the - DDD format, e.g. 41.40338, 2.17403. + code, country, for example, Mountain View, CA, + USA. (2) Full address, for example, 123 + Boulevard St, Mountain View, CA 94043. (3) + Latitude-longitude in the DDD format, for + example, 41.40338, 2.17403. origin_name (str): - Origin name, e.g. London. + Origin name, for example, London. price (str): Price which can be a number followed by the alphabetic currency code, ISO 4217 standard. Use - '.' as the decimal mark. e.g. 100.00 USD. + '.' as the decimal mark, for example, 100.00 + USD. sale_price (str): Sale price which can be a number followed by the alphabetic currency code, ISO 4217 standard. - Use '.' as the decimal mark, e.g. 80.00 USD. - Must be less than the 'price' field. + Use '.' as the decimal mark, for example, 80.00 + USD. Must be less than the 'price' field. formatted_price (str): Formatted price which can be any characters. If set, this attribute will be used instead of - 'price', e.g. Starting at $100.00. + 'price', for example, Starting at $100.00. formatted_sale_price (str): Formatted sale price which can be any characters. If set, this attribute will be used - instead of 'sale price', e.g. On sale for - $80.00. + instead of 'sale price', for example, On sale + for $80.00. category (str): - Category, e.g. Express. + Category, for example, Express. contextual_keywords (Sequence[str]): - Contextual keywords, e.g. Paris trains. + Contextual keywords, for example, Paris + trains. similar_destination_ids (Sequence[str]): - Similar destination IDs, e.g. NYC. + Similar destination IDs, for example, NYC. image_url (str): - Image URL, e.g. + Image URL, for example, http://www.example.com/image.png. The image will not be uploaded as image asset. android_app_link (str): - Android deep link, e.g. + Android deep link, for example, android-app://com.example.android/http/example.com/gizmos?1234. ios_app_link (str): - iOS deep link, e.g. + iOS deep link, for example, exampleApp://content/page. ios_app_store_id (int): iOS app store ID. This is used to check if the user has the @@ -1327,53 +1342,56 @@ class DynamicLocalAsset(proto.Message): of letters and digits, and must be unique and match the values of remarketing tag. Required. deal_name (str): - Required. Deal name, e.g. 50% off at Mountain - View Grocers. Required. + Required. Deal name, for example, 50% off at + Mountain View Grocers. Required. subtitle (str): - Subtitle, e.g. Groceries. + Subtitle, for example, Groceries. description (str): - Description, e.g. Save on your weekly bill. + Description, for example, Save on your weekly + bill. price (str): Price which can be a number followed by the alphabetic currency code, ISO 4217 standard. Use - '.' as the decimal mark, e.g. 100.00 USD. + '.' as the decimal mark, for example, 100.00 + USD. sale_price (str): Sale price which can be number followed by the alphabetic currency code, ISO 4217 standard. - Use '.' as the decimal mark, e.g. 80.00 USD. - Must be less than the 'price' field. + Use '.' as the decimal mark, for example, 80.00 + USD. Must be less than the 'price' field. image_url (str): - Image URL, e.g. + Image URL, for example, http://www.example.com/image.png. The image will not be uploaded as image asset. address (str): Address which can be specified in one of the following formats. (1) City, state, code, - country, e.g. Mountain View, CA, USA. (2) Full - address, e.g. 123 Boulevard St, Mountain View, - CA 94043. (3) Latitude-longitude in the DDD - format, e.g. 41.40338, 2.17403. + country, for example, Mountain View, CA, USA. + (2) Full address, for example, 123 Boulevard St, + Mountain View, CA 94043. (3) Latitude-longitude + in the DDD format, for example, 41.40338, + 2.17403. category (str): - Category, e.g. Food. + Category, for example, Food. contextual_keywords (Sequence[str]): - Contextual keywords, e.g. Save groceries - coupons. + Contextual keywords, for example, Save + groceries coupons. formatted_price (str): Formatted price which can be any characters. If set, this attribute will be used instead of - 'price', e.g. Starting at $100.00. + 'price', for example, Starting at $100.00. formatted_sale_price (str): Formatted sale price which can be any characters. If set, this attribute will be used - instead of 'sale price', e.g. On sale for - $80.00. + instead of 'sale price', for example, On sale + for $80.00. android_app_link (str): - Android deep link, e.g. + Android deep link, for example, android-app://com.example.android/http/example.com/gizmos?1234. similar_deal_ids (Sequence[str]): - Similar deal IDs, e.g. 1275. + Similar deal IDs, for example, 1275. ios_app_link (str): - iOS deep link, e.g. + iOS deep link, for example, exampleApp://content/page. ios_app_store_id (int): iOS app store ID. This is used to check if the user has the @@ -1413,38 +1431,39 @@ class DynamicJobsAsset(proto.Message): letters and digits. The ID sequence (job ID + location ID) must be unique. job_title (str): - Required. Job title, e.g. Software engineer. - Required. + Required. Job title, for example, Software + engineer. Required. job_subtitle (str): - Job subtitle, e.g. Level II. + Job subtitle, for example, Level II. description (str): - Description, e.g. Apply your technical - skills. + Description, for example, Apply your + technical skills. image_url (str): - Image URL, e.g. + Image URL, for example, http://www.example.com/image.png. The image will not be uploaded as image asset. job_category (str): - Job category, e.g. Technical. + Job category, for example, Technical. contextual_keywords (Sequence[str]): - Contextual keywords, e.g. Software + Contextual keywords, for example, Software engineering job. address (str): Address which can be specified in one of the following formats. (1) City, state, code, - country, e.g. Mountain View, CA, USA. (2) Full - address, e.g. 123 Boulevard St, Mountain View, - CA 94043. (3) Latitude-longitude in the DDD - format, e.g. 41.40338, 2.17403. + country, for example, Mountain View, CA, USA. + (2) Full address, for example, 123 Boulevard St, + Mountain View, CA 94043. (3) Latitude-longitude + in the DDD format, for example, 41.40338, + 2.17403. salary (str): - Salary, e.g. $100,000. + Salary, for example, $100,000. android_app_link (str): - Android deep link, e.g. + Android deep link, for example, android-app://com.example.android/http/example.com/gizmos?1234. similar_job_ids (Sequence[str]): - Similar job IDs, e.g. 1275. + Similar job IDs, for example, 1275. ios_app_link (str): - iOS deep link, e.g. + iOS deep link, for example, exampleApp://content/page. ios_app_store_id (int): iOS app store ID. This is used to check if the user has the diff --git a/google/ads/googleads/v11/common/types/bidding.py b/google/ads/googleads/v11/common/types/bidding.py index 8aa41d47c..90b98dae5 100644 --- a/google/ads/googleads/v11/common/types/bidding.py +++ b/google/ads/googleads/v11/common/types/bidding.py @@ -220,9 +220,9 @@ class TargetImpressionShare(proto.Message): The targeted location on the search results page. location_fraction_micros (int): - The desired fraction of ads to be shown in - the targeted location in micros. E.g. 1% equals - 10,000. + The chosen fraction of ads to be shown in the + targeted location in micros. For example, 1% + equals 10,000. This field is a member of `oneof`_ ``_location_fraction_micros``. cpc_bid_ceiling_micros (int): @@ -251,7 +251,7 @@ class TargetRoas(proto.Message): Attributes: target_roas (float): - Required. The desired revenue (based on + Required. The chosen revenue (based on conversion data) per unit of spend. Value must be between 0.01 and 1000.0, inclusive. diff --git a/google/ads/googleads/v11/common/types/criteria.py b/google/ads/googleads/v11/common/types/criteria.py index 020c19565..22919011f 100644 --- a/google/ads/googleads/v11/common/types/criteria.py +++ b/google/ads/googleads/v11/common/types/criteria.py @@ -132,11 +132,7 @@ class KeywordInfo(proto.Message): The match type of the keyword. """ - text = proto.Field( - proto.STRING, - number=3, - optional=True, - ) + text = proto.Field(proto.STRING, number=3, optional=True,) match_type = proto.Field( proto.ENUM, number=2, @@ -156,11 +152,7 @@ class PlacementInfo(proto.Message): This field is a member of `oneof`_ ``_url``. """ - url = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + url = proto.Field(proto.STRING, number=2, optional=True,) class MobileAppCategoryInfo(proto.Message): @@ -175,9 +167,7 @@ class MobileAppCategoryInfo(proto.Message): """ mobile_app_category_constant = proto.Field( - proto.STRING, - number=2, - optional=True, + proto.STRING, number=2, optional=True, ) @@ -193,12 +183,12 @@ class MobileApplicationInfo(proto.Message): platform_native_id is the mobile application identifier native to the corresponding platform. For iOS, this native identifier is the 9 digit string that appears at the end of - an App Store URL (e.g., "476943146" for "Flood-It! 2" whose - App Store link is + an App Store URL (for example, "476943146" for "Flood-It! 2" + whose App Store link is "http://itunes.apple.com/us/app/flood-it!-2/id476943146"). For Android, this native identifier is the application's - package name (e.g., "com.labpixies.colordrips" for "Color - Drips" given Google Play link + package name (for example, "com.labpixies.colordrips" for + "Color Drips" given Google Play link "https://play.google.com/store/apps/details?id=com.labpixies.colordrips"). A well formed app id for Google Ads API would thus be "1-476943146" for iOS and "2-com.labpixies.colordrips" for @@ -212,16 +202,8 @@ class MobileApplicationInfo(proto.Message): This field is a member of `oneof`_ ``_name``. """ - app_id = proto.Field( - proto.STRING, - number=4, - optional=True, - ) - name = proto.Field( - proto.STRING, - number=5, - optional=True, - ) + app_id = proto.Field(proto.STRING, number=4, optional=True,) + name = proto.Field(proto.STRING, number=5, optional=True,) class LocationInfo(proto.Message): @@ -234,11 +216,7 @@ class LocationInfo(proto.Message): This field is a member of `oneof`_ ``_geo_target_constant``. """ - geo_target_constant = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + geo_target_constant = proto.Field(proto.STRING, number=2, optional=True,) class DeviceInfo(proto.Message): @@ -249,11 +227,7 @@ class DeviceInfo(proto.Message): Type of the device. """ - type_ = proto.Field( - proto.ENUM, - number=1, - enum=device.DeviceEnum.Device, - ) + type_ = proto.Field(proto.ENUM, number=1, enum=device.DeviceEnum.Device,) class PreferredContentInfo(proto.Message): @@ -295,14 +269,10 @@ class ListingGroupInfo(proto.Message): enum=listing_group_type.ListingGroupTypeEnum.ListingGroupType, ) case_value = proto.Field( - proto.MESSAGE, - number=2, - message="ListingDimensionInfo", + proto.MESSAGE, number=2, message="ListingDimensionInfo", ) parent_ad_group_criterion = proto.Field( - proto.STRING, - number=4, - optional=True, + proto.STRING, number=4, optional=True, ) @@ -315,9 +285,7 @@ class ListingScopeInfo(proto.Message): """ dimensions = proto.RepeatedField( - proto.MESSAGE, - number=2, - message="ListingDimensionInfo", + proto.MESSAGE, number=2, message="ListingDimensionInfo", ) @@ -409,16 +377,10 @@ class ListingDimensionInfo(proto.Message): """ hotel_id = proto.Field( - proto.MESSAGE, - number=2, - oneof="dimension", - message="HotelIdInfo", + proto.MESSAGE, number=2, oneof="dimension", message="HotelIdInfo", ) hotel_class = proto.Field( - proto.MESSAGE, - number=3, - oneof="dimension", - message="HotelClassInfo", + proto.MESSAGE, number=3, oneof="dimension", message="HotelClassInfo", ) hotel_country_region = proto.Field( proto.MESSAGE, @@ -427,16 +389,10 @@ class ListingDimensionInfo(proto.Message): message="HotelCountryRegionInfo", ) hotel_state = proto.Field( - proto.MESSAGE, - number=5, - oneof="dimension", - message="HotelStateInfo", + proto.MESSAGE, number=5, oneof="dimension", message="HotelStateInfo", ) hotel_city = proto.Field( - proto.MESSAGE, - number=6, - oneof="dimension", - message="HotelCityInfo", + proto.MESSAGE, number=6, oneof="dimension", message="HotelCityInfo", ) product_bidding_category = proto.Field( proto.MESSAGE, @@ -445,10 +401,7 @@ class ListingDimensionInfo(proto.Message): message="ProductBiddingCategoryInfo", ) product_brand = proto.Field( - proto.MESSAGE, - number=15, - oneof="dimension", - message="ProductBrandInfo", + proto.MESSAGE, number=15, oneof="dimension", message="ProductBrandInfo", ) product_channel = proto.Field( proto.MESSAGE, @@ -481,10 +434,7 @@ class ListingDimensionInfo(proto.Message): message="ProductItemIdInfo", ) product_type = proto.Field( - proto.MESSAGE, - number=12, - oneof="dimension", - message="ProductTypeInfo", + proto.MESSAGE, number=12, oneof="dimension", message="ProductTypeInfo", ) product_grouping = proto.Field( proto.MESSAGE, @@ -528,11 +478,7 @@ class HotelIdInfo(proto.Message): This field is a member of `oneof`_ ``_value``. """ - value = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + value = proto.Field(proto.STRING, number=2, optional=True,) class HotelClassInfo(proto.Message): @@ -545,11 +491,7 @@ class HotelClassInfo(proto.Message): This field is a member of `oneof`_ ``_value``. """ - value = proto.Field( - proto.INT64, - number=2, - optional=True, - ) + value = proto.Field(proto.INT64, number=2, optional=True,) class HotelCountryRegionInfo(proto.Message): @@ -563,9 +505,7 @@ class HotelCountryRegionInfo(proto.Message): """ country_region_criterion = proto.Field( - proto.STRING, - number=2, - optional=True, + proto.STRING, number=2, optional=True, ) @@ -579,11 +519,7 @@ class HotelStateInfo(proto.Message): This field is a member of `oneof`_ ``_state_criterion``. """ - state_criterion = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + state_criterion = proto.Field(proto.STRING, number=2, optional=True,) class HotelCityInfo(proto.Message): @@ -596,11 +532,7 @@ class HotelCityInfo(proto.Message): This field is a member of `oneof`_ ``_city_criterion``. """ - city_criterion = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + city_criterion = proto.Field(proto.STRING, number=2, optional=True,) class ProductBiddingCategoryInfo(proto.Message): @@ -625,16 +557,8 @@ class ProductBiddingCategoryInfo(proto.Message): Level of the product bidding category. """ - id = proto.Field( - proto.INT64, - number=4, - optional=True, - ) - country_code = proto.Field( - proto.STRING, - number=5, - optional=True, - ) + id = proto.Field(proto.INT64, number=4, optional=True,) + country_code = proto.Field(proto.STRING, number=5, optional=True,) level = proto.Field( proto.ENUM, number=3, @@ -652,11 +576,7 @@ class ProductBrandInfo(proto.Message): This field is a member of `oneof`_ ``_value``. """ - value = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + value = proto.Field(proto.STRING, number=2, optional=True,) class ProductChannelInfo(proto.Message): @@ -716,11 +636,7 @@ class ProductCustomAttributeInfo(proto.Message): Indicates the index of the custom attribute. """ - value = proto.Field( - proto.STRING, - number=3, - optional=True, - ) + value = proto.Field(proto.STRING, number=3, optional=True,) index = proto.Field( proto.ENUM, number=2, @@ -738,11 +654,7 @@ class ProductItemIdInfo(proto.Message): This field is a member of `oneof`_ ``_value``. """ - value = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + value = proto.Field(proto.STRING, number=2, optional=True,) class ProductTypeInfo(proto.Message): @@ -757,11 +669,7 @@ class ProductTypeInfo(proto.Message): Level of the type. """ - value = proto.Field( - proto.STRING, - number=3, - optional=True, - ) + value = proto.Field(proto.STRING, number=3, optional=True,) level = proto.Field( proto.ENUM, number=2, @@ -780,11 +688,7 @@ class ProductGroupingInfo(proto.Message): This field is a member of `oneof`_ ``_value``. """ - value = proto.Field( - proto.STRING, - number=1, - optional=True, - ) + value = proto.Field(proto.STRING, number=1, optional=True,) class ProductLabelsInfo(proto.Message): @@ -798,11 +702,7 @@ class ProductLabelsInfo(proto.Message): This field is a member of `oneof`_ ``_value``. """ - value = proto.Field( - proto.STRING, - number=1, - optional=True, - ) + value = proto.Field(proto.STRING, number=1, optional=True,) class ProductLegacyConditionInfo(proto.Message): @@ -816,11 +716,7 @@ class ProductLegacyConditionInfo(proto.Message): This field is a member of `oneof`_ ``_value``. """ - value = proto.Field( - proto.STRING, - number=1, - optional=True, - ) + value = proto.Field(proto.STRING, number=1, optional=True,) class ProductTypeFullInfo(proto.Message): @@ -834,19 +730,16 @@ class ProductTypeFullInfo(proto.Message): This field is a member of `oneof`_ ``_value``. """ - value = proto.Field( - proto.STRING, - number=1, - optional=True, - ) + value = proto.Field(proto.STRING, number=1, optional=True,) class UnknownListingDimensionInfo(proto.Message): - r"""Unknown listing dimension.""" + r"""Unknown listing dimension. + """ class HotelDateSelectionTypeInfo(proto.Message): - r"""Criterion for hotel date selection (default dates vs. user + r"""Criterion for hotel date selection (default dates versus user selected). Attributes: @@ -878,16 +771,8 @@ class HotelAdvanceBookingWindowInfo(proto.Message): This field is a member of `oneof`_ ``_max_days``. """ - min_days = proto.Field( - proto.INT64, - number=3, - optional=True, - ) - max_days = proto.Field( - proto.INT64, - number=4, - optional=True, - ) + min_days = proto.Field(proto.INT64, number=3, optional=True,) + max_days = proto.Field(proto.INT64, number=4, optional=True,) class HotelLengthOfStayInfo(proto.Message): @@ -904,16 +789,8 @@ class HotelLengthOfStayInfo(proto.Message): This field is a member of `oneof`_ ``_max_nights``. """ - min_nights = proto.Field( - proto.INT64, - number=3, - optional=True, - ) - max_nights = proto.Field( - proto.INT64, - number=4, - optional=True, - ) + min_nights = proto.Field(proto.INT64, number=3, optional=True,) + max_nights = proto.Field(proto.INT64, number=4, optional=True,) class HotelCheckInDateRangeInfo(proto.Message): @@ -926,14 +803,8 @@ class HotelCheckInDateRangeInfo(proto.Message): End date in the YYYY-MM-DD format. """ - start_date = proto.Field( - proto.STRING, - number=1, - ) - end_date = proto.Field( - proto.STRING, - number=2, - ) + start_date = proto.Field(proto.STRING, number=1,) + end_date = proto.Field(proto.STRING, number=2,) class HotelCheckInDayInfo(proto.Message): @@ -945,9 +816,7 @@ class HotelCheckInDayInfo(proto.Message): """ day_of_week = proto.Field( - proto.ENUM, - number=1, - enum=gage_day_of_week.DayOfWeekEnum.DayOfWeek, + proto.ENUM, number=1, enum=gage_day_of_week.DayOfWeekEnum.DayOfWeek, ) @@ -1007,29 +876,15 @@ class AdScheduleInfo(proto.Message): """ start_minute = proto.Field( - proto.ENUM, - number=1, - enum=minute_of_hour.MinuteOfHourEnum.MinuteOfHour, + proto.ENUM, number=1, enum=minute_of_hour.MinuteOfHourEnum.MinuteOfHour, ) end_minute = proto.Field( - proto.ENUM, - number=2, - enum=minute_of_hour.MinuteOfHourEnum.MinuteOfHour, - ) - start_hour = proto.Field( - proto.INT32, - number=6, - optional=True, - ) - end_hour = proto.Field( - proto.INT32, - number=7, - optional=True, + proto.ENUM, number=2, enum=minute_of_hour.MinuteOfHourEnum.MinuteOfHour, ) + start_hour = proto.Field(proto.INT32, number=6, optional=True,) + end_hour = proto.Field(proto.INT32, number=7, optional=True,) day_of_week = proto.Field( - proto.ENUM, - number=5, - enum=gage_day_of_week.DayOfWeekEnum.DayOfWeek, + proto.ENUM, number=5, enum=gage_day_of_week.DayOfWeekEnum.DayOfWeek, ) @@ -1042,9 +897,7 @@ class AgeRangeInfo(proto.Message): """ type_ = proto.Field( - proto.ENUM, - number=1, - enum=age_range_type.AgeRangeTypeEnum.AgeRangeType, + proto.ENUM, number=1, enum=age_range_type.AgeRangeTypeEnum.AgeRangeType, ) @@ -1057,9 +910,7 @@ class GenderInfo(proto.Message): """ type_ = proto.Field( - proto.ENUM, - number=1, - enum=gender_type.GenderTypeEnum.GenderType, + proto.ENUM, number=1, enum=gender_type.GenderTypeEnum.GenderType, ) @@ -1104,11 +955,7 @@ class YouTubeVideoInfo(proto.Message): This field is a member of `oneof`_ ``_video_id``. """ - video_id = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + video_id = proto.Field(proto.STRING, number=2, optional=True,) class YouTubeChannelInfo(proto.Message): @@ -1122,11 +969,7 @@ class YouTubeChannelInfo(proto.Message): This field is a member of `oneof`_ ``_channel_id``. """ - channel_id = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + channel_id = proto.Field(proto.STRING, number=2, optional=True,) class UserListInfo(proto.Message): @@ -1140,11 +983,7 @@ class UserListInfo(proto.Message): This field is a member of `oneof`_ ``_user_list``. """ - user_list = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + user_list = proto.Field(proto.STRING, number=2, optional=True,) class ProximityInfo(proto.Message): @@ -1171,26 +1010,14 @@ class ProximityInfo(proto.Message): Full address. """ - geo_point = proto.Field( - proto.MESSAGE, - number=1, - message="GeoPointInfo", - ) - radius = proto.Field( - proto.DOUBLE, - number=5, - optional=True, - ) + geo_point = proto.Field(proto.MESSAGE, number=1, message="GeoPointInfo",) + radius = proto.Field(proto.DOUBLE, number=5, optional=True,) radius_units = proto.Field( proto.ENUM, number=3, enum=proximity_radius_units.ProximityRadiusUnitsEnum.ProximityRadiusUnits, ) - address = proto.Field( - proto.MESSAGE, - number=4, - message="AddressInfo", - ) + address = proto.Field(proto.MESSAGE, number=4, message="AddressInfo",) class GeoPointInfo(proto.Message): @@ -1208,14 +1035,10 @@ class GeoPointInfo(proto.Message): """ longitude_in_micro_degrees = proto.Field( - proto.INT32, - number=3, - optional=True, + proto.INT32, number=3, optional=True, ) latitude_in_micro_degrees = proto.Field( - proto.INT32, - number=4, - optional=True, + proto.INT32, number=4, optional=True, ) @@ -1255,41 +1078,13 @@ class AddressInfo(proto.Message): This field is a member of `oneof`_ ``_city_name``. """ - postal_code = proto.Field( - proto.STRING, - number=8, - optional=True, - ) - province_code = proto.Field( - proto.STRING, - number=9, - optional=True, - ) - country_code = proto.Field( - proto.STRING, - number=10, - optional=True, - ) - province_name = proto.Field( - proto.STRING, - number=11, - optional=True, - ) - street_address = proto.Field( - proto.STRING, - number=12, - optional=True, - ) - street_address2 = proto.Field( - proto.STRING, - number=13, - optional=True, - ) - city_name = proto.Field( - proto.STRING, - number=14, - optional=True, - ) + postal_code = proto.Field(proto.STRING, number=8, optional=True,) + province_code = proto.Field(proto.STRING, number=9, optional=True,) + country_code = proto.Field(proto.STRING, number=10, optional=True,) + province_name = proto.Field(proto.STRING, number=11, optional=True,) + street_address = proto.Field(proto.STRING, number=12, optional=True,) + street_address2 = proto.Field(proto.STRING, number=13, optional=True,) + city_name = proto.Field(proto.STRING, number=14, optional=True,) class TopicInfo(proto.Message): @@ -1310,15 +1105,8 @@ class TopicInfo(proto.Message): Animals/Pets/Dogs" category. """ - topic_constant = proto.Field( - proto.STRING, - number=3, - optional=True, - ) - path = proto.RepeatedField( - proto.STRING, - number=4, - ) + topic_constant = proto.Field(proto.STRING, number=3, optional=True,) + path = proto.RepeatedField(proto.STRING, number=4,) class LanguageInfo(proto.Message): @@ -1331,11 +1119,7 @@ class LanguageInfo(proto.Message): This field is a member of `oneof`_ ``_language_constant``. """ - language_constant = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + language_constant = proto.Field(proto.STRING, number=2, optional=True,) class IpBlockInfo(proto.Message): @@ -1352,11 +1136,7 @@ class IpBlockInfo(proto.Message): This field is a member of `oneof`_ ``_ip_address``. """ - ip_address = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + ip_address = proto.Field(proto.STRING, number=2, optional=True,) class ContentLabelInfo(proto.Message): @@ -1385,11 +1165,7 @@ class CarrierInfo(proto.Message): This field is a member of `oneof`_ ``_carrier_constant``. """ - carrier_constant = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + carrier_constant = proto.Field(proto.STRING, number=2, optional=True,) class UserInterestInfo(proto.Message): @@ -1402,11 +1178,7 @@ class UserInterestInfo(proto.Message): This field is a member of `oneof`_ ``_user_interest_category``. """ - user_interest_category = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + user_interest_category = proto.Field(proto.STRING, number=2, optional=True,) class WebpageInfo(proto.Message): @@ -1447,25 +1219,12 @@ class WebpageInfo(proto.Message): target. This field is read-only. """ - criterion_name = proto.Field( - proto.STRING, - number=3, - optional=True, - ) + criterion_name = proto.Field(proto.STRING, number=3, optional=True,) conditions = proto.RepeatedField( - proto.MESSAGE, - number=2, - message="WebpageConditionInfo", - ) - coverage_percentage = proto.Field( - proto.DOUBLE, - number=4, - ) - sample = proto.Field( - proto.MESSAGE, - number=5, - message="WebpageSampleInfo", + proto.MESSAGE, number=2, message="WebpageConditionInfo", ) + coverage_percentage = proto.Field(proto.DOUBLE, number=4,) + sample = proto.Field(proto.MESSAGE, number=5, message="WebpageSampleInfo",) class WebpageConditionInfo(proto.Message): @@ -1493,11 +1252,7 @@ class WebpageConditionInfo(proto.Message): number=2, enum=webpage_condition_operator.WebpageConditionOperatorEnum.WebpageConditionOperator, ) - argument = proto.Field( - proto.STRING, - number=4, - optional=True, - ) + argument = proto.Field(proto.STRING, number=4, optional=True,) class WebpageSampleInfo(proto.Message): @@ -1508,10 +1263,7 @@ class WebpageSampleInfo(proto.Message): Webpage sample urls """ - sample_urls = proto.RepeatedField( - proto.STRING, - number=1, - ) + sample_urls = proto.RepeatedField(proto.STRING, number=1,) class OperatingSystemVersionInfo(proto.Message): @@ -1526,9 +1278,7 @@ class OperatingSystemVersionInfo(proto.Message): """ operating_system_version_constant = proto.Field( - proto.STRING, - number=2, - optional=True, + proto.STRING, number=2, optional=True, ) @@ -1557,11 +1307,7 @@ class MobileDeviceInfo(proto.Message): This field is a member of `oneof`_ ``_mobile_device_constant``. """ - mobile_device_constant = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + mobile_device_constant = proto.Field(proto.STRING, number=2, optional=True,) class CustomAffinityInfo(proto.Message): @@ -1575,11 +1321,7 @@ class CustomAffinityInfo(proto.Message): This field is a member of `oneof`_ ``_custom_affinity``. """ - custom_affinity = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + custom_affinity = proto.Field(proto.STRING, number=2, optional=True,) class CustomIntentInfo(proto.Message): @@ -1593,15 +1335,11 @@ class CustomIntentInfo(proto.Message): This field is a member of `oneof`_ ``_custom_intent``. """ - custom_intent = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + custom_intent = proto.Field(proto.STRING, number=2, optional=True,) class LocationGroupInfo(proto.Message): - r"""A radius around a list of locations specified via a feed. + r"""A radius around a list of locations specified through a feed. Attributes: feed (str): @@ -1635,29 +1373,15 @@ class LocationGroupInfo(proto.Message): in CREATE operations. """ - feed = proto.Field( - proto.STRING, - number=5, - optional=True, - ) - geo_target_constants = proto.RepeatedField( - proto.STRING, - number=6, - ) - radius = proto.Field( - proto.INT64, - number=7, - optional=True, - ) + feed = proto.Field(proto.STRING, number=5, optional=True,) + geo_target_constants = proto.RepeatedField(proto.STRING, number=6,) + radius = proto.Field(proto.INT64, number=7, optional=True,) radius_units = proto.Field( proto.ENUM, number=4, enum=location_group_radius_units.LocationGroupRadiusUnitsEnum.LocationGroupRadiusUnits, ) - feed_item_sets = proto.RepeatedField( - proto.STRING, - number=8, - ) + feed_item_sets = proto.RepeatedField(proto.STRING, number=8,) class CustomAudienceInfo(proto.Message): @@ -1668,10 +1392,7 @@ class CustomAudienceInfo(proto.Message): The CustomAudience resource name. """ - custom_audience = proto.Field( - proto.STRING, - number=1, - ) + custom_audience = proto.Field(proto.STRING, number=1,) class CombinedAudienceInfo(proto.Message): @@ -1682,10 +1403,7 @@ class CombinedAudienceInfo(proto.Message): The CombinedAudience resource name. """ - combined_audience = proto.Field( - proto.STRING, - number=1, - ) + combined_audience = proto.Field(proto.STRING, number=1,) class AudienceInfo(proto.Message): @@ -1696,10 +1414,7 @@ class AudienceInfo(proto.Message): The Audience resource name. """ - audience = proto.Field( - proto.STRING, - number=1, - ) + audience = proto.Field(proto.STRING, number=1,) class KeywordThemeInfo(proto.Message): @@ -1728,14 +1443,10 @@ class KeywordThemeInfo(proto.Message): """ keyword_theme_constant = proto.Field( - proto.STRING, - number=1, - oneof="keyword_theme", + proto.STRING, number=1, oneof="keyword_theme", ) free_form_keyword_theme = proto.Field( - proto.STRING, - number=2, - oneof="keyword_theme", + proto.STRING, number=2, oneof="keyword_theme", ) diff --git a/google/ads/googleads/v11/common/types/dates.py b/google/ads/googleads/v11/common/types/dates.py index f0c6e1b1b..a197453a5 100644 --- a/google/ads/googleads/v11/common/types/dates.py +++ b/google/ads/googleads/v11/common/types/dates.py @@ -66,9 +66,10 @@ class YearMonth(proto.Message): Attributes: year (int): - The year (e.g. 2020). + The year (for example, 2020). month (google.ads.googleads.v11.enums.types.MonthOfYearEnum.MonthOfYear): - The month of the year. (e.g. FEBRUARY). + The month of the year. (for example, + FEBRUARY). """ year = proto.Field(proto.INT64, number=1,) diff --git a/google/ads/googleads/v11/common/types/frequency_cap.py b/google/ads/googleads/v11/common/types/frequency_cap.py index f6e552bd3..d402f3a02 100644 --- a/google/ads/googleads/v11/common/types/frequency_cap.py +++ b/google/ads/googleads/v11/common/types/frequency_cap.py @@ -55,14 +55,14 @@ class FrequencyCapKey(proto.Message): Attributes: level (google.ads.googleads.v11.enums.types.FrequencyCapLevelEnum.FrequencyCapLevel): The level on which the cap is to be applied - (e.g. ad group ad, ad group). The cap is applied - to all the entities of this level. + (for example, ad group ad, ad group). The cap is + applied to all the entities of this level. event_type (google.ads.googleads.v11.enums.types.FrequencyCapEventTypeEnum.FrequencyCapEventType): The type of event that the cap applies to - (e.g. impression). + (for example, impression). time_unit (google.ads.googleads.v11.enums.types.FrequencyCapTimeUnitEnum.FrequencyCapTimeUnit): - Unit of time the cap is defined at (e.g. day, - week). + Unit of time the cap is defined at (for + example, day, week). time_length (int): Number of time units the cap lasts. diff --git a/google/ads/googleads/v11/common/types/keyword_plan_common.py b/google/ads/googleads/v11/common/types/keyword_plan_common.py index b0d20ec9c..6ad666598 100644 --- a/google/ads/googleads/v11/common/types/keyword_plan_common.py +++ b/google/ads/googleads/v11/common/types/keyword_plan_common.py @@ -137,7 +137,8 @@ class MonthlySearchVolume(proto.Message): Attributes: year (int): - The year of the search volume (e.g. 2020). + The year of the search volume (for example, + 2020). This field is a member of `oneof`_ ``_year``. month (google.ads.googleads.v11.enums.types.MonthOfYearEnum.MonthOfYear): diff --git a/google/ads/googleads/v11/common/types/metrics.py b/google/ads/googleads/v11/common/types/metrics.py index 8c1c5ea8e..98d4ed3d1 100644 --- a/google/ads/googleads/v11/common/types/metrics.py +++ b/google/ads/googleads/v11/common/types/metrics.py @@ -22,9 +22,7 @@ __protobuf__ = proto.module( package="google.ads.googleads.v11.common", marshal="google.ads.googleads.v11", - manifest={ - "Metrics", - }, + manifest={"Metrics",}, ) @@ -338,10 +336,10 @@ class Metrics(proto.Message): conversion action successfully fired and was seen by Google Ads. This firing event may not have been the result of an attributable - conversion (e.g. because the tag was fired from - a browser that did not previously click an ad - from an appropriate advertiser). The date/time - is in the customer's time zone. + conversion (for example, because the tag was + fired from a browser that did not previously + click an ad from an appropriate advertiser). The + date/time is in the customer's time zone. This field is a member of `oneof`_ ``_conversion_last_received_request_date_time``. conversion_last_conversion_date (str): @@ -913,8 +911,8 @@ class Metrics(proto.Message): The total number of view-through conversions. These happen when a customer sees an image or rich media ad, then later completes a conversion - on your site without interacting with (e.g., - clicking on) another ad. + on your site without interacting with (for + example, clicking on) another ad. This field is a member of `oneof`_ ``_view_through_conversions``. sk_ad_network_conversions (int): @@ -923,370 +921,178 @@ class Metrics(proto.Message): """ absolute_top_impression_percentage = proto.Field( - proto.DOUBLE, - number=183, - optional=True, - ) - active_view_cpm = proto.Field( - proto.DOUBLE, - number=184, - optional=True, - ) - active_view_ctr = proto.Field( - proto.DOUBLE, - number=185, - optional=True, + proto.DOUBLE, number=183, optional=True, ) + active_view_cpm = proto.Field(proto.DOUBLE, number=184, optional=True,) + active_view_ctr = proto.Field(proto.DOUBLE, number=185, optional=True,) active_view_impressions = proto.Field( - proto.INT64, - number=186, - optional=True, + proto.INT64, number=186, optional=True, ) active_view_measurability = proto.Field( - proto.DOUBLE, - number=187, - optional=True, + proto.DOUBLE, number=187, optional=True, ) active_view_measurable_cost_micros = proto.Field( - proto.INT64, - number=188, - optional=True, + proto.INT64, number=188, optional=True, ) active_view_measurable_impressions = proto.Field( - proto.INT64, - number=189, - optional=True, + proto.INT64, number=189, optional=True, ) active_view_viewability = proto.Field( - proto.DOUBLE, - number=190, - optional=True, + proto.DOUBLE, number=190, optional=True, ) all_conversions_from_interactions_rate = proto.Field( - proto.DOUBLE, - number=191, - optional=True, + proto.DOUBLE, number=191, optional=True, ) all_conversions_value = proto.Field( - proto.DOUBLE, - number=192, - optional=True, + proto.DOUBLE, number=192, optional=True, ) all_conversions_value_by_conversion_date = proto.Field( - proto.DOUBLE, - number=240, - ) - all_conversions = proto.Field( - proto.DOUBLE, - number=193, - optional=True, - ) - all_conversions_by_conversion_date = proto.Field( - proto.DOUBLE, - number=241, + proto.DOUBLE, number=240, ) + all_conversions = proto.Field(proto.DOUBLE, number=193, optional=True,) + all_conversions_by_conversion_date = proto.Field(proto.DOUBLE, number=241,) all_conversions_value_per_cost = proto.Field( - proto.DOUBLE, - number=194, - optional=True, + proto.DOUBLE, number=194, optional=True, ) all_conversions_from_click_to_call = proto.Field( - proto.DOUBLE, - number=195, - optional=True, + proto.DOUBLE, number=195, optional=True, ) all_conversions_from_directions = proto.Field( - proto.DOUBLE, - number=196, - optional=True, + proto.DOUBLE, number=196, optional=True, ) all_conversions_from_interactions_value_per_interaction = proto.Field( - proto.DOUBLE, - number=197, - optional=True, + proto.DOUBLE, number=197, optional=True, ) all_conversions_from_menu = proto.Field( - proto.DOUBLE, - number=198, - optional=True, + proto.DOUBLE, number=198, optional=True, ) all_conversions_from_order = proto.Field( - proto.DOUBLE, - number=199, - optional=True, + proto.DOUBLE, number=199, optional=True, ) all_conversions_from_other_engagement = proto.Field( - proto.DOUBLE, - number=200, - optional=True, + proto.DOUBLE, number=200, optional=True, ) all_conversions_from_store_visit = proto.Field( - proto.DOUBLE, - number=201, - optional=True, + proto.DOUBLE, number=201, optional=True, ) all_conversions_from_store_website = proto.Field( - proto.DOUBLE, - number=202, - optional=True, + proto.DOUBLE, number=202, optional=True, ) auction_insight_search_absolute_top_impression_percentage = proto.Field( - proto.DOUBLE, - number=258, - optional=True, + proto.DOUBLE, number=258, optional=True, ) auction_insight_search_impression_share = proto.Field( - proto.DOUBLE, - number=259, - optional=True, + proto.DOUBLE, number=259, optional=True, ) auction_insight_search_outranking_share = proto.Field( - proto.DOUBLE, - number=260, - optional=True, + proto.DOUBLE, number=260, optional=True, ) auction_insight_search_overlap_rate = proto.Field( - proto.DOUBLE, - number=261, - optional=True, + proto.DOUBLE, number=261, optional=True, ) auction_insight_search_position_above_rate = proto.Field( - proto.DOUBLE, - number=262, - optional=True, + proto.DOUBLE, number=262, optional=True, ) auction_insight_search_top_impression_percentage = proto.Field( - proto.DOUBLE, - number=263, - optional=True, - ) - average_cost = proto.Field( - proto.DOUBLE, - number=203, - optional=True, - ) - average_cpc = proto.Field( - proto.DOUBLE, - number=204, - optional=True, - ) - average_cpe = proto.Field( - proto.DOUBLE, - number=205, - optional=True, - ) - average_cpm = proto.Field( - proto.DOUBLE, - number=206, - optional=True, - ) - average_cpv = proto.Field( - proto.DOUBLE, - number=207, - optional=True, - ) - average_page_views = proto.Field( - proto.DOUBLE, - number=208, - optional=True, - ) - average_time_on_site = proto.Field( - proto.DOUBLE, - number=209, - optional=True, - ) + proto.DOUBLE, number=263, optional=True, + ) + average_cost = proto.Field(proto.DOUBLE, number=203, optional=True,) + average_cpc = proto.Field(proto.DOUBLE, number=204, optional=True,) + average_cpe = proto.Field(proto.DOUBLE, number=205, optional=True,) + average_cpm = proto.Field(proto.DOUBLE, number=206, optional=True,) + average_cpv = proto.Field(proto.DOUBLE, number=207, optional=True,) + average_page_views = proto.Field(proto.DOUBLE, number=208, optional=True,) + average_time_on_site = proto.Field(proto.DOUBLE, number=209, optional=True,) benchmark_average_max_cpc = proto.Field( - proto.DOUBLE, - number=210, - optional=True, + proto.DOUBLE, number=210, optional=True, ) biddable_app_install_conversions = proto.Field( - proto.DOUBLE, - number=254, - optional=True, + proto.DOUBLE, number=254, optional=True, ) biddable_app_post_install_conversions = proto.Field( - proto.DOUBLE, - number=255, - optional=True, - ) - benchmark_ctr = proto.Field( - proto.DOUBLE, - number=211, - optional=True, - ) - bounce_rate = proto.Field( - proto.DOUBLE, - number=212, - optional=True, - ) - clicks = proto.Field( - proto.INT64, - number=131, - optional=True, - ) - combined_clicks = proto.Field( - proto.INT64, - number=156, - optional=True, + proto.DOUBLE, number=255, optional=True, ) + benchmark_ctr = proto.Field(proto.DOUBLE, number=211, optional=True,) + bounce_rate = proto.Field(proto.DOUBLE, number=212, optional=True,) + clicks = proto.Field(proto.INT64, number=131, optional=True,) + combined_clicks = proto.Field(proto.INT64, number=156, optional=True,) combined_clicks_per_query = proto.Field( - proto.DOUBLE, - number=157, - optional=True, - ) - combined_queries = proto.Field( - proto.INT64, - number=158, - optional=True, + proto.DOUBLE, number=157, optional=True, ) + combined_queries = proto.Field(proto.INT64, number=158, optional=True,) content_budget_lost_impression_share = proto.Field( - proto.DOUBLE, - number=159, - optional=True, + proto.DOUBLE, number=159, optional=True, ) content_impression_share = proto.Field( - proto.DOUBLE, - number=160, - optional=True, + proto.DOUBLE, number=160, optional=True, ) conversion_last_received_request_date_time = proto.Field( - proto.STRING, - number=161, - optional=True, + proto.STRING, number=161, optional=True, ) conversion_last_conversion_date = proto.Field( - proto.STRING, - number=162, - optional=True, + proto.STRING, number=162, optional=True, ) content_rank_lost_impression_share = proto.Field( - proto.DOUBLE, - number=163, - optional=True, + proto.DOUBLE, number=163, optional=True, ) conversions_from_interactions_rate = proto.Field( - proto.DOUBLE, - number=164, - optional=True, - ) - conversions_value = proto.Field( - proto.DOUBLE, - number=165, - optional=True, + proto.DOUBLE, number=164, optional=True, ) + conversions_value = proto.Field(proto.DOUBLE, number=165, optional=True,) conversions_value_by_conversion_date = proto.Field( - proto.DOUBLE, - number=242, + proto.DOUBLE, number=242, ) conversions_value_per_cost = proto.Field( - proto.DOUBLE, - number=166, - optional=True, + proto.DOUBLE, number=166, optional=True, ) conversions_from_interactions_value_per_interaction = proto.Field( - proto.DOUBLE, - number=167, - optional=True, - ) - conversions = proto.Field( - proto.DOUBLE, - number=168, - optional=True, - ) - conversions_by_conversion_date = proto.Field( - proto.DOUBLE, - number=243, - ) - cost_micros = proto.Field( - proto.INT64, - number=169, - optional=True, + proto.DOUBLE, number=167, optional=True, ) + conversions = proto.Field(proto.DOUBLE, number=168, optional=True,) + conversions_by_conversion_date = proto.Field(proto.DOUBLE, number=243,) + cost_micros = proto.Field(proto.INT64, number=169, optional=True,) cost_per_all_conversions = proto.Field( - proto.DOUBLE, - number=170, - optional=True, - ) - cost_per_conversion = proto.Field( - proto.DOUBLE, - number=171, - optional=True, + proto.DOUBLE, number=170, optional=True, ) + cost_per_conversion = proto.Field(proto.DOUBLE, number=171, optional=True,) cost_per_current_model_attributed_conversion = proto.Field( - proto.DOUBLE, - number=172, - optional=True, + proto.DOUBLE, number=172, optional=True, ) cross_device_conversions = proto.Field( - proto.DOUBLE, - number=173, - optional=True, - ) - ctr = proto.Field( - proto.DOUBLE, - number=174, - optional=True, + proto.DOUBLE, number=173, optional=True, ) + ctr = proto.Field(proto.DOUBLE, number=174, optional=True,) current_model_attributed_conversions = proto.Field( - proto.DOUBLE, - number=175, - optional=True, + proto.DOUBLE, number=175, optional=True, ) current_model_attributed_conversions_from_interactions_rate = proto.Field( - proto.DOUBLE, - number=176, - optional=True, + proto.DOUBLE, number=176, optional=True, ) current_model_attributed_conversions_from_interactions_value_per_interaction = proto.Field( - proto.DOUBLE, - number=177, - optional=True, + proto.DOUBLE, number=177, optional=True, ) current_model_attributed_conversions_value = proto.Field( - proto.DOUBLE, - number=178, - optional=True, + proto.DOUBLE, number=178, optional=True, ) current_model_attributed_conversions_value_per_cost = proto.Field( - proto.DOUBLE, - number=179, - optional=True, - ) - engagement_rate = proto.Field( - proto.DOUBLE, - number=180, - optional=True, - ) - engagements = proto.Field( - proto.INT64, - number=181, - optional=True, + proto.DOUBLE, number=179, optional=True, ) + engagement_rate = proto.Field(proto.DOUBLE, number=180, optional=True,) + engagements = proto.Field(proto.INT64, number=181, optional=True,) hotel_average_lead_value_micros = proto.Field( - proto.DOUBLE, - number=213, - optional=True, + proto.DOUBLE, number=213, optional=True, ) hotel_commission_rate_micros = proto.Field( - proto.INT64, - number=256, - optional=True, + proto.INT64, number=256, optional=True, ) hotel_expected_commission_cost = proto.Field( - proto.DOUBLE, - number=257, - optional=True, + proto.DOUBLE, number=257, optional=True, ) hotel_price_difference_percentage = proto.Field( - proto.DOUBLE, - number=214, - optional=True, + proto.DOUBLE, number=214, optional=True, ) hotel_eligible_impressions = proto.Field( - proto.INT64, - number=215, - optional=True, + proto.INT64, number=215, optional=True, ) historical_creative_quality_score = proto.Field( proto.ENUM, @@ -1299,279 +1105,126 @@ class Metrics(proto.Message): enum=quality_score_bucket.QualityScoreBucketEnum.QualityScoreBucket, ) historical_quality_score = proto.Field( - proto.INT64, - number=216, - optional=True, + proto.INT64, number=216, optional=True, ) historical_search_predicted_ctr = proto.Field( proto.ENUM, number=83, enum=quality_score_bucket.QualityScoreBucketEnum.QualityScoreBucket, ) - gmail_forwards = proto.Field( - proto.INT64, - number=217, - optional=True, - ) - gmail_saves = proto.Field( - proto.INT64, - number=218, - optional=True, - ) + gmail_forwards = proto.Field(proto.INT64, number=217, optional=True,) + gmail_saves = proto.Field(proto.INT64, number=218, optional=True,) gmail_secondary_clicks = proto.Field( - proto.INT64, - number=219, - optional=True, + proto.INT64, number=219, optional=True, ) impressions_from_store_reach = proto.Field( - proto.INT64, - number=220, - optional=True, - ) - impressions = proto.Field( - proto.INT64, - number=221, - optional=True, - ) - interaction_rate = proto.Field( - proto.DOUBLE, - number=222, - optional=True, - ) - interactions = proto.Field( - proto.INT64, - number=223, - optional=True, + proto.INT64, number=220, optional=True, ) + impressions = proto.Field(proto.INT64, number=221, optional=True,) + interaction_rate = proto.Field(proto.DOUBLE, number=222, optional=True,) + interactions = proto.Field(proto.INT64, number=223, optional=True,) interaction_event_types = proto.RepeatedField( proto.ENUM, number=100, enum=interaction_event_type.InteractionEventTypeEnum.InteractionEventType, ) - invalid_click_rate = proto.Field( - proto.DOUBLE, - number=224, - optional=True, - ) - invalid_clicks = proto.Field( - proto.INT64, - number=225, - optional=True, - ) - message_chats = proto.Field( - proto.INT64, - number=226, - optional=True, - ) - message_impressions = proto.Field( - proto.INT64, - number=227, - optional=True, - ) - message_chat_rate = proto.Field( - proto.DOUBLE, - number=228, - optional=True, - ) + invalid_click_rate = proto.Field(proto.DOUBLE, number=224, optional=True,) + invalid_clicks = proto.Field(proto.INT64, number=225, optional=True,) + message_chats = proto.Field(proto.INT64, number=226, optional=True,) + message_impressions = proto.Field(proto.INT64, number=227, optional=True,) + message_chat_rate = proto.Field(proto.DOUBLE, number=228, optional=True,) mobile_friendly_clicks_percentage = proto.Field( - proto.DOUBLE, - number=229, - optional=True, + proto.DOUBLE, number=229, optional=True, ) optimization_score_uplift = proto.Field( - proto.DOUBLE, - number=247, - optional=True, + proto.DOUBLE, number=247, optional=True, ) optimization_score_url = proto.Field( - proto.STRING, - number=248, - optional=True, - ) - organic_clicks = proto.Field( - proto.INT64, - number=230, - optional=True, + proto.STRING, number=248, optional=True, ) + organic_clicks = proto.Field(proto.INT64, number=230, optional=True,) organic_clicks_per_query = proto.Field( - proto.DOUBLE, - number=231, - optional=True, - ) - organic_impressions = proto.Field( - proto.INT64, - number=232, - optional=True, + proto.DOUBLE, number=231, optional=True, ) + organic_impressions = proto.Field(proto.INT64, number=232, optional=True,) organic_impressions_per_query = proto.Field( - proto.DOUBLE, - number=233, - optional=True, - ) - organic_queries = proto.Field( - proto.INT64, - number=234, - optional=True, - ) - percent_new_visitors = proto.Field( - proto.DOUBLE, - number=235, - optional=True, - ) - phone_calls = proto.Field( - proto.INT64, - number=236, - optional=True, - ) - phone_impressions = proto.Field( - proto.INT64, - number=237, - optional=True, - ) - phone_through_rate = proto.Field( - proto.DOUBLE, - number=238, - optional=True, - ) - relative_ctr = proto.Field( - proto.DOUBLE, - number=239, - optional=True, - ) + proto.DOUBLE, number=233, optional=True, + ) + organic_queries = proto.Field(proto.INT64, number=234, optional=True,) + percent_new_visitors = proto.Field(proto.DOUBLE, number=235, optional=True,) + phone_calls = proto.Field(proto.INT64, number=236, optional=True,) + phone_impressions = proto.Field(proto.INT64, number=237, optional=True,) + phone_through_rate = proto.Field(proto.DOUBLE, number=238, optional=True,) + relative_ctr = proto.Field(proto.DOUBLE, number=239, optional=True,) search_absolute_top_impression_share = proto.Field( - proto.DOUBLE, - number=136, - optional=True, + proto.DOUBLE, number=136, optional=True, ) search_budget_lost_absolute_top_impression_share = proto.Field( - proto.DOUBLE, - number=137, - optional=True, + proto.DOUBLE, number=137, optional=True, ) search_budget_lost_impression_share = proto.Field( - proto.DOUBLE, - number=138, - optional=True, + proto.DOUBLE, number=138, optional=True, ) search_budget_lost_top_impression_share = proto.Field( - proto.DOUBLE, - number=139, - optional=True, - ) - search_click_share = proto.Field( - proto.DOUBLE, - number=140, - optional=True, + proto.DOUBLE, number=139, optional=True, ) + search_click_share = proto.Field(proto.DOUBLE, number=140, optional=True,) search_exact_match_impression_share = proto.Field( - proto.DOUBLE, - number=141, - optional=True, + proto.DOUBLE, number=141, optional=True, ) search_impression_share = proto.Field( - proto.DOUBLE, - number=142, - optional=True, + proto.DOUBLE, number=142, optional=True, ) search_rank_lost_absolute_top_impression_share = proto.Field( - proto.DOUBLE, - number=143, - optional=True, + proto.DOUBLE, number=143, optional=True, ) search_rank_lost_impression_share = proto.Field( - proto.DOUBLE, - number=144, - optional=True, + proto.DOUBLE, number=144, optional=True, ) search_rank_lost_top_impression_share = proto.Field( - proto.DOUBLE, - number=145, - optional=True, + proto.DOUBLE, number=145, optional=True, ) search_top_impression_share = proto.Field( - proto.DOUBLE, - number=146, - optional=True, - ) - speed_score = proto.Field( - proto.INT64, - number=147, - optional=True, + proto.DOUBLE, number=146, optional=True, ) + speed_score = proto.Field(proto.INT64, number=147, optional=True,) top_impression_percentage = proto.Field( - proto.DOUBLE, - number=148, - optional=True, + proto.DOUBLE, number=148, optional=True, ) valid_accelerated_mobile_pages_clicks_percentage = proto.Field( - proto.DOUBLE, - number=149, - optional=True, + proto.DOUBLE, number=149, optional=True, ) value_per_all_conversions = proto.Field( - proto.DOUBLE, - number=150, - optional=True, + proto.DOUBLE, number=150, optional=True, ) value_per_all_conversions_by_conversion_date = proto.Field( - proto.DOUBLE, - number=244, - optional=True, - ) - value_per_conversion = proto.Field( - proto.DOUBLE, - number=151, - optional=True, + proto.DOUBLE, number=244, optional=True, ) + value_per_conversion = proto.Field(proto.DOUBLE, number=151, optional=True,) value_per_conversions_by_conversion_date = proto.Field( - proto.DOUBLE, - number=245, - optional=True, + proto.DOUBLE, number=245, optional=True, ) value_per_current_model_attributed_conversion = proto.Field( - proto.DOUBLE, - number=152, - optional=True, + proto.DOUBLE, number=152, optional=True, ) video_quartile_p100_rate = proto.Field( - proto.DOUBLE, - number=132, - optional=True, + proto.DOUBLE, number=132, optional=True, ) video_quartile_p25_rate = proto.Field( - proto.DOUBLE, - number=133, - optional=True, + proto.DOUBLE, number=133, optional=True, ) video_quartile_p50_rate = proto.Field( - proto.DOUBLE, - number=134, - optional=True, + proto.DOUBLE, number=134, optional=True, ) video_quartile_p75_rate = proto.Field( - proto.DOUBLE, - number=135, - optional=True, - ) - video_view_rate = proto.Field( - proto.DOUBLE, - number=153, - optional=True, - ) - video_views = proto.Field( - proto.INT64, - number=154, - optional=True, + proto.DOUBLE, number=135, optional=True, ) + video_view_rate = proto.Field(proto.DOUBLE, number=153, optional=True,) + video_views = proto.Field(proto.INT64, number=154, optional=True,) view_through_conversions = proto.Field( - proto.INT64, - number=155, - optional=True, - ) - sk_ad_network_conversions = proto.Field( - proto.INT64, - number=246, + proto.INT64, number=155, optional=True, ) + sk_ad_network_conversions = proto.Field(proto.INT64, number=246,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/common/types/offline_user_data.py b/google/ads/googleads/v11/common/types/offline_user_data.py index d4319c5fe..fcb1b22eb 100644 --- a/google/ads/googleads/v11/common/types/offline_user_data.py +++ b/google/ads/googleads/v11/common/types/offline_user_data.py @@ -31,6 +31,8 @@ "ItemAttribute", "UserData", "UserAttribute", + "EventAttribute", + "EventItemAttribute", "ShoppingLoyalty", "CustomerMatchUserListMetadata", "StoreSalesMetadata", @@ -348,6 +350,20 @@ class UserAttribute(proto.Message): on the allow-list with the user's consent. This field is a member of `oneof`_ ``_shopping_loyalty``. + lifecycle_stage (str): + Optional. Advertiser defined lifecycle stage + for the user. The accepted values are “Lead”, + “Active” and “Churned”. + first_purchase_date_time (str): + Optional. Timestamp of the first purchase made by the user. + The format is YYYY-MM-DD HH:MM:SS[+/-HH:MM], where + [+/-HH:MM] is an optional timezone offset from UTC. If the + offset is absent, the API will use the account's timezone as + default. + event_attribute (Sequence[google.ads.googleads.v11.common.types.EventAttribute]): + Optional. Advertiser defined events and their + attributes. All the values in the nested fields + are required. Currently this field is in beta. """ lifetime_value_micros = proto.Field(proto.INT64, number=1, optional=True,) @@ -359,6 +375,49 @@ class UserAttribute(proto.Message): shopping_loyalty = proto.Field( proto.MESSAGE, number=7, optional=True, message="ShoppingLoyalty", ) + lifecycle_stage = proto.Field(proto.STRING, number=8,) + first_purchase_date_time = proto.Field(proto.STRING, number=9,) + event_attribute = proto.RepeatedField( + proto.MESSAGE, number=10, message="EventAttribute", + ) + + +class EventAttribute(proto.Message): + r"""Advertiser defined events and their attributes. All the + values in the nested fields are required. + + Attributes: + event (str): + Required. Advertiser defined event to be used + for remarketing. The accepted values are + “Viewed”, “Cart”, “Purchased” and “Recommended”. + event_date_time (str): + Required. Timestamp at which the event happened. The format + is YYYY-MM-DD HH:MM:SS[+/-HH:MM], where [+/-HH:MM] is an + optional timezone offset from UTC. If the offset is absent, + the API will use the account's timezone as default. + item_attribute (Sequence[google.ads.googleads.v11.common.types.EventItemAttribute]): + Required. Item attributes of the event. + """ + + event = proto.Field(proto.STRING, number=1,) + event_date_time = proto.Field(proto.STRING, number=2,) + item_attribute = proto.RepeatedField( + proto.MESSAGE, number=3, message="EventItemAttribute", + ) + + +class EventItemAttribute(proto.Message): + r"""Event Item attributes of the Customer Match. + + Attributes: + item_id (str): + Optional. A unique identifier of a product. + It can be either the Merchant Center Item ID or + GTIN (Global Trade Item Number). + """ + + item_id = proto.Field(proto.STRING, number=1,) class ShoppingLoyalty(proto.Message): @@ -400,10 +459,10 @@ class StoreSalesMetadata(proto.Message): Attributes: loyalty_fraction (float): This is the fraction of all transactions that - are identifiable (i.e., associated with any form - of customer information). Required. - The fraction needs to be between 0 and 1 - (excluding 0). + are identifiable (for example, associated with + any form of customer information). Required. The + fraction needs to be between 0 and 1 (excluding + 0). This field is a member of `oneof`_ ``_loyalty_fraction``. transaction_upload_fraction (float): @@ -441,9 +500,9 @@ class StoreSalesMetadata(proto.Message): class StoreSalesThirdPartyMetadata(proto.Message): r"""Metadata for a third party Store Sales. - This product is only for customers on the allow-list. Please - contact your Google business development representative for - details on the upload configuration. + This product is only for customers on the allow-list. Contact + your Google business development representative for details on + the upload configuration. Attributes: advertiser_upload_date_time (str): diff --git a/google/ads/googleads/v11/common/types/policy.py b/google/ads/googleads/v11/common/types/policy.py index 3ce0513fa..8d36d1ef5 100644 --- a/google/ads/googleads/v11/common/types/policy.py +++ b/google/ads/googleads/v11/common/types/policy.py @@ -52,9 +52,9 @@ class PolicyViolationKey(proto.Message): violating_text (str): The text that violates the policy if specified. Otherwise, refers to the policy in - general (e.g., when requesting to be exempt from - the whole policy). If not specified for - criterion exemptions, the whole policy is + general (for example, when requesting to be + exempt from the whole policy). If not specified + for criterion exemptions, the whole policy is implied. Must be specified for ad exemptions. This field is a member of `oneof`_ ``_violating_text``. @@ -82,8 +82,8 @@ class PolicyValidationParameter(proto.Message): exempt_policy_violation_keys (Sequence[google.ads.googleads.v11.common.types.PolicyViolationKey]): The list of policy violation keys that should not cause a PolicyViolationError to be reported. Not all policy - violations are exemptable, please refer to the is_exemptible - field in the returned PolicyViolationError. + violations are exemptable, refer to the is_exemptible field + in the returned PolicyViolationError. Resources violating these polices will be saved, but will not be eligible to serve. They may begin serving at a later @@ -98,8 +98,8 @@ class PolicyValidationParameter(proto.Message): class PolicyTopicEntry(proto.Message): - r"""Policy finding attached to a resource (e.g. alcohol policy - associated with a site that sells alcohol). + r"""Policy finding attached to a resource (for example, alcohol + policy associated with a site that sells alcohol). Each PolicyTopicEntry has a topic that indicates the specific ads policy the entry is about and a type to indicate the effect @@ -121,11 +121,12 @@ class PolicyTopicEntry(proto.Message): this policy will have on serving. evidences (Sequence[google.ads.googleads.v11.common.types.PolicyTopicEvidence]): Additional information that explains policy - finding (e.g. the brand name for a trademark - finding). + finding (for example, the brand name for a + trademark finding). constraints (Sequence[google.ads.googleads.v11.common.types.PolicyTopicConstraint]): Indicates how serving of this resource may be - affected (e.g. not serving in a country). + affected (for example, not serving in a + country). """ topic = proto.Field(proto.STRING, number=5, optional=True,) diff --git a/google/ads/googleads/v11/common/types/segments.py b/google/ads/googleads/v11/common/types/segments.py index 00b71d70f..7310fc230 100644 --- a/google/ads/googleads/v11/common/types/segments.py +++ b/google/ads/googleads/v11/common/types/segments.py @@ -133,12 +133,12 @@ class Segments(proto.Message): This field is a member of `oneof`_ ``_conversion_action_name``. conversion_adjustment (bool): This segments your conversion columns by the - original conversion and conversion value vs. the - delta if conversions were adjusted. False row - has the data as originally stated; While true - row has the delta between data now and the data - as originally stated. Summing the two together - results post-adjustment data. + original conversion and conversion value versus + the delta if conversions were adjusted. False + row has the data as originally stated; While + true row has the delta between data now and the + data as originally stated. Summing the two + together results post-adjustment data. This field is a member of `oneof`_ ``_conversion_adjustment``. conversion_attribution_event_type (google.ads.googleads.v11.enums.types.ConversionAttributionEventTypeEnum.ConversionAttributionEventType): @@ -153,11 +153,11 @@ class Segments(proto.Message): conversion. date (str): Date to which metrics apply. - yyyy-MM-dd format, e.g., 2018-04-17. + yyyy-MM-dd format, for example, 2018-04-17. This field is a member of `oneof`_ ``_date``. day_of_week (google.ads.googleads.v11.enums.types.DayOfWeekEnum.DayOfWeek): - Day of the week, e.g., MONDAY. + Day of the week, for example, MONDAY. device (google.ads.googleads.v11.enums.types.DeviceEnum.Device): Device to which metrics apply. external_conversion_source (google.ads.googleads.v11.enums.types.ExternalConversionSourceEnum.ExternalConversionSource): @@ -286,7 +286,7 @@ class Segments(proto.Message): This field is a member of `oneof`_ ``_month``. month_of_year (google.ads.googleads.v11.enums.types.MonthOfYearEnum.MonthOfYear): - Month of the year, e.g., January. + Month of the year, for example, January. partner_hotel_id (str): Partner hotel ID. @@ -397,8 +397,9 @@ class Segments(proto.Message): quarter (str): Quarter as represented by the date of the first day of a quarter. Uses the calendar year - for quarters, e.g., the second quarter of 2018 - starts on 2018-04-01. Formatted as yyyy-MM-dd. + for quarters, for example, the second quarter of + 2018 starts on 2018-04-01. Formatted as + yyyy-MM-dd. This field is a member of `oneof`_ ``_quarter``. recommendation_type (google.ads.googleads.v11.enums.types.RecommendationTypeEnum.RecommendationType): @@ -435,7 +436,7 @@ class Segments(proto.Message): sk_ad_network_conversion_value (int): iOS Store Kit Ad Network conversion value. Null value means this segment is not applicable, - e.g. non-iOS campaign. + for example, non-iOS campaign. This field is a member of `oneof`_ ``_sk_ad_network_conversion_value``. sk_ad_network_user_type (google.ads.googleads.v11.enums.types.SkAdNetworkUserTypeEnum.SkAdNetworkUserType): @@ -445,9 +446,9 @@ class Segments(proto.Message): sk_ad_network_source_app (google.ads.googleads.v11.common.types.SkAdNetworkSourceApp): App where the ad that drove the iOS Store Kit Ad Network install was shown. Null value means - this segment is not applicable, e.g. non-iOS - campaign, or was not present in any postbacks - sent by Apple. + this segment is not applicable, for example, + non-iOS campaign, or was not present in any + postbacks sent by Apple. This field is a member of `oneof`_ ``_sk_ad_network_source_app``. sk_ad_network_attribution_credit (google.ads.googleads.v11.enums.types.SkAdNetworkAttributionCreditEnum.SkAdNetworkAttributionCredit): @@ -456,11 +457,11 @@ class Segments(proto.Message): Only used with CustomerAsset, CampaignAsset and AdGroupAsset metrics. Indicates whether the interaction metrics occurred on the asset itself or a different asset or ad unit. - Interactions (e.g. clicks) are counted across all the parts - of the served ad (e.g. Ad itself and other components like - Sitelinks) when they are served together. When - interaction_on_this_asset is true, it means the interactions - are on this specific asset and when + Interactions (for example, clicks) are counted across all + the parts of the served ad (for example, Ad itself and other + components like Sitelinks) when they are served together. + When interaction_on_this_asset is true, it means the + interactions are on this specific asset and when interaction_on_this_asset is false, it means the interactions is not on this specific asset but on other parts of the served ad this asset is served with. @@ -479,40 +480,24 @@ class Segments(proto.Message): enum=gage_ad_network_type.AdNetworkTypeEnum.AdNetworkType, ) auction_insight_domain = proto.Field( - proto.STRING, - number=145, - optional=True, + proto.STRING, number=145, optional=True, ) budget_campaign_association_status = proto.Field( - proto.MESSAGE, - number=134, - message="BudgetCampaignAssociationStatus", + proto.MESSAGE, number=134, message="BudgetCampaignAssociationStatus", ) click_type = proto.Field( - proto.ENUM, - number=26, - enum=gage_click_type.ClickTypeEnum.ClickType, - ) - conversion_action = proto.Field( - proto.STRING, - number=113, - optional=True, + proto.ENUM, number=26, enum=gage_click_type.ClickTypeEnum.ClickType, ) + conversion_action = proto.Field(proto.STRING, number=113, optional=True,) conversion_action_category = proto.Field( proto.ENUM, number=53, enum=gage_conversion_action_category.ConversionActionCategoryEnum.ConversionActionCategory, ) conversion_action_name = proto.Field( - proto.STRING, - number=114, - optional=True, - ) - conversion_adjustment = proto.Field( - proto.BOOL, - number=115, - optional=True, + proto.STRING, number=114, optional=True, ) + conversion_adjustment = proto.Field(proto.BOOL, number=115, optional=True,) conversion_attribution_event_type = proto.Field( proto.ENUM, number=2, @@ -528,136 +513,52 @@ class Segments(proto.Message): number=51, enum=gage_conversion_or_adjustment_lag_bucket.ConversionOrAdjustmentLagBucketEnum.ConversionOrAdjustmentLagBucket, ) - date = proto.Field( - proto.STRING, - number=79, - optional=True, - ) + date = proto.Field(proto.STRING, number=79, optional=True,) day_of_week = proto.Field( - proto.ENUM, - number=5, - enum=gage_day_of_week.DayOfWeekEnum.DayOfWeek, + proto.ENUM, number=5, enum=gage_day_of_week.DayOfWeekEnum.DayOfWeek, ) device = proto.Field( - proto.ENUM, - number=1, - enum=gage_device.DeviceEnum.Device, + proto.ENUM, number=1, enum=gage_device.DeviceEnum.Device, ) external_conversion_source = proto.Field( proto.ENUM, number=55, enum=gage_external_conversion_source.ExternalConversionSourceEnum.ExternalConversionSource, ) - geo_target_airport = proto.Field( - proto.STRING, - number=116, - optional=True, - ) - geo_target_canton = proto.Field( - proto.STRING, - number=117, - optional=True, - ) - geo_target_city = proto.Field( - proto.STRING, - number=118, - optional=True, - ) - geo_target_country = proto.Field( - proto.STRING, - number=119, - optional=True, - ) - geo_target_county = proto.Field( - proto.STRING, - number=120, - optional=True, - ) - geo_target_district = proto.Field( - proto.STRING, - number=121, - optional=True, - ) - geo_target_metro = proto.Field( - proto.STRING, - number=122, - optional=True, - ) + geo_target_airport = proto.Field(proto.STRING, number=116, optional=True,) + geo_target_canton = proto.Field(proto.STRING, number=117, optional=True,) + geo_target_city = proto.Field(proto.STRING, number=118, optional=True,) + geo_target_country = proto.Field(proto.STRING, number=119, optional=True,) + geo_target_county = proto.Field(proto.STRING, number=120, optional=True,) + geo_target_district = proto.Field(proto.STRING, number=121, optional=True,) + geo_target_metro = proto.Field(proto.STRING, number=122, optional=True,) geo_target_most_specific_location = proto.Field( - proto.STRING, - number=123, - optional=True, + proto.STRING, number=123, optional=True, ) geo_target_postal_code = proto.Field( - proto.STRING, - number=124, - optional=True, - ) - geo_target_province = proto.Field( - proto.STRING, - number=125, - optional=True, - ) - geo_target_region = proto.Field( - proto.STRING, - number=126, - optional=True, - ) - geo_target_state = proto.Field( - proto.STRING, - number=127, - optional=True, + proto.STRING, number=124, optional=True, ) + geo_target_province = proto.Field(proto.STRING, number=125, optional=True,) + geo_target_region = proto.Field(proto.STRING, number=126, optional=True,) + geo_target_state = proto.Field(proto.STRING, number=127, optional=True,) hotel_booking_window_days = proto.Field( - proto.INT64, - number=135, - optional=True, - ) - hotel_center_id = proto.Field( - proto.INT64, - number=80, - optional=True, - ) - hotel_check_in_date = proto.Field( - proto.STRING, - number=81, - optional=True, + proto.INT64, number=135, optional=True, ) + hotel_center_id = proto.Field(proto.INT64, number=80, optional=True,) + hotel_check_in_date = proto.Field(proto.STRING, number=81, optional=True,) hotel_check_in_day_of_week = proto.Field( - proto.ENUM, - number=9, - enum=gage_day_of_week.DayOfWeekEnum.DayOfWeek, - ) - hotel_city = proto.Field( - proto.STRING, - number=82, - optional=True, - ) - hotel_class = proto.Field( - proto.INT32, - number=83, - optional=True, - ) - hotel_country = proto.Field( - proto.STRING, - number=84, - optional=True, + proto.ENUM, number=9, enum=gage_day_of_week.DayOfWeekEnum.DayOfWeek, ) + hotel_city = proto.Field(proto.STRING, number=82, optional=True,) + hotel_class = proto.Field(proto.INT32, number=83, optional=True,) + hotel_country = proto.Field(proto.STRING, number=84, optional=True,) hotel_date_selection_type = proto.Field( proto.ENUM, number=13, enum=gage_hotel_date_selection_type.HotelDateSelectionTypeEnum.HotelDateSelectionType, ) - hotel_length_of_stay = proto.Field( - proto.INT32, - number=85, - optional=True, - ) - hotel_rate_rule_id = proto.Field( - proto.STRING, - number=86, - optional=True, - ) + hotel_length_of_stay = proto.Field(proto.INT32, number=85, optional=True,) + hotel_rate_rule_id = proto.Field(proto.STRING, number=86, optional=True,) hotel_rate_type = proto.Field( proto.ENUM, number=74, @@ -668,81 +569,41 @@ class Segments(proto.Message): number=78, enum=gage_hotel_price_bucket.HotelPriceBucketEnum.HotelPriceBucket, ) - hotel_state = proto.Field( - proto.STRING, - number=87, - optional=True, - ) - hour = proto.Field( - proto.INT32, - number=88, - optional=True, - ) + hotel_state = proto.Field(proto.STRING, number=87, optional=True,) + hour = proto.Field(proto.INT32, number=88, optional=True,) interaction_on_this_extension = proto.Field( - proto.BOOL, - number=89, - optional=True, - ) - keyword = proto.Field( - proto.MESSAGE, - number=61, - message="Keyword", - ) - month = proto.Field( - proto.STRING, - number=90, - optional=True, + proto.BOOL, number=89, optional=True, ) + keyword = proto.Field(proto.MESSAGE, number=61, message="Keyword",) + month = proto.Field(proto.STRING, number=90, optional=True,) month_of_year = proto.Field( proto.ENUM, number=18, enum=gage_month_of_year.MonthOfYearEnum.MonthOfYear, ) - partner_hotel_id = proto.Field( - proto.STRING, - number=91, - optional=True, - ) + partner_hotel_id = proto.Field(proto.STRING, number=91, optional=True,) placeholder_type = proto.Field( proto.ENUM, number=20, enum=gage_placeholder_type.PlaceholderTypeEnum.PlaceholderType, ) - product_aggregator_id = proto.Field( - proto.INT64, - number=132, - optional=True, - ) + product_aggregator_id = proto.Field(proto.INT64, number=132, optional=True,) product_bidding_category_level1 = proto.Field( - proto.STRING, - number=92, - optional=True, + proto.STRING, number=92, optional=True, ) product_bidding_category_level2 = proto.Field( - proto.STRING, - number=93, - optional=True, + proto.STRING, number=93, optional=True, ) product_bidding_category_level3 = proto.Field( - proto.STRING, - number=94, - optional=True, + proto.STRING, number=94, optional=True, ) product_bidding_category_level4 = proto.Field( - proto.STRING, - number=95, - optional=True, + proto.STRING, number=95, optional=True, ) product_bidding_category_level5 = proto.Field( - proto.STRING, - number=96, - optional=True, - ) - product_brand = proto.Field( - proto.STRING, - number=97, - optional=True, + proto.STRING, number=96, optional=True, ) + product_brand = proto.Field(proto.STRING, number=97, optional=True,) product_channel = proto.Field( proto.ENUM, number=30, @@ -758,91 +619,33 @@ class Segments(proto.Message): number=32, enum=gage_product_condition.ProductConditionEnum.ProductCondition, ) - product_country = proto.Field( - proto.STRING, - number=98, - optional=True, - ) + product_country = proto.Field(proto.STRING, number=98, optional=True,) product_custom_attribute0 = proto.Field( - proto.STRING, - number=99, - optional=True, + proto.STRING, number=99, optional=True, ) product_custom_attribute1 = proto.Field( - proto.STRING, - number=100, - optional=True, + proto.STRING, number=100, optional=True, ) product_custom_attribute2 = proto.Field( - proto.STRING, - number=101, - optional=True, + proto.STRING, number=101, optional=True, ) product_custom_attribute3 = proto.Field( - proto.STRING, - number=102, - optional=True, + proto.STRING, number=102, optional=True, ) product_custom_attribute4 = proto.Field( - proto.STRING, - number=103, - optional=True, - ) - product_item_id = proto.Field( - proto.STRING, - number=104, - optional=True, - ) - product_language = proto.Field( - proto.STRING, - number=105, - optional=True, - ) - product_merchant_id = proto.Field( - proto.INT64, - number=133, - optional=True, - ) - product_store_id = proto.Field( - proto.STRING, - number=106, - optional=True, - ) - product_title = proto.Field( - proto.STRING, - number=107, - optional=True, - ) - product_type_l1 = proto.Field( - proto.STRING, - number=108, - optional=True, - ) - product_type_l2 = proto.Field( - proto.STRING, - number=109, - optional=True, - ) - product_type_l3 = proto.Field( - proto.STRING, - number=110, - optional=True, - ) - product_type_l4 = proto.Field( - proto.STRING, - number=111, - optional=True, - ) - product_type_l5 = proto.Field( - proto.STRING, - number=112, - optional=True, - ) - quarter = proto.Field( - proto.STRING, - number=128, - optional=True, - ) + proto.STRING, number=103, optional=True, + ) + product_item_id = proto.Field(proto.STRING, number=104, optional=True,) + product_language = proto.Field(proto.STRING, number=105, optional=True,) + product_merchant_id = proto.Field(proto.INT64, number=133, optional=True,) + product_store_id = proto.Field(proto.STRING, number=106, optional=True,) + product_title = proto.Field(proto.STRING, number=107, optional=True,) + product_type_l1 = proto.Field(proto.STRING, number=108, optional=True,) + product_type_l2 = proto.Field(proto.STRING, number=109, optional=True,) + product_type_l3 = proto.Field(proto.STRING, number=110, optional=True,) + product_type_l4 = proto.Field(proto.STRING, number=111, optional=True,) + product_type_l5 = proto.Field(proto.STRING, number=112, optional=True,) + quarter = proto.Field(proto.STRING, number=128, optional=True,) recommendation_type = proto.Field( proto.ENUM, number=140, @@ -858,35 +661,17 @@ class Segments(proto.Message): number=22, enum=gage_search_term_match_type.SearchTermMatchTypeEnum.SearchTermMatchType, ) - slot = proto.Field( - proto.ENUM, - number=23, - enum=gage_slot.SlotEnum.Slot, - ) + slot = proto.Field(proto.ENUM, number=23, enum=gage_slot.SlotEnum.Slot,) conversion_value_rule_primary_dimension = proto.Field( proto.ENUM, number=138, enum=gage_conversion_value_rule_primary_dimension.ConversionValueRulePrimaryDimensionEnum.ConversionValueRulePrimaryDimension, ) - webpage = proto.Field( - proto.STRING, - number=129, - optional=True, - ) - week = proto.Field( - proto.STRING, - number=130, - optional=True, - ) - year = proto.Field( - proto.INT32, - number=131, - optional=True, - ) + webpage = proto.Field(proto.STRING, number=129, optional=True,) + week = proto.Field(proto.STRING, number=130, optional=True,) + year = proto.Field(proto.INT32, number=131, optional=True,) sk_ad_network_conversion_value = proto.Field( - proto.INT64, - number=137, - optional=True, + proto.INT64, number=137, optional=True, ) sk_ad_network_user_type = proto.Field( proto.ENUM, @@ -929,16 +714,8 @@ class Keyword(proto.Message): Keyword info. """ - ad_group_criterion = proto.Field( - proto.STRING, - number=3, - optional=True, - ) - info = proto.Field( - proto.MESSAGE, - number=2, - message=criteria.KeywordInfo, - ) + ad_group_criterion = proto.Field(proto.STRING, number=3, optional=True,) + info = proto.Field(proto.MESSAGE, number=2, message=criteria.KeywordInfo,) class BudgetCampaignAssociationStatus(proto.Message): @@ -953,11 +730,7 @@ class BudgetCampaignAssociationStatus(proto.Message): Budget campaign association status. """ - campaign = proto.Field( - proto.STRING, - number=1, - optional=True, - ) + campaign = proto.Field(proto.STRING, number=1, optional=True,) status = proto.Field( proto.ENUM, number=2, @@ -978,14 +751,8 @@ class AssetInteractionTarget(proto.Message): or a different asset or ad unit. """ - asset = proto.Field( - proto.STRING, - number=1, - ) - interaction_on_this_asset = proto.Field( - proto.BOOL, - number=2, - ) + asset = proto.Field(proto.STRING, number=1,) + interaction_on_this_asset = proto.Field(proto.BOOL, number=2,) class SkAdNetworkSourceApp(proto.Message): @@ -1000,9 +767,7 @@ class SkAdNetworkSourceApp(proto.Message): """ sk_ad_network_source_app_id = proto.Field( - proto.STRING, - number=1, - optional=True, + proto.STRING, number=1, optional=True, ) diff --git a/google/ads/googleads/v11/common/types/simulation.py b/google/ads/googleads/v11/common/types/simulation.py index f701ed3aa..777a3d4aa 100644 --- a/google/ads/googleads/v11/common/types/simulation.py +++ b/google/ads/googleads/v11/common/types/simulation.py @@ -599,9 +599,10 @@ class TargetImpressionShareSimulationPoint(proto.Message): Attributes: target_impression_share_micros (int): The simulated target impression share value (in micros) upon - which projected metrics are based. E.g. 10% impression - share, which is equal to 0.1, is stored as 100_000. This - value is validated and will not exceed 1M (100%). + which projected metrics are based. For example, 10% + impression share, which is equal to 0.1, is stored as + 100_000. This value is validated and will not exceed 1M + (100%). required_cpc_bid_ceiling_micros (int): Projected required daily cpc bid ceiling that the advertiser must set to realize this diff --git a/google/ads/googleads/v11/common/types/tag_snippet.py b/google/ads/googleads/v11/common/types/tag_snippet.py index 2d4c25f28..2f2eb6d42 100644 --- a/google/ads/googleads/v11/common/types/tag_snippet.py +++ b/google/ads/googleads/v11/common/types/tag_snippet.py @@ -35,7 +35,8 @@ class TagSnippet(proto.Message): tracking conversions. page_format (google.ads.googleads.v11.enums.types.TrackingCodePageFormatEnum.TrackingCodePageFormat): The format of the web page where the tracking - tag and snippet will be installed, e.g. HTML. + tag and snippet will be installed, for example, + HTML. global_site_tag (str): The site tag that adds visitors to your basic remarketing lists and sets new cookies on your diff --git a/google/ads/googleads/v11/common/types/user_lists.py b/google/ads/googleads/v11/common/types/user_lists.py index de6432cb8..34a387624 100644 --- a/google/ads/googleads/v11/common/types/user_lists.py +++ b/google/ads/googleads/v11/common/types/user_lists.py @@ -23,6 +23,9 @@ from google.ads.googleads.v11.enums.types import ( user_list_date_rule_item_operator, ) +from google.ads.googleads.v11.enums.types import ( + user_list_flexible_rule_operator, +) from google.ads.googleads.v11.enums.types import user_list_logical_rule_operator from google.ads.googleads.v11.enums.types import ( user_list_number_rule_item_operator, @@ -48,6 +51,8 @@ "UserListStringRuleItemInfo", "CombinedRuleUserListInfo", "ExpressionRuleUserListInfo", + "FlexibleRuleOperandInfo", + "FlexibleRuleUserListInfo", "RuleBasedUserListInfo", "LogicalUserListInfo", "UserListLogicalRuleInfo", @@ -82,13 +87,14 @@ class CrmBasedUserListInfo(proto.Message): A string that uniquely identifies a mobile application from which the data was collected. For iOS, the ID string is the 9 digit string - that appears at the end of an App Store URL - (e.g., "476943146" for "Flood-It! 2" whose App + that appears at the end of an App Store URL (for + example, "476943146" for "Flood-It! 2" whose App Store link is http://itunes.apple.com/us/app/flood-it!-2/id476943146). For Android, the ID string is the application's - package name (e.g., "com.labpixies.colordrips" - for "Color Drips" given Google Play link + package name (for example, + "com.labpixies.colordrips" for "Color Drips" + given Google Play link https://play.google.com/store/apps/details?id=com.labpixies.colordrips). Required when creating CrmBasedUserList for uploading mobile advertising IDs. @@ -356,6 +362,55 @@ class ExpressionRuleUserListInfo(proto.Message): rule = proto.Field(proto.MESSAGE, number=1, message="UserListRuleInfo",) +class FlexibleRuleOperandInfo(proto.Message): + r"""Flexible rule that wraps the common rule and a lookback + window. + + Attributes: + rule (google.ads.googleads.v11.common.types.UserListRuleInfo): + List of rule item groups that defines this + rule. Rule item groups are grouped together. + lookback_window_days (int): + Lookback window for this rule in days. From + now until X days ago. + + This field is a member of `oneof`_ ``_lookback_window_days``. + """ + + rule = proto.Field(proto.MESSAGE, number=1, message="UserListRuleInfo",) + lookback_window_days = proto.Field(proto.INT64, number=2, optional=True,) + + +class FlexibleRuleUserListInfo(proto.Message): + r"""Flexible rule representation of visitors with one or multiple + actions. + + Attributes: + inclusive_rule_operator (google.ads.googleads.v11.enums.types.UserListFlexibleRuleOperatorEnum.UserListFlexibleRuleOperator): + Operator that defines how the inclusive + operands are combined. + inclusive_operands (Sequence[google.ads.googleads.v11.common.types.FlexibleRuleOperandInfo]): + Actions that are located on the inclusive side. These are + joined together by either AND/OR as specified by the + inclusive_rule_operator. + exclusive_operands (Sequence[google.ads.googleads.v11.common.types.FlexibleRuleOperandInfo]): + Actions that are located on the exclusive + side. These are joined together with OR. + """ + + inclusive_rule_operator = proto.Field( + proto.ENUM, + number=1, + enum=user_list_flexible_rule_operator.UserListFlexibleRuleOperatorEnum.UserListFlexibleRuleOperator, + ) + inclusive_operands = proto.RepeatedField( + proto.MESSAGE, number=2, message="FlexibleRuleOperandInfo", + ) + exclusive_operands = proto.RepeatedField( + proto.MESSAGE, number=3, message="FlexibleRuleOperandInfo", + ) + + class RuleBasedUserListInfo(proto.Message): r"""Representation of a userlist that is generated by a rule. @@ -380,6 +435,9 @@ class RuleBasedUserListInfo(proto.Message): is added. The status will be updated to FINISHED once request is processed, or FAILED if the request fails. + flexible_rule_user_list (google.ads.googleads.v11.common.types.FlexibleRuleUserListInfo): + Flexible rule representation of visitors with + one or multiple actions. combined_rule_user_list (google.ads.googleads.v11.common.types.CombinedRuleUserListInfo): User lists defined by combining two rules. There are two operators: AND, where the left and right operands have to be @@ -399,6 +457,9 @@ class RuleBasedUserListInfo(proto.Message): number=1, enum=user_list_prepopulation_status.UserListPrepopulationStatusEnum.UserListPrepopulationStatus, ) + flexible_rule_user_list = proto.Field( + proto.MESSAGE, number=5, message="FlexibleRuleUserListInfo", + ) combined_rule_user_list = proto.Field( proto.MESSAGE, number=2, diff --git a/google/ads/googleads/v11/enums/__init__.py b/google/ads/googleads/v11/enums/__init__.py index 2474a03fb..ea33fc640 100644 --- a/google/ads/googleads/v11/enums/__init__.py +++ b/google/ads/googleads/v11/enums/__init__.py @@ -63,6 +63,7 @@ "BidModifierSourceEnum", "BiddingSourceEnum", "BiddingStrategyStatusEnum", + "BiddingStrategySystemStatusEnum", "BiddingStrategyTypeEnum", "BillingSetupStatusEnum", "BrandSafetySuitabilityEnum", @@ -294,6 +295,7 @@ "UserListCombinedRuleOperatorEnum", "UserListCrmDataSourceTypeEnum", "UserListDateRuleItemOperatorEnum", + "UserListFlexibleRuleOperatorEnum", "UserListLogicalRuleOperatorEnum", "UserListMembershipStatusEnum", "UserListNumberRuleItemOperatorEnum", diff --git a/google/ads/googleads/v11/enums/types/age_range_type.py b/google/ads/googleads/v11/enums/types/age_range_type.py index 30a6795e9..2d8ea0f88 100644 --- a/google/ads/googleads/v11/enums/types/age_range_type.py +++ b/google/ads/googleads/v11/enums/types/age_range_type.py @@ -30,8 +30,8 @@ class AgeRangeTypeEnum(proto.Message): """ class AgeRangeType(proto.Enum): - r"""The type of demographic age ranges (e.g. between 18 and 24 - years old). + r"""The type of demographic age ranges (for example, between 18 + and 24 years old). """ UNSPECIFIED = 0 UNKNOWN = 1 diff --git a/google/ads/googleads/v11/enums/types/asset_set_link_status.py b/google/ads/googleads/v11/enums/types/asset_set_link_status.py index 050f8c50e..673ff5b65 100644 --- a/google/ads/googleads/v11/enums/types/asset_set_link_status.py +++ b/google/ads/googleads/v11/enums/types/asset_set_link_status.py @@ -30,8 +30,8 @@ class AssetSetLinkStatusEnum(proto.Message): """ class AssetSetLinkStatus(proto.Enum): - r"""The possible statuses of he linkage between asset set and its - container. + r"""The possible statuses of the linkage between asset set and + its container. """ UNSPECIFIED = 0 UNKNOWN = 1 diff --git a/google/ads/googleads/v11/enums/types/asset_source.py b/google/ads/googleads/v11/enums/types/asset_source.py index 4f55cc89b..1f1890432 100644 --- a/google/ads/googleads/v11/enums/types/asset_source.py +++ b/google/ads/googleads/v11/enums/types/asset_source.py @@ -25,7 +25,7 @@ class AssetSourceEnum(proto.Message): r"""Source of the asset or asset link for who generated the - entity. e.g. advertiser or automatically created. + entity. For example, advertiser or automatically created. """ diff --git a/google/ads/googleads/v11/enums/types/audience_insights_dimension.py b/google/ads/googleads/v11/enums/types/audience_insights_dimension.py index a6f96605f..93d92918b 100644 --- a/google/ads/googleads/v11/enums/types/audience_insights_dimension.py +++ b/google/ads/googleads/v11/enums/types/audience_insights_dimension.py @@ -19,14 +19,13 @@ __protobuf__ = proto.module( package="google.ads.googleads.v11.enums", marshal="google.ads.googleads.v11", - manifest={ - "AudienceInsightsDimensionEnum", - }, + manifest={"AudienceInsightsDimensionEnum",}, ) class AudienceInsightsDimensionEnum(proto.Message): - r"""Container for enum describing audience insights dimensions.""" + r"""Container for enum describing audience insights dimensions. + """ class AudienceInsightsDimension(proto.Enum): r"""Possible audience dimensions for use in generating insights.""" @@ -34,6 +33,16 @@ class AudienceInsightsDimension(proto.Enum): UNKNOWN = 1 CATEGORY = 2 KNOWLEDGE_GRAPH = 3 + GEO_TARGET_COUNTRY = 4 + SUB_COUNTRY_LOCATION = 5 + YOUTUBE_CHANNEL = 6 + YOUTUBE_DYNAMIC_LINEUP = 7 + AFFINITY_USER_INTEREST = 8 + IN_MARKET_USER_INTEREST = 9 + PARENTAL_STATUS = 10 + INCOME_RANGE = 11 + AGE_RANGE = 12 + GENDER = 13 __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/enums/types/bidding_strategy_system_status.py b/google/ads/googleads/v11/enums/types/bidding_strategy_system_status.py new file mode 100644 index 000000000..e468a99cd --- /dev/null +++ b/google/ads/googleads/v11/enums/types/bidding_strategy_system_status.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import proto # type: ignore + + +__protobuf__ = proto.module( + package="google.ads.googleads.v11.enums", + marshal="google.ads.googleads.v11", + manifest={"BiddingStrategySystemStatusEnum",}, +) + + +class BiddingStrategySystemStatusEnum(proto.Message): + r"""Message describing BiddingStrategy system statuses. + """ + + class BiddingStrategySystemStatus(proto.Enum): + r"""The possible system statuses of a BiddingStrategy.""" + UNSPECIFIED = 0 + UNKNOWN = 1 + ENABLED = 2 + LEARNING_NEW = 3 + LEARNING_SETTING_CHANGE = 4 + LEARNING_BUDGET_CHANGE = 5 + LEARNING_COMPOSITION_CHANGE = 6 + LEARNING_CONVERSION_TYPE_CHANGE = 7 + LEARNING_CONVERSION_SETTING_CHANGE = 8 + LIMITED_BY_CPC_BID_CEILING = 9 + LIMITED_BY_CPC_BID_FLOOR = 10 + LIMITED_BY_DATA = 11 + LIMITED_BY_BUDGET = 12 + LIMITED_BY_LOW_PRIORITY_SPEND = 13 + LIMITED_BY_LOW_QUALITY = 14 + LIMITED_BY_INVENTORY = 15 + MISCONFIGURED_ZERO_ELIGIBILITY = 16 + MISCONFIGURED_CONVERSION_TYPES = 17 + MISCONFIGURED_CONVERSION_SETTINGS = 18 + MISCONFIGURED_SHARED_BUDGET = 19 + MISCONFIGURED_STRATEGY_TYPE = 20 + PAUSED = 21 + UNAVAILABLE = 22 + MULTIPLE_LEARNING = 23 + MULTIPLE_LIMITED = 24 + MULTIPLE_MISCONFIGURED = 25 + MULTIPLE = 26 + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/enums/types/conversion_environment_enum.py b/google/ads/googleads/v11/enums/types/conversion_environment_enum.py index 06148a39b..76ac73007 100644 --- a/google/ads/googleads/v11/enums/types/conversion_environment_enum.py +++ b/google/ads/googleads/v11/enums/types/conversion_environment_enum.py @@ -25,7 +25,7 @@ class ConversionEnvironmentEnum(proto.Message): r"""Container for enum representing the conversion environment an - uploaded conversion was recorded on. e.g. App or Web. + uploaded conversion was recorded on, for example, App or Web. """ diff --git a/google/ads/googleads/v11/enums/types/day_of_week.py b/google/ads/googleads/v11/enums/types/day_of_week.py index fa67abed2..fa99c9d81 100644 --- a/google/ads/googleads/v11/enums/types/day_of_week.py +++ b/google/ads/googleads/v11/enums/types/day_of_week.py @@ -24,13 +24,13 @@ class DayOfWeekEnum(proto.Message): - r"""Container for enumeration of days of the week, e.g., + r"""Container for enumeration of days of the week, for example, "Monday". """ class DayOfWeek(proto.Enum): - r"""Enumerates days of the week, e.g., "Monday".""" + r"""Enumerates days of the week, for example, "Monday".""" UNSPECIFIED = 0 UNKNOWN = 1 MONDAY = 2 diff --git a/google/ads/googleads/v11/enums/types/frequency_cap_event_type.py b/google/ads/googleads/v11/enums/types/frequency_cap_event_type.py index c4a9c5ea2..7cd52f538 100644 --- a/google/ads/googleads/v11/enums/types/frequency_cap_event_type.py +++ b/google/ads/googleads/v11/enums/types/frequency_cap_event_type.py @@ -30,7 +30,9 @@ class FrequencyCapEventTypeEnum(proto.Message): """ class FrequencyCapEventType(proto.Enum): - r"""The type of event that the cap applies to (e.g. impression).""" + r"""The type of event that the cap applies to (for example, + impression). + """ UNSPECIFIED = 0 UNKNOWN = 1 IMPRESSION = 2 diff --git a/google/ads/googleads/v11/enums/types/frequency_cap_time_unit.py b/google/ads/googleads/v11/enums/types/frequency_cap_time_unit.py index 2d0bb6b08..ad97490c6 100644 --- a/google/ads/googleads/v11/enums/types/frequency_cap_time_unit.py +++ b/google/ads/googleads/v11/enums/types/frequency_cap_time_unit.py @@ -30,7 +30,7 @@ class FrequencyCapTimeUnitEnum(proto.Message): """ class FrequencyCapTimeUnit(proto.Enum): - r"""Unit of time the cap is defined at (e.g. day, week).""" + r"""Unit of time the cap is defined at (for example, day, week).""" UNSPECIFIED = 0 UNKNOWN = 1 DAY = 2 diff --git a/google/ads/googleads/v11/enums/types/gender_type.py b/google/ads/googleads/v11/enums/types/gender_type.py index 5fdf6e51b..cc4f17836 100644 --- a/google/ads/googleads/v11/enums/types/gender_type.py +++ b/google/ads/googleads/v11/enums/types/gender_type.py @@ -30,7 +30,7 @@ class GenderTypeEnum(proto.Message): """ class GenderType(proto.Enum): - r"""The type of demographic genders (e.g. female).""" + r"""The type of demographic genders (for example, female).""" UNSPECIFIED = 0 UNKNOWN = 1 MALE = 10 diff --git a/google/ads/googleads/v11/enums/types/income_range_type.py b/google/ads/googleads/v11/enums/types/income_range_type.py index aead9f559..5a0781185 100644 --- a/google/ads/googleads/v11/enums/types/income_range_type.py +++ b/google/ads/googleads/v11/enums/types/income_range_type.py @@ -30,8 +30,8 @@ class IncomeRangeTypeEnum(proto.Message): """ class IncomeRangeType(proto.Enum): - r"""The type of demographic income ranges (e.g. between 0% to - 50%). + r"""The type of demographic income ranges (for example, between + 0% to 50%). """ UNSPECIFIED = 0 UNKNOWN = 1 diff --git a/google/ads/googleads/v11/enums/types/lead_form_desired_intent.py b/google/ads/googleads/v11/enums/types/lead_form_desired_intent.py index 592bf67d7..ac32a3500 100644 --- a/google/ads/googleads/v11/enums/types/lead_form_desired_intent.py +++ b/google/ads/googleads/v11/enums/types/lead_form_desired_intent.py @@ -24,11 +24,11 @@ class LeadFormDesiredIntentEnum(proto.Message): - r"""Describes the desired level of intent of generated leads. + r"""Describes the chosen level of intent of generated leads. """ class LeadFormDesiredIntent(proto.Enum): - r"""Enum describing the desired level of intent of generated + r"""Enum describing the chosen level of intent of generated leads. """ UNSPECIFIED = 0 diff --git a/google/ads/googleads/v11/enums/types/lead_form_field_user_input_type.py b/google/ads/googleads/v11/enums/types/lead_form_field_user_input_type.py index de0b94638..eb66ee7a8 100644 --- a/google/ads/googleads/v11/enums/types/lead_form_field_user_input_type.py +++ b/google/ads/googleads/v11/enums/types/lead_form_field_user_input_type.py @@ -35,6 +35,7 @@ class LeadFormFieldUserInputType(proto.Enum): EMAIL = 3 PHONE_NUMBER = 4 POSTAL_CODE = 5 + STREET_ADDRESS = 8 CITY = 9 REGION = 10 COUNTRY = 11 @@ -63,6 +64,54 @@ class LeadFormFieldUserInputType(proto.Enum): YEARS_IN_BUSINESS = 1008 JOB_DEPARTMENT = 1011 JOB_ROLE = 1012 + OVER_18_AGE = 1078 + OVER_19_AGE = 1079 + OVER_20_AGE = 1080 + OVER_21_AGE = 1081 + OVER_22_AGE = 1082 + OVER_23_AGE = 1083 + OVER_24_AGE = 1084 + OVER_25_AGE = 1085 + OVER_26_AGE = 1086 + OVER_27_AGE = 1087 + OVER_28_AGE = 1088 + OVER_29_AGE = 1089 + OVER_30_AGE = 1090 + OVER_31_AGE = 1091 + OVER_32_AGE = 1092 + OVER_33_AGE = 1093 + OVER_34_AGE = 1094 + OVER_35_AGE = 1095 + OVER_36_AGE = 1096 + OVER_37_AGE = 1097 + OVER_38_AGE = 1098 + OVER_39_AGE = 1099 + OVER_40_AGE = 1100 + OVER_41_AGE = 1101 + OVER_42_AGE = 1102 + OVER_43_AGE = 1103 + OVER_44_AGE = 1104 + OVER_45_AGE = 1105 + OVER_46_AGE = 1106 + OVER_47_AGE = 1107 + OVER_48_AGE = 1108 + OVER_49_AGE = 1109 + OVER_50_AGE = 1110 + OVER_51_AGE = 1111 + OVER_52_AGE = 1112 + OVER_53_AGE = 1113 + OVER_54_AGE = 1114 + OVER_55_AGE = 1115 + OVER_56_AGE = 1116 + OVER_57_AGE = 1117 + OVER_58_AGE = 1118 + OVER_59_AGE = 1119 + OVER_60_AGE = 1120 + OVER_61_AGE = 1121 + OVER_62_AGE = 1122 + OVER_63_AGE = 1123 + OVER_64_AGE = 1124 + OVER_65_AGE = 1125 EDUCATION_PROGRAM = 1013 EDUCATION_COURSE = 1014 PRODUCT = 1016 diff --git a/google/ads/googleads/v11/enums/types/location_group_radius_units.py b/google/ads/googleads/v11/enums/types/location_group_radius_units.py index bbfc87a20..f85bb5214 100644 --- a/google/ads/googleads/v11/enums/types/location_group_radius_units.py +++ b/google/ads/googleads/v11/enums/types/location_group_radius_units.py @@ -30,7 +30,9 @@ class LocationGroupRadiusUnitsEnum(proto.Message): """ class LocationGroupRadiusUnits(proto.Enum): - r"""The unit of radius distance in location group (e.g. MILES)""" + r"""The unit of radius distance in location group (for example, + MILES) + """ UNSPECIFIED = 0 UNKNOWN = 1 METERS = 2 diff --git a/google/ads/googleads/v11/enums/types/minute_of_hour.py b/google/ads/googleads/v11/enums/types/minute_of_hour.py index 9de94130c..568b2673f 100644 --- a/google/ads/googleads/v11/enums/types/minute_of_hour.py +++ b/google/ads/googleads/v11/enums/types/minute_of_hour.py @@ -28,7 +28,7 @@ class MinuteOfHourEnum(proto.Message): """ class MinuteOfHour(proto.Enum): - r"""Enumerates of quarter-hours. E.g. "FIFTEEN".""" + r"""Enumerates of quarter-hours. For example, "FIFTEEN".""" UNSPECIFIED = 0 UNKNOWN = 1 ZERO = 2 diff --git a/google/ads/googleads/v11/enums/types/month_of_year.py b/google/ads/googleads/v11/enums/types/month_of_year.py index 319d9504c..28b3dc363 100644 --- a/google/ads/googleads/v11/enums/types/month_of_year.py +++ b/google/ads/googleads/v11/enums/types/month_of_year.py @@ -24,13 +24,13 @@ class MonthOfYearEnum(proto.Message): - r"""Container for enumeration of months of the year, e.g., + r"""Container for enumeration of months of the year, for example, "January". """ class MonthOfYear(proto.Enum): - r"""Enumerates months of the year, e.g., "January".""" + r"""Enumerates months of the year, for example, "January".""" UNSPECIFIED = 0 UNKNOWN = 1 JANUARY = 2 diff --git a/google/ads/googleads/v11/enums/types/parental_status_type.py b/google/ads/googleads/v11/enums/types/parental_status_type.py index 9123a0157..12cc48b44 100644 --- a/google/ads/googleads/v11/enums/types/parental_status_type.py +++ b/google/ads/googleads/v11/enums/types/parental_status_type.py @@ -30,7 +30,7 @@ class ParentalStatusTypeEnum(proto.Message): """ class ParentalStatusType(proto.Enum): - r"""The type of parental statuses (e.g. not a parent).""" + r"""The type of parental statuses (for example, not a parent).""" UNSPECIFIED = 0 UNKNOWN = 1 PARENT = 300 diff --git a/google/ads/googleads/v11/enums/types/promotion_extension_occasion.py b/google/ads/googleads/v11/enums/types/promotion_extension_occasion.py index 3635cd25f..c678e7e46 100644 --- a/google/ads/googleads/v11/enums/types/promotion_extension_occasion.py +++ b/google/ads/googleads/v11/enums/types/promotion_extension_occasion.py @@ -25,7 +25,7 @@ class PromotionExtensionOccasionEnum(proto.Message): r"""Container for enum describing a promotion extension occasion. - For more information about the occasions please check: + For more information about the occasions check: https://support.google.com/google-ads/answer/7367521 """ diff --git a/google/ads/googleads/v11/enums/types/proximity_radius_units.py b/google/ads/googleads/v11/enums/types/proximity_radius_units.py index 3cf4aafb9..71f4b6cfe 100644 --- a/google/ads/googleads/v11/enums/types/proximity_radius_units.py +++ b/google/ads/googleads/v11/enums/types/proximity_radius_units.py @@ -28,7 +28,7 @@ class ProximityRadiusUnitsEnum(proto.Message): """ class ProximityRadiusUnits(proto.Enum): - r"""The unit of radius distance in proximity (e.g. MILES)""" + r"""The unit of radius distance in proximity (for example, MILES)""" UNSPECIFIED = 0 UNKNOWN = 1 MILES = 2 diff --git a/google/ads/googleads/v11/enums/types/recommendation_type.py b/google/ads/googleads/v11/enums/types/recommendation_type.py index b4cb92dbd..43075ff3c 100644 --- a/google/ads/googleads/v11/enums/types/recommendation_type.py +++ b/google/ads/googleads/v11/enums/types/recommendation_type.py @@ -53,6 +53,8 @@ class RecommendationType(proto.Enum): RESPONSIVE_SEARCH_AD_ASSET = 21 UPGRADE_SMART_SHOPPING_CAMPAIGN_TO_PERFORMANCE_MAX = 22 RESPONSIVE_SEARCH_AD_IMPROVE_AD_STRENGTH = 23 + DISPLAY_EXPANSION_OPT_IN = 24 + UPGRADE_LOCAL_CAMPAIGN_TO_PERFORMANCE_MAX = 25 __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/enums/types/user_list_flexible_rule_operator.py b/google/ads/googleads/v11/enums/types/user_list_flexible_rule_operator.py new file mode 100644 index 000000000..59f2d1f09 --- /dev/null +++ b/google/ads/googleads/v11/enums/types/user_list_flexible_rule_operator.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import proto # type: ignore + + +__protobuf__ = proto.module( + package="google.ads.googleads.v11.enums", + marshal="google.ads.googleads.v11", + manifest={"UserListFlexibleRuleOperatorEnum",}, +) + + +class UserListFlexibleRuleOperatorEnum(proto.Message): + r"""Logical operator connecting two rules. + """ + + class UserListFlexibleRuleOperator(proto.Enum): + r"""Enum describing possible user list combined rule operators.""" + UNSPECIFIED = 0 + UNKNOWN = 1 + AND = 2 + OR = 3 + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/errors/__init__.py b/google/ads/googleads/v11/errors/__init__.py index 6507622c6..d07f5a7b7 100644 --- a/google/ads/googleads/v11/errors/__init__.py +++ b/google/ads/googleads/v11/errors/__init__.py @@ -39,6 +39,7 @@ "AssetSetErrorEnum", "AssetSetLinkErrorEnum", "AudienceErrorEnum", + "AudienceInsightsErrorEnum", "AuthenticationErrorEnum", "AuthorizationErrorEnum", "BatchJobErrorEnum", diff --git a/google/ads/googleads/v11/errors/types/asset_link_error.py b/google/ads/googleads/v11/errors/types/asset_link_error.py index 4ed3c6311..3affddad1 100644 --- a/google/ads/googleads/v11/errors/types/asset_link_error.py +++ b/google/ads/googleads/v11/errors/types/asset_link_error.py @@ -47,6 +47,7 @@ class AssetLinkError(proto.Enum): YOUTUBE_VIDEO_REMOVED = 13 YOUTUBE_VIDEO_TOO_LONG = 14 YOUTUBE_VIDEO_TOO_SHORT = 15 + EXCLUDED_PARENT_FIELD_TYPE = 16 INVALID_STATUS = 17 YOUTUBE_VIDEO_DURATION_NOT_DEFINED = 18 CANNOT_CREATE_AUTOMATICALLY_CREATED_LINKS = 19 diff --git a/google/ads/googleads/v11/errors/types/audience_insights_error.py b/google/ads/googleads/v11/errors/types/audience_insights_error.py new file mode 100644 index 000000000..611bf60b0 --- /dev/null +++ b/google/ads/googleads/v11/errors/types/audience_insights_error.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import proto # type: ignore + + +__protobuf__ = proto.module( + package="google.ads.googleads.v11.errors", + marshal="google.ads.googleads.v11", + manifest={"AudienceInsightsErrorEnum",}, +) + + +class AudienceInsightsErrorEnum(proto.Message): + r"""Container for enum describing possible errors returned from + the AudienceInsightsService. + + """ + + class AudienceInsightsError(proto.Enum): + r"""Enum describing possible errors from AudienceInsightsService.""" + UNSPECIFIED = 0 + UNKNOWN = 1 + DIMENSION_INCOMPATIBLE_WITH_TOPIC_AUDIENCE_COMBINATIONS = 2 + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/errors/types/errors.py b/google/ads/googleads/v11/errors/types/errors.py index 42d1dd96a..13b2a2183 100644 --- a/google/ads/googleads/v11/errors/types/errors.py +++ b/google/ads/googleads/v11/errors/types/errors.py @@ -86,6 +86,9 @@ from google.ads.googleads.v11.errors.types import ( audience_error as gage_audience_error, ) +from google.ads.googleads.v11.errors.types import ( + audience_insights_error as gage_audience_insights_error, +) from google.ads.googleads.v11.errors.types import ( authentication_error as gage_authentication_error, ) @@ -1090,6 +1093,10 @@ class ErrorCode(proto.Message): experiment_arm_error (google.ads.googleads.v11.errors.types.ExperimentArmErrorEnum.ExperimentArmError): The reasons for the experiment arm error + This field is a member of `oneof`_ ``error_code``. + audience_insights_error (google.ads.googleads.v11.errors.types.AudienceInsightsErrorEnum.AudienceInsightsError): + The reasons for the Audience Insights error + This field is a member of `oneof`_ ``error_code``. """ @@ -1927,6 +1934,12 @@ class ErrorCode(proto.Message): oneof="error_code", enum=gage_experiment_arm_error.ExperimentArmErrorEnum.ExperimentArmError, ) + audience_insights_error = proto.Field( + proto.ENUM, + number=167, + oneof="error_code", + enum=gage_audience_insights_error.AudienceInsightsErrorEnum.AudienceInsightsError, + ) class ErrorLocation(proto.Message): diff --git a/google/ads/googleads/v11/errors/types/offline_user_data_job_error.py b/google/ads/googleads/v11/errors/types/offline_user_data_job_error.py index 281ec99e5..598e6b1e0 100644 --- a/google/ads/googleads/v11/errors/types/offline_user_data_job_error.py +++ b/google/ads/googleads/v11/errors/types/offline_user_data_job_error.py @@ -67,6 +67,10 @@ class OfflineUserDataJobError(proto.Enum): LAST_PURCHASE_TIME_LESS_THAN_ACQUISITION_TIME = 38 CUSTOMER_IDENTIFIER_NOT_ALLOWED = 39 INVALID_ITEM_ID = 40 + FIRST_PURCHASE_TIME_GREATER_THAN_LAST_PURCHASE_TIME = 42 + INVALID_LIFECYCLE_STAGE = 43 + INVALID_EVENT_VALUE = 44 + EVENT_ATTRIBUTE_ALL_FIELDS_ARE_REQUIRED = 45 __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/resources/types/accessible_bidding_strategy.py b/google/ads/googleads/v11/resources/types/accessible_bidding_strategy.py index 9e5f9d8bf..9a72a85aa 100644 --- a/google/ads/googleads/v11/resources/types/accessible_bidding_strategy.py +++ b/google/ads/googleads/v11/resources/types/accessible_bidding_strategy.py @@ -86,7 +86,7 @@ class AccessibleBiddingStrategy(proto.Message): This field is a member of `oneof`_ ``scheme``. target_impression_share (google.ads.googleads.v11.resources.types.AccessibleBiddingStrategy.TargetImpressionShare): Output only. A bidding strategy that - automatically optimizes towards a desired + automatically optimizes towards a chosen percentage of impressions. This field is a member of `oneof`_ ``scheme``. @@ -162,9 +162,9 @@ class TargetImpressionShare(proto.Message): Output only. The targeted location on the search results page. location_fraction_micros (int): - The desired fraction of ads to be shown in - the targeted location in micros. E.g. 1% equals - 10,000. + The chosen fraction of ads to be shown in the + targeted location in micros. For example, 1% + equals 10,000. This field is a member of `oneof`_ ``_location_fraction_micros``. cpc_bid_ceiling_micros (int): @@ -195,7 +195,7 @@ class TargetRoas(proto.Message): Attributes: target_roas (float): - Output only. The desired revenue (based on + Output only. The chosen revenue (based on conversion data) per unit of spend. This field is a member of `oneof`_ ``_target_roas``. diff --git a/google/ads/googleads/v11/resources/types/account_budget.py b/google/ads/googleads/v11/resources/types/account_budget.py index 442da3d93..ce8ea5ed0 100644 --- a/google/ads/googleads/v11/resources/types/account_budget.py +++ b/google/ads/googleads/v11/resources/types/account_budget.py @@ -38,8 +38,9 @@ class AccountBudget(proto.Message): Effective details about the budget are found in fields prefixed 'approved_', 'adjusted_' and those without a prefix. Since some effective details may differ from what the user had originally - requested (e.g. spending limit), these differences are juxtaposed - via 'proposed_', 'approved_', and possibly 'adjusted_' fields. + requested (for example, spending limit), these differences are + juxtaposed through 'proposed_', 'approved_', and possibly + 'adjusted_' fields. This resource is mutated using AccountBudgetProposal and cannot be mutated directly. A budget may have at most one pending proposal at @@ -131,7 +132,7 @@ class AccountBudget(proto.Message): This field is a member of `oneof`_ ``proposed_end_time``. proposed_end_time_type (google.ads.googleads.v11.enums.types.TimeTypeEnum.TimeType): Output only. The proposed end time as a - well-defined type, e.g. FOREVER. + well-defined type, for example, FOREVER. This field is a member of `oneof`_ ``proposed_end_time``. approved_end_date_time (str): @@ -141,7 +142,7 @@ class AccountBudget(proto.Message): This field is a member of `oneof`_ ``approved_end_time``. approved_end_time_type (google.ads.googleads.v11.enums.types.TimeTypeEnum.TimeType): Output only. The approved end time as a - well-defined type, e.g. FOREVER. + well-defined type, for example, FOREVER. This field is a member of `oneof`_ ``approved_end_time``. proposed_spending_limit_micros (int): @@ -151,7 +152,7 @@ class AccountBudget(proto.Message): This field is a member of `oneof`_ ``proposed_spending_limit``. proposed_spending_limit_type (google.ads.googleads.v11.enums.types.SpendingLimitTypeEnum.SpendingLimitType): Output only. The proposed spending limit as a - well-defined type, e.g. INFINITE. + well-defined type, for example, INFINITE. This field is a member of `oneof`_ ``proposed_spending_limit``. approved_spending_limit_micros (int): @@ -165,9 +166,9 @@ class AccountBudget(proto.Message): This field is a member of `oneof`_ ``approved_spending_limit``. approved_spending_limit_type (google.ads.googleads.v11.enums.types.SpendingLimitTypeEnum.SpendingLimitType): Output only. The approved spending limit as a - well-defined type, e.g. INFINITE. This will - only be populated if the approved spending limit - is INFINITE. + well-defined type, for example, INFINITE. This + will only be populated if the approved spending + limit is INFINITE. This field is a member of `oneof`_ ``approved_spending_limit``. adjusted_spending_limit_micros (int): @@ -187,10 +188,10 @@ class AccountBudget(proto.Message): This field is a member of `oneof`_ ``adjusted_spending_limit``. adjusted_spending_limit_type (google.ads.googleads.v11.enums.types.SpendingLimitTypeEnum.SpendingLimitType): Output only. The adjusted spending limit as a - well-defined type, e.g. INFINITE. This will only - be populated if the adjusted spending limit is - INFINITE, which is guaranteed to be true if the - approved spending limit is INFINITE. + well-defined type, for example, INFINITE. This + will only be populated if the adjusted spending + limit is INFINITE, which is guaranteed to be + true if the approved spending limit is INFINITE. This field is a member of `oneof`_ ``adjusted_spending_limit``. """ @@ -215,9 +216,9 @@ class PendingAccountBudgetProposal(proto.Message): This field is a member of `oneof`_ ``_account_budget_proposal``. proposal_type (google.ads.googleads.v11.enums.types.AccountBudgetProposalTypeEnum.AccountBudgetProposalType): - Output only. The type of this proposal, e.g. - END to end the budget associated with this - proposal. + Output only. The type of this proposal, for + example, END to end the budget associated with + this proposal. name (str): Output only. The name to assign to the account-level budget. @@ -252,7 +253,7 @@ class PendingAccountBudgetProposal(proto.Message): This field is a member of `oneof`_ ``end_time``. end_time_type (google.ads.googleads.v11.enums.types.TimeTypeEnum.TimeType): Output only. The end time as a well-defined - type, e.g. FOREVER. + type, for example, FOREVER. This field is a member of `oneof`_ ``end_time``. spending_limit_micros (int): @@ -262,7 +263,7 @@ class PendingAccountBudgetProposal(proto.Message): This field is a member of `oneof`_ ``spending_limit``. spending_limit_type (google.ads.googleads.v11.enums.types.SpendingLimitTypeEnum.SpendingLimitType): Output only. The spending limit as a - well-defined type, e.g. INFINITE. + well-defined type, for example, INFINITE. This field is a member of `oneof`_ ``spending_limit``. """ diff --git a/google/ads/googleads/v11/resources/types/account_budget_proposal.py b/google/ads/googleads/v11/resources/types/account_budget_proposal.py index 4e24651af..424c95acb 100644 --- a/google/ads/googleads/v11/resources/types/account_budget_proposal.py +++ b/google/ads/googleads/v11/resources/types/account_budget_proposal.py @@ -34,10 +34,10 @@ class AccountBudgetProposal(proto.Message): All fields prefixed with 'proposed' may not necessarily be applied directly. For example, proposed spending limits may be adjusted before their application. This is true if the 'proposed' field has - an 'approved' counterpart, e.g. spending limits. + an 'approved' counterpart, for example, spending limits. - Please note that the proposal type (proposal_type) changes which - fields are required and which must remain empty. + Note that the proposal type (proposal_type) changes which fields are + required and which must remain empty. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -68,9 +68,9 @@ class AccountBudgetProposal(proto.Message): This field is a member of `oneof`_ ``_account_budget``. proposal_type (google.ads.googleads.v11.enums.types.AccountBudgetProposalTypeEnum.AccountBudgetProposalType): - Immutable. The type of this proposal, e.g. - END to end the budget associated with this - proposal. + Immutable. The type of this proposal, for + example, END to end the budget associated with + this proposal. status (google.ads.googleads.v11.enums.types.AccountBudgetProposalStatusEnum.AccountBudgetProposalStatus): Output only. The status of this proposal. When a new proposal is created, the status @@ -115,7 +115,7 @@ class AccountBudgetProposal(proto.Message): This field is a member of `oneof`_ ``proposed_start_time``. proposed_start_time_type (google.ads.googleads.v11.enums.types.TimeTypeEnum.TimeType): Immutable. The proposed start date time as a - well-defined type, e.g. NOW. + well-defined type, for example, NOW. This field is a member of `oneof`_ ``proposed_start_time``. proposed_end_date_time (str): @@ -125,7 +125,7 @@ class AccountBudgetProposal(proto.Message): This field is a member of `oneof`_ ``proposed_end_time``. proposed_end_time_type (google.ads.googleads.v11.enums.types.TimeTypeEnum.TimeType): Immutable. The proposed end date time as a - well-defined type, e.g. FOREVER. + well-defined type, for example, FOREVER. This field is a member of `oneof`_ ``proposed_end_time``. approved_end_date_time (str): @@ -135,7 +135,7 @@ class AccountBudgetProposal(proto.Message): This field is a member of `oneof`_ ``approved_end_time``. approved_end_time_type (google.ads.googleads.v11.enums.types.TimeTypeEnum.TimeType): Output only. The approved end date time as a - well-defined type, e.g. FOREVER. + well-defined type, for example, FOREVER. This field is a member of `oneof`_ ``approved_end_time``. proposed_spending_limit_micros (int): @@ -145,7 +145,7 @@ class AccountBudgetProposal(proto.Message): This field is a member of `oneof`_ ``proposed_spending_limit``. proposed_spending_limit_type (google.ads.googleads.v11.enums.types.SpendingLimitTypeEnum.SpendingLimitType): Immutable. The proposed spending limit as a - well-defined type, e.g. INFINITE. + well-defined type, for example, INFINITE. This field is a member of `oneof`_ ``proposed_spending_limit``. approved_spending_limit_micros (int): @@ -155,7 +155,7 @@ class AccountBudgetProposal(proto.Message): This field is a member of `oneof`_ ``approved_spending_limit``. approved_spending_limit_type (google.ads.googleads.v11.enums.types.SpendingLimitTypeEnum.SpendingLimitType): Output only. The approved spending limit as a - well-defined type, e.g. INFINITE. + well-defined type, for example, INFINITE. This field is a member of `oneof`_ ``approved_spending_limit``. """ diff --git a/google/ads/googleads/v11/resources/types/account_link.py b/google/ads/googleads/v11/resources/types/account_link.py index f53bebfcf..4981d62a9 100644 --- a/google/ads/googleads/v11/resources/types/account_link.py +++ b/google/ads/googleads/v11/resources/types/account_link.py @@ -131,12 +131,13 @@ class ThirdPartyAppAnalyticsLinkIdentifier(proto.Message): a mobile application from which the data was collected to the Google Ads API. For iOS, the ID string is the 9 digit string that appears at the - end of an App Store URL (e.g., "422689480" for - "Gmail" whose App Store link is + end of an App Store URL (for example, + "422689480" for "Gmail" whose App Store link is https://apps.apple.com/us/app/gmail-email-by-google/id422689480). For Android, the ID string is the application's - package name (e.g., "com.google.android.gm" for - "Gmail" given Google Play link + package name (for example, + "com.google.android.gm" for "Gmail" given Google + Play link https://play.google.com/store/apps/details?id=com.google.android.gm) This field should not be empty when creating a new third party app analytics link. It is unable diff --git a/google/ads/googleads/v11/resources/types/ad.py b/google/ads/googleads/v11/resources/types/ad.py index c2e30f892..522fada9a 100644 --- a/google/ads/googleads/v11/resources/types/ad.py +++ b/google/ads/googleads/v11/resources/types/ad.py @@ -74,8 +74,8 @@ class Ad(proto.Message): url_custom_parameters (Sequence[google.ads.googleads.v11.common.types.CustomParameter]): The list of mappings that can be used to substitute custom parameter tags in a ``tracking_url_template``, - ``final_urls``, or ``mobile_final_urls``. For mutates, - please use url custom parameter operations. + ``final_urls``, or ``mobile_final_urls``. For mutates, use + url custom parameter operations. display_url (str): The URL that appears in the ad description for some ad formats. @@ -98,8 +98,8 @@ class Ad(proto.Message): When this preference is set the ad will be preferred over other ads when being displayed on a mobile device. The ad can still be displayed - on other device types, e.g. if no other ads are - available. If unspecified (no device + on other device types, for example, if no other + ads are available. If unspecified (no device preference), all devices are targeted. This is only supported by some ad types. url_collections (Sequence[google.ads.googleads.v11.common.types.UrlCollection]): diff --git a/google/ads/googleads/v11/resources/types/ad_group_ad_asset_view.py b/google/ads/googleads/v11/resources/types/ad_group_ad_asset_view.py index f564e48ff..99bc0bc8d 100644 --- a/google/ads/googleads/v11/resources/types/ad_group_ad_asset_view.py +++ b/google/ads/googleads/v11/resources/types/ad_group_ad_asset_view.py @@ -31,7 +31,8 @@ class AdGroupAdAssetView(proto.Message): r"""A link between an AdGroupAd and an Asset. - Currently we only support AdGroupAdAssetView for AppAds. + Currently we only support AdGroupAdAssetView for AppAds and + Responsive Search Ads. Attributes: resource_name (str): diff --git a/google/ads/googleads/v11/resources/types/ad_group_bid_modifier.py b/google/ads/googleads/v11/resources/types/ad_group_bid_modifier.py index 1e4988775..58b4286dc 100644 --- a/google/ads/googleads/v11/resources/types/ad_group_bid_modifier.py +++ b/google/ads/googleads/v11/resources/types/ad_group_bid_modifier.py @@ -76,7 +76,7 @@ class AdGroupBidModifier(proto.Message): Output only. Bid modifier source. hotel_date_selection_type (google.ads.googleads.v11.common.types.HotelDateSelectionTypeInfo): Immutable. Criterion for hotel date selection - (default dates vs. user selected). + (default dates versus user selected). This field is a member of `oneof`_ ``criterion``. hotel_advance_booking_window (google.ads.googleads.v11.common.types.HotelAdvanceBookingWindowInfo): diff --git a/google/ads/googleads/v11/resources/types/ad_parameter.py b/google/ads/googleads/v11/resources/types/ad_parameter.py index d521fd80c..18c84a2a0 100644 --- a/google/ads/googleads/v11/resources/types/ad_parameter.py +++ b/google/ads/googleads/v11/resources/types/ad_parameter.py @@ -29,7 +29,8 @@ class AdParameter(proto.Message): URLs). There can be a maximum of two AdParameters per ad group criterion. (One with parameter_index = 1 and one with parameter_index = 2.) In the ad the parameters are referenced by a - placeholder of the form "{param#:value}". E.g. "{param1:$17}" + placeholder of the form "{param#:value}". For example, + "{param1:$17}" Attributes: resource_name (str): diff --git a/google/ads/googleads/v11/resources/types/asset_group.py b/google/ads/googleads/v11/resources/types/asset_group.py index 28552653d..85233c81a 100644 --- a/google/ads/googleads/v11/resources/types/asset_group.py +++ b/google/ads/googleads/v11/resources/types/asset_group.py @@ -15,6 +15,7 @@ # import proto # type: ignore +from google.ads.googleads.v11.enums.types import ad_strength as gage_ad_strength from google.ads.googleads.v11.enums.types import asset_group_status @@ -67,6 +68,9 @@ class AssetGroup(proto.Message): Second part of text that may appear appended to the url displayed in the ad. This field can only be set when path1 is set. + ad_strength (google.ads.googleads.v11.enums.types.AdStrengthEnum.AdStrength): + Output only. Overall ad strength of this + asset group. """ resource_name = proto.Field(proto.STRING, number=1,) @@ -82,6 +86,9 @@ class AssetGroup(proto.Message): ) path1 = proto.Field(proto.STRING, number=7,) path2 = proto.Field(proto.STRING, number=8,) + ad_strength = proto.Field( + proto.ENUM, number=10, enum=gage_ad_strength.AdStrengthEnum.AdStrength, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/resources/types/asset_group_asset.py b/google/ads/googleads/v11/resources/types/asset_group_asset.py index 5b16a39dd..04f82b32d 100644 --- a/google/ads/googleads/v11/resources/types/asset_group_asset.py +++ b/google/ads/googleads/v11/resources/types/asset_group_asset.py @@ -49,7 +49,7 @@ class AssetGroupAsset(proto.Message): asset is linking. field_type (google.ads.googleads.v11.enums.types.AssetFieldTypeEnum.AssetFieldType): The description of the placement of the asset within the - asset group. E.g.: HEADLINE, YOUTUBE_VIDEO etc + asset group. For example: HEADLINE, YOUTUBE_VIDEO etc status (google.ads.googleads.v11.enums.types.AssetLinkStatusEnum.AssetLinkStatus): The status of the link between an asset and asset group. diff --git a/google/ads/googleads/v11/resources/types/audience.py b/google/ads/googleads/v11/resources/types/audience.py index 7b3b41578..1a769b5f5 100644 --- a/google/ads/googleads/v11/resources/types/audience.py +++ b/google/ads/googleads/v11/resources/types/audience.py @@ -27,7 +27,7 @@ class Audience(proto.Message): - r"""Audience is an effective targeting option that allows you to + r"""Audience is an effective targeting option that lets you intersect different segment attributes, such as detailed demographics and affinities, to create audiences that represent sections of your target segments. diff --git a/google/ads/googleads/v11/resources/types/bidding_strategy.py b/google/ads/googleads/v11/resources/types/bidding_strategy.py index ce36e7eab..2028a4ba2 100644 --- a/google/ads/googleads/v11/resources/types/bidding_strategy.py +++ b/google/ads/googleads/v11/resources/types/bidding_strategy.py @@ -127,7 +127,7 @@ class BiddingStrategy(proto.Message): This field is a member of `oneof`_ ``scheme``. target_impression_share (google.ads.googleads.v11.common.types.TargetImpressionShare): A bidding strategy that automatically - optimizes towards a desired percentage of + optimizes towards a chosen percentage of impressions. This field is a member of `oneof`_ ``scheme``. diff --git a/google/ads/googleads/v11/resources/types/billing_setup.py b/google/ads/googleads/v11/resources/types/billing_setup.py index 96d7fb7f9..eb417fa2c 100644 --- a/google/ads/googleads/v11/resources/types/billing_setup.py +++ b/google/ads/googleads/v11/resources/types/billing_setup.py @@ -98,8 +98,8 @@ class PaymentsAccountInfo(proto.Message): Output only. A 16 digit id used to identify the payments account associated with the billing setup. - This must be passed as a string with dashes, - e.g. "1234-5678-9012-3456". + This must be passed as a string with dashes, for + example, "1234-5678-9012-3456". This field is a member of `oneof`_ ``_payments_account_id``. payments_account_name (str): @@ -118,7 +118,7 @@ class PaymentsAccountInfo(proto.Message): payments profile associated with the billing setup. This must be passed in as a string with dashes, - e.g. "1234-5678-9012". + for example, "1234-5678-9012". This field is a member of `oneof`_ ``_payments_profile_id``. payments_profile_name (str): @@ -128,8 +128,8 @@ class PaymentsAccountInfo(proto.Message): This field is a member of `oneof`_ ``_payments_profile_name``. secondary_payments_profile_id (str): Output only. A secondary payments profile id - present in uncommon situations, e.g. when a - sequential liability agreement has been + present in uncommon situations, for example, + when a sequential liability agreement has been arranged. This field is a member of `oneof`_ ``_secondary_payments_profile_id``. diff --git a/google/ads/googleads/v11/resources/types/campaign.py b/google/ads/googleads/v11/resources/types/campaign.py index f6d4b6b98..783759ad0 100644 --- a/google/ads/googleads/v11/resources/types/campaign.py +++ b/google/ads/googleads/v11/resources/types/campaign.py @@ -38,6 +38,9 @@ app_campaign_bidding_strategy_goal_type, ) from google.ads.googleads.v11.enums.types import asset_field_type +from google.ads.googleads.v11.enums.types import ( + bidding_strategy_system_status as gage_bidding_strategy_system_status, +) from google.ads.googleads.v11.enums.types import ( bidding_strategy_type as gage_bidding_strategy_type, ) @@ -111,6 +114,9 @@ class Campaign(proto.Message): serving_status (google.ads.googleads.v11.enums.types.CampaignServingStatusEnum.CampaignServingStatus): Output only. The ad serving status of the campaign. + bidding_strategy_system_status (google.ads.googleads.v11.enums.types.BiddingStrategySystemStatusEnum.BiddingStrategySystemStatus): + Output only. The system status of the + campaign's bidding strategy. ad_serving_optimization_status (google.ads.googleads.v11.enums.types.AdServingOptimizationStatusEnum.AdServingOptimizationStatus): The ad serving optimization status of the campaign. @@ -220,7 +226,11 @@ class Campaign(proto.Message): This field is a member of `oneof`_ ``_campaign_group``. end_date (str): The last day of the campaign in serving - customer's timezone in YYYY-MM-DD format. + customer's timezone in YYYY-MM-DD format. On + create, defaults to 2037-12-30, which means the + campaign will run indefinitely. To set an + existing campaign to run indefinitely, set this + field to 2037-12-30. This field is a member of `oneof`_ ``_end_date``. final_url_suffix (str): @@ -340,7 +350,7 @@ class Campaign(proto.Message): target_impression_share (google.ads.googleads.v11.common.types.TargetImpressionShare): Target Impression Share bidding strategy. An automated bidding strategy that sets bids to - achieve a desired percentage of impressions. + achieve a chosen percentage of impressions. This field is a member of `oneof`_ ``campaign_bidding_strategy``. target_roas (google.ads.googleads.v11.common.types.TargetRoas): @@ -451,11 +461,11 @@ class DynamicSearchAdsSetting(proto.Message): Attributes: domain_name (str): Required. The Internet domain name that this - setting represents, e.g., "google.com" or + setting represents, for example, "google.com" or "www.google.com". language_code (str): Required. The language code specifying the - language of the domain, e.g., "en". + language of the domain, for example, "en". use_supplied_urls_only (bool): Whether the campaign uses advertiser supplied URLs exclusively. @@ -489,7 +499,7 @@ class ShoppingSetting(proto.Message): Sales country of products to include in the campaign. Only one of feed_label or sales_country can be set. Field is immutable except for clearing. Once this field is cleared, - you must use feed_label if you wish to set the sales + you must use feed_label if you want to set the sales country. This field is a member of `oneof`_ ``_sales_country``. @@ -497,8 +507,8 @@ class ShoppingSetting(proto.Message): Feed label of products to include in the campaign. Only one of feed_label or sales_country can be set. If used instead of sales_country, the feed_label field accepts country codes - in the same format i.e. 'XX'. Otherwise can be any string - used for feed label in Google Merchant Center. + in the same format for example: 'XX'. Otherwise can be any + string used for feed label in Google Merchant Center. campaign_priority (int): Priority of the campaign. Campaigns with numerically higher priorities take precedence @@ -723,6 +733,11 @@ class CategoryBid(proto.Message): number=21, enum=campaign_serving_status.CampaignServingStatusEnum.CampaignServingStatus, ) + bidding_strategy_system_status = proto.Field( + proto.ENUM, + number=78, + enum=gage_bidding_strategy_system_status.BiddingStrategySystemStatusEnum.BiddingStrategySystemStatus, + ) ad_serving_optimization_status = proto.Field( proto.ENUM, number=8, diff --git a/google/ads/googleads/v11/resources/types/campaign_simulation.py b/google/ads/googleads/v11/resources/types/campaign_simulation.py index ac659d55f..a447bbeb6 100644 --- a/google/ads/googleads/v11/resources/types/campaign_simulation.py +++ b/google/ads/googleads/v11/resources/types/campaign_simulation.py @@ -36,9 +36,8 @@ class CampaignSimulation(proto.Message): TARGET_CPA - UNIFORM SEARCH - TARGET_CPA - SCALING SEARCH - TARGET_ROAS - UNIFORM SEARCH - TARGET_IMPRESSION_SHARE - UNIFORM SEARCH - BUDGET - UNIFORM SHOPPING - BUDGET - UNIFORM SHOPPING - - TARGET_ROAS - UNIFORM MULTIPLE - TARGET_CPA - UNIFORM - OWNED_AND_OPERATED - TARGET_CPA - DEFAULT DISPLAY - TARGET_CPA - - UNIFORM + TARGET_ROAS - UNIFORM MULTI_CHANNEL - TARGET_CPA - UNIFORM DISCOVERY + - TARGET_CPA - DEFAULT DISPLAY - TARGET_CPA - UNIFORM This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. diff --git a/google/ads/googleads/v11/resources/types/carrier_constant.py b/google/ads/googleads/v11/resources/types/carrier_constant.py index 4d1609acc..405b75dae 100644 --- a/google/ads/googleads/v11/resources/types/carrier_constant.py +++ b/google/ads/googleads/v11/resources/types/carrier_constant.py @@ -43,8 +43,8 @@ class CarrierConstant(proto.Message): This field is a member of `oneof`_ ``_name``. country_code (str): Output only. The country code of the country - where the carrier is located, e.g., "AR", "FR", - etc. + where the carrier is located, for example, "AR", + "FR", etc. This field is a member of `oneof`_ ``_country_code``. """ diff --git a/google/ads/googleads/v11/resources/types/conversion_action.py b/google/ads/googleads/v11/resources/types/conversion_action.py index 9501c8070..c77dafc35 100644 --- a/google/ads/googleads/v11/resources/types/conversion_action.py +++ b/google/ads/googleads/v11/resources/types/conversion_action.py @@ -76,8 +76,9 @@ class ConversionAction(proto.Message): conversion goal configured with a primary_for_goal = false conversion action, that conversion action is still biddable. By default, primary_for_goal will be true if not set. In V9, - primary_for_goal can only be set to false after creation via - an 'update' operation because it's not declared as optional. + primary_for_goal can only be set to false after creation + through an 'update' operation because it's not declared as + optional. This field is a member of `oneof`_ ``_primary_for_goal``. category (google.ads.googleads.v11.enums.types.ConversionActionCategoryEnum.ConversionActionCategory): @@ -96,8 +97,8 @@ class ConversionAction(proto.Message): This field is a member of `oneof`_ ``_include_in_conversions_metric``. click_through_lookback_window_days (int): The maximum number of days that may elapse - between an interaction (e.g., a click) and a - conversion event. + between an interaction (for example, a click) + and a conversion event. This field is a member of `oneof`_ ``_click_through_lookback_window_days``. view_through_lookback_window_days (int): diff --git a/google/ads/googleads/v11/resources/types/currency_constant.py b/google/ads/googleads/v11/resources/types/currency_constant.py index 1548f67bf..d40526adf 100644 --- a/google/ads/googleads/v11/resources/types/currency_constant.py +++ b/google/ads/googleads/v11/resources/types/currency_constant.py @@ -34,7 +34,7 @@ class CurrencyConstant(proto.Message): ``currencyConstants/{code}`` code (str): Output only. ISO 4217 three-letter currency - code, e.g. "USD". + code, for example, "USD". This field is a member of `oneof`_ ``_code``. name (str): @@ -44,7 +44,7 @@ class CurrencyConstant(proto.Message): This field is a member of `oneof`_ ``_name``. symbol (str): Output only. Standard symbol for describing - this currency, e.g. '$' for US Dollars. + this currency, for example, '$' for US Dollars. This field is a member of `oneof`_ ``_symbol``. billable_unit_micros (int): diff --git a/google/ads/googleads/v11/resources/types/customer.py b/google/ads/googleads/v11/resources/types/customer.py index 01d945d1a..1c911f4c7 100644 --- a/google/ads/googleads/v11/resources/types/customer.py +++ b/google/ads/googleads/v11/resources/types/customer.py @@ -180,7 +180,7 @@ class CallReportingSetting(proto.Message): Attributes: call_reporting_enabled (bool): Enable reporting of phone call events by - redirecting them via Google System. + redirecting them through Google System. This field is a member of `oneof`_ ``_call_reporting_enabled``. call_conversion_reporting_enabled (bool): @@ -211,11 +211,10 @@ class ConversionTrackingSetting(proto.Message): Attributes: conversion_tracking_id (int): - Output only. The conversion tracking id used - for this account. This id is automatically - assigned after any conversion tracking feature - is used. If the customer doesn't use conversion - tracking, this is 0. This field is read-only. + Output only. The conversion tracking id used for this + account. This id doesn't indicate whether the customer uses + conversion tracking (conversion_tracking_status does). This + field is read-only. This field is a member of `oneof`_ ``_conversion_tracking_id``. cross_account_conversion_tracking_id (int): diff --git a/google/ads/googleads/v11/resources/types/customer_client.py b/google/ads/googleads/v11/resources/types/customer_client.py index 0d8b4e95d..ee1091d9f 100644 --- a/google/ads/googleads/v11/resources/types/customer_client.py +++ b/google/ads/googleads/v11/resources/types/customer_client.py @@ -56,7 +56,7 @@ class CustomerClient(proto.Message): This field is a member of `oneof`_ ``_level``. time_zone (str): Output only. Common Locale Data Repository (CLDR) string - representation of the time zone of the client, e.g. + representation of the time zone of the client, for example, America/Los_Angeles. Read only. This field is a member of `oneof`_ ``_time_zone``. @@ -76,8 +76,8 @@ class CustomerClient(proto.Message): This field is a member of `oneof`_ ``_descriptive_name``. currency_code (str): - Output only. Currency code (e.g. 'USD', - 'EUR') for the client. Read only. + Output only. Currency code (for example, + 'USD', 'EUR') for the client. Read only. This field is a member of `oneof`_ ``_currency_code``. id (int): diff --git a/google/ads/googleads/v11/resources/types/detail_placement_view.py b/google/ads/googleads/v11/resources/types/detail_placement_view.py index 1ff344e64..74936bbf1 100644 --- a/google/ads/googleads/v11/resources/types/detail_placement_view.py +++ b/google/ads/googleads/v11/resources/types/detail_placement_view.py @@ -50,20 +50,21 @@ class DetailPlacementView(proto.Message): This field is a member of `oneof`_ ``_display_name``. group_placement_target_url (str): - Output only. URL of the group placement, e.g. - domain, link to the mobile application in app - store, or a YouTube channel URL. + Output only. URL of the group placement, for + example, domain, link to the mobile application + in app store, or a YouTube channel URL. This field is a member of `oneof`_ ``_group_placement_target_url``. target_url (str): - Output only. URL of the placement, e.g. - website, link to the mobile application in app - store, or a YouTube video URL. + Output only. URL of the placement, for + example, website, link to the mobile application + in app store, or a YouTube video URL. This field is a member of `oneof`_ ``_target_url``. placement_type (google.ads.googleads.v11.enums.types.PlacementTypeEnum.PlacementType): - Output only. Type of the placement, e.g. - Website, YouTube Video, and Mobile Application. + Output only. Type of the placement, for + example, Website, YouTube Video, and Mobile + Application. """ resource_name = proto.Field(proto.STRING, number=1,) diff --git a/google/ads/googleads/v11/resources/types/detailed_demographic.py b/google/ads/googleads/v11/resources/types/detailed_demographic.py index 59721965a..12052ab7c 100644 --- a/google/ads/googleads/v11/resources/types/detailed_demographic.py +++ b/google/ads/googleads/v11/resources/types/detailed_demographic.py @@ -42,8 +42,8 @@ class DetailedDemographic(proto.Message): demographic. name (str): Output only. The name of the detailed - demographic. E.g."Highest Level of Educational - Attainment". + demographic. For example,"Highest Level of + Educational Attainment". parent (str): Output only. The parent of the detailed_demographic. launched_to_all (bool): diff --git a/google/ads/googleads/v11/resources/types/domain_category.py b/google/ads/googleads/v11/resources/types/domain_category.py index ec5639ffe..f6ea89470 100644 --- a/google/ads/googleads/v11/resources/types/domain_category.py +++ b/google/ads/googleads/v11/resources/types/domain_category.py @@ -43,15 +43,15 @@ class DomainCategory(proto.Message): This field is a member of `oneof`_ ``_campaign``. category (str): Output only. Recommended category for the - website domain. e.g. if you have a website about - electronics, the categories could be "cameras", - "televisions", etc. + website domain, for example, if you have a + website about electronics, the categories could + be "cameras", "televisions", etc. This field is a member of `oneof`_ ``_category``. language_code (str): Output only. The language code specifying the - language of the website. e.g. "en" for English. - The language can be specified in the + language of the website, for example, "en" for + English. The language can be specified in the DynamicSearchAdsSetting required for dynamic search ads. This is the language of the pages from your website that you want Google Ads to diff --git a/google/ads/googleads/v11/resources/types/experiment.py b/google/ads/googleads/v11/resources/types/experiment.py index 76c528f5a..303fb943c 100644 --- a/google/ads/googleads/v11/resources/types/experiment.py +++ b/google/ads/googleads/v11/resources/types/experiment.py @@ -63,7 +63,7 @@ class Experiment(proto.Message): The product/feature that uses this experiment. status (google.ads.googleads.v11.enums.types.ExperimentStatusEnum.ExperimentStatus): - The Advertiser-desired status of this + The Advertiser-chosen status of this experiment. start_date (str): Date when the experiment starts. By default, diff --git a/google/ads/googleads/v11/resources/types/feed_item.py b/google/ads/googleads/v11/resources/types/feed_item.py index 3205b492a..361e75a64 100644 --- a/google/ads/googleads/v11/resources/types/feed_item.py +++ b/google/ads/googleads/v11/resources/types/feed_item.py @@ -100,8 +100,8 @@ class FeedItem(proto.Message): validation and approval state for active feed mappings. There will be an entry in the list for each type of feed mapping associated with the - feed, e.g. a feed with a sitelink and a call - feed mapping would cause every feed item + feed, for example, a feed with a sitelink and a + call feed mapping would cause every feed item associated with that feed to have an entry in this list for both sitelink and call. This field is read-only. @@ -301,12 +301,12 @@ class FeedItemValidationError(proto.Message): Output only. Set of feed attributes in the feed item flagged during validation. If empty, no specific feed attributes can be associated - with the error (e.g. error across the entire - feed item). + with the error (for example, error across the + entire feed item). extra_info (str): Output only. Any extra information related to this error which is not captured by validation_error and - feed_attribute_id (e.g. placeholder field IDs when + feed_attribute_id (for example, placeholder field IDs when feed_attribute_id is not mapped). Note that extra_info is not localized. diff --git a/google/ads/googleads/v11/resources/types/feed_mapping.py b/google/ads/googleads/v11/resources/types/feed_mapping.py index e56b1200c..bebe07d22 100644 --- a/google/ads/googleads/v11/resources/types/feed_mapping.py +++ b/google/ads/googleads/v11/resources/types/feed_mapping.py @@ -91,14 +91,14 @@ class FeedMapping(proto.Message): This field is read-only. placeholder_type (google.ads.googleads.v11.enums.types.PlaceholderTypeEnum.PlaceholderType): Immutable. The placeholder type of this - mapping (i.e., if the mapping maps feed + mapping (for example, if the mapping maps feed attributes to placeholder fields). This field is a member of `oneof`_ ``target``. criterion_type (google.ads.googleads.v11.enums.types.FeedMappingCriterionTypeEnum.FeedMappingCriterionType): Immutable. The criterion type of this mapping - (i.e., if the mapping maps feed attributes to - criterion fields). + (for example, if the mapping maps feed + attributes to criterion fields). This field is a member of `oneof`_ ``target``. """ diff --git a/google/ads/googleads/v11/resources/types/group_placement_view.py b/google/ads/googleads/v11/resources/types/group_placement_view.py index a8bc73ce3..05645b675 100644 --- a/google/ads/googleads/v11/resources/types/group_placement_view.py +++ b/google/ads/googleads/v11/resources/types/group_placement_view.py @@ -48,14 +48,15 @@ class GroupPlacementView(proto.Message): This field is a member of `oneof`_ ``_display_name``. target_url (str): - Output only. URL of the group placement, e.g. - domain, link to the mobile application in app - store, or a YouTube channel URL. + Output only. URL of the group placement, for + example, domain, link to the mobile application + in app store, or a YouTube channel URL. This field is a member of `oneof`_ ``_target_url``. placement_type (google.ads.googleads.v11.enums.types.PlacementTypeEnum.PlacementType): - Output only. Type of the placement, e.g. - Website, YouTube Channel, Mobile Application. + Output only. Type of the placement, for + example, Website, YouTube Channel, Mobile + Application. """ resource_name = proto.Field(proto.STRING, number=1,) diff --git a/google/ads/googleads/v11/resources/types/hotel_reconciliation.py b/google/ads/googleads/v11/resources/types/hotel_reconciliation.py index 09cf87c0f..068b5efe8 100644 --- a/google/ads/googleads/v11/resources/types/hotel_reconciliation.py +++ b/google/ads/googleads/v11/resources/types/hotel_reconciliation.py @@ -28,7 +28,8 @@ class HotelReconciliation(proto.Message): r"""A hotel reconciliation. It contains conversion information from Hotel bookings to reconcile with advertiser records. These - rows may be updated or canceled before billing via Bulk Uploads. + rows may be updated or canceled before billing through Bulk + Uploads. Attributes: resource_name (str): diff --git a/google/ads/googleads/v11/resources/types/invoice.py b/google/ads/googleads/v11/resources/types/invoice.py index 653edf55a..43546da2b 100644 --- a/google/ads/googleads/v11/resources/types/invoice.py +++ b/google/ads/googleads/v11/resources/types/invoice.py @@ -57,15 +57,16 @@ class Invoice(proto.Message): payments_account_id (str): Output only. A 16 digit ID used to identify the payments account associated with the billing - setup, e.g. "1234-5678-9012-3456". It appears on - the invoice PDF as "Billing Account Number". + setup, for example, "1234-5678-9012-3456". It + appears on the invoice PDF as "Billing Account + Number". This field is a member of `oneof`_ ``_payments_account_id``. payments_profile_id (str): Output only. A 12 digit ID used to identify the payments profile associated with the billing - setup, e.g. "1234-5678-9012". It appears on the - invoice PDF as "Billing ID". + setup, for example, "1234-5678-9012". It appears + on the invoice PDF as "Billing ID". This field is a member of `oneof`_ ``_payments_profile_id``. issue_date (str): diff --git a/google/ads/googleads/v11/resources/types/keyword_plan_ad_group_keyword.py b/google/ads/googleads/v11/resources/types/keyword_plan_ad_group_keyword.py index e9a8ca34e..dfe0f1502 100644 --- a/google/ads/googleads/v11/resources/types/keyword_plan_ad_group_keyword.py +++ b/google/ads/googleads/v11/resources/types/keyword_plan_ad_group_keyword.py @@ -53,12 +53,12 @@ class KeywordPlanAdGroupKeyword(proto.Message): match_type (google.ads.googleads.v11.enums.types.KeywordMatchTypeEnum.KeywordMatchType): The keyword match type. cpc_bid_micros (int): - A keyword level max cpc bid in micros (e.g. - $1 = 1mm). The currency is the same as the - account currency code. This will override any - CPC bid set at the keyword plan ad group level. - Not applicable for negative keywords. (negative - = true) This field is Optional. + A keyword level max cpc bid in micros (for + example, $1 = 1mm). The currency is the same as + the account currency code. This will override + any CPC bid set at the keyword plan ad group + level. Not applicable for negative keywords. + (negative = true) This field is Optional. This field is a member of `oneof`_ ``_cpc_bid_micros``. negative (bool): diff --git a/google/ads/googleads/v11/resources/types/language_constant.py b/google/ads/googleads/v11/resources/types/language_constant.py index 8c3847eb4..f7e36f3b7 100644 --- a/google/ads/googleads/v11/resources/types/language_constant.py +++ b/google/ads/googleads/v11/resources/types/language_constant.py @@ -37,13 +37,14 @@ class LanguageConstant(proto.Message): This field is a member of `oneof`_ ``_id``. code (str): - Output only. The language code, e.g. "en_US", "en_AU", "es", - "fr", etc. + Output only. The language code, for example, "en_US", + "en_AU", "es", "fr", etc. This field is a member of `oneof`_ ``_code``. name (str): Output only. The full name of the language in - English, e.g., "English (US)", "Spanish", etc. + English, for example, "English (US)", "Spanish", + etc. This field is a member of `oneof`_ ``_name``. targetable (bool): diff --git a/google/ads/googleads/v11/resources/types/lead_form_submission_data.py b/google/ads/googleads/v11/resources/types/lead_form_submission_data.py index 74fac61c6..018f3d653 100644 --- a/google/ads/googleads/v11/resources/types/lead_form_submission_data.py +++ b/google/ads/googleads/v11/resources/types/lead_form_submission_data.py @@ -57,8 +57,8 @@ class LeadFormSubmissionData(proto.Message): the submissed lead form. submission_date_time (str): Output only. The date and time at which the lead form was - submitted. The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. - "2019-01-01 12:32:45-08:00". + submitted. The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for + example, "2019-01-01 12:32:45-08:00". """ resource_name = proto.Field(proto.STRING, number=1,) diff --git a/google/ads/googleads/v11/resources/types/life_event.py b/google/ads/googleads/v11/resources/types/life_event.py index 84df79f65..c5b4de00b 100644 --- a/google/ads/googleads/v11/resources/types/life_event.py +++ b/google/ads/googleads/v11/resources/types/life_event.py @@ -41,8 +41,8 @@ class LifeEvent(proto.Message): id (int): Output only. The ID of the life event. name (str): - Output only. The name of the life event. - E.g.,"Recently Moved". + Output only. The name of the life event, for + example,"Recently Moved". parent (str): Output only. The parent of the life_event. launched_to_all (bool): diff --git a/google/ads/googleads/v11/resources/types/media_file.py b/google/ads/googleads/v11/resources/types/media_file.py index 2f0400d76..b0972ae80 100644 --- a/google/ads/googleads/v11/resources/types/media_file.py +++ b/google/ads/googleads/v11/resources/types/media_file.py @@ -153,7 +153,7 @@ class MediaBundle(proto.Message): This field is a member of `oneof`_ ``_data``. url (str): Output only. The url to access the uploaded - zipped data. E.g. + zipped data. For example, https://tpc.googlesyndication.com/simgad/123 This field is read-only. diff --git a/google/ads/googleads/v11/resources/types/payments_account.py b/google/ads/googleads/v11/resources/types/payments_account.py index a268e5ae2..34eac81fb 100644 --- a/google/ads/googleads/v11/resources/types/payments_account.py +++ b/google/ads/googleads/v11/resources/types/payments_account.py @@ -57,8 +57,8 @@ class PaymentsAccount(proto.Message): This field is a member of `oneof`_ ``_payments_profile_id``. secondary_payments_profile_id (str): Output only. A secondary payments profile ID - present in uncommon situations, e.g. when a - sequential liability agreement has been + present in uncommon situations, for example, + when a sequential liability agreement has been arranged. This field is a member of `oneof`_ ``_secondary_payments_profile_id``. diff --git a/google/ads/googleads/v11/resources/types/recommendation.py b/google/ads/googleads/v11/resources/types/recommendation.py index fbb96839d..020473eb1 100644 --- a/google/ads/googleads/v11/resources/types/recommendation.py +++ b/google/ads/googleads/v11/resources/types/recommendation.py @@ -71,10 +71,12 @@ class Recommendation(proto.Message): This field will be set for the following recommendation types: CALL_EXTENSION, CALLOUT_EXTENSION, ENHANCED_CPC_OPT_IN, USE_BROAD_MATCH_KEYWORD, KEYWORD, - KEYWORD_MATCH_TYPE, MAXIMIZE_CLICKS_OPT_IN, - MAXIMIZE_CONVERSIONS_OPT_IN, OPTIMIZE_AD_ROTATION, - RESPONSIVE_SEARCH_AD, RESPONSIVE_SEARCH_AD_ASSET, - SEARCH_PARTNERS_OPT_IN, SITELINK_EXTENSION, + KEYWORD_MATCH_TYPE, + UPGRADE_LOCAL_CAMPAIGN_TO_PERFORMANCE_MAX, + MAXIMIZE_CLICKS_OPT_IN, MAXIMIZE_CONVERSIONS_OPT_IN, + OPTIMIZE_AD_ROTATION, RESPONSIVE_SEARCH_AD, + RESPONSIVE_SEARCH_AD_ASSET, SEARCH_PARTNERS_OPT_IN, + DISPLAY_EXPANSION_OPT_IN, SITELINK_EXTENSION, TARGET_CPA_OPT_IN, TARGET_ROAS_OPT_IN, TEXT_AD, UPGRADE_SMART_SHOPPING_CAMPAIGN_TO_PERFORMANCE_MAX @@ -203,6 +205,16 @@ class Recommendation(proto.Message): Output only. The responsive search ad improve ad strength recommendation. + This field is a member of `oneof`_ ``recommendation``. + display_expansion_opt_in_recommendation (google.ads.googleads.v11.resources.types.Recommendation.DisplayExpansionOptInRecommendation): + Output only. The Display Expansion opt-in + recommendation. + + This field is a member of `oneof`_ ``recommendation``. + upgrade_local_campaign_to_performance_max_recommendation (google.ads.googleads.v11.resources.types.Recommendation.UpgradeLocalCampaignToPerformanceMaxRecommendation): + Output only. The upgrade a Local campaign to + a Performance Max campaign recommendation. + This field is a member of `oneof`_ ``recommendation``. """ @@ -351,13 +363,14 @@ class TextAdRecommendation(proto.Message): Output only. Recommended ad. creation_date (str): Output only. Creation date of the recommended - ad. YYYY-MM-DD format, e.g., 2018-04-17. + ad. YYYY-MM-DD format, for example, 2018-04-17. This field is a member of `oneof`_ ``_creation_date``. auto_apply_date (str): Output only. Date, if present, is the earliest when the recommendation will be auto - applied. YYYY-MM-DD format, e.g., 2018-04-17. + applied. YYYY-MM-DD format, for example, + 2018-04-17. This field is a member of `oneof`_ ``_auto_apply_date``. """ @@ -673,6 +686,16 @@ class UpgradeSmartShoppingCampaignToPerformanceMaxRecommendation( merchant_id = proto.Field(proto.INT64, number=1,) sales_country_code = proto.Field(proto.STRING, number=2,) + class DisplayExpansionOptInRecommendation(proto.Message): + r"""The Display Expansion opt-in recommendation. + """ + + class UpgradeLocalCampaignToPerformanceMaxRecommendation(proto.Message): + r"""The Upgrade Local campaign to Performance Max campaign + recommendation. + + """ + resource_name = proto.Field(proto.STRING, number=1,) type_ = proto.Field( proto.ENUM, @@ -816,6 +839,18 @@ class UpgradeSmartShoppingCampaignToPerformanceMaxRecommendation( oneof="recommendation", message=ResponsiveSearchAdImproveAdStrengthRecommendation, ) + display_expansion_opt_in_recommendation = proto.Field( + proto.MESSAGE, + number=34, + oneof="recommendation", + message=DisplayExpansionOptInRecommendation, + ) + upgrade_local_campaign_to_performance_max_recommendation = proto.Field( + proto.MESSAGE, + number=35, + oneof="recommendation", + message=UpgradeLocalCampaignToPerformanceMaxRecommendation, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/resources/types/smart_campaign_setting.py b/google/ads/googleads/v11/resources/types/smart_campaign_setting.py index e5f17b3b5..e4b152c08 100644 --- a/google/ads/googleads/v11/resources/types/smart_campaign_setting.py +++ b/google/ads/googleads/v11/resources/types/smart_campaign_setting.py @@ -19,9 +19,7 @@ __protobuf__ = proto.module( package="google.ads.googleads.v11.resources", marshal="google.ads.googleads.v11", - manifest={ - "SmartCampaignSetting", - }, + manifest={"SmartCampaignSetting",}, ) @@ -58,7 +56,7 @@ class SmartCampaignSetting(proto.Message): optimized for ads as this campaign's landing page. This campaign must be linked to a business profile to use this option. For more - information on this feature, please consult + information on this feature, consult https://support.google.com/google-ads/answer/9827068. This field is a member of `oneof`_ ``landing_page``. @@ -68,7 +66,7 @@ class SmartCampaignSetting(proto.Message): This field is a member of `oneof`_ ``business_setting``. business_profile_location (str): The resource name of a Business Profile location. Business - Profile location resource names can be fetched via the + Profile location resource names can be fetched through the Business Profile API and adhere to the following format: ``locations/{locationId}``. @@ -94,16 +92,8 @@ class PhoneNumber(proto.Message): This field is a member of `oneof`_ ``_country_code``. """ - phone_number = proto.Field( - proto.STRING, - number=1, - optional=True, - ) - country_code = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + phone_number = proto.Field(proto.STRING, number=1, optional=True,) + country_code = proto.Field(proto.STRING, number=2, optional=True,) class AdOptimizedBusinessProfileSetting(proto.Message): r"""Settings for configuring a business profile optimized for ads @@ -114,36 +104,16 @@ class AdOptimizedBusinessProfileSetting(proto.Message): Enabling a lead form on your business profile enables prospective customers to contact your business by filling out a simple form, and - you'll receive their information via email. + you'll receive their information through email. """ - include_lead_form = proto.Field( - proto.BOOL, - number=1, - ) + include_lead_form = proto.Field(proto.BOOL, number=1,) - resource_name = proto.Field( - proto.STRING, - number=1, - ) - campaign = proto.Field( - proto.STRING, - number=2, - ) - phone_number = proto.Field( - proto.MESSAGE, - number=3, - message=PhoneNumber, - ) - advertising_language_code = proto.Field( - proto.STRING, - number=7, - ) - final_url = proto.Field( - proto.STRING, - number=8, - oneof="landing_page", - ) + resource_name = proto.Field(proto.STRING, number=1,) + campaign = proto.Field(proto.STRING, number=2,) + phone_number = proto.Field(proto.MESSAGE, number=3, message=PhoneNumber,) + advertising_language_code = proto.Field(proto.STRING, number=7,) + final_url = proto.Field(proto.STRING, number=8, oneof="landing_page",) ad_optimized_business_profile_setting = proto.Field( proto.MESSAGE, number=9, @@ -151,14 +121,10 @@ class AdOptimizedBusinessProfileSetting(proto.Message): message=AdOptimizedBusinessProfileSetting, ) business_name = proto.Field( - proto.STRING, - number=5, - oneof="business_setting", + proto.STRING, number=5, oneof="business_setting", ) business_profile_location = proto.Field( - proto.STRING, - number=10, - oneof="business_setting", + proto.STRING, number=10, oneof="business_setting", ) diff --git a/google/ads/googleads/v11/resources/types/user_list.py b/google/ads/googleads/v11/resources/types/user_list.py index cbb431079..2fc6e6c99 100644 --- a/google/ads/googleads/v11/resources/types/user_list.py +++ b/google/ads/googleads/v11/resources/types/user_list.py @@ -54,17 +54,17 @@ class UserList(proto.Message): This field is a member of `oneof`_ ``_id``. read_only (bool): - Output only. A flag that indicates if a user - may edit a list. Depends on the list ownership - and list type. For example, external remarketing - user lists are not editable. + Output only. An option that indicates if a + user may edit a list. Depends on the list + ownership and list type. For example, external + remarketing user lists are not editable. This field is read-only. This field is a member of `oneof`_ ``_read_only``. name (str): Name of this user list. Depending on its access_reason, the - user list name may not be unique (e.g. if + user list name may not be unique (for example, if access_reason=SHARED) This field is a member of `oneof`_ ``_name``. diff --git a/google/ads/googleads/v11/services/services/account_budget_proposal_service/client.py b/google/ads/googleads/v11/services/services/account_budget_proposal_service/client.py index abe47dbfc..7ab92fbc3 100644 --- a/google/ads/googleads/v11/services/services/account_budget_proposal_service/client.py +++ b/google/ads/googleads/v11/services/services/account_budget_proposal_service/client.py @@ -80,7 +80,8 @@ def get_transport_class( class AccountBudgetProposalServiceClient( metaclass=AccountBudgetProposalServiceClientMeta ): - """A service for managing account-level budgets via proposals. + """A service for managing account-level budgets through + proposals. A proposal is a request to create a new budget or make changes to an existing one. diff --git a/google/ads/googleads/v11/services/services/account_budget_proposal_service/transports/grpc.py b/google/ads/googleads/v11/services/services/account_budget_proposal_service/transports/grpc.py index b7a8b44fa..8ee294019 100644 --- a/google/ads/googleads/v11/services/services/account_budget_proposal_service/transports/grpc.py +++ b/google/ads/googleads/v11/services/services/account_budget_proposal_service/transports/grpc.py @@ -35,7 +35,8 @@ class AccountBudgetProposalServiceGrpcTransport( ): """gRPC backend transport for AccountBudgetProposalService. - A service for managing account-level budgets via proposals. + A service for managing account-level budgets through + proposals. A proposal is a request to create a new budget or make changes to an existing one. diff --git a/google/ads/googleads/v11/services/services/account_link_service/client.py b/google/ads/googleads/v11/services/services/account_link_service/client.py index 8bf2ec56d..961535238 100644 --- a/google/ads/googleads/v11/services/services/account_link_service/client.py +++ b/google/ads/googleads/v11/services/services/account_link_service/client.py @@ -503,8 +503,8 @@ def mutate_account_link( metadata: Sequence[Tuple[str, str]] = (), ) -> account_link_service.MutateAccountLinkResponse: r"""Creates or removes an account link. From V5, create is not - supported through AccountLinkService.MutateAccountLink. Please - use AccountLinkService.CreateAccountLink instead. + supported through AccountLinkService.MutateAccountLink. Use + AccountLinkService.CreateAccountLink instead. List of thrown errors: `AccountLinkError <>`__ `AuthenticationError <>`__ `AuthorizationError <>`__ diff --git a/google/ads/googleads/v11/services/services/account_link_service/transports/grpc.py b/google/ads/googleads/v11/services/services/account_link_service/transports/grpc.py index 5dcadbea8..6e9ab5333 100644 --- a/google/ads/googleads/v11/services/services/account_link_service/transports/grpc.py +++ b/google/ads/googleads/v11/services/services/account_link_service/transports/grpc.py @@ -278,8 +278,8 @@ def mutate_account_link( r"""Return a callable for the mutate account link method over gRPC. Creates or removes an account link. From V5, create is not - supported through AccountLinkService.MutateAccountLink. Please - use AccountLinkService.CreateAccountLink instead. + supported through AccountLinkService.MutateAccountLink. Use + AccountLinkService.CreateAccountLink instead. List of thrown errors: `AccountLinkError <>`__ `AuthenticationError <>`__ `AuthorizationError <>`__ diff --git a/google/ads/googleads/v11/services/services/audience_insights_service/client.py b/google/ads/googleads/v11/services/services/audience_insights_service/client.py index fd19dfde6..bfbb537fa 100644 --- a/google/ads/googleads/v11/services/services/audience_insights_service/client.py +++ b/google/ads/googleads/v11/services/services/audience_insights_service/client.py @@ -56,8 +56,7 @@ class AudienceInsightsServiceClientMeta(type): _transport_registry["grpc"] = AudienceInsightsServiceGrpcTransport def get_transport_class( - cls, - label: str = None, + cls, label: str = None, ) -> Type[AudienceInsightsServiceTransport]: """Returns an appropriate transport class. @@ -184,9 +183,7 @@ def __exit__(self, type, value, traceback): self.transport.close() @staticmethod - def common_billing_account_path( - billing_account: str, - ) -> str: + def common_billing_account_path(billing_account: str,) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -199,13 +196,9 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path( - folder: str, - ) -> str: + def common_folder_path(folder: str,) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format( - folder=folder, - ) + return "folders/{folder}".format(folder=folder,) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -214,13 +207,9 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path( - organization: str, - ) -> str: + def common_organization_path(organization: str,) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format( - organization=organization, - ) + return "organizations/{organization}".format(organization=organization,) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -229,13 +218,9 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path( - project: str, - ) -> str: + def common_project_path(project: str,) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format( - project=project, - ) + return "projects/{project}".format(project=project,) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -244,14 +229,10 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path( - project: str, - location: str, - ) -> str: + def common_location_path(project: str, location: str,) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, - location=location, + project=project, location=location, ) @staticmethod @@ -469,10 +450,8 @@ def generate_insights_finder_report( request, audience_insights_service.GenerateInsightsFinderReportRequest, ): - request = ( - audience_insights_service.GenerateInsightsFinderReportRequest( - request - ) + request = audience_insights_service.GenerateInsightsFinderReportRequest( + request ) # If we have keyword arguments corresponding to fields on the # request, apply these. @@ -499,10 +478,7 @@ def generate_insights_finder_report( # Send the request. response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, + request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. @@ -586,10 +562,8 @@ def list_audience_insights_attributes( request, audience_insights_service.ListAudienceInsightsAttributesRequest, ): - request = ( - audience_insights_service.ListAudienceInsightsAttributesRequest( - request - ) + request = audience_insights_service.ListAudienceInsightsAttributesRequest( + request ) # If we have keyword arguments corresponding to fields on the # request, apply these. @@ -616,10 +590,120 @@ def list_audience_insights_attributes( # Send the request. response = rpc( + request, retry=retry, timeout=timeout, metadata=metadata, + ) + + # Done; return the response. + return response + + def generate_audience_composition_insights( + self, + request: Union[ + audience_insights_service.GenerateAudienceCompositionInsightsRequest, + dict, + ] = None, + *, + customer_id: str = None, + audience: audience_insights_service.InsightsAudience = None, + dimensions: Sequence[ + audience_insights_dimension.AudienceInsightsDimensionEnum.AudienceInsightsDimension + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> audience_insights_service.GenerateAudienceCompositionInsightsResponse: + r"""Returns a collection of attributes that are represented in an + audience of interest, with metrics that compare each attribute's + share of the audience with its share of a baseline audience. + + List of thrown errors: `AudienceInsightsError <>`__ + `AuthenticationError <>`__ `AuthorizationError <>`__ + `FieldError <>`__ `HeaderError <>`__ `InternalError <>`__ + `QuotaError <>`__ `RangeError <>`__ `RequestError <>`__ + + Args: + request (Union[google.ads.googleads.v11.services.types.GenerateAudienceCompositionInsightsRequest, dict]): + The request object. Request message for + [AudienceInsightsService.GenerateAudienceCompositionInsights][google.ads.googleads.v11.services.AudienceInsightsService.GenerateAudienceCompositionInsights]. + customer_id (str): + Required. The ID of the customer. + This corresponds to the ``customer_id`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + audience (google.ads.googleads.v11.services.types.InsightsAudience): + Required. The audience of interest + for which insights are being requested. + + This corresponds to the ``audience`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + dimensions (Sequence[google.ads.googleads.v11.enums.types.AudienceInsightsDimensionEnum.AudienceInsightsDimension]): + Required. The audience dimensions for + which composition insights should be + returned. + + This corresponds to the ``dimensions`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.ads.googleads.v11.services.types.GenerateAudienceCompositionInsightsResponse: + Response message for + [AudienceInsightsService.GenerateAudienceCompositionInsights][google.ads.googleads.v11.services.AudienceInsightsService.GenerateAudienceCompositionInsights]. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([customer_id, audience, dimensions]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a audience_insights_service.GenerateAudienceCompositionInsightsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( request, - retry=retry, - timeout=timeout, - metadata=metadata, + audience_insights_service.GenerateAudienceCompositionInsightsRequest, + ): + request = audience_insights_service.GenerateAudienceCompositionInsightsRequest( + request + ) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if customer_id is not None: + request.customer_id = customer_id + if audience is not None: + request.audience = audience + if dimensions is not None: + request.dimensions = dimensions + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.generate_audience_composition_insights + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("customer_id", request.customer_id),) + ), + ) + + # Send the request. + response = rpc( + request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. @@ -628,9 +712,7 @@ def list_audience_insights_attributes( try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-ads", - ).version, + gapic_version=pkg_resources.get_distribution("google-ads",).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/ads/googleads/v11/services/services/audience_insights_service/transports/base.py b/google/ads/googleads/v11/services/services/audience_insights_service/transports/base.py index d59b2952d..b54417657 100644 --- a/google/ads/googleads/v11/services/services/audience_insights_service/transports/base.py +++ b/google/ads/googleads/v11/services/services/audience_insights_service/transports/base.py @@ -29,9 +29,7 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-ads", - ).version, + gapic_version=pkg_resources.get_distribution("google-ads",).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -134,14 +132,19 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.generate_audience_composition_insights: gapic_v1.method.wrap_method( + self.generate_audience_composition_insights, + default_timeout=None, + client_info=client_info, + ), } def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() @@ -173,5 +176,19 @@ def list_audience_insights_attributes( ]: raise NotImplementedError() + @property + def generate_audience_composition_insights( + self, + ) -> Callable[ + [audience_insights_service.GenerateAudienceCompositionInsightsRequest], + Union[ + audience_insights_service.GenerateAudienceCompositionInsightsResponse, + Awaitable[ + audience_insights_service.GenerateAudienceCompositionInsightsResponse + ], + ], + ]: + raise NotImplementedError() + __all__ = ("AudienceInsightsServiceTransport",) diff --git a/google/ads/googleads/v11/services/services/audience_insights_service/transports/grpc.py b/google/ads/googleads/v11/services/services/audience_insights_service/transports/grpc.py index b48848538..19a539077 100644 --- a/google/ads/googleads/v11/services/services/audience_insights_service/transports/grpc.py +++ b/google/ads/googleads/v11/services/services/audience_insights_service/transports/grpc.py @@ -134,10 +134,8 @@ def __init__( # default SSL credentials. if client_cert_source: cert, key = client_cert_source() - self._ssl_channel_credentials = ( - grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key ) else: self._ssl_channel_credentials = ( @@ -147,10 +145,8 @@ def __init__( else: if client_cert_source_for_mtls and not ssl_channel_credentials: cert, key = client_cert_source_for_mtls() - self._ssl_channel_credentials = ( - grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key ) # The base transport sets the host, credentials and scopes @@ -233,7 +229,8 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service.""" + """Return the channel designed to connect to this service. + """ return self._grpc_channel @property @@ -312,6 +309,45 @@ def list_audience_insights_attributes( ) return self._stubs["list_audience_insights_attributes"] + @property + def generate_audience_composition_insights( + self, + ) -> Callable[ + [audience_insights_service.GenerateAudienceCompositionInsightsRequest], + audience_insights_service.GenerateAudienceCompositionInsightsResponse, + ]: + r"""Return a callable for the generate audience composition + insights method over gRPC. + + Returns a collection of attributes that are represented in an + audience of interest, with metrics that compare each attribute's + share of the audience with its share of a baseline audience. + + List of thrown errors: `AudienceInsightsError <>`__ + `AuthenticationError <>`__ `AuthorizationError <>`__ + `FieldError <>`__ `HeaderError <>`__ `InternalError <>`__ + `QuotaError <>`__ `RangeError <>`__ `RequestError <>`__ + + Returns: + Callable[[~.GenerateAudienceCompositionInsightsRequest], + ~.GenerateAudienceCompositionInsightsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "generate_audience_composition_insights" not in self._stubs: + self._stubs[ + "generate_audience_composition_insights" + ] = self.grpc_channel.unary_unary( + "/google.ads.googleads.v11.services.AudienceInsightsService/GenerateAudienceCompositionInsights", + request_serializer=audience_insights_service.GenerateAudienceCompositionInsightsRequest.serialize, + response_deserializer=audience_insights_service.GenerateAudienceCompositionInsightsResponse.deserialize, + ) + return self._stubs["generate_audience_composition_insights"] + def close(self): self.grpc_channel.close() diff --git a/google/ads/googleads/v11/services/services/batch_job_service/client.py b/google/ads/googleads/v11/services/services/batch_job_service/client.py index 90556599c..4d2f25a24 100644 --- a/google/ads/googleads/v11/services/services/batch_job_service/client.py +++ b/google/ads/googleads/v11/services/services/batch_job_service/client.py @@ -2090,9 +2090,6 @@ def run_batch_job( } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have diff --git a/google/ads/googleads/v11/services/services/campaign_draft_service/client.py b/google/ads/googleads/v11/services/services/campaign_draft_service/client.py index 23f6a9607..3f4e2d484 100644 --- a/google/ads/googleads/v11/services/services/campaign_draft_service/client.py +++ b/google/ads/googleads/v11/services/services/campaign_draft_service/client.py @@ -565,9 +565,6 @@ def promote_campaign_draft( } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have diff --git a/google/ads/googleads/v11/services/services/campaign_experiment_service/client.py b/google/ads/googleads/v11/services/services/campaign_experiment_service/client.py index 8e413924a..558cc48cc 100644 --- a/google/ads/googleads/v11/services/services/campaign_experiment_service/client.py +++ b/google/ads/googleads/v11/services/services/campaign_experiment_service/client.py @@ -512,9 +512,6 @@ def create_campaign_experiment( } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have @@ -834,9 +831,6 @@ def promote_campaign_experiment( } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have diff --git a/google/ads/googleads/v11/services/services/customer_manager_link_service/client.py b/google/ads/googleads/v11/services/services/customer_manager_link_service/client.py index cde0d496b..e6d79fcf1 100644 --- a/google/ads/googleads/v11/services/services/customer_manager_link_service/client.py +++ b/google/ads/googleads/v11/services/services/customer_manager_link_service/client.py @@ -517,7 +517,7 @@ def move_manager_link( ) -> customer_manager_link_service.MoveManagerLinkResponse: r"""Moves a client customer to a new manager customer. This simplifies the complex request that requires two operations to - move a client customer to a new manager. i.e: + move a client customer to a new manager, for example: 1. Update operation with Status INACTIVE (previous manager) and, 2. Update operation with Status ACTIVE (new manager). diff --git a/google/ads/googleads/v11/services/services/customer_manager_link_service/transports/grpc.py b/google/ads/googleads/v11/services/services/customer_manager_link_service/transports/grpc.py index 82ff7666f..3b85f5341 100644 --- a/google/ads/googleads/v11/services/services/customer_manager_link_service/transports/grpc.py +++ b/google/ads/googleads/v11/services/services/customer_manager_link_service/transports/grpc.py @@ -284,7 +284,7 @@ def move_manager_link( Moves a client customer to a new manager customer. This simplifies the complex request that requires two operations to - move a client customer to a new manager. i.e: + move a client customer to a new manager, for example: 1. Update operation with Status INACTIVE (previous manager) and, 2. Update operation with Status ACTIVE (new manager). diff --git a/google/ads/googleads/v11/services/services/experiment_service/client.py b/google/ads/googleads/v11/services/services/experiment_service/client.py index 453753154..7a6e4b0a2 100644 --- a/google/ads/googleads/v11/services/services/experiment_service/client.py +++ b/google/ads/googleads/v11/services/services/experiment_service/client.py @@ -831,9 +831,6 @@ def schedule_experiment( } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have @@ -944,9 +941,6 @@ def promote_experiment( } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have diff --git a/google/ads/googleads/v11/services/services/google_ads_service/client.py b/google/ads/googleads/v11/services/services/google_ads_service/client.py index d551294dc..5cf5b1487 100644 --- a/google/ads/googleads/v11/services/services/google_ads_service/client.py +++ b/google/ads/googleads/v11/services/services/google_ads_service/client.py @@ -3462,7 +3462,7 @@ def mutate( Atomicity makes error handling much easier. If you're making a series of changes and one fails, it can leave your account in an - inconsistent state. With atomicity, you either reach the desired + inconsistent state. With atomicity, you either reach the chosen state directly, or the request fails and you can retry. Temp Resource Names diff --git a/google/ads/googleads/v11/services/services/google_ads_service/transports/grpc.py b/google/ads/googleads/v11/services/services/google_ads_service/transports/grpc.py index 451cf1287..da04f43e6 100644 --- a/google/ads/googleads/v11/services/services/google_ads_service/transports/grpc.py +++ b/google/ads/googleads/v11/services/services/google_ads_service/transports/grpc.py @@ -333,7 +333,7 @@ def mutate( Atomicity makes error handling much easier. If you're making a series of changes and one fails, it can leave your account in an - inconsistent state. With atomicity, you either reach the desired + inconsistent state. With atomicity, you either reach the chosen state directly, or the request fails and you can retry. Temp Resource Names diff --git a/google/ads/googleads/v11/services/services/keyword_plan_idea_service/client.py b/google/ads/googleads/v11/services/services/keyword_plan_idea_service/client.py index 6cc1b04d0..e7e779bf0 100644 --- a/google/ads/googleads/v11/services/services/keyword_plan_idea_service/client.py +++ b/google/ads/googleads/v11/services/services/keyword_plan_idea_service/client.py @@ -58,8 +58,7 @@ class KeywordPlanIdeaServiceClientMeta(type): _transport_registry["grpc"] = KeywordPlanIdeaServiceGrpcTransport def get_transport_class( - cls, - label: str = None, + cls, label: str = None, ) -> Type[KeywordPlanIdeaServiceTransport]: """Returns an appropriate transport class. @@ -182,9 +181,7 @@ def __exit__(self, type, value, traceback): self.transport.close() @staticmethod - def common_billing_account_path( - billing_account: str, - ) -> str: + def common_billing_account_path(billing_account: str,) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -197,13 +194,9 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path( - folder: str, - ) -> str: + def common_folder_path(folder: str,) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format( - folder=folder, - ) + return "folders/{folder}".format(folder=folder,) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -212,13 +205,9 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path( - organization: str, - ) -> str: + def common_organization_path(organization: str,) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format( - organization=organization, - ) + return "organizations/{organization}".format(organization=organization,) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -227,13 +216,9 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path( - project: str, - ) -> str: + def common_project_path(project: str,) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format( - project=project, - ) + return "projects/{project}".format(project=project,) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -242,14 +227,10 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path( - project: str, - location: str, - ) -> str: + def common_location_path(project: str, location: str,) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, - location=location, + project=project, location=location, ) @staticmethod @@ -450,19 +431,13 @@ def generate_keyword_ideas( # Send the request. response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, + request, retry=retry, timeout=timeout, metadata=metadata, ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.GenerateKeywordIdeasPager( - method=rpc, - request=request, - response=response, - metadata=metadata, + method=rpc, request=request, response=response, metadata=metadata, ) # Done; return the response. @@ -531,10 +506,7 @@ def generate_keyword_historical_metrics( # Send the request. response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, + request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. @@ -602,10 +574,7 @@ def generate_ad_group_themes( # Send the request. response = rpc( - request, - retry=retry, - timeout=timeout, - metadata=metadata, + request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. @@ -614,9 +583,7 @@ def generate_ad_group_themes( try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-ads", - ).version, + gapic_version=pkg_resources.get_distribution("google-ads",).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/ads/googleads/v11/services/services/keyword_plan_idea_service/transports/base.py b/google/ads/googleads/v11/services/services/keyword_plan_idea_service/transports/base.py index dadd49300..1e3d002a2 100644 --- a/google/ads/googleads/v11/services/services/keyword_plan_idea_service/transports/base.py +++ b/google/ads/googleads/v11/services/services/keyword_plan_idea_service/transports/base.py @@ -29,9 +29,7 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-ads", - ).version, + gapic_version=pkg_resources.get_distribution("google-ads",).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -144,9 +142,9 @@ def _prep_wrapped_messages(self, client_info): def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() diff --git a/google/ads/googleads/v11/services/services/keyword_plan_idea_service/transports/grpc.py b/google/ads/googleads/v11/services/services/keyword_plan_idea_service/transports/grpc.py index 2a00e6f79..0cf621b16 100644 --- a/google/ads/googleads/v11/services/services/keyword_plan_idea_service/transports/grpc.py +++ b/google/ads/googleads/v11/services/services/keyword_plan_idea_service/transports/grpc.py @@ -133,10 +133,8 @@ def __init__( # default SSL credentials. if client_cert_source: cert, key = client_cert_source() - self._ssl_channel_credentials = ( - grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key ) else: self._ssl_channel_credentials = ( @@ -146,10 +144,8 @@ def __init__( else: if client_cert_source_for_mtls and not ssl_channel_credentials: cert, key = client_cert_source_for_mtls() - self._ssl_channel_credentials = ( - grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key ) # The base transport sets the host, credentials and scopes @@ -232,7 +228,8 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service.""" + """Return the channel designed to connect to this service. + """ return self._grpc_channel @property diff --git a/google/ads/googleads/v11/services/services/offline_user_data_job_service/client.py b/google/ads/googleads/v11/services/services/offline_user_data_job_service/client.py index 6d3cbfe50..0c9fa6269 100644 --- a/google/ads/googleads/v11/services/services/offline_user_data_job_service/client.py +++ b/google/ads/googleads/v11/services/services/offline_user_data_job_service/client.py @@ -649,9 +649,6 @@ def run_offline_user_data_job( } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have diff --git a/google/ads/googleads/v11/services/services/user_data_service/client.py b/google/ads/googleads/v11/services/services/user_data_service/client.py index 93a155951..e3bd3453b 100644 --- a/google/ads/googleads/v11/services/services/user_data_service/client.py +++ b/google/ads/googleads/v11/services/services/user_data_service/client.py @@ -74,12 +74,13 @@ def get_transport_class( class UserDataServiceClient(metaclass=UserDataServiceClientMeta): """Service to manage user data uploads. - Any uploads made to a Customer Match list via this service will - be eligible for matching as per the customer matching process. - Please see https://support.google.com/google-ads/answer/7474263. - However, the uploads made via this service will not be visible - under the 'Segment members' section for the Customer Match List - in the Google Ads UI. + Any uploads made to a Customer Match list through this service + will be eligible for matching as per the customer matching + process. See + https://support.google.com/google-ads/answer/7474263. However, + the uploads made through this service will not be visible under + the 'Segment members' section for the Customer Match List in the + Google Ads UI. """ @staticmethod @@ -396,7 +397,7 @@ def upload_user_data( Returns: google.ads.googleads.v11.services.types.UploadUserDataResponse: Response message for [UserDataService.UploadUserData][google.ads.googleads.v11.services.UserDataService.UploadUserData] - Uploads made via this service will not be visible + Uploads made through this service will not be visible under the 'Segment members' section for the Customer Match List in the Google Ads UI. diff --git a/google/ads/googleads/v11/services/services/user_data_service/transports/grpc.py b/google/ads/googleads/v11/services/services/user_data_service/transports/grpc.py index fca04bc72..547151e7b 100644 --- a/google/ads/googleads/v11/services/services/user_data_service/transports/grpc.py +++ b/google/ads/googleads/v11/services/services/user_data_service/transports/grpc.py @@ -32,12 +32,13 @@ class UserDataServiceGrpcTransport(UserDataServiceTransport): """gRPC backend transport for UserDataService. Service to manage user data uploads. - Any uploads made to a Customer Match list via this service will - be eligible for matching as per the customer matching process. - Please see https://support.google.com/google-ads/answer/7474263. - However, the uploads made via this service will not be visible - under the 'Segment members' section for the Customer Match List - in the Google Ads UI. + Any uploads made to a Customer Match list through this service + will be eligible for matching as per the customer matching + process. See + https://support.google.com/google-ads/answer/7474263. However, + the uploads made through this service will not be visible under + the 'Segment members' section for the Customer Match List in the + Google Ads UI. This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation diff --git a/google/ads/googleads/v11/services/types/account_link_service.py b/google/ads/googleads/v11/services/types/account_link_service.py index 7cf329c63..c23255425 100644 --- a/google/ads/googleads/v11/services/types/account_link_service.py +++ b/google/ads/googleads/v11/services/types/account_link_service.py @@ -147,8 +147,8 @@ class MutateAccountLinkResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ result = proto.Field( diff --git a/google/ads/googleads/v11/services/types/ad_group_ad_label_service.py b/google/ads/googleads/v11/services/types/ad_group_ad_label_service.py index ef458494a..f20bd4248 100644 --- a/google/ads/googleads/v11/services/types/ad_group_ad_label_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_ad_label_service.py @@ -103,8 +103,8 @@ class MutateAdGroupAdLabelsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupAdLabelResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_group_ad_service.py b/google/ads/googleads/v11/services/types/ad_group_ad_service.py index c92cbf1ae..0de954434 100644 --- a/google/ads/googleads/v11/services/types/ad_group_ad_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_ad_service.py @@ -142,8 +142,8 @@ class MutateAdGroupAdsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupAdResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_group_asset_service.py b/google/ads/googleads/v11/services/types/ad_group_asset_service.py index 59d54adf9..9c76c9d6a 100644 --- a/google/ads/googleads/v11/services/types/ad_group_asset_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_asset_service.py @@ -136,8 +136,8 @@ class MutateAdGroupAssetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupAssetResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_group_bid_modifier_service.py b/google/ads/googleads/v11/services/types/ad_group_bid_modifier_service.py index 5131e265d..da6829590 100644 --- a/google/ads/googleads/v11/services/types/ad_group_bid_modifier_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_bid_modifier_service.py @@ -136,8 +136,8 @@ class MutateAdGroupBidModifiersResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupBidModifierResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_group_criterion_customizer_service.py b/google/ads/googleads/v11/services/types/ad_group_criterion_customizer_service.py index 7e8fd73cf..1086e4511 100644 --- a/google/ads/googleads/v11/services/types/ad_group_criterion_customizer_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_criterion_customizer_service.py @@ -121,8 +121,8 @@ class MutateAdGroupCriterionCustomizersResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/ad_group_criterion_label_service.py b/google/ads/googleads/v11/services/types/ad_group_criterion_label_service.py index 76daae15c..c5df932bb 100644 --- a/google/ads/googleads/v11/services/types/ad_group_criterion_label_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_criterion_label_service.py @@ -104,8 +104,8 @@ class MutateAdGroupCriterionLabelsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupCriterionLabelResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_group_criterion_service.py b/google/ads/googleads/v11/services/types/ad_group_criterion_service.py index cb1577e94..1462f3342 100644 --- a/google/ads/googleads/v11/services/types/ad_group_criterion_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_criterion_service.py @@ -95,8 +95,8 @@ class AdGroupCriterionOperation(proto.Message): exempt_policy_violation_keys (Sequence[google.ads.googleads.v11.common.types.PolicyViolationKey]): The list of policy violation keys that should not cause a PolicyViolationError to be reported. Not all policy - violations are exemptable, please refer to the is_exemptible - field in the returned PolicyViolationError. + violations are exemptable, refer to the is_exemptible field + in the returned PolicyViolationError. Resources violating these polices will be saved, but will not be eligible to serve. They may begin serving at a later @@ -150,8 +150,8 @@ class MutateAdGroupCriteriaResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupCriterionResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_group_customizer_service.py b/google/ads/googleads/v11/services/types/ad_group_customizer_service.py index d07cefd71..fa489bb57 100644 --- a/google/ads/googleads/v11/services/types/ad_group_customizer_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_customizer_service.py @@ -119,8 +119,8 @@ class MutateAdGroupCustomizersResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/ad_group_extension_setting_service.py b/google/ads/googleads/v11/services/types/ad_group_extension_setting_service.py index 8017babdc..c5308218d 100644 --- a/google/ads/googleads/v11/services/types/ad_group_extension_setting_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_extension_setting_service.py @@ -137,8 +137,8 @@ class MutateAdGroupExtensionSettingsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupExtensionSettingResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_group_feed_service.py b/google/ads/googleads/v11/services/types/ad_group_feed_service.py index 83630070e..00fb45268 100644 --- a/google/ads/googleads/v11/services/types/ad_group_feed_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_feed_service.py @@ -136,8 +136,8 @@ class MutateAdGroupFeedsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupFeedResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_group_label_service.py b/google/ads/googleads/v11/services/types/ad_group_label_service.py index 023e63655..6ea347af1 100644 --- a/google/ads/googleads/v11/services/types/ad_group_label_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_label_service.py @@ -103,8 +103,8 @@ class MutateAdGroupLabelsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupLabelResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_group_service.py b/google/ads/googleads/v11/services/types/ad_group_service.py index 1a86e9a77..5f24ddb24 100644 --- a/google/ads/googleads/v11/services/types/ad_group_service.py +++ b/google/ads/googleads/v11/services/types/ad_group_service.py @@ -133,8 +133,8 @@ class MutateAdGroupsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdGroupResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_parameter_service.py b/google/ads/googleads/v11/services/types/ad_parameter_service.py index e16373854..549366e10 100644 --- a/google/ads/googleads/v11/services/types/ad_parameter_service.py +++ b/google/ads/googleads/v11/services/types/ad_parameter_service.py @@ -135,8 +135,8 @@ class MutateAdParametersResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdParameterResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/ad_service.py b/google/ads/googleads/v11/services/types/ad_service.py index 8272da46a..ceebb778c 100644 --- a/google/ads/googleads/v11/services/types/ad_service.py +++ b/google/ads/googleads/v11/services/types/ad_service.py @@ -128,8 +128,8 @@ class MutateAdsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAdResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/asset_group_asset_service.py b/google/ads/googleads/v11/services/types/asset_group_asset_service.py index 7078b06ba..a3aa8e625 100644 --- a/google/ads/googleads/v11/services/types/asset_group_asset_service.py +++ b/google/ads/googleads/v11/services/types/asset_group_asset_service.py @@ -122,8 +122,8 @@ class MutateAssetGroupAssetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/asset_group_service.py b/google/ads/googleads/v11/services/types/asset_group_service.py index 53795747b..1184ddfc8 100644 --- a/google/ads/googleads/v11/services/types/asset_group_service.py +++ b/google/ads/googleads/v11/services/types/asset_group_service.py @@ -115,8 +115,8 @@ class MutateAssetGroupsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/asset_group_signal_service.py b/google/ads/googleads/v11/services/types/asset_group_signal_service.py index aade8ac40..03dec4911 100644 --- a/google/ads/googleads/v11/services/types/asset_group_signal_service.py +++ b/google/ads/googleads/v11/services/types/asset_group_signal_service.py @@ -118,8 +118,8 @@ class MutateAssetGroupSignalsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/asset_service.py b/google/ads/googleads/v11/services/types/asset_service.py index b49cf4ea0..7d2457691 100644 --- a/google/ads/googleads/v11/services/types/asset_service.py +++ b/google/ads/googleads/v11/services/types/asset_service.py @@ -123,8 +123,8 @@ class MutateAssetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateAssetResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/asset_set_asset_service.py b/google/ads/googleads/v11/services/types/asset_set_asset_service.py index 49ea8fe9a..933ee2c03 100644 --- a/google/ads/googleads/v11/services/types/asset_set_asset_service.py +++ b/google/ads/googleads/v11/services/types/asset_set_asset_service.py @@ -118,8 +118,8 @@ class MutateAssetSetAssetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/asset_set_service.py b/google/ads/googleads/v11/services/types/asset_set_service.py index 077cb0767..ea430b571 100644 --- a/google/ads/googleads/v11/services/types/asset_set_service.py +++ b/google/ads/googleads/v11/services/types/asset_set_service.py @@ -134,8 +134,8 @@ class MutateAssetSetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/audience_insights_service.py b/google/ads/googleads/v11/services/types/audience_insights_service.py index a765a911d..a1ee30558 100644 --- a/google/ads/googleads/v11/services/types/audience_insights_service.py +++ b/google/ads/googleads/v11/services/types/audience_insights_service.py @@ -25,14 +25,25 @@ manifest={ "GenerateInsightsFinderReportRequest", "GenerateInsightsFinderReportResponse", + "GenerateAudienceCompositionInsightsRequest", + "GenerateAudienceCompositionInsightsResponse", "ListAudienceInsightsAttributesRequest", "ListAudienceInsightsAttributesResponse", "AudienceInsightsAttribute", "AudienceInsightsTopic", "AudienceInsightsEntity", "AudienceInsightsCategory", + "AudienceInsightsDynamicLineup", "BasicInsightsAudience", "AudienceInsightsAttributeMetadata", + "YouTubeChannelAttributeMetadata", + "DynamicLineupAttributeMetadata", + "InsightsAudience", + "InsightsAudienceAttributeGroup", + "AudienceCompositionSection", + "AudienceCompositionAttributeCluster", + "AudienceCompositionMetrics", + "AudienceCompositionAttribute", }, ) @@ -58,24 +69,14 @@ class GenerateInsightsFinderReportRequest(proto.Message): This is a user-defined value. """ - customer_id = proto.Field( - proto.STRING, - number=1, - ) + customer_id = proto.Field(proto.STRING, number=1,) baseline_audience = proto.Field( - proto.MESSAGE, - number=2, - message="BasicInsightsAudience", + proto.MESSAGE, number=2, message="BasicInsightsAudience", ) specific_audience = proto.Field( - proto.MESSAGE, - number=3, - message="BasicInsightsAudience", - ) - customer_insights_group = proto.Field( - proto.STRING, - number=4, + proto.MESSAGE, number=3, message="BasicInsightsAudience", ) + customer_insights_group = proto.Field(proto.STRING, number=4,) class GenerateInsightsFinderReportResponse(proto.Message): @@ -90,9 +91,59 @@ class GenerateInsightsFinderReportResponse(proto.Message): in according to the request. """ - saved_report_url = proto.Field( - proto.STRING, - number=1, + saved_report_url = proto.Field(proto.STRING, number=1,) + + +class GenerateAudienceCompositionInsightsRequest(proto.Message): + r"""Request message for + [AudienceInsightsService.GenerateAudienceCompositionInsights][google.ads.googleads.v11.services.AudienceInsightsService.GenerateAudienceCompositionInsights]. + + Attributes: + customer_id (str): + Required. The ID of the customer. + audience (google.ads.googleads.v11.services.types.InsightsAudience): + Required. The audience of interest for which + insights are being requested. + data_month (str): + The one-month range of historical data to use + for insights, in the format "yyyy-mm". If unset, + insights will be returned for the last thirty + days of data. + dimensions (Sequence[google.ads.googleads.v11.enums.types.AudienceInsightsDimensionEnum.AudienceInsightsDimension]): + Required. The audience dimensions for which + composition insights should be returned. + customer_insights_group (str): + The name of the customer being planned for. + This is a user-defined value. + """ + + customer_id = proto.Field(proto.STRING, number=1,) + audience = proto.Field(proto.MESSAGE, number=2, message="InsightsAudience",) + data_month = proto.Field(proto.STRING, number=3,) + dimensions = proto.RepeatedField( + proto.ENUM, + number=4, + enum=audience_insights_dimension.AudienceInsightsDimensionEnum.AudienceInsightsDimension, + ) + customer_insights_group = proto.Field(proto.STRING, number=5,) + + +class GenerateAudienceCompositionInsightsResponse(proto.Message): + r"""Response message for + [AudienceInsightsService.GenerateAudienceCompositionInsights][google.ads.googleads.v11.services.AudienceInsightsService.GenerateAudienceCompositionInsights]. + + Attributes: + sections (Sequence[google.ads.googleads.v11.services.types.AudienceCompositionSection]): + The contents of the insights report, + organized into sections. Each section is + associated with one of the + AudienceInsightsDimension values in the request. + There may be more than one section per + dimension. + """ + + sections = proto.RepeatedField( + proto.MESSAGE, number=1, message="AudienceCompositionSection", ) @@ -115,23 +166,14 @@ class ListAudienceInsightsAttributesRequest(proto.Message): This is a user-defined value. """ - customer_id = proto.Field( - proto.STRING, - number=1, - ) + customer_id = proto.Field(proto.STRING, number=1,) dimensions = proto.RepeatedField( proto.ENUM, number=2, enum=audience_insights_dimension.AudienceInsightsDimensionEnum.AudienceInsightsDimension, ) - query_text = proto.Field( - proto.STRING, - number=3, - ) - customer_insights_group = proto.Field( - proto.STRING, - number=4, - ) + query_text = proto.Field(proto.STRING, number=3,) + customer_insights_group = proto.Field(proto.STRING, number=4,) class ListAudienceInsightsAttributesResponse(proto.Message): @@ -144,9 +186,7 @@ class ListAudienceInsightsAttributesResponse(proto.Message): """ attributes = proto.RepeatedField( - proto.MESSAGE, - number=1, - message="AudienceInsightsAttributeMetadata", + proto.MESSAGE, number=1, message="AudienceInsightsAttributeMetadata", ) @@ -172,7 +212,7 @@ class AudienceInsightsAttribute(proto.Message): This field is a member of `oneof`_ ``attribute``. location (google.ads.googleads.v11.common.types.LocationInfo): - An audience attribute defiend by a geographic + An audience attribute defined by a geographic location. This field is a member of `oneof`_ ``attribute``. @@ -189,6 +229,23 @@ class AudienceInsightsAttribute(proto.Message): An audience attribute defined by interest in a Product & Service category. + This field is a member of `oneof`_ ``attribute``. + dynamic_lineup (google.ads.googleads.v11.services.types.AudienceInsightsDynamicLineup): + A YouTube Dynamic Lineup + + This field is a member of `oneof`_ ``attribute``. + parental_status (google.ads.googleads.v11.common.types.ParentalStatusInfo): + A Parental Status value (parent, or not a + parent). + + This field is a member of `oneof`_ ``attribute``. + income_range (google.ads.googleads.v11.common.types.IncomeRangeInfo): + A household income percentile range. + + This field is a member of `oneof`_ ``attribute``. + youtube_channel (google.ads.googleads.v11.common.types.YouTubeChannelInfo): + A YouTube channel. + This field is a member of `oneof`_ ``attribute``. """ @@ -199,10 +256,7 @@ class AudienceInsightsAttribute(proto.Message): message=criteria.AgeRangeInfo, ) gender = proto.Field( - proto.MESSAGE, - number=2, - oneof="attribute", - message=criteria.GenderInfo, + proto.MESSAGE, number=2, oneof="attribute", message=criteria.GenderInfo, ) location = proto.Field( proto.MESSAGE, @@ -228,6 +282,30 @@ class AudienceInsightsAttribute(proto.Message): oneof="attribute", message="AudienceInsightsCategory", ) + dynamic_lineup = proto.Field( + proto.MESSAGE, + number=7, + oneof="attribute", + message="AudienceInsightsDynamicLineup", + ) + parental_status = proto.Field( + proto.MESSAGE, + number=8, + oneof="attribute", + message=criteria.ParentalStatusInfo, + ) + income_range = proto.Field( + proto.MESSAGE, + number=9, + oneof="attribute", + message=criteria.IncomeRangeInfo, + ) + youtube_channel = proto.Field( + proto.MESSAGE, + number=10, + oneof="attribute", + message=criteria.YouTubeChannelInfo, + ) class AudienceInsightsTopic(proto.Message): @@ -275,10 +353,7 @@ class AudienceInsightsEntity(proto.Message): Knowledge Graph entity. """ - knowledge_graph_machine_id = proto.Field( - proto.STRING, - number=1, - ) + knowledge_graph_machine_id = proto.Field(proto.STRING, number=1,) class AudienceInsightsCategory(proto.Message): @@ -289,10 +364,19 @@ class AudienceInsightsCategory(proto.Message): Required. The criterion id of the category. """ - category_id = proto.Field( - proto.STRING, - number=1, - ) + category_id = proto.Field(proto.STRING, number=1,) + + +class AudienceInsightsDynamicLineup(proto.Message): + r"""A YouTube Dynamic Lineup. + + Attributes: + dynamic_lineup_id (str): + Required. The numeric ID of the dynamic + lineup. + """ + + dynamic_lineup_id = proto.Field(proto.STRING, number=1,) class BasicInsightsAudience(proto.Message): @@ -322,34 +406,20 @@ class BasicInsightsAudience(proto.Message): """ country_location = proto.RepeatedField( - proto.MESSAGE, - number=1, - message=criteria.LocationInfo, + proto.MESSAGE, number=1, message=criteria.LocationInfo, ) sub_country_locations = proto.RepeatedField( - proto.MESSAGE, - number=2, - message=criteria.LocationInfo, - ) - gender = proto.Field( - proto.MESSAGE, - number=3, - message=criteria.GenderInfo, + proto.MESSAGE, number=2, message=criteria.LocationInfo, ) + gender = proto.Field(proto.MESSAGE, number=3, message=criteria.GenderInfo,) age_ranges = proto.RepeatedField( - proto.MESSAGE, - number=4, - message=criteria.AgeRangeInfo, + proto.MESSAGE, number=4, message=criteria.AgeRangeInfo, ) user_interests = proto.RepeatedField( - proto.MESSAGE, - number=5, - message=criteria.UserInterestInfo, + proto.MESSAGE, number=5, message=criteria.UserInterestInfo, ) topics = proto.RepeatedField( - proto.MESSAGE, - number=6, - message="AudienceInsightsTopic", + proto.MESSAGE, number=6, message="AudienceInsightsTopic", ) @@ -357,6 +427,13 @@ class AudienceInsightsAttributeMetadata(proto.Message): r"""An audience attribute, with metadata about it, returned in response to a search. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: dimension (google.ads.googleads.v11.enums.types.AudienceInsightsDimensionEnum.AudienceInsightsDimension): The type of the attribute. @@ -374,6 +451,15 @@ class AudienceInsightsAttributeMetadata(proto.Message): singer-songwriter". If the dimension is CATEGORY, this is the complete path to the category in The Product & Service taxonomy, for example "/Apparel/Clothing/Outerwear". + youtube_channel_metadata (google.ads.googleads.v11.services.types.YouTubeChannelAttributeMetadata): + Special metadata for a YouTube channel. + + This field is a member of `oneof`_ ``dimension_metadata``. + dynamic_attribute_metadata (google.ads.googleads.v11.services.types.DynamicLineupAttributeMetadata): + Special metadata for a YouTube Dynamic + Lineup. + + This field is a member of `oneof`_ ``dimension_metadata``. """ dimension = proto.Field( @@ -382,21 +468,255 @@ class AudienceInsightsAttributeMetadata(proto.Message): enum=audience_insights_dimension.AudienceInsightsDimensionEnum.AudienceInsightsDimension, ) attribute = proto.Field( + proto.MESSAGE, number=2, message="AudienceInsightsAttribute", + ) + display_name = proto.Field(proto.STRING, number=3,) + score = proto.Field(proto.DOUBLE, number=4,) + display_info = proto.Field(proto.STRING, number=5,) + youtube_channel_metadata = proto.Field( proto.MESSAGE, - number=2, - message="AudienceInsightsAttribute", + number=6, + oneof="dimension_metadata", + message="YouTubeChannelAttributeMetadata", ) - display_name = proto.Field( - proto.STRING, - number=3, + dynamic_attribute_metadata = proto.Field( + proto.MESSAGE, + number=7, + oneof="dimension_metadata", + message="DynamicLineupAttributeMetadata", ) - score = proto.Field( - proto.DOUBLE, - number=4, + + +class YouTubeChannelAttributeMetadata(proto.Message): + r"""Metadata associated with a YouTube channel attribute. + + Attributes: + subscriber_count (int): + The approximate number of subscribers to the + YouTube channel. + """ + + subscriber_count = proto.Field(proto.INT64, number=1,) + + +class DynamicLineupAttributeMetadata(proto.Message): + r"""Metadata associated with a Dynamic Lineup attribute. + + Attributes: + inventory_country (google.ads.googleads.v11.common.types.LocationInfo): + The national market associated with the + lineup. + median_monthly_inventory (int): + The median number of impressions per month on + this lineup. + + This field is a member of `oneof`_ ``_median_monthly_inventory``. + channel_count_lower_bound (int): + The lower end of a range containing the + number of channels in the lineup. + + This field is a member of `oneof`_ ``_channel_count_lower_bound``. + channel_count_upper_bound (int): + The upper end of a range containing the + number of channels in the lineup. + + This field is a member of `oneof`_ ``_channel_count_upper_bound``. + """ + + inventory_country = proto.Field( + proto.MESSAGE, number=1, message=criteria.LocationInfo, ) - display_info = proto.Field( - proto.STRING, - number=5, + median_monthly_inventory = proto.Field( + proto.INT64, number=2, optional=True, + ) + channel_count_lower_bound = proto.Field( + proto.INT64, number=3, optional=True, + ) + channel_count_upper_bound = proto.Field( + proto.INT64, number=4, optional=True, + ) + + +class InsightsAudience(proto.Message): + r"""A set of users, defined by various characteristics, for which + insights can be requested in AudienceInsightsService. + + Attributes: + country_locations (Sequence[google.ads.googleads.v11.common.types.LocationInfo]): + Required. The countries for the audience. + sub_country_locations (Sequence[google.ads.googleads.v11.common.types.LocationInfo]): + Sub-country geographic location attributes. If present, each + of these must be contained in one of the countries in this + audience. If absent, the audience is geographically to the + country_locations and no further. + gender (google.ads.googleads.v11.common.types.GenderInfo): + Gender for the audience. If absent, the + audience does not restrict by gender. + age_ranges (Sequence[google.ads.googleads.v11.common.types.AgeRangeInfo]): + Age ranges for the audience. If absent, the + audience represents all people over 18 that + match the other attributes. + parental_status (google.ads.googleads.v11.common.types.ParentalStatusInfo): + Parental status for the audience. If absent, + the audience does not restrict by parental + status. + income_ranges (Sequence[google.ads.googleads.v11.common.types.IncomeRangeInfo]): + Household income percentile ranges for the + audience. If absent, the audience does not + restrict by household income range. + dynamic_lineups (Sequence[google.ads.googleads.v11.services.types.AudienceInsightsDynamicLineup]): + Dynamic lineups representing the YouTube + content viewed by the audience. + topic_audience_combinations (Sequence[google.ads.googleads.v11.services.types.InsightsAudienceAttributeGroup]): + A combination of entity, category and user + interest attributes defining the audience. The + combination has a logical AND-of-ORs structure: + Attributes within each + InsightsAudienceAttributeGroup are combined with + OR, and the combinations themselves are combined + together with AND. For example, the expression + (Entity OR Affinity) AND (In-Market OR Category) + can be formed using two + InsightsAudienceAttributeGroups with two + Attributes each. + """ + + country_locations = proto.RepeatedField( + proto.MESSAGE, number=1, message=criteria.LocationInfo, + ) + sub_country_locations = proto.RepeatedField( + proto.MESSAGE, number=2, message=criteria.LocationInfo, + ) + gender = proto.Field(proto.MESSAGE, number=3, message=criteria.GenderInfo,) + age_ranges = proto.RepeatedField( + proto.MESSAGE, number=4, message=criteria.AgeRangeInfo, + ) + parental_status = proto.Field( + proto.MESSAGE, number=5, message=criteria.ParentalStatusInfo, + ) + income_ranges = proto.RepeatedField( + proto.MESSAGE, number=6, message=criteria.IncomeRangeInfo, + ) + dynamic_lineups = proto.RepeatedField( + proto.MESSAGE, number=7, message="AudienceInsightsDynamicLineup", + ) + topic_audience_combinations = proto.RepeatedField( + proto.MESSAGE, number=8, message="InsightsAudienceAttributeGroup", + ) + + +class InsightsAudienceAttributeGroup(proto.Message): + r"""A list of AudienceInsightsAttributes. + + Attributes: + attributes (Sequence[google.ads.googleads.v11.services.types.AudienceInsightsAttribute]): + Required. A collection of audience attributes + to be combined with logical OR. Attributes need + not all be the same dimension. Only Knowledge + Graph entities, Product & Service Categories, + and Affinity and In-Market audiences are + supported in this context. + """ + + attributes = proto.RepeatedField( + proto.MESSAGE, number=1, message="AudienceInsightsAttribute", + ) + + +class AudienceCompositionSection(proto.Message): + r"""A collection of related attributes of the same type in an + audience composition insights report. + + Attributes: + dimension (google.ads.googleads.v11.enums.types.AudienceInsightsDimensionEnum.AudienceInsightsDimension): + The type of the attributes in this section. + top_attributes (Sequence[google.ads.googleads.v11.services.types.AudienceCompositionAttribute]): + The most relevant segments for this audience. If dimension + is GENDER, AGE_RANGE or PARENTAL_STATUS, then this list of + attributes is exhaustive. + clustered_attributes (Sequence[google.ads.googleads.v11.services.types.AudienceCompositionAttributeCluster]): + Additional attributes for this audience, grouped into + clusters. Only populated if dimension is YOUTUBE_CHANNEL. + """ + + dimension = proto.Field( + proto.ENUM, + number=1, + enum=audience_insights_dimension.AudienceInsightsDimensionEnum.AudienceInsightsDimension, + ) + top_attributes = proto.RepeatedField( + proto.MESSAGE, number=3, message="AudienceCompositionAttribute", + ) + clustered_attributes = proto.RepeatedField( + proto.MESSAGE, number=4, message="AudienceCompositionAttributeCluster", + ) + + +class AudienceCompositionAttributeCluster(proto.Message): + r"""A collection of related attributes, with metadata and + metrics, in an audience composition insights report. + + Attributes: + cluster_display_name (str): + The name of this cluster of attributes + cluster_metrics (google.ads.googleads.v11.services.types.AudienceCompositionMetrics): + If the dimension associated with this cluster is + YOUTUBE_CHANNEL, then cluster_metrics are metrics associated + with the cluster as a whole. For other dimensions, this + field is unset. + attributes (Sequence[google.ads.googleads.v11.services.types.AudienceCompositionAttribute]): + The individual attributes that make up this + cluster, with metadata and metrics. + """ + + cluster_display_name = proto.Field(proto.STRING, number=1,) + cluster_metrics = proto.Field( + proto.MESSAGE, number=3, message="AudienceCompositionMetrics", + ) + attributes = proto.RepeatedField( + proto.MESSAGE, number=4, message="AudienceCompositionAttribute", + ) + + +class AudienceCompositionMetrics(proto.Message): + r"""The share and index metrics associated with an attribute in + an audience composition insights report. + + Attributes: + baseline_audience_share (float): + The fraction (from 0 to 1 inclusive) of the + baseline audience that match the attribute. + audience_share (float): + The fraction (from 0 to 1 inclusive) of the + specific audience that match the attribute. + index (float): + The ratio of audience_share to baseline_audience_share, or + zero if this ratio is undefined or is not meaningful. + score (float): + A relevance score from 0 to 1 inclusive. + """ + + baseline_audience_share = proto.Field(proto.DOUBLE, number=1,) + audience_share = proto.Field(proto.DOUBLE, number=2,) + index = proto.Field(proto.DOUBLE, number=3,) + score = proto.Field(proto.DOUBLE, number=4,) + + +class AudienceCompositionAttribute(proto.Message): + r"""An audience attribute with metadata and metrics. + + Attributes: + attribute_metadata (google.ads.googleads.v11.services.types.AudienceInsightsAttributeMetadata): + The attribute with its metadata. + metrics (google.ads.googleads.v11.services.types.AudienceCompositionMetrics): + Share and index metrics for the attribute. + """ + + attribute_metadata = proto.Field( + proto.MESSAGE, number=1, message="AudienceInsightsAttributeMetadata", + ) + metrics = proto.Field( + proto.MESSAGE, number=2, message="AudienceCompositionMetrics", ) diff --git a/google/ads/googleads/v11/services/types/audience_service.py b/google/ads/googleads/v11/services/types/audience_service.py index 91d9f883b..9d1af1e18 100644 --- a/google/ads/googleads/v11/services/types/audience_service.py +++ b/google/ads/googleads/v11/services/types/audience_service.py @@ -84,8 +84,8 @@ class MutateAudiencesResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/bidding_data_exclusion_service.py b/google/ads/googleads/v11/services/types/bidding_data_exclusion_service.py index 34ea361ac..2d4175a06 100644 --- a/google/ads/googleads/v11/services/types/bidding_data_exclusion_service.py +++ b/google/ads/googleads/v11/services/types/bidding_data_exclusion_service.py @@ -136,8 +136,8 @@ class MutateBiddingDataExclusionsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateBiddingDataExclusionsResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/bidding_seasonality_adjustment_service.py b/google/ads/googleads/v11/services/types/bidding_seasonality_adjustment_service.py index 3ff760b9c..1759861e0 100644 --- a/google/ads/googleads/v11/services/types/bidding_seasonality_adjustment_service.py +++ b/google/ads/googleads/v11/services/types/bidding_seasonality_adjustment_service.py @@ -138,8 +138,8 @@ class MutateBiddingSeasonalityAdjustmentsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateBiddingSeasonalityAdjustmentsResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/bidding_strategy_service.py b/google/ads/googleads/v11/services/types/bidding_strategy_service.py index 15e53a734..e5464aeb7 100644 --- a/google/ads/googleads/v11/services/types/bidding_strategy_service.py +++ b/google/ads/googleads/v11/services/types/bidding_strategy_service.py @@ -136,8 +136,8 @@ class MutateBiddingStrategiesResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateBiddingStrategyResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_asset_service.py b/google/ads/googleads/v11/services/types/campaign_asset_service.py index 602fbd097..2783a87ad 100644 --- a/google/ads/googleads/v11/services/types/campaign_asset_service.py +++ b/google/ads/googleads/v11/services/types/campaign_asset_service.py @@ -136,8 +136,8 @@ class MutateCampaignAssetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignAssetResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_asset_set_service.py b/google/ads/googleads/v11/services/types/campaign_asset_set_service.py index bb6711167..5b557a3fd 100644 --- a/google/ads/googleads/v11/services/types/campaign_asset_set_service.py +++ b/google/ads/googleads/v11/services/types/campaign_asset_set_service.py @@ -118,8 +118,8 @@ class MutateCampaignAssetSetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/campaign_bid_modifier_service.py b/google/ads/googleads/v11/services/types/campaign_bid_modifier_service.py index d0579a496..fcffd8ba4 100644 --- a/google/ads/googleads/v11/services/types/campaign_bid_modifier_service.py +++ b/google/ads/googleads/v11/services/types/campaign_bid_modifier_service.py @@ -136,8 +136,8 @@ class MutateCampaignBidModifiersResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignBidModifierResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_budget_service.py b/google/ads/googleads/v11/services/types/campaign_budget_service.py index 76990952f..8a998c2fd 100644 --- a/google/ads/googleads/v11/services/types/campaign_budget_service.py +++ b/google/ads/googleads/v11/services/types/campaign_budget_service.py @@ -136,8 +136,8 @@ class MutateCampaignBudgetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignBudgetResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_criterion_service.py b/google/ads/googleads/v11/services/types/campaign_criterion_service.py index 9136b7201..6bd5ce72a 100644 --- a/google/ads/googleads/v11/services/types/campaign_criterion_service.py +++ b/google/ads/googleads/v11/services/types/campaign_criterion_service.py @@ -136,8 +136,8 @@ class MutateCampaignCriteriaResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignCriterionResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_customizer_service.py b/google/ads/googleads/v11/services/types/campaign_customizer_service.py index f1bc47e0b..161cfc95c 100644 --- a/google/ads/googleads/v11/services/types/campaign_customizer_service.py +++ b/google/ads/googleads/v11/services/types/campaign_customizer_service.py @@ -119,8 +119,8 @@ class MutateCampaignCustomizersResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/campaign_draft_service.py b/google/ads/googleads/v11/services/types/campaign_draft_service.py index a9338c0f1..cb98d3700 100644 --- a/google/ads/googleads/v11/services/types/campaign_draft_service.py +++ b/google/ads/googleads/v11/services/types/campaign_draft_service.py @@ -157,8 +157,8 @@ class MutateCampaignDraftsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignDraftResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_experiment_service.py b/google/ads/googleads/v11/services/types/campaign_experiment_service.py index 9ad2799a5..7cb8408ad 100644 --- a/google/ads/googleads/v11/services/types/campaign_experiment_service.py +++ b/google/ads/googleads/v11/services/types/campaign_experiment_service.py @@ -132,8 +132,8 @@ class MutateCampaignExperimentsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignExperimentResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_extension_setting_service.py b/google/ads/googleads/v11/services/types/campaign_extension_setting_service.py index 271d2cc7c..2c4b3be9d 100644 --- a/google/ads/googleads/v11/services/types/campaign_extension_setting_service.py +++ b/google/ads/googleads/v11/services/types/campaign_extension_setting_service.py @@ -137,8 +137,8 @@ class MutateCampaignExtensionSettingsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignExtensionSettingResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_feed_service.py b/google/ads/googleads/v11/services/types/campaign_feed_service.py index 1cc004a60..b05d8e10d 100644 --- a/google/ads/googleads/v11/services/types/campaign_feed_service.py +++ b/google/ads/googleads/v11/services/types/campaign_feed_service.py @@ -136,8 +136,8 @@ class MutateCampaignFeedsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignFeedResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_group_service.py b/google/ads/googleads/v11/services/types/campaign_group_service.py index 18ece3ec2..3ac8d4af3 100644 --- a/google/ads/googleads/v11/services/types/campaign_group_service.py +++ b/google/ads/googleads/v11/services/types/campaign_group_service.py @@ -138,8 +138,8 @@ class MutateCampaignGroupsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/campaign_label_service.py b/google/ads/googleads/v11/services/types/campaign_label_service.py index 1b441e757..9e1c9afe8 100644 --- a/google/ads/googleads/v11/services/types/campaign_label_service.py +++ b/google/ads/googleads/v11/services/types/campaign_label_service.py @@ -105,8 +105,8 @@ class MutateCampaignLabelsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignLabelResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_service.py b/google/ads/googleads/v11/services/types/campaign_service.py index e2526fcfb..92771e1db 100644 --- a/google/ads/googleads/v11/services/types/campaign_service.py +++ b/google/ads/googleads/v11/services/types/campaign_service.py @@ -133,8 +133,8 @@ class MutateCampaignsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/campaign_shared_set_service.py b/google/ads/googleads/v11/services/types/campaign_shared_set_service.py index b9b487802..d3a1a9365 100644 --- a/google/ads/googleads/v11/services/types/campaign_shared_set_service.py +++ b/google/ads/googleads/v11/services/types/campaign_shared_set_service.py @@ -118,8 +118,8 @@ class MutateCampaignSharedSetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCampaignSharedSetResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/conversion_action_service.py b/google/ads/googleads/v11/services/types/conversion_action_service.py index e3f9ff91c..fcafd8951 100644 --- a/google/ads/googleads/v11/services/types/conversion_action_service.py +++ b/google/ads/googleads/v11/services/types/conversion_action_service.py @@ -137,8 +137,8 @@ class MutateConversionActionsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateConversionActionResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/conversion_adjustment_upload_service.py b/google/ads/googleads/v11/services/types/conversion_adjustment_upload_service.py index b09a0805e..6ef5e3642 100644 --- a/google/ads/googleads/v11/services/types/conversion_adjustment_upload_service.py +++ b/google/ads/googleads/v11/services/types/conversion_adjustment_upload_service.py @@ -77,9 +77,9 @@ class UploadConversionAdjustmentsResponse(proto.Message): Errors that pertain to conversion adjustment failures in the partial failure mode. Returned when all errors occur inside the adjustments. If - any errors occur outside the adjustments (e.g. - auth errors), we return an RPC level error. - See + any errors occur outside the adjustments (for + example, auth errors), we return an RPC level + error. See https://developers.google.com/google-ads/api/docs/best-practices/partial-failures for more information about partial failure. results (Sequence[google.ads.googleads.v11.services.types.ConversionAdjustmentResult]): @@ -126,8 +126,8 @@ class ConversionAdjustment(proto.Message): adjustment_date_time (str): The date time at which the adjustment occurred. Must be after the conversion_date_time. The timezone must be - specified. The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. - "2019-01-01 12:32:45-08:00". + specified. The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for + example, "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_adjustment_date_time``. adjustment_type (google.ads.googleads.v11.enums.types.ConversionAdjustmentTypeEnum.ConversionAdjustmentType): @@ -204,8 +204,8 @@ class RestatementValue(proto.Message): provided, then the default currency from the conversion action is used, and if that is not set then the account currency is used. This is - the ISO 4217 3-character currency code e.g. USD - or EUR. + the ISO 4217 3-character currency code for + example, USD or EUR. This field is a member of `oneof`_ ``_currency_code``. """ @@ -227,8 +227,8 @@ class GclidDateTimePair(proto.Message): conversion_date_time (str): The date time at which the original conversion for this adjustment occurred. The timezone must be specified. The - format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 - 12:32:45-08:00". + format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, + "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_conversion_date_time``. """ @@ -255,7 +255,7 @@ class ConversionAdjustmentResult(proto.Message): This field is a member of `oneof`_ ``_conversion_action``. adjustment_date_time (str): The date time at which the adjustment occurred. The format - is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 + is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_adjustment_date_time``. diff --git a/google/ads/googleads/v11/services/types/conversion_custom_variable_service.py b/google/ads/googleads/v11/services/types/conversion_custom_variable_service.py index d9167b55d..fce3be2df 100644 --- a/google/ads/googleads/v11/services/types/conversion_custom_variable_service.py +++ b/google/ads/googleads/v11/services/types/conversion_custom_variable_service.py @@ -130,8 +130,8 @@ class MutateConversionCustomVariablesResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateConversionCustomVariableResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/conversion_upload_service.py b/google/ads/googleads/v11/services/types/conversion_upload_service.py index 6cf003520..e3f9b1686 100644 --- a/google/ads/googleads/v11/services/types/conversion_upload_service.py +++ b/google/ads/googleads/v11/services/types/conversion_upload_service.py @@ -82,8 +82,9 @@ class UploadClickConversionsResponse(proto.Message): Errors that pertain to conversion failures in the partial failure mode. Returned when all errors occur inside the conversions. If any - errors occur outside the conversions (e.g. auth - errors), we return an RPC level error. See + errors occur outside the conversions (for + example, auth errors), we return an RPC level + error. See https://developers.google.com/google-ads/api/docs/best-practices/partial-failures for more information about partial failure. results (Sequence[google.ads.googleads.v11.services.types.ClickConversionResult]): @@ -143,8 +144,9 @@ class UploadCallConversionsResponse(proto.Message): Errors that pertain to conversion failures in the partial failure mode. Returned when all errors occur inside the conversions. If any - errors occur outside the conversions (e.g. auth - errors), we return an RPC level error. See + errors occur outside the conversions (for + example, auth errors), we return an RPC level + error. See https://developers.google.com/google-ads/api/docs/best-practices/partial-failures for more information about partial failure. results (Sequence[google.ads.googleads.v11.services.types.CallConversionResult]): @@ -190,8 +192,8 @@ class ClickConversion(proto.Message): conversion_date_time (str): The date time at which the conversion occurred. Must be after the click time. The timezone must be specified. The - format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 - 12:32:45-08:00". + format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, + "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_conversion_date_time``. conversion_value (float): @@ -230,7 +232,7 @@ class ClickConversion(proto.Message): for each conversion is 5. conversion_environment (google.ads.googleads.v11.enums.types.ConversionEnvironmentEnum.ConversionEnvironment): The environment this conversion was recorded - on. e.g. App or Web. + on, for example, App or Web. """ gclid = proto.Field(proto.STRING, number=9, optional=True,) @@ -265,14 +267,14 @@ class CallConversion(proto.Message): caller_id (str): The caller id from which this call was placed. Caller id is expected to be in E.164 - format with preceding '+' sign. e.g. + format with preceding '+' sign, for example, "+16502531234". This field is a member of `oneof`_ ``_caller_id``. call_start_date_time (str): The date time at which the call occurred. The timezone must be specified. The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", - e.g. "2019-01-01 12:32:45-08:00". + for example, "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_call_start_date_time``. conversion_action (str): @@ -287,8 +289,8 @@ class CallConversion(proto.Message): conversion_date_time (str): The date time at which the conversion occurred. Must be after the call time. The timezone must be specified. The - format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 - 12:32:45-08:00". + format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, + "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_conversion_date_time``. conversion_value (float): @@ -367,7 +369,7 @@ class ClickConversionResult(proto.Message): This field is a member of `oneof`_ ``_conversion_action``. conversion_date_time (str): The date time at which the conversion occurred. The format - is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 + is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_conversion_date_time``. @@ -401,7 +403,7 @@ class CallConversionResult(proto.Message): This field is a member of `oneof`_ ``_caller_id``. call_start_date_time (str): The date time at which the call occurred. The format is - "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 + "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_call_start_date_time``. @@ -412,7 +414,7 @@ class CallConversionResult(proto.Message): This field is a member of `oneof`_ ``_conversion_action``. conversion_date_time (str): The date time at which the conversion occurred. The format - is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 + is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_conversion_date_time``. diff --git a/google/ads/googleads/v11/services/types/conversion_value_rule_service.py b/google/ads/googleads/v11/services/types/conversion_value_rule_service.py index f33217c26..2d1dbca65 100644 --- a/google/ads/googleads/v11/services/types/conversion_value_rule_service.py +++ b/google/ads/googleads/v11/services/types/conversion_value_rule_service.py @@ -139,8 +139,8 @@ class MutateConversionValueRulesResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/conversion_value_rule_set_service.py b/google/ads/googleads/v11/services/types/conversion_value_rule_set_service.py index 086651b3d..e9b163547 100644 --- a/google/ads/googleads/v11/services/types/conversion_value_rule_set_service.py +++ b/google/ads/googleads/v11/services/types/conversion_value_rule_set_service.py @@ -139,8 +139,8 @@ class MutateConversionValueRuleSetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/customer_asset_service.py b/google/ads/googleads/v11/services/types/customer_asset_service.py index 79d4ceb6b..e99fd79f7 100644 --- a/google/ads/googleads/v11/services/types/customer_asset_service.py +++ b/google/ads/googleads/v11/services/types/customer_asset_service.py @@ -136,8 +136,8 @@ class MutateCustomerAssetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCustomerAssetResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/customer_customizer_service.py b/google/ads/googleads/v11/services/types/customer_customizer_service.py index 795c1a339..413055c7c 100644 --- a/google/ads/googleads/v11/services/types/customer_customizer_service.py +++ b/google/ads/googleads/v11/services/types/customer_customizer_service.py @@ -119,8 +119,8 @@ class MutateCustomerCustomizersResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/customer_extension_setting_service.py b/google/ads/googleads/v11/services/types/customer_extension_setting_service.py index 472ed4ad0..7be6a8efb 100644 --- a/google/ads/googleads/v11/services/types/customer_extension_setting_service.py +++ b/google/ads/googleads/v11/services/types/customer_extension_setting_service.py @@ -137,8 +137,8 @@ class MutateCustomerExtensionSettingsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCustomerExtensionSettingResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/customer_feed_service.py b/google/ads/googleads/v11/services/types/customer_feed_service.py index 148b6e3c1..3a82e9ec2 100644 --- a/google/ads/googleads/v11/services/types/customer_feed_service.py +++ b/google/ads/googleads/v11/services/types/customer_feed_service.py @@ -136,8 +136,8 @@ class MutateCustomerFeedsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCustomerFeedResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/customer_label_service.py b/google/ads/googleads/v11/services/types/customer_label_service.py index 31622e6d5..8d911e0c7 100644 --- a/google/ads/googleads/v11/services/types/customer_label_service.py +++ b/google/ads/googleads/v11/services/types/customer_label_service.py @@ -105,8 +105,8 @@ class MutateCustomerLabelsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCustomerLabelResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/customer_negative_criterion_service.py b/google/ads/googleads/v11/services/types/customer_negative_criterion_service.py index fcdd9cbd3..12cb8ac36 100644 --- a/google/ads/googleads/v11/services/types/customer_negative_criterion_service.py +++ b/google/ads/googleads/v11/services/types/customer_negative_criterion_service.py @@ -118,8 +118,8 @@ class MutateCustomerNegativeCriteriaResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateCustomerNegativeCriteriaResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/customizer_attribute_service.py b/google/ads/googleads/v11/services/types/customizer_attribute_service.py index a46404de1..bd1cd7557 100644 --- a/google/ads/googleads/v11/services/types/customizer_attribute_service.py +++ b/google/ads/googleads/v11/services/types/customizer_attribute_service.py @@ -126,8 +126,8 @@ class MutateCustomizerAttributesResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/experiment_arm_service.py b/google/ads/googleads/v11/services/types/experiment_arm_service.py index 26d9a43aa..89615c1e1 100644 --- a/google/ads/googleads/v11/services/types/experiment_arm_service.py +++ b/google/ads/googleads/v11/services/types/experiment_arm_service.py @@ -134,8 +134,8 @@ class MutateExperimentArmsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateExperimentArmResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/experiment_service.py b/google/ads/googleads/v11/services/types/experiment_service.py index 7cabd2962..8a2b15904 100644 --- a/google/ads/googleads/v11/services/types/experiment_service.py +++ b/google/ads/googleads/v11/services/types/experiment_service.py @@ -131,8 +131,8 @@ class MutateExperimentsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateExperimentResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/extension_feed_item_service.py b/google/ads/googleads/v11/services/types/extension_feed_item_service.py index e5acac1ec..473a5b5e3 100644 --- a/google/ads/googleads/v11/services/types/extension_feed_item_service.py +++ b/google/ads/googleads/v11/services/types/extension_feed_item_service.py @@ -136,8 +136,8 @@ class MutateExtensionFeedItemsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateExtensionFeedItemResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/feed_item_service.py b/google/ads/googleads/v11/services/types/feed_item_service.py index 2d566272d..8d0684b04 100644 --- a/google/ads/googleads/v11/services/types/feed_item_service.py +++ b/google/ads/googleads/v11/services/types/feed_item_service.py @@ -133,8 +133,8 @@ class MutateFeedItemsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateFeedItemResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/feed_item_set_link_service.py b/google/ads/googleads/v11/services/types/feed_item_set_link_service.py index ee5c5c434..eeb89d3b5 100644 --- a/google/ads/googleads/v11/services/types/feed_item_set_link_service.py +++ b/google/ads/googleads/v11/services/types/feed_item_set_link_service.py @@ -106,8 +106,8 @@ class MutateFeedItemSetLinksResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/feed_item_set_service.py b/google/ads/googleads/v11/services/types/feed_item_set_service.py index 13f062e70..6e8a08114 100644 --- a/google/ads/googleads/v11/services/types/feed_item_set_service.py +++ b/google/ads/googleads/v11/services/types/feed_item_set_service.py @@ -122,8 +122,8 @@ class MutateFeedItemSetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. """ results = proto.RepeatedField( diff --git a/google/ads/googleads/v11/services/types/feed_item_target_service.py b/google/ads/googleads/v11/services/types/feed_item_target_service.py index d70c40d29..48255b6ef 100644 --- a/google/ads/googleads/v11/services/types/feed_item_target_service.py +++ b/google/ads/googleads/v11/services/types/feed_item_target_service.py @@ -117,8 +117,8 @@ class MutateFeedItemTargetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateFeedItemTargetResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/feed_mapping_service.py b/google/ads/googleads/v11/services/types/feed_mapping_service.py index 48dd2d71f..950b78cfe 100644 --- a/google/ads/googleads/v11/services/types/feed_mapping_service.py +++ b/google/ads/googleads/v11/services/types/feed_mapping_service.py @@ -117,8 +117,8 @@ class MutateFeedMappingsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateFeedMappingResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/feed_service.py b/google/ads/googleads/v11/services/types/feed_service.py index 96c90df89..69889f14f 100644 --- a/google/ads/googleads/v11/services/types/feed_service.py +++ b/google/ads/googleads/v11/services/types/feed_service.py @@ -127,8 +127,8 @@ class MutateFeedsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateFeedResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/google_ads_service.py b/google/ads/googleads/v11/services/types/google_ads_service.py index 1dfb764a9..e966bb068 100644 --- a/google/ads/googleads/v11/services/types/google_ads_service.py +++ b/google/ads/googleads/v11/services/types/google_ads_service.py @@ -1781,7 +1781,7 @@ class MutateGoogleAdsRequest(proto.Message): resource name should be returned post mutation. The mutable resource will only be returned if the resource has the appropriate response field. - E.g. MutateCampaignResult.campaign. + For example, MutateCampaignResult.campaign. """ customer_id = proto.Field(proto.STRING, number=1,) @@ -1806,8 +1806,8 @@ class MutateGoogleAdsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g., auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. mutate_operation_responses (Sequence[google.ads.googleads.v11.services.types.MutateOperationResponse]): All responses for the mutate. """ @@ -2858,6 +2858,14 @@ class MutateOperationResponse(proto.Message): The result for the customizer attribute mutate. + This field is a member of `oneof`_ ``response``. + experiment_result (google.ads.googleads.v11.services.types.MutateExperimentResult): + The result for the experiment mutate. + + This field is a member of `oneof`_ ``response``. + experiment_arm_result (google.ads.googleads.v11.services.types.MutateExperimentArmResult): + The result for the experiment arm mutate. + This field is a member of `oneof`_ ``response``. extension_feed_item_result (google.ads.googleads.v11.services.types.MutateExtensionFeedItemResult): The result for the extension feed item @@ -3273,6 +3281,18 @@ class MutateOperationResponse(proto.Message): oneof="response", message=customizer_attribute_service.MutateCustomizerAttributeResult, ) + experiment_result = proto.Field( + proto.MESSAGE, + number=81, + oneof="response", + message=experiment_service.MutateExperimentResult, + ) + experiment_arm_result = proto.Field( + proto.MESSAGE, + number=82, + oneof="response", + message=experiment_arm_service.MutateExperimentArmResult, + ) extension_feed_item_result = proto.Field( proto.MESSAGE, number=36, diff --git a/google/ads/googleads/v11/services/types/keyword_plan_ad_group_keyword_service.py b/google/ads/googleads/v11/services/types/keyword_plan_ad_group_keyword_service.py index 1d9e4386d..57ccd40d2 100644 --- a/google/ads/googleads/v11/services/types/keyword_plan_ad_group_keyword_service.py +++ b/google/ads/googleads/v11/services/types/keyword_plan_ad_group_keyword_service.py @@ -127,8 +127,8 @@ class MutateKeywordPlanAdGroupKeywordsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateKeywordPlanAdGroupKeywordResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/keyword_plan_ad_group_service.py b/google/ads/googleads/v11/services/types/keyword_plan_ad_group_service.py index 1569116d0..7c4d7dc1e 100644 --- a/google/ads/googleads/v11/services/types/keyword_plan_ad_group_service.py +++ b/google/ads/googleads/v11/services/types/keyword_plan_ad_group_service.py @@ -122,8 +122,8 @@ class MutateKeywordPlanAdGroupsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateKeywordPlanAdGroupResult]): All results for the mutate. The order of the results is determined by the order of the diff --git a/google/ads/googleads/v11/services/types/keyword_plan_campaign_keyword_service.py b/google/ads/googleads/v11/services/types/keyword_plan_campaign_keyword_service.py index f60231510..8a2200dcd 100644 --- a/google/ads/googleads/v11/services/types/keyword_plan_campaign_keyword_service.py +++ b/google/ads/googleads/v11/services/types/keyword_plan_campaign_keyword_service.py @@ -125,8 +125,8 @@ class MutateKeywordPlanCampaignKeywordsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateKeywordPlanCampaignKeywordResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/keyword_plan_campaign_service.py b/google/ads/googleads/v11/services/types/keyword_plan_campaign_service.py index cd97a69c4..02ee96b78 100644 --- a/google/ads/googleads/v11/services/types/keyword_plan_campaign_service.py +++ b/google/ads/googleads/v11/services/types/keyword_plan_campaign_service.py @@ -122,8 +122,8 @@ class MutateKeywordPlanCampaignsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateKeywordPlanCampaignResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/keyword_plan_idea_service.py b/google/ads/googleads/v11/services/types/keyword_plan_idea_service.py index 484b6e47e..117c16f12 100644 --- a/google/ads/googleads/v11/services/types/keyword_plan_idea_service.py +++ b/google/ads/googleads/v11/services/types/keyword_plan_idea_service.py @@ -102,51 +102,33 @@ class GenerateKeywordIdeasRequest(proto.Message): The options for historical metrics data. keyword_and_url_seed (google.ads.googleads.v11.services.types.KeywordAndUrlSeed): A Keyword and a specific Url to generate - ideas from e.g. cars, www.example.com/cars. + ideas from for example, cars, + www.example.com/cars. This field is a member of `oneof`_ ``seed``. keyword_seed (google.ads.googleads.v11.services.types.KeywordSeed): A Keyword or phrase to generate ideas from, - e.g. cars. + for example, cars. This field is a member of `oneof`_ ``seed``. url_seed (google.ads.googleads.v11.services.types.UrlSeed): - A specific url to generate ideas from, e.g. - www.example.com/cars. + A specific url to generate ideas from, for + example, www.example.com/cars. This field is a member of `oneof`_ ``seed``. site_seed (google.ads.googleads.v11.services.types.SiteSeed): - The site to generate ideas from, e.g. + The site to generate ideas from, for example, www.example.com. This field is a member of `oneof`_ ``seed``. """ - customer_id = proto.Field( - proto.STRING, - number=1, - ) - language = proto.Field( - proto.STRING, - number=14, - optional=True, - ) - geo_target_constants = proto.RepeatedField( - proto.STRING, - number=15, - ) - include_adult_keywords = proto.Field( - proto.BOOL, - number=10, - ) - page_token = proto.Field( - proto.STRING, - number=12, - ) - page_size = proto.Field( - proto.INT32, - number=13, - ) + customer_id = proto.Field(proto.STRING, number=1,) + language = proto.Field(proto.STRING, number=14, optional=True,) + geo_target_constants = proto.RepeatedField(proto.STRING, number=15,) + include_adult_keywords = proto.Field(proto.BOOL, number=10,) + page_token = proto.Field(proto.STRING, number=12,) + page_size = proto.Field(proto.INT32, number=13,) keyword_plan_network = proto.Field( proto.ENUM, number=9, @@ -168,28 +150,16 @@ class GenerateKeywordIdeasRequest(proto.Message): message=keyword_plan_common.HistoricalMetricsOptions, ) keyword_and_url_seed = proto.Field( - proto.MESSAGE, - number=2, - oneof="seed", - message="KeywordAndUrlSeed", + proto.MESSAGE, number=2, oneof="seed", message="KeywordAndUrlSeed", ) keyword_seed = proto.Field( - proto.MESSAGE, - number=3, - oneof="seed", - message="KeywordSeed", + proto.MESSAGE, number=3, oneof="seed", message="KeywordSeed", ) url_seed = proto.Field( - proto.MESSAGE, - number=5, - oneof="seed", - message="UrlSeed", + proto.MESSAGE, number=5, oneof="seed", message="UrlSeed", ) site_seed = proto.Field( - proto.MESSAGE, - number=11, - oneof="seed", - message="SiteSeed", + proto.MESSAGE, number=11, oneof="seed", message="SiteSeed", ) @@ -206,15 +176,8 @@ class KeywordAndUrlSeed(proto.Message): Requires at least one keyword. """ - url = proto.Field( - proto.STRING, - number=3, - optional=True, - ) - keywords = proto.RepeatedField( - proto.STRING, - number=4, - ) + url = proto.Field(proto.STRING, number=3, optional=True,) + keywords = proto.RepeatedField(proto.STRING, number=4,) class KeywordSeed(proto.Message): @@ -225,10 +188,7 @@ class KeywordSeed(proto.Message): Requires at least one keyword. """ - keywords = proto.RepeatedField( - proto.STRING, - number=2, - ) + keywords = proto.RepeatedField(proto.STRING, number=2,) class SiteSeed(proto.Message): @@ -243,11 +203,7 @@ class SiteSeed(proto.Message): This field is a member of `oneof`_ ``_site``. """ - site = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + site = proto.Field(proto.STRING, number=2, optional=True,) class UrlSeed(proto.Message): @@ -261,11 +217,7 @@ class UrlSeed(proto.Message): This field is a member of `oneof`_ ``_url``. """ - url = proto.Field( - proto.STRING, - number=2, - optional=True, - ) + url = proto.Field(proto.STRING, number=2, optional=True,) class GenerateKeywordIdeaResponse(proto.Message): @@ -291,23 +243,15 @@ def raw_page(self): return self results = proto.RepeatedField( - proto.MESSAGE, - number=1, - message="GenerateKeywordIdeaResult", + proto.MESSAGE, number=1, message="GenerateKeywordIdeaResult", ) aggregate_metric_results = proto.Field( proto.MESSAGE, number=4, message=keyword_plan_common.KeywordPlanAggregateMetricResults, ) - next_page_token = proto.Field( - proto.STRING, - number=2, - ) - total_size = proto.Field( - proto.INT64, - number=3, - ) + next_page_token = proto.Field(proto.STRING, number=2,) + total_size = proto.Field(proto.INT64, number=3,) class GenerateKeywordIdeaResult(proto.Message): @@ -337,25 +281,16 @@ class GenerateKeywordIdeaResult(proto.Message): for the definition of "close variants". """ - text = proto.Field( - proto.STRING, - number=5, - optional=True, - ) + text = proto.Field(proto.STRING, number=5, optional=True,) keyword_idea_metrics = proto.Field( proto.MESSAGE, number=3, message=keyword_plan_common.KeywordPlanHistoricalMetrics, ) keyword_annotations = proto.Field( - proto.MESSAGE, - number=6, - message=keyword_plan_common.KeywordAnnotations, - ) - close_variants = proto.RepeatedField( - proto.STRING, - number=7, + proto.MESSAGE, number=6, message=keyword_plan_common.KeywordAnnotations, ) + close_variants = proto.RepeatedField(proto.STRING, number=7,) class GenerateKeywordHistoricalMetricsRequest(proto.Message): @@ -398,27 +333,11 @@ class GenerateKeywordHistoricalMetricsRequest(proto.Message): The options for historical metrics data. """ - customer_id = proto.Field( - proto.STRING, - number=1, - ) - keywords = proto.RepeatedField( - proto.STRING, - number=2, - ) - language = proto.Field( - proto.STRING, - number=4, - optional=True, - ) - include_adult_keywords = proto.Field( - proto.BOOL, - number=5, - ) - geo_target_constants = proto.RepeatedField( - proto.STRING, - number=6, - ) + customer_id = proto.Field(proto.STRING, number=1,) + keywords = proto.RepeatedField(proto.STRING, number=2,) + language = proto.Field(proto.STRING, number=4, optional=True,) + include_adult_keywords = proto.Field(proto.BOOL, number=5,) + geo_target_constants = proto.RepeatedField(proto.STRING, number=6,) keyword_plan_network = proto.Field( proto.ENUM, number=7, @@ -483,15 +402,8 @@ class GenerateKeywordHistoricalMetricsResult(proto.Message): variants """ - text = proto.Field( - proto.STRING, - number=1, - optional=True, - ) - close_variants = proto.RepeatedField( - proto.STRING, - number=3, - ) + text = proto.Field(proto.STRING, number=1, optional=True,) + close_variants = proto.RepeatedField(proto.STRING, number=3,) keyword_metrics = proto.Field( proto.MESSAGE, number=2, @@ -515,18 +427,9 @@ class GenerateAdGroupThemesRequest(proto.Message): ``customers/{customer_id}/adGroups/{ad_group_id}`` """ - customer_id = proto.Field( - proto.STRING, - number=1, - ) - keywords = proto.RepeatedField( - proto.STRING, - number=2, - ) - ad_groups = proto.RepeatedField( - proto.STRING, - number=3, - ) + customer_id = proto.Field(proto.STRING, number=1,) + keywords = proto.RepeatedField(proto.STRING, number=2,) + ad_groups = proto.RepeatedField(proto.STRING, number=3,) class GenerateAdGroupThemesResponse(proto.Message): @@ -542,14 +445,10 @@ class GenerateAdGroupThemesResponse(proto.Message): """ ad_group_keyword_suggestions = proto.RepeatedField( - proto.MESSAGE, - number=1, - message="AdGroupKeywordSuggestion", + proto.MESSAGE, number=1, message="AdGroupKeywordSuggestion", ) unusable_ad_groups = proto.RepeatedField( - proto.MESSAGE, - number=2, - message="UnusableAdGroup", + proto.MESSAGE, number=2, message="UnusableAdGroup", ) @@ -573,27 +472,15 @@ class AdGroupKeywordSuggestion(proto.Message): format: ``customers/{customer_id}/campaigns/{campaign_id}`` """ - keyword_text = proto.Field( - proto.STRING, - number=1, - ) - suggested_keyword_text = proto.Field( - proto.STRING, - number=2, - ) + keyword_text = proto.Field(proto.STRING, number=1,) + suggested_keyword_text = proto.Field(proto.STRING, number=2,) suggested_match_type = proto.Field( proto.ENUM, number=3, enum=keyword_match_type.KeywordMatchTypeEnum.KeywordMatchType, ) - suggested_ad_group = proto.Field( - proto.STRING, - number=4, - ) - suggested_campaign = proto.Field( - proto.STRING, - number=5, - ) + suggested_ad_group = proto.Field(proto.STRING, number=4,) + suggested_campaign = proto.Field(proto.STRING, number=5,) class UnusableAdGroup(proto.Message): @@ -614,14 +501,8 @@ class UnusableAdGroup(proto.Message): ``customers/{customer_id}/campaigns/{campaign_id}`` """ - ad_group = proto.Field( - proto.STRING, - number=1, - ) - campaign = proto.Field( - proto.STRING, - number=2, - ) + ad_group = proto.Field(proto.STRING, number=1,) + campaign = proto.Field(proto.STRING, number=2,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/services/types/keyword_plan_service.py b/google/ads/googleads/v11/services/types/keyword_plan_service.py index aed824706..6afa0cca8 100644 --- a/google/ads/googleads/v11/services/types/keyword_plan_service.py +++ b/google/ads/googleads/v11/services/types/keyword_plan_service.py @@ -143,8 +143,8 @@ class MutateKeywordPlansResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateKeywordPlansResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/keyword_theme_constant_service.py b/google/ads/googleads/v11/services/types/keyword_theme_constant_service.py index 1e8ab2c2c..64e7affef 100644 --- a/google/ads/googleads/v11/services/types/keyword_theme_constant_service.py +++ b/google/ads/googleads/v11/services/types/keyword_theme_constant_service.py @@ -35,8 +35,8 @@ class SuggestKeywordThemeConstantsRequest(proto.Message): Attributes: query_text (str): The query text of a keyword theme that will - be used to map to similar keyword themes. E.g. - "plumber" or "roofer". + be used to map to similar keyword themes. For + example, "plumber" or "roofer". country_code (str): Upper-case, two-letter country code as defined by ISO-3166. This for refining the scope diff --git a/google/ads/googleads/v11/services/types/label_service.py b/google/ads/googleads/v11/services/types/label_service.py index 79b974ce4..410a07b00 100644 --- a/google/ads/googleads/v11/services/types/label_service.py +++ b/google/ads/googleads/v11/services/types/label_service.py @@ -127,8 +127,8 @@ class MutateLabelsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateLabelResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/media_file_service.py b/google/ads/googleads/v11/services/types/media_file_service.py index 70801f1ba..d0f0e38f4 100644 --- a/google/ads/googleads/v11/services/types/media_file_service.py +++ b/google/ads/googleads/v11/services/types/media_file_service.py @@ -104,8 +104,8 @@ class MutateMediaFilesResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateMediaFileResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/offline_user_data_job_service.py b/google/ads/googleads/v11/services/types/offline_user_data_job_service.py index 6d589e4c9..7ba6ad93b 100644 --- a/google/ads/googleads/v11/services/types/offline_user_data_job_service.py +++ b/google/ads/googleads/v11/services/types/offline_user_data_job_service.py @@ -184,8 +184,8 @@ class AddOfflineUserDataJobOperationsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. warning (google.rpc.status_pb2.Status): Non blocking errors that pertain to operation failures in the warnings mode. Returned only when enable_warnings = diff --git a/google/ads/googleads/v11/services/types/reach_plan_service.py b/google/ads/googleads/v11/services/types/reach_plan_service.py index fc1516906..b02cf343d 100644 --- a/google/ads/googleads/v11/services/types/reach_plan_service.py +++ b/google/ads/googleads/v11/services/types/reach_plan_service.py @@ -53,6 +53,10 @@ "OnTargetAudienceMetrics", "EffectiveFrequencyBreakdown", "ForecastMetricOptions", + "AudienceTargeting", + "AdvancedProductTargeting", + "YouTubeSelectSettings", + "YouTubeSelectLineUp", }, ) @@ -191,6 +195,9 @@ class PlannableTargeting(proto.Message): products. networks (Sequence[google.ads.googleads.v11.enums.types.ReachPlanNetworkEnum.ReachPlanNetwork]): Targetable networks for the ad product. + youtube_select_lineups (Sequence[google.ads.googleads.v11.services.types.YouTubeSelectLineUp]): + Targetable YouTube Select Lineups for the ad + product. """ age_ranges = proto.RepeatedField( @@ -209,6 +216,9 @@ class PlannableTargeting(proto.Message): number=4, enum=reach_plan_network.ReachPlanNetworkEnum.ReachPlanNetwork, ) + youtube_select_lineups = proto.RepeatedField( + proto.MESSAGE, number=5, message="YouTubeSelectLineUp", + ) class GenerateProductMixIdeasRequest(proto.Message): @@ -336,18 +346,18 @@ class GenerateReachForecastRequest(proto.Message): campaign_duration (google.ads.googleads.v11.services.types.CampaignDuration): Required. Campaign duration. cookie_frequency_cap (int): - Desired cookie frequency cap to be applied to each planned + Chosen cookie frequency cap to be applied to each planned product. This is equivalent to the frequency cap exposed in Google Ads when creating a campaign, it represents the maximum number of times an ad can be shown to the same user. If not specified, no cap is applied. This field is deprecated in v4 and will eventually be - removed. Please use cookie_frequency_cap_setting instead. + removed. Use cookie_frequency_cap_setting instead. This field is a member of `oneof`_ ``_cookie_frequency_cap``. cookie_frequency_cap_setting (google.ads.googleads.v11.services.types.FrequencyCap): - Desired cookie frequency cap to be applied to each planned + Chosen cookie frequency cap to be applied to each planned product. This is equivalent to the frequency cap exposed in Google Ads when creating a campaign, it represents the maximum number of times an ad can be shown to the same user @@ -357,7 +367,7 @@ class GenerateReachForecastRequest(proto.Message): This field replaces the deprecated cookie_frequency_cap field. min_effective_frequency (int): - Desired minimum effective frequency (the number of times a + Chosen minimum effective frequency (the number of times a person was exposed to the ad) for the reported reach metrics [1-10]. This won't affect the targeting, but just the reporting. If not specified, a default of 1 is applied. @@ -386,7 +396,7 @@ class GenerateReachForecastRequest(proto.Message): selected in the product mix. This is planned targeting: execution details might vary based on the advertising product, - please consult an implementation specialist. + consult an implementation specialist. See specific metrics for details on how targeting affects them. planned_products (Sequence[google.ads.googleads.v11.services.types.PlannedProduct]): @@ -396,6 +406,12 @@ class GenerateReachForecastRequest(proto.Message): forecast_metric_options (google.ads.googleads.v11.services.types.ForecastMetricOptions): Controls the forecast metrics returned in the response. + customer_reach_group (str): + The name of the customer being planned for. This is a + user-defined value. Required if targeting.audience_targeting + is set. + + This field is a member of `oneof`_ ``_customer_reach_group``. """ customer_id = proto.Field(proto.STRING, number=1,) @@ -423,6 +439,7 @@ class GenerateReachForecastRequest(proto.Message): forecast_metric_options = proto.Field( proto.MESSAGE, number=13, message="ForecastMetricOptions", ) + customer_reach_group = proto.Field(proto.STRING, number=14, optional=True,) class EffectiveFrequencyLimit(proto.Message): @@ -486,6 +503,10 @@ class Targeting(proto.Message): targets all applicable networks. Applicable networks vary by product and region and can be obtained from [ReachPlanService.ListPlannableProducts][google.ads.googleads.v11.services.ReachPlanService.ListPlannableProducts]. + audience_targeting (google.ads.googleads.v11.services.types.AudienceTargeting): + Targeted audiences. + If not specified, does not target any specific + audience. """ plannable_location_id = proto.Field(proto.STRING, number=6, optional=True,) @@ -505,6 +526,9 @@ class Targeting(proto.Message): number=5, enum=reach_plan_network.ReachPlanNetworkEnum.ReachPlanNetwork, ) + audience_targeting = proto.Field( + proto.MESSAGE, number=7, message="AudienceTargeting", + ) class CampaignDuration(proto.Message): @@ -548,10 +572,17 @@ class PlannedProduct(proto.Message): 000 000 micros. This field is a member of `oneof`_ ``_budget_micros``. + advanced_product_targeting (google.ads.googleads.v11.services.types.AdvancedProductTargeting): + Targeting settings for the selected product. To list the + available targeting for each product use + [ReachPlanService.ListPlannableProducts][google.ads.googleads.v11.services.ReachPlanService.ListPlannableProducts]. """ plannable_product_code = proto.Field(proto.STRING, number=3, optional=True,) budget_micros = proto.Field(proto.INT64, number=4, optional=True,) + advanced_product_targeting = proto.Field( + proto.MESSAGE, number=5, message="AdvancedProductTargeting", + ) class GenerateReachForecastResponse(proto.Message): @@ -883,4 +914,63 @@ class ForecastMetricOptions(proto.Message): include_coview = proto.Field(proto.BOOL, number=1,) +class AudienceTargeting(proto.Message): + r"""Audience targeting for reach forecast. + + Attributes: + user_interest (Sequence[google.ads.googleads.v11.common.types.UserInterestInfo]): + List of audiences based on user interests to + be targeted. + """ + + user_interest = proto.RepeatedField( + proto.MESSAGE, number=1, message=criteria.UserInterestInfo, + ) + + +class AdvancedProductTargeting(proto.Message): + r"""Advanced targeting settings for products. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + youtube_select_settings (google.ads.googleads.v11.services.types.YouTubeSelectSettings): + Settings for YouTube Select targeting. + + This field is a member of `oneof`_ ``advanced_targeting``. + """ + + youtube_select_settings = proto.Field( + proto.MESSAGE, + number=1, + oneof="advanced_targeting", + message="YouTubeSelectSettings", + ) + + +class YouTubeSelectSettings(proto.Message): + r"""Request settings for YouTube Select Lineups + + Attributes: + lineup_id (int): + Lineup for YouTube Select Targeting. + """ + + lineup_id = proto.Field(proto.INT64, number=1,) + + +class YouTubeSelectLineUp(proto.Message): + r"""A Plannable YouTube Select Lineup for product targeting. + + Attributes: + lineup_id (int): + The ID of the YouTube Select Lineup. + lineup_name (str): + The unique name of the YouTube Select Lineup. + """ + + lineup_id = proto.Field(proto.INT64, number=1,) + lineup_name = proto.Field(proto.STRING, number=2,) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/ads/googleads/v11/services/types/recommendation_service.py b/google/ads/googleads/v11/services/types/recommendation_service.py index 36307bd1f..a63bb621b 100644 --- a/google/ads/googleads/v11/services/types/recommendation_service.py +++ b/google/ads/googleads/v11/services/types/recommendation_service.py @@ -449,8 +449,8 @@ class ApplyRecommendationResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors) we return the RPC - level error. + outside the operations (for example, auth errors) we return + the RPC level error. """ results = proto.RepeatedField( @@ -524,8 +524,8 @@ class DismissRecommendationResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors) we return the RPC - level error. + outside the operations (for example, auth errors) we return + the RPC level error. """ class DismissRecommendationResult(proto.Message): diff --git a/google/ads/googleads/v11/services/types/remarketing_action_service.py b/google/ads/googleads/v11/services/types/remarketing_action_service.py index b3474209f..22573cfab 100644 --- a/google/ads/googleads/v11/services/types/remarketing_action_service.py +++ b/google/ads/googleads/v11/services/types/remarketing_action_service.py @@ -113,8 +113,8 @@ class MutateRemarketingActionsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateRemarketingActionResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/shared_criterion_service.py b/google/ads/googleads/v11/services/types/shared_criterion_service.py index 56ac3f09b..5ed4d8ee9 100644 --- a/google/ads/googleads/v11/services/types/shared_criterion_service.py +++ b/google/ads/googleads/v11/services/types/shared_criterion_service.py @@ -117,8 +117,8 @@ class MutateSharedCriteriaResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateSharedCriterionResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/shared_set_service.py b/google/ads/googleads/v11/services/types/shared_set_service.py index b62d874c7..d218621c5 100644 --- a/google/ads/googleads/v11/services/types/shared_set_service.py +++ b/google/ads/googleads/v11/services/types/shared_set_service.py @@ -135,8 +135,8 @@ class MutateSharedSetsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateSharedSetResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/smart_campaign_setting_service.py b/google/ads/googleads/v11/services/types/smart_campaign_setting_service.py index c0d0c47d5..c94c42e87 100644 --- a/google/ads/googleads/v11/services/types/smart_campaign_setting_service.py +++ b/google/ads/googleads/v11/services/types/smart_campaign_setting_service.py @@ -107,8 +107,8 @@ class MutateSmartCampaignSettingsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateSmartCampaignSettingResult]): All results for the mutate. """ diff --git a/google/ads/googleads/v11/services/types/smart_campaign_suggest_service.py b/google/ads/googleads/v11/services/types/smart_campaign_suggest_service.py index 9b95a116c..b3c8af904 100644 --- a/google/ads/googleads/v11/services/types/smart_campaign_suggest_service.py +++ b/google/ads/googleads/v11/services/types/smart_campaign_suggest_service.py @@ -62,15 +62,8 @@ class SuggestSmartCampaignBudgetOptionsRequest(proto.Message): This field is a member of `oneof`_ ``suggestion_data``. """ - customer_id = proto.Field( - proto.STRING, - number=1, - ) - campaign = proto.Field( - proto.STRING, - number=2, - oneof="suggestion_data", - ) + customer_id = proto.Field(proto.STRING, number=1,) + campaign = proto.Field(proto.STRING, number=2, oneof="suggestion_data",) suggestion_info = proto.Field( proto.MESSAGE, number=3, @@ -111,9 +104,9 @@ class SmartCampaignSuggestionInfo(proto.Message): This field is a member of `oneof`_ ``business_setting``. business_profile_location (str): Optional. The resource name of a Business Profile location. - Business Profile location resource names can be fetched via - the Business Profile API and adhere to the following format: - ``locations/{locationId}``. + Business Profile location resource names can be fetched + through the Business Profile API and adhere to the following + format: ``locations/{locationId}``. See the [Business Profile API] (https://developers.google.com/my-business/reference/businessinformation/rest/v1/accounts.locations) @@ -141,9 +134,7 @@ class LocationList(proto.Message): """ locations = proto.RepeatedField( - proto.MESSAGE, - number=1, - message=criteria.LocationInfo, + proto.MESSAGE, number=1, message=criteria.LocationInfo, ) class BusinessContext(proto.Message): @@ -154,28 +145,15 @@ class BusinessContext(proto.Message): Optional. The name of the business. """ - business_name = proto.Field( - proto.STRING, - number=1, - ) + business_name = proto.Field(proto.STRING, number=1,) - final_url = proto.Field( - proto.STRING, - number=1, - ) - language_code = proto.Field( - proto.STRING, - number=3, - ) + final_url = proto.Field(proto.STRING, number=1,) + language_code = proto.Field(proto.STRING, number=3,) ad_schedules = proto.RepeatedField( - proto.MESSAGE, - number=6, - message=criteria.AdScheduleInfo, + proto.MESSAGE, number=6, message=criteria.AdScheduleInfo, ) keyword_themes = proto.RepeatedField( - proto.MESSAGE, - number=7, - message=criteria.KeywordThemeInfo, + proto.MESSAGE, number=7, message=criteria.KeywordThemeInfo, ) business_context = proto.Field( proto.MESSAGE, @@ -184,15 +162,10 @@ class BusinessContext(proto.Message): message=BusinessContext, ) business_profile_location = proto.Field( - proto.STRING, - number=9, - oneof="business_setting", + proto.STRING, number=9, oneof="business_setting", ) location_list = proto.Field( - proto.MESSAGE, - number=4, - oneof="geo_target", - message=LocationList, + proto.MESSAGE, number=4, oneof="geo_target", message=LocationList, ) proximity = proto.Field( proto.MESSAGE, @@ -233,14 +206,8 @@ class Metrics(proto.Message): The estimated max daily clicks. """ - min_daily_clicks = proto.Field( - proto.INT64, - number=1, - ) - max_daily_clicks = proto.Field( - proto.INT64, - number=2, - ) + min_daily_clicks = proto.Field(proto.INT64, number=1,) + max_daily_clicks = proto.Field(proto.INT64, number=2,) class BudgetOption(proto.Message): r"""Smart Campaign budget option. @@ -257,10 +224,7 @@ class BudgetOption(proto.Message): information to derive the estimates. """ - daily_amount_micros = proto.Field( - proto.INT64, - number=1, - ) + daily_amount_micros = proto.Field(proto.INT64, number=1,) metrics = proto.Field( proto.MESSAGE, number=2, @@ -268,22 +232,13 @@ class BudgetOption(proto.Message): ) low = proto.Field( - proto.MESSAGE, - number=1, - optional=True, - message=BudgetOption, + proto.MESSAGE, number=1, optional=True, message=BudgetOption, ) recommended = proto.Field( - proto.MESSAGE, - number=2, - optional=True, - message=BudgetOption, + proto.MESSAGE, number=2, optional=True, message=BudgetOption, ) high = proto.Field( - proto.MESSAGE, - number=3, - optional=True, - message=BudgetOption, + proto.MESSAGE, number=3, optional=True, message=BudgetOption, ) @@ -301,14 +256,9 @@ class SuggestSmartCampaignAdRequest(proto.Message): the suggestion: business_setting and geo_target. """ - customer_id = proto.Field( - proto.STRING, - number=1, - ) + customer_id = proto.Field(proto.STRING, number=1,) suggestion_info = proto.Field( - proto.MESSAGE, - number=2, - message="SmartCampaignSuggestionInfo", + proto.MESSAGE, number=2, message="SmartCampaignSuggestionInfo", ) @@ -323,9 +273,7 @@ class SuggestSmartCampaignAdResponse(proto.Message): """ ad_info = proto.Field( - proto.MESSAGE, - number=1, - message=ad_type_infos.SmartCampaignAdInfo, + proto.MESSAGE, number=1, message=ad_type_infos.SmartCampaignAdInfo, ) @@ -349,14 +297,9 @@ class SuggestKeywordThemesRequest(proto.Message): - suggestion_info.business_setting """ - customer_id = proto.Field( - proto.STRING, - number=1, - ) + customer_id = proto.Field(proto.STRING, number=1,) suggestion_info = proto.Field( - proto.MESSAGE, - number=2, - message="SmartCampaignSuggestionInfo", + proto.MESSAGE, number=2, message="SmartCampaignSuggestionInfo", ) diff --git a/google/ads/googleads/v11/services/types/user_data_service.py b/google/ads/googleads/v11/services/types/user_data_service.py index 1aacaa99a..0b49b2d05 100644 --- a/google/ads/googleads/v11/services/types/user_data_service.py +++ b/google/ads/googleads/v11/services/types/user_data_service.py @@ -101,14 +101,15 @@ class UserDataOperation(proto.Message): class UploadUserDataResponse(proto.Message): r"""Response message for [UserDataService.UploadUserData][google.ads.googleads.v11.services.UserDataService.UploadUserData] - Uploads made via this service will not be visible under the 'Segment - members' section for the Customer Match List in the Google Ads UI. + Uploads made through this service will not be visible under the + 'Segment members' section for the Customer Match List in the Google + Ads UI. Attributes: upload_date_time (str): The date time at which the request was received by API, - formatted as "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 - 12:32:45-08:00". + formatted as "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, + "2019-01-01 12:32:45-08:00". This field is a member of `oneof`_ ``_upload_date_time``. received_operations_count (int): diff --git a/google/ads/googleads/v11/services/types/user_list_service.py b/google/ads/googleads/v11/services/types/user_list_service.py index a42ebb17c..5a9613ac1 100644 --- a/google/ads/googleads/v11/services/types/user_list_service.py +++ b/google/ads/googleads/v11/services/types/user_list_service.py @@ -115,8 +115,8 @@ class MutateUserListsResponse(proto.Message): Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur - outside the operations (e.g. auth errors), we return an RPC - level error. + outside the operations (for example, auth errors), we return + an RPC level error. results (Sequence[google.ads.googleads.v11.services.types.MutateUserListResult]): All results for the mutate. """ diff --git a/setup.py b/setup.py index 946b44f79..b8eb19fbf 100644 --- a/setup.py +++ b/setup.py @@ -18,20 +18,17 @@ install_requires = [ "google-auth-oauthlib >= 0.3.0, < 1.0.0", - "google-api-core >= 2.8.1, < 3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", - "googleapis-common-protos >= 1.5.8, < 2.0.0", + "google-api-core >= 2.8.1, < 3.0.0", + "googleapis-common-protos >= 1.56.4, < 2.0.0", # NOTE: Source code for grpcio and grpcio-status exist in the same # grpc/grpc monorepo and thus these two dependencies should always # have the same version range. "grpcio >= 1.38.1, < 2.0.0", "grpcio-status >= 1.38.1, < 2.0.0", - "proto-plus == 1.19.6", + "proto-plus == 1.22.0", "PyYAML >= 5.1, < 7.0", "setuptools >= 40.3.0", - # Protobuf versions 3.18.* and 3.19.* are incompatible with this - # library due to performance issues. See the following for more details: - # https://github.com/protocolbuffers/protobuf/issues/9180 - "protobuf >= 3.12.0, <= 3.20.0,!=3.18.*,!=3.19.*", + "protobuf >= 4.21.5", ] with io.open("README.rst", "r", encoding="utf-8") as readme_file: @@ -39,7 +36,7 @@ setup( name="google-ads", - version="18.0.0", + version="18.1.0", author="Google LLC", author_email="googleapis-packages@google.com", classifiers=[ @@ -56,11 +53,7 @@ python_requires=">=3.7", long_description=long_description, install_requires=install_requires, - extras_require={ - "tests": [ - "nox >= 2020.12.31, < 2022.6", - ] - }, + extras_require={"tests": ["nox >= 2020.12.31, < 2022.6",]}, license="Apache 2.0", packages=find_packages( exclude=["examples", "examples.*", "tests", "tests.*"] diff --git a/tests/fixtures/protobuf_fixture_pb2.py b/tests/fixtures/protobuf_fixture_pb2.py index 0d5cfd608..023cb812d 100644 --- a/tests/fixtures/protobuf_fixture_pb2.py +++ b/tests/fixtures/protobuf_fixture_pb2.py @@ -1,80 +1,25 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: protobuf_fixture.proto - +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database - # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor.FileDescriptor( - name="protobuf_fixture.proto", - package="", - syntax="proto3", - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x16protobuf_fixture.proto"\x1f\n\x0fProtobufFixture\x12\x0c\n\x04name\x18\x01 \x01(\tb\x06proto3', -) - - -_PROTOBUFFIXTURE = _descriptor.Descriptor( - name="ProtobufFixture", - full_name="ProtobufFixture", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="ProtobufFixture.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26, - serialized_end=57, -) -DESCRIPTOR.message_types_by_name["ProtobufFixture"] = _PROTOBUFFIXTURE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) -ProtobufFixture = _reflection.GeneratedProtocolMessageType( - "ProtobufFixture", - (_message.Message,), - { - "DESCRIPTOR": _PROTOBUFFIXTURE, - "__module__": "protobuf_fixture_pb2" - # @@protoc_insertion_point(class_scope:ProtobufFixture) - }, -) -_sym_db.RegisterMessage(ProtobufFixture) +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16protobuf_fixture.proto\"\x1f\n\x0fProtobufFixture\x12\x0c\n\x04name\x18\x01 \x01(\tb\x06proto3') +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protobuf_fixture_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None + _PROTOBUFFIXTURE._serialized_start=26 + _PROTOBUFFIXTURE._serialized_end=57 # @@protoc_insertion_point(module_scope)