Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/account_management/create_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
"""

import argparse
import sys
from datetime import datetime
import logging
import sys

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
Expand All @@ -34,6 +35,9 @@
CreateCustomerClientResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# [START create_customer]
def main(client: GoogleAdsClient, manager_customer_id: str) -> None:
Expand Down
5 changes: 5 additions & 0 deletions examples/account_management/get_account_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"""

import argparse
import logging
import sys
from typing import Optional, List, Dict

Expand All @@ -42,6 +43,10 @@
GoogleAdsRow,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# ListAccessibleCustomersResponse is not directly used for a variable type,
# but its attribute .resource_names is used, which is List[str].

Expand Down
4 changes: 4 additions & 0 deletions examples/account_management/get_change_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import argparse
from datetime import datetime, timedelta
import logging
import sys
from typing import Any

Expand All @@ -38,6 +39,9 @@
)
from google.ads.googleads.v24.resources.types.change_event import ChangeEvent

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# [START get_change_details]
def main(client: GoogleAdsClient, customer_id: str) -> None:
Expand Down
4 changes: 4 additions & 0 deletions examples/account_management/get_change_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""This example gets a list of which resources have been changed in an account."""

import argparse
import logging
import sys

from google.ads.googleads.client import GoogleAdsClient
Expand All @@ -31,6 +32,9 @@
)
from google.ads.googleads.v24.resources.types.change_status import ChangeStatus

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# [START get_change_summary]
def main(client: GoogleAdsClient, customer_id: str) -> None:
Expand Down
5 changes: 5 additions & 0 deletions examples/account_management/invite_user_with_access_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

import argparse
import logging
import sys

from google.ads.googleads.client import GoogleAdsClient
Expand All @@ -33,6 +34,10 @@
CustomerUserAccessInvitation,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# 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
5 changes: 5 additions & 0 deletions examples/account_management/link_manager_to_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""This example shows how to link a manager customer to a client customer."""

import argparse
import logging
import sys

from google.api_core import protobuf_helpers
Expand Down Expand Up @@ -50,6 +51,10 @@
CustomerManagerLink,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# ManagerLinkStatusEnum is used via client.enums


Expand Down
4 changes: 4 additions & 0 deletions examples/account_management/list_accessible_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
documentation: https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid
"""

import logging
import sys
from typing import List

Expand All @@ -32,6 +33,9 @@
ListAccessibleCustomersResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# [START list_accessible_customers]
def main(client: GoogleAdsClient) -> None:
Expand Down
27 changes: 4 additions & 23 deletions examples/account_management/update_user_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,13 @@
"""

import argparse
import logging
import sys
from typing import Optional

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 (
GoogleAdsServiceClient,
)
from google.ads.googleads.v24.services.types.google_ads_service import (
SearchGoogleAdsRequest,
SearchPagedResponse,
)
from google.ads.googleads.v24.resources.types.customer_user_access import (
CustomerUserAccess,
)
from google.ads.googleads.v24.services.services.customer_user_access_service.client import (
CustomerUserAccessServiceClient,
)
from google.ads.googleads.v24.services.types.customer_user_access_service import (
CustomerUserAccessOperation,
MutateCustomerUserAccessResponse,
)

from google.api_core import protobuf_helpers
from google.protobuf.field_mask_pb2 import FieldMask
logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))

from typing import Optional

_ACCESS_ROLES = ["ADMIN", "STANDARD", "READ_ONLY", "EMAIL_ONLY"]

Expand Down
4 changes: 4 additions & 0 deletions examples/account_management/verify_advertiser_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

import argparse
import logging
import sys
from typing import Optional

Expand All @@ -35,6 +36,9 @@
IdentityVerificationProgress,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


