Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
* 30.1.0
- Google Ads API v24 release.
- Update examples to use Google Ads API v24.
- Fix apply_incentive example to make country code required. (#1070)
- Fix 'UnaryUnaryCall' object has no attribute 'exception' error in async requests (#1061)
- Update Generate Forecast Metrics example for v24

* 30.0.0
- Google Ads API v23_2 release.
- Fix config module so that login_customer_id=None doesn't raise an error.
Expand Down
9 changes: 4 additions & 5 deletions examples/account_management/create_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@
account.
"""


import argparse
import sys
from datetime import datetime

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v23.resources.types.customer import Customer
from google.ads.googleads.v23.services.services.customer_service.client import (
from google.ads.googleads.v24.resources.types.customer import Customer
from google.ads.googleads.v24.services.services.customer_service.client import (
CustomerServiceClient,
)
from google.ads.googleads.v23.services.types.customer_service import (
from google.ads.googleads.v24.services.types.customer_service import (
CreateCustomerClientResponse,
)

Expand Down Expand Up @@ -91,7 +90,7 @@ def main(client: GoogleAdsClient, manager_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="v23")
googleads_client = GoogleAdsClient.load_from_storage(version="v24")

try:
main(googleads_client, args.manager_customer_id)
Expand Down
10 changes: 5 additions & 5 deletions examples/account_management/get_account_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v23.services.services.google_ads_service.client import (
from google.ads.googleads.v24.services.services.google_ads_service.client import (
GoogleAdsServiceClient,
)
from google.ads.googleads.v23.services.services.customer_service.client import (
from google.ads.googleads.v24.services.services.customer_service.client import (
CustomerServiceClient,
)
from google.ads.googleads.v23.resources.types.customer_client import (
from google.ads.googleads.v24.resources.types.customer_client import (
CustomerClient,
)
from google.ads.googleads.v23.services.types.google_ads_service import (
from google.ads.googleads.v24.services.types.google_ads_service import (
SearchPagedResponse,
GoogleAdsRow,
)
Expand Down Expand Up @@ -238,7 +238,7 @@ def print_account_hierarchy(

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v23")
googleads_client = GoogleAdsClient.load_from_storage(version="v24")
try:
main(googleads_client, args.login_customer_id)
except GoogleAdsException as ex:
Expand Down
8 changes: 4 additions & 4 deletions examples/account_management/get_change_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.v23.services.services.google_ads_service.client import (
from google.ads.googleads.v24.services.services.google_ads_service.client import (
GoogleAdsServiceClient,
)
from google.ads.googleads.v23.services.types.google_ads_service import (
from google.ads.googleads.v24.services.types.google_ads_service import (
SearchGoogleAdsRequest,
SearchPagedResponse,
GoogleAdsRow,
)
from google.ads.googleads.v23.resources.types.change_event import ChangeEvent
from google.ads.googleads.v24.resources.types.change_event import ChangeEvent


# [START get_change_details]
Expand Down Expand Up @@ -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="v23")
googleads_client = GoogleAdsClient.load_from_storage(version="v24")
try:
main(googleads_client, args.customer_id)
except GoogleAdsException as ex:
Expand Down
9 changes: 4 additions & 5 deletions examples/account_management/get_change_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@

"""This example gets a list of which resources have been changed in an account."""


import argparse
import sys

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v23.services.services.google_ads_service.client import (
from google.ads.googleads.v24.services.services.google_ads_service.client import (
GoogleAdsServiceClient,
)
from google.ads.googleads.v23.services.types.google_ads_service import (
from google.ads.googleads.v24.services.types.google_ads_service import (
SearchGoogleAdsRequest,
SearchPagedResponse,
GoogleAdsRow,
)
from google.ads.googleads.v23.resources.types.change_status import ChangeStatus
from google.ads.googleads.v24.resources.types.change_status import ChangeStatus


# [START get_change_summary]
Expand Down Expand Up @@ -110,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="v23")
googleads_client = GoogleAdsClient.load_from_storage(version="v24")

try:
main(googleads_client, args.customer_id)
Expand Down
11 changes: 5 additions & 6 deletions examples/account_management/invite_user_with_access_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,23 @@
The invitation is to manage a customer account with a desired access role.
"""


import argparse
import sys

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v23.services.services.customer_user_access_invitation_service.client import (
from google.ads.googleads.v24.services.services.customer_user_access_invitation_service.client import (
CustomerUserAccessInvitationServiceClient,
)
from google.ads.googleads.v23.services.types.customer_user_access_invitation_service import (
from google.ads.googleads.v24.services.types.customer_user_access_invitation_service import (
CustomerUserAccessInvitationOperation,
MutateCustomerUserAccessInvitationResponse,
)
from google.ads.googleads.v23.resources.types.customer_user_access_invitation import (
from google.ads.googleads.v24.resources.types.customer_user_access_invitation import (
CustomerUserAccessInvitation,
)

# AccessRoleEnum is part of google.ads.googleads.v23.enums.types.access_role
# AccessRoleEnum is part of google.ads.googleads.v24.enums.types.access_role
# but it's accessed via client.enums.AccessRoleEnum, so direct import for type hint might not be strictly needed for the parameter.
# The field invitation.access_role expects an int (the enum value).

Expand Down Expand Up @@ -115,7 +114,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="v23")
googleads_client = GoogleAdsClient.load_from_storage(version="v24")

try:
main(
Expand Down
18 changes: 9 additions & 9 deletions examples/account_management/link_manager_to_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v23.services.services.customer_client_link_service.client import (
from google.ads.googleads.v24.services.services.customer_client_link_service.client import (
CustomerClientLinkServiceClient,
)
from google.ads.googleads.v23.services.types.customer_client_link_service import (
from google.ads.googleads.v24.services.types.customer_client_link_service import (
CustomerClientLinkOperation,
MutateCustomerClientLinkResponse,
)
from google.ads.googleads.v23.resources.types.customer_client_link import (
from google.ads.googleads.v24.resources.types.customer_client_link import (
CustomerClientLink,
)
from google.ads.googleads.v23.services.services.google_ads_service.client import (
from google.ads.googleads.v24.services.services.google_ads_service.client import (
GoogleAdsServiceClient,
)
from google.ads.googleads.v23.services.types.google_ads_service import (
from google.ads.googleads.v24.services.types.google_ads_service import (
SearchPagedResponse,
GoogleAdsRow,
)
from google.ads.googleads.v23.services.services.customer_manager_link_service.client import (
from google.ads.googleads.v24.services.services.customer_manager_link_service.client import (
CustomerManagerLinkServiceClient,
)
from google.ads.googleads.v23.services.types.customer_manager_link_service import (
from google.ads.googleads.v24.services.types.customer_manager_link_service import (
CustomerManagerLinkOperation,
MutateCustomerManagerLinkResponse,
)
from google.ads.googleads.v23.resources.types.customer_manager_link import (
from google.ads.googleads.v24.resources.types.customer_manager_link import (
CustomerManagerLink,
)

Expand Down Expand Up @@ -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="v23")
googleads_client = GoogleAdsClient.load_from_storage(version="v24")
try:
main(googleads_client, args.customer_id, args.manager_customer_id)
except GoogleAdsException as ex:
Expand Down
7 changes: 3 additions & 4 deletions examples/account_management/list_accessible_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
documentation: https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid
"""


import sys
from typing import List

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v23.services.services.customer_service.client import (
from google.ads.googleads.v24.services.services.customer_service.client import (
CustomerServiceClient,
)
from google.ads.googleads.v23.services.types.customer_service import (
from google.ads.googleads.v24.services.types.customer_service import (
ListAccessibleCustomersResponse,
)

Expand All @@ -55,7 +54,7 @@ def main(client: GoogleAdsClient) -> None:
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="v23")
googleads_client = GoogleAdsClient.load_from_storage(version="v24")

try:
main(googleads_client)
Expand Down
12 changes: 6 additions & 6 deletions examples/account_management/update_user_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v23.services.services.google_ads_service.client import (
from google.ads.googleads.v24.services.services.google_ads_service.client import (
GoogleAdsServiceClient,
)
from google.ads.googleads.v23.services.types.google_ads_service import (
from google.ads.googleads.v24.services.types.google_ads_service import (
SearchGoogleAdsRequest,
SearchPagedResponse,
)
from google.ads.googleads.v23.resources.types.customer_user_access import (
from google.ads.googleads.v24.resources.types.customer_user_access import (
CustomerUserAccess,
)
from google.ads.googleads.v23.services.services.customer_user_access_service.client import (
from google.ads.googleads.v24.services.services.customer_user_access_service.client import (
CustomerUserAccessServiceClient,
)
from google.ads.googleads.v23.services.types.customer_user_access_service import (
from google.ads.googleads.v24.services.types.customer_user_access_service import (
CustomerUserAccessOperation,
MutateCustomerUserAccessResponse,
)
Expand Down Expand Up @@ -219,7 +219,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="v23")
googleads_client = GoogleAdsClient.load_from_storage(version="v24")
try:
main(
googleads_client,
Expand Down
9 changes: 4 additions & 5 deletions examples/account_management/verify_advertiser_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@
If required and not already started, it also starts the verification process.
"""


import argparse
import sys
from typing import Optional

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v23.enums.types.identity_verification_program_status import (
from google.ads.googleads.v24.enums.types.identity_verification_program_status import (
IdentityVerificationProgramStatusEnum,
)
from google.ads.googleads.v23.services.services.identity_verification_service.client import (
from google.ads.googleads.v24.services.services.identity_verification_service.client import (
IdentityVerificationServiceClient,
)
from google.ads.googleads.v23.services.types.identity_verification_service import (
from google.ads.googleads.v24.services.types.identity_verification_service import (
GetIdentityVerificationResponse,
IdentityVerification,
IdentityVerificationProgress,
Expand Down Expand Up @@ -183,7 +182,7 @@ def start_identity_verification(

# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(version="v23")
googleads_client = GoogleAdsClient.load_from_storage(version="v24")

try:
main(googleads_client, args.customer_id)
Expand Down
17 changes: 8 additions & 9 deletions examples/advanced_operations/add_ad_customizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,31 @@
customizer attributes to populate dynamic data.
"""


import argparse
import sys
from uuid import uuid4

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v23.common.types import AdTextAsset
from google.ads.googleads.v23.resources.types import (
from google.ads.googleads.v24.common.types import AdTextAsset
from google.ads.googleads.v24.resources.types import (
AdGroupAd,
AdGroupCustomizer,
CustomizerAttribute,
)
from google.ads.googleads.v23.services.services.ad_group_ad_service import (
from google.ads.googleads.v24.services.services.ad_group_ad_service import (
AdGroupAdServiceClient,
)
from google.ads.googleads.v23.services.services.ad_group_customizer_service import (
from google.ads.googleads.v24.services.services.ad_group_customizer_service import (
AdGroupCustomizerServiceClient,
)
from google.ads.googleads.v23.services.services.customizer_attribute_service import (
from google.ads.googleads.v24.services.services.customizer_attribute_service import (
CustomizerAttributeServiceClient,
)
from google.ads.googleads.v23.services.services.google_ads_service import (
from google.ads.googleads.v24.services.services.google_ads_service import (
GoogleAdsServiceClient,
)
from google.ads.googleads.v23.services.types import (
from google.ads.googleads.v24.services.types import (
AdGroupAdOperation,
AdGroupCustomizerOperation,
CustomizerAttributeOperation,
Expand Down Expand Up @@ -342,7 +341,7 @@ def create_ad_with_customizations(
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client: GoogleAdsClient = GoogleAdsClient.load_from_storage(
version="v23"
version="v24"
)

try:
Expand Down
Loading
Loading