Skip to content

Commit 09be83d

Browse files
Changes for release v8_0. (#449)
1 parent ee2c059 commit 09be83d

File tree

2,165 files changed

+164413
-137423
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,165 files changed

+164413
-137423
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
* 12.0.0
2+
- Google Ads API v8_0 release.
3+
- Deprecate Google Ads API v5_0.
4+
- *NOTE* This will be the last release to support Python 3.6.
5+
16
* 11.0.2
27
- Update dataclasses dependency so it's only installed when using Python < 3.7
38

examples/account_management/approve_merchant_center_link.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _update_merchant_center_link_status(
127127
if __name__ == "__main__":
128128
# GoogleAdsClient will read the google-ads.yaml configuration file in the
129129
# home directory if none is specified.
130-
googleads_client = GoogleAdsClient.load_from_storage(version="v7")
130+
googleads_client = GoogleAdsClient.load_from_storage(version="v8")
131131

132132
parser = argparse.ArgumentParser(
133133
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="v7")
61+
googleads_client = GoogleAdsClient.load_from_storage(version="v8")
6262

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

examples/account_management/get_account_hierarchy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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="v7")
182+
googleads_client = GoogleAdsClient.load_from_storage(version="v8")
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def main(client, customer_id):
4242
if __name__ == "__main__":
4343
# GoogleAdsClient will read the google-ads.yaml configuration file in the
4444
# home directory if none is specified.
45-
googleads_client = GoogleAdsClient.load_from_storage(version="v7")
45+
googleads_client = GoogleAdsClient.load_from_storage(version="v8")
4646

4747
parser = argparse.ArgumentParser(
4848
description=(

examples/account_management/get_change_details.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,21 @@ def main(client, customer_id):
123123

124124
print(
125125
f"On {event.change_date_time}, user {event.user_email} "
126-
f"used interface {event.client_type} to perform a(n) "
127-
f"{event.resource_change_operation} operation on a "
128-
f"{event.change_resource_type} with resource name "
126+
f"used interface {event.client_type.name} to perform a(n) "
127+
f"{event.resource_change_operation.name} operation on a "
128+
f"{event.change_resource_type.name} with resource name "
129129
f"'{event.change_resource_name}'"
130130
)
131131

132132
operation_type = event.resource_change_operation.name
133133

134134
if operation_type in ("UPDATE", "CREATE"):
135135
for changed_field in event.changed_fields.paths:
136+
# Change field name from "type" to "type_" so that it doesn't
137+
# raise an exception when accessed on the protobuf object, see:
138+
# https://developers.google.com/google-ads/api/docs/client-libs/python/library-version-10#field_names_that_are_reserved_words
139+
if changed_field == "type":
140+
changed_field = "type_"
136141
new_value = get_nested_attr(new_resource, changed_field)
137142
if operation_type == "CREATE":
138143
print(f"\t{changed_field} set to {new_value}")
@@ -147,7 +152,7 @@ def main(client, customer_id):
147152
if __name__ == "__main__":
148153
# GoogleAdsClient will read the google-ads.yaml configuration file in the
149154
# home directory if none is specified.
150-
googleads_client = GoogleAdsClient.load_from_storage(version="v7")
155+
googleads_client = GoogleAdsClient.load_from_storage(version="v8")
151156

152157
parser = argparse.ArgumentParser(
153158
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="v7")
88+
googleads_client = GoogleAdsClient.load_from_storage(version="v8")
8989

9090
parser = argparse.ArgumentParser(
9191
description=(

examples/account_management/get_pending_invitations.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ def main(client, customer_id):
5757
f"access role: {invite.access_role}, and "
5858
f"created on: {invite.creation_date_time} was found."
5959
)
60+
61+
6062
# [END get_pending_invitations]
6163

6264

6365
if __name__ == "__main__":
6466
# GoogleAdsClient will read the google-ads.yaml configuration file in the
6567
# home directory if none is specified.
66-
googleads_client = GoogleAdsClient.load_from_storage(version="v7")
68+
googleads_client = GoogleAdsClient.load_from_storage(version="v8")
6769

6870
parser = argparse.ArgumentParser(
6971
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
@@ -61,7 +61,7 @@ def main(client, customer_id, email_address, access_role):
6161
if __name__ == "__main__":
6262
# GoogleAdsClient will read the google-ads.yaml configuration file in the
6363
# home directory if none is specified.
64-
googleads_client = GoogleAdsClient.load_from_storage(version="v7")
64+
googleads_client = GoogleAdsClient.load_from_storage(version="v8")
6565

6666
parser = argparse.ArgumentParser(
6767
description=(

examples/account_management/link_manager_to_client.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,8 @@ def main(client, customer_id, manager_customer_id):
8585
)
8686
manager_link_operation = client.get_type("CustomerManagerLinkOperation")
8787
manager_link = manager_link_operation.update
88-
manager_link.resource_name = (
89-
customer_manager_link_service.customer_manager_link_path(
90-
customer_id,
91-
manager_customer_id,
92-
manager_link_id,
93-
)
88+
manager_link.resource_name = customer_manager_link_service.customer_manager_link_path(
89+
customer_id, manager_customer_id, manager_link_id,
9490
)
9591

9692
manager_link.status = client.get_type(
@@ -131,7 +127,7 @@ def _handle_googleads_exception(exception):
131127
if __name__ == "__main__":
132128
# GoogleAdsClient will read the google-ads.yaml configuration file in the
133129
# home directory if none is specified.
134-
googleads_client = GoogleAdsClient.load_from_storage(version="v7")
130+
googleads_client = GoogleAdsClient.load_from_storage(version="v8")
135131

136132
parser = argparse.ArgumentParser(
137133
description=(

0 commit comments

Comments
 (0)