Skip to content

Commit

Permalink
Changes for release v10_0. (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurachevalier4 committed Feb 16, 2022
1 parent 2a1d606 commit bdc334a
Show file tree
Hide file tree
Showing 2,102 changed files with 155,570 additions and 154,445 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 125,7 @@ def _update_merchant_center_link_status(
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=("Approves a Merchant Center link request.")
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/create_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 58,7 @@ def main(client, manager_customer_id):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=("Creates a new client under the given manager.")
Expand Down
12 changes: 6 additions & 6 deletions examples/account_management/get_account_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 76,11 @@ def main(client, login_customer_id=None):
)

for customer_resource_name in customer_resource_names:
customer = customer_service.get_customer(
resource_name=customer_resource_name
)
print(customer.id)
seed_customer_ids.append(customer.id)
customer_id = googleads_service.parse_customer_path(
customer_resource_name
)["customer_id"]
print(customer_id)
seed_customer_ids.append(customer_id)

for seed_customer_id in seed_customer_ids:
# Performs a breadth-first search to build a Dictionary that maps
Expand Down Expand Up @@ -179,7 179,7 @@ def _print_account_hierarchy(
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description="This example gets the account hierarchy of the specified "
Expand Down
21 changes: 17 additions & 4 deletions examples/account_management/get_account_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 26,23 @@


def main(client, customer_id):
customer_service = client.get_service("CustomerService")
resource_name = customer_service.customer_path(customer_id)
ga_service = client.get_service("GoogleAdsService")
query = """
SELECT
customer.id,
customer.descriptive_name,
customer.currency_code,
customer.time_zone,
customer.tracking_url_template,
customer.auto_tagging_enabled
FROM customer
LIMIT 1"""

customer = customer_service.get_customer(resource_name=resource_name)
request = client.get_type("SearchGoogleAdsRequest")
request.customer_id = customer_id
request.query = query
response = ga_service.search(request=request)
customer = list(response)[0].customer

print(f"Customer ID: {customer.id}")
print(f"\tDescriptive name: {customer.descriptive_name}")
Expand All @@ -42,7 55,7 @@ def main(client, customer_id):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=(
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/get_change_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 177,7 @@ def main(client, customer_id):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description="This example gets specific details about the most recent "
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/get_change_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 85,7 @@ def main(client, customer_id):
if __name__ == "__main__":
# GoogleAdsClient will read a google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=(
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/get_pending_invitations.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 65,7 @@ def main(client, customer_id):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=("Retrieves pending invitations for a customer account.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 59,7 @@ def main(client, customer_id, email_address, access_role):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=(
Expand Down
6 changes: 4 additions & 2 deletions examples/account_management/link_manager_to_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 38,9 @@ def main(client, customer_id, manager_customer_id):
# Extend an invitation to the client while authenticating as the manager.
client_link_operation = client.get_type("CustomerClientLinkOperation")
client_link = client_link_operation.create
client_link.client_customer = customer_client_link_service.customer_path(customer_id)
client_link.client_customer = customer_client_link_service.customer_path(
customer_id
)
client_link.status = client.enums.ManagerLinkStatusEnum.PENDING

response = customer_client_link_service.mutate_customer_client_link(
Expand Down Expand Up @@ -110,7 112,7 @@ def main(client, customer_id, manager_customer_id):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=(
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/list_accessible_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 44,7 @@ def main(client):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

try:
main(googleads_client)
Expand Down
8 changes: 5 additions & 3 deletions examples/account_management/reject_merchant_center_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 45,10 @@ def main(client, customer_id, merchant_center_account_id):
"MerchantCenterLinkService"
)
# Get the extant customer account to Merchant Center account links.
list_merchant_center_links_response = merchant_center_link_service.list_merchant_center_links(
customer_id=customer_id
list_merchant_center_links_response = (
merchant_center_link_service.list_merchant_center_links(
customer_id=customer_id
)
)

number_of_links = len(
Expand Down Expand Up @@ -129,7 131,7 @@ def _remove_merchant_center_link(
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=(
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/update_user_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 137,7 @@ def _modify_user_access(client, customer_id, user_id, access_role):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description="This code example updates the access role of a user, "
Expand Down
5 changes: 2 additions & 3 deletions examples/advanced_operations/add_ad_customizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 205,7 @@ def _create_ad_customizer_mapping(
)
for result in response.results:
print(
"Created feed mapping with resource name "
f"{result.resource_name}"
"Created feed mapping with resource name " f"{result.resource_name}"
)
# [END add_ad_customizer_2]

Expand Down Expand Up @@ -402,7 401,7 @@ def _create_ads_with_customizations(
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=(
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_ad_group_bid_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 65,7 @@ def main(client, customer_id, ad_group_id, bid_modifier_value):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=(
Expand Down
6 changes: 3 additions & 3 deletions examples/advanced_operations/add_app_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 171,7 @@ def _set_campaign_targeting_criteria(
"""
campaign_criterion_service = client.get_service("CampaignCriterionService")
geo_target_constant_service = client.get_service("GeoTargetConstantService")
language_constant_service = client.get_service("LanguageConstantService")
googleads_service = client.get_service("GoogleAdsService")

campaign_criterion_operations = []
# Creates the location campaign criteria.
Expand All @@ -198,7 198,7 @@ def _set_campaign_targeting_criteria(
campaign_criterion = campaign_criterion_operation.create
campaign_criterion.campaign = campaign_resource_name
campaign_criterion.language.language_constant = (
language_constant_service.language_constant_path(language_id)
googleads_service.language_constant_path(language_id)
)
campaign_criterion_operations.append(campaign_criterion_operation)

Expand Down Expand Up @@ -297,7 297,7 @@ def _create_ad_text_asset(client, text):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description=(
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_operations/add_bidding_data_exclusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 80,7 @@ def main(client, customer_id, start_date_time, end_date_time):
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description="Adds a data exclusion for conversions in Smart Bidding "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 94,7 @@ def main(
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="v9")
googleads_client = GoogleAdsClient.load_from_storage(version="v10")

parser = argparse.ArgumentParser(
description="Adds a seasonality adjustment for conversions in Smart "
Expand Down
Loading

0 comments on commit bdc334a

Please sign in to comment.