Skip to content

Commit bdc334a

Browse files
Changes for release v10_0. (#579)
1 parent 2a1d606 commit bdc334a

File tree

2,102 files changed

+155570
-154445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,102 files changed

+155570
-154445
lines changed

examples/account_management/approve_merchant_center_link.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _update_merchant_center_link_status(
125125
if __name__ == "__main__":
126126
# GoogleAdsClient will read the google-ads.yaml configuration file in the
127127
# home directory if none is specified.
128-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
128+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
129129

130130
parser = argparse.ArgumentParser(
131131
description=("Approves a Merchant Center link request.")

examples/account_management/create_customer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def main(client, manager_customer_id):
5858
if __name__ == "__main__":
5959
# GoogleAdsClient will read the google-ads.yaml configuration file in the
6060
# home directory if none is specified.
61-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
61+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
6262

6363
parser = argparse.ArgumentParser(
6464
description=("Creates a new client under the given manager.")

examples/account_management/get_account_hierarchy.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ def main(client, login_customer_id=None):
7676
)
7777

7878
for customer_resource_name in customer_resource_names:
79-
customer = customer_service.get_customer(
80-
resource_name=customer_resource_name
81-
)
82-
print(customer.id)
83-
seed_customer_ids.append(customer.id)
79+
customer_id = googleads_service.parse_customer_path(
80+
customer_resource_name
81+
)["customer_id"]
82+
print(customer_id)
83+
seed_customer_ids.append(customer_id)
8484

8585
for seed_customer_id in seed_customer_ids:
8686
# Performs a breadth-first search to build a Dictionary that maps
@@ -179,7 +179,7 @@ def _print_account_hierarchy(
179179
if __name__ == "__main__":
180180
# GoogleAdsClient will read the google-ads.yaml configuration file in the
181181
# home directory if none is specified.
182-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
182+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
183183

184184
parser = argparse.ArgumentParser(
185185
description="This example gets the account hierarchy of the specified "

examples/account_management/get_account_information.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,23 @@
2626

2727

2828
def main(client, customer_id):
29-
customer_service = client.get_service("CustomerService")
30-
resource_name = customer_service.customer_path(customer_id)
29+
ga_service = client.get_service("GoogleAdsService")
30+
query = """
31+
SELECT
32+
customer.id,
33+
customer.descriptive_name,
34+
customer.currency_code,
35+
customer.time_zone,
36+
customer.tracking_url_template,
37+
customer.auto_tagging_enabled
38+
FROM customer
39+
LIMIT 1"""
3140

32-
customer = customer_service.get_customer(resource_name=resource_name)
41+
request = client.get_type("SearchGoogleAdsRequest")
42+
request.customer_id = customer_id
43+
request.query = query
44+
response = ga_service.search(request=request)
45+
customer = list(response)[0].customer
3346

3447
print(f"Customer ID: {customer.id}")
3548
print(f"\tDescriptive name: {customer.descriptive_name}")
@@ -42,7 +55,7 @@ def main(client, customer_id):
4255
if __name__ == "__main__":
4356
# GoogleAdsClient will read the google-ads.yaml configuration file in the
4457
# home directory if none is specified.
45-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
58+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
4659

4760
parser = argparse.ArgumentParser(
4861
description=(

examples/account_management/get_change_details.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def main(client, customer_id):
177177
if __name__ == "__main__":
178178
# GoogleAdsClient will read the google-ads.yaml configuration file in the
179179
# home directory if none is specified.
180-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
180+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
181181

182182
parser = argparse.ArgumentParser(
183183
description="This example gets specific details about the most recent "

examples/account_management/get_change_summary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def main(client, customer_id):
8585
if __name__ == "__main__":
8686
# GoogleAdsClient will read a google-ads.yaml configuration file in the
8787
# home directory if none is specified.
88-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
88+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
8989

9090
parser = argparse.ArgumentParser(
9191
description=(

examples/account_management/get_pending_invitations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def main(client, customer_id):
6565
if __name__ == "__main__":
6666
# GoogleAdsClient will read the google-ads.yaml configuration file in the
6767
# home directory if none is specified.
68-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
68+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
6969

7070
parser = argparse.ArgumentParser(
7171
description=("Retrieves pending invitations for a customer account.")

examples/account_management/invite_user_with_access_role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def main(client, customer_id, email_address, access_role):
5959
if __name__ == "__main__":
6060
# GoogleAdsClient will read the google-ads.yaml configuration file in the
6161
# home directory if none is specified.
62-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
62+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
6363

6464
parser = argparse.ArgumentParser(
6565
description=(

examples/account_management/link_manager_to_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def main(client, customer_id, manager_customer_id):
3838
# Extend an invitation to the client while authenticating as the manager.
3939
client_link_operation = client.get_type("CustomerClientLinkOperation")
4040
client_link = client_link_operation.create
41-
client_link.client_customer = customer_client_link_service.customer_path(customer_id)
41+
client_link.client_customer = customer_client_link_service.customer_path(
42+
customer_id
43+
)
4244
client_link.status = client.enums.ManagerLinkStatusEnum.PENDING
4345

4446
response = customer_client_link_service.mutate_customer_client_link(
@@ -110,7 +112,7 @@ def main(client, customer_id, manager_customer_id):
110112
if __name__ == "__main__":
111113
# GoogleAdsClient will read the google-ads.yaml configuration file in the
112114
# home directory if none is specified.
113-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
115+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
114116

115117
parser = argparse.ArgumentParser(
116118
description=(

examples/account_management/list_accessible_customers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def main(client):
4444
if __name__ == "__main__":
4545
# GoogleAdsClient will read the google-ads.yaml configuration file in the
4646
# home directory if none is specified.
47-
googleads_client = GoogleAdsClient.load_from_storage(version="v9")
47+
googleads_client = GoogleAdsClient.load_from_storage(version="v10")
4848

4949
try:
5050
main(googleads_client)

0 commit comments

Comments
 (0)