def main(client: GoogleAdsClient, customer_id: str) -> None:
"""The main method that creates all necessary entities for the example.
Expand Down
4 changes: 4 additions & 0 deletions examples/advanced_operations/add_ad_customizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""

import argparse
import logging
import sys
from uuid import uuid4

Expand Down Expand Up @@ -51,6 +52,9 @@
MutateCustomizerAttributesResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


def main(client: GoogleAdsClient, customer_id: str, ad_group_id: str) -> None:
"""The main method that creates all necessary entities for the example.
Expand Down
4 changes: 4 additions & 0 deletions examples/advanced_operations/add_ad_group_bid_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

import argparse
import logging
import sys

from google.ads.googleads.client import GoogleAdsClient
Expand All @@ -37,6 +38,9 @@
MutateAdGroupBidModifiersResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# [START add_ad_group_bid_modifier]
def main(
Expand Down
4 changes: 4 additions & 0 deletions examples/advanced_operations/add_app_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import argparse
from datetime import datetime, timedelta
import logging
import sys
from typing import List
from uuid import uuid4
Expand Down Expand Up @@ -60,6 +61,9 @@
)
from google.ads.googleads.v24.services.types import *

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


def main(client: GoogleAdsClient, customer_id: str) -> None:
"""Main function for running this example."""
Expand Down
4 changes: 4 additions & 0 deletions examples/advanced_operations/add_bidding_data_exclusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"""

import argparse
import logging
import sys
from uuid import uuid4

Expand All @@ -38,6 +39,9 @@
MutateBiddingDataExclusionsResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


def main(
client: GoogleAdsClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"""

import argparse
import logging
import sys
from uuid import uuid4

Expand All @@ -38,6 +39,9 @@
MutateBiddingSeasonalityAdjustmentsResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


def main(
client: GoogleAdsClient,
Expand Down
5 changes: 5 additions & 0 deletions examples/advanced_operations/add_demand_gen_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

import argparse
import logging
import sys
from typing import List
from uuid import uuid4
Expand Down Expand Up @@ -51,6 +52,10 @@
MutateOperation,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# Temporary IDs for resources.
BUDGET_TEMPORARY_ID: int = -1
CAMPAIGN_TEMPORARY_ID: int = -2
Expand Down
8 changes: 6 additions & 2 deletions examples/advanced_operations/add_display_upload_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"""

import argparse
import sys

import logging
import requests
import sys

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
Expand All @@ -42,6 +42,10 @@
MutateAssetsResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


BUNDLE_URL: str = "https://gaagl.page.link/ib87"


Expand Down
5 changes: 5 additions & 0 deletions examples/advanced_operations/add_dynamic_page_feed_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Adds a page feed with URLs for a Dynamic Search Ads campaign."""

import argparse
import logging
import sys
from typing import List, Optional

Expand Down Expand Up @@ -75,6 +76,10 @@
MutateCampaignAssetSetsResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# The label for the DSA page URLs.
DSA_PAGE_URL_LABEL = "discounts"

Expand Down
4 changes: 4 additions & 0 deletions examples/advanced_operations/add_dynamic_search_ads.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import argparse
from datetime import datetime, timedelta
import logging
import sys
from uuid import uuid4

Expand Down Expand Up @@ -70,6 +71,9 @@
MutateCampaignsResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


def main(client: GoogleAdsClient, customer_id: str) -> None:
"""The main method that creates all necessary entities for the example.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import argparse
from datetime import datetime, timedelta
import logging
import sys
from typing import List, Optional, Iterable
from uuid import uuid4
Expand Down Expand Up @@ -82,6 +83,10 @@
MutateOperationResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# We specify temporary IDs that are specific to a single mutate request.
# Temporary IDs are always negative and unique within one mutate request.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
"""

import argparse
import logging
import sys
import uuid
from typing import List, Optional
import uuid

from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
Expand Down Expand Up @@ -115,6 +116,10 @@
MutateCustomizerAttributesResponse,
)

logger = logging.getLogger("google.ads.googleads.client")
logger.addHandler(logging.StreamHandler(sys.stdout))


# Keywords from user.
KEYWORD_TEXT_EXACT = "example of exact match"
KEYWORD_TEXT_PHRASE = "example of phrase match"
Expand Down
Loading