Repository navigation
Update examples to use v26 #1097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,15 +28,15 @@ | |||||||||||||||||||||||||
| from google.ads.googleads.client import GoogleAdsClient | ||||||||||||||||||||||||||
| from google.ads.googleads.errors import GoogleAdsException | ||||||||||||||||||||||||||
| from google.ads.googleads.util import get_nested_attr | ||||||||||||||||||||||||||
| from google.ads.googleads.v24.services.services.google_ads_service.client import ( | ||||||||||||||||||||||||||
| from google.ads.googleads.v26.services.services.google_ads_service.client import ( | ||||||||||||||||||||||||||
| GoogleAdsServiceClient, | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| from google.ads.googleads.v24.services.types.google_ads_service import ( | ||||||||||||||||||||||||||
| from google.ads.googleads.v26.services.types.google_ads_service import ( | ||||||||||||||||||||||||||
| SearchGoogleAdsRequest, | ||||||||||||||||||||||||||
| SearchPagedResponse, | ||||||||||||||||||||||||||
| GoogleAdsRow, | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
Comment on lines
+34
to
38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
| from google.ads.googleads.v24.resources.types.change_event import ChangeEvent | ||||||||||||||||||||||||||
| from google.ads.googleads.v26.resources.types.change_event import ChangeEvent | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # [START get_change_details] | ||||||||||||||||||||||||||
|
|
@@ -218,7 +218,7 @@ def main(client: GoogleAdsClient, customer_id: str) -> None: | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # GoogleAdsClient will read the google-ads.yaml configuration file in the | ||||||||||||||||||||||||||
| # home directory if none is specified. | ||||||||||||||||||||||||||
| googleads_client = GoogleAdsClient.load_from_storage(version="v24") | ||||||||||||||||||||||||||
| googleads_client = GoogleAdsClient.load_from_storage(version="v26") | ||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||
| main(googleads_client, args.customer_id) | ||||||||||||||||||||||||||
| except GoogleAdsException as ex: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,15 +21,15 @@ | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| from google.ads.googleads.client import GoogleAdsClient | ||||||||||||||||||||||||||
| from google.ads.googleads.errors import GoogleAdsException | ||||||||||||||||||||||||||
| from google.ads.googleads.v24.services.services.google_ads_service.client import ( | ||||||||||||||||||||||||||
| from google.ads.googleads.v26.services.services.google_ads_service.client import ( | ||||||||||||||||||||||||||
| GoogleAdsServiceClient, | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| from google.ads.googleads.v24.services.types.google_ads_service import ( | ||||||||||||||||||||||||||
| from google.ads.googleads.v26.services.types.google_ads_service import ( | ||||||||||||||||||||||||||
| SearchGoogleAdsRequest, | ||||||||||||||||||||||||||
| SearchPagedResponse, | ||||||||||||||||||||||||||
| GoogleAdsRow, | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
Comment on lines
+27
to
31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
| from google.ads.googleads.v24.resources.types.change_status import ChangeStatus | ||||||||||||||||||||||||||
| from google.ads.googleads.v26.resources.types.change_status import ChangeStatus | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # [START get_change_summary] | ||||||||||||||||||||||||||
|
|
@@ -109,7 +109,7 @@ def main(client: GoogleAdsClient, customer_id: str) -> None: | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # GoogleAdsClient will read the google-ads.yaml configuration file in the | ||||||||||||||||||||||||||
| # home directory if none is specified. | ||||||||||||||||||||||||||
| googleads_client = GoogleAdsClient.load_from_storage(version="v24") | ||||||||||||||||||||||||||
| googleads_client = GoogleAdsClient.load_from_storage(version="v26") | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||
| main(googleads_client, args.customer_id) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,31 +22,31 @@ | |
|
|
||
| from google.ads.googleads.client import GoogleAdsClient | ||
| from google.ads.googleads.errors import GoogleAdsException | ||
| from google.ads.googleads.v24.services.services.customer_client_link_service.client import ( | ||
| from google.ads.googleads.v26.services.services.customer_client_link_service.client import ( | ||
| CustomerClientLinkServiceClient, | ||
| ) | ||
| from google.ads.googleads.v24.services.types.customer_client_link_service import ( | ||
| from google.ads.googleads.v26.services.types.customer_client_link_service import ( | ||
| CustomerClientLinkOperation, | ||
| MutateCustomerClientLinkResponse, | ||
| ) | ||
| from google.ads.googleads.v24.resources.types.customer_client_link import ( | ||
| from google.ads.googleads.v26.resources.types.customer_client_link import ( | ||
| CustomerClientLink, | ||
| ) | ||
| from google.ads.googleads.v24.services.services.google_ads_service.client import ( | ||
| from google.ads.googleads.v26.services.services.google_ads_service.client import ( | ||
| GoogleAdsServiceClient, | ||
| ) | ||
| from google.ads.googleads.v24.services.types.google_ads_service import ( | ||
| from google.ads.googleads.v26.services.types.google_ads_service import ( | ||
| SearchPagedResponse, | ||
| GoogleAdsRow, | ||
| ) | ||
|
Comment on lines
+38
to
41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Also note: |
||
| from google.ads.googleads.v24.services.services.customer_manager_link_service.client import ( | ||
| from google.ads.googleads.v26.services.services.customer_manager_link_service.client import ( | ||
| CustomerManagerLinkServiceClient, | ||
| ) | ||
| from google.ads.googleads.v24.services.types.customer_manager_link_service import ( | ||
| from google.ads.googleads.v26.services.types.customer_manager_link_service import ( | ||
| CustomerManagerLinkOperation, | ||
| MutateCustomerManagerLinkResponse, | ||
| ) | ||
| from google.ads.googleads.v24.resources.types.customer_manager_link import ( | ||
| from google.ads.googleads.v26.resources.types.customer_manager_link import ( | ||
| CustomerManagerLink, | ||
| ) | ||
|
|
||
|
|
@@ -179,7 +179,7 @@ def 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="v24") | ||
| googleads_client = GoogleAdsClient.load_from_storage(version="v26") | ||
| try: | ||
| main(googleads_client, args.customer_id, args.manager_customer_id) | ||
| except GoogleAdsException as ex: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,20 +26,20 @@ | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| from google.ads.googleads.client import GoogleAdsClient | ||||||||||||||||||||||
| from google.ads.googleads.errors import GoogleAdsException | ||||||||||||||||||||||
| from google.ads.googleads.v24.services.services.google_ads_service.client import ( | ||||||||||||||||||||||
| from google.ads.googleads.v26.services.services.google_ads_service.client import ( | ||||||||||||||||||||||
| GoogleAdsServiceClient, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| from google.ads.googleads.v24.services.types.google_ads_service import ( | ||||||||||||||||||||||
| from google.ads.googleads.v26.services.types.google_ads_service import ( | ||||||||||||||||||||||
| SearchGoogleAdsRequest, | ||||||||||||||||||||||
| SearchPagedResponse, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
Comment on lines
+32
to
35
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
| from google.ads.googleads.v24.resources.types.customer_user_access import ( | ||||||||||||||||||||||
| from google.ads.googleads.v26.resources.types.customer_user_access import ( | ||||||||||||||||||||||
| CustomerUserAccess, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| from google.ads.googleads.v24.services.services.customer_user_access_service.client import ( | ||||||||||||||||||||||
| from google.ads.googleads.v26.services.services.customer_user_access_service.client import ( | ||||||||||||||||||||||
| CustomerUserAccessServiceClient, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| from google.ads.googleads.v24.services.types.customer_user_access_service import ( | ||||||||||||||||||||||
| from google.ads.googleads.v26.services.types.customer_user_access_service import ( | ||||||||||||||||||||||
| CustomerUserAccessOperation, | ||||||||||||||||||||||
| MutateCustomerUserAccessResponse, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
@@ -233,7 +233,7 @@ def modify_user_access( | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| # GoogleAdsClient will read the google-ads.yaml configuration file in the | ||||||||||||||||||||||
| # home directory if none is specified. | ||||||||||||||||||||||
| googleads_client = GoogleAdsClient.load_from_storage(version="v24") | ||||||||||||||||||||||
| googleads_client = GoogleAdsClient.load_from_storage(version="v26") | ||||||||||||||||||||||
| try: | ||||||||||||||||||||||
| main( | ||||||||||||||||||||||
| googleads_client, | ||||||||||||||||||||||
|
|
||||||||||||||||||||||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SearchPagedResponsedoes not exist ingoogle.ads.googleads.v26.services.types.google_ads_serviceand raises anImportErrorat runtime.GoogleAdsServiceClient.search()returns aSearchPager: