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
Jump to file
Failed to load files.
Loading
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.0.0
- Google Ads API v23_2 release.
- Fix config module so that login_customer_id=None doesn't raise an error.
- Rename "gaada" configuration setting to "ads_assistant"
- Set default for brand_guidelines_enabled to True in Pmax examples.
- Fix a small bug in setting the video upload resource name

* 29.2.0
- Google Ads API v23_1 release.
- Update Google Ads API v20, v21, and v22 to include EU political advertising changes.
Expand Down
2 changes: 1 addition & 1 deletion google/ads/googleads/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import google.ads.googleads.errors
import google.ads.googleads.util

VERSION = "29.2.0"
VERSION = "30.0.0"

# Checks if the current runtime is Python 3.9.
if sys.version_info.major == 3 and sys.version_info.minor <= 9:
Expand Down
2 changes: 2 additions & 0 deletions google/ads/googleads/v23/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# this code path once we drop support for Python 3.7
import importlib_metadata as metadata

from . import actions
from . import common
from . import enums
from . import errors
Expand Down Expand Up @@ -131,6 +132,7 @@ def _get_version(dependency_name):
)

__all__ = (
"actions",
"common",
"enums",
"errors",
Expand Down
137 changes: 137 additions & 0 deletions google/ads/googleads/v23/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.ads.googleads.v23 import gapic_version as package_version

import google.api_core as api_core
import sys

__version__ = package_version.__version__

if sys.version_info >= (3, 8): # pragma: NO COVER
from importlib import metadata
else: # pragma: NO COVER
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
# this code path once we drop support for Python 3.7
import importlib_metadata as metadata


from .types.book_campaigns import BookCampaignsOperation
from .types.book_campaigns import BookCampaignsResult
from .types.quote_campaigns import QuoteCampaignsOperation
from .types.quote_campaigns import QuoteCampaignsResult

if hasattr(api_core, "check_python_version") and hasattr(
api_core, "check_dependency_versions"
): # pragma: NO COVER
api_core.check_python_version("google.ads.googleads.v23") # type: ignore
api_core.check_dependency_versions("google.ads.googleads.v23") # type: ignore
else: # pragma: NO COVER
# An older version of api_core is installed which does not define the
# functions above. We do equivalent checks manually.
try:
import warnings
import sys

_py_version_str = sys.version.split()[0]
_package_label = "google.ads.googleads.v23"
if sys.version_info < (3, 9):
warnings.warn(
"You are using a non-supported Python version "
+ f"({_py_version_str}). Google will not post any further "
+ f"updates to {_package_label} supporting this Python version. "
+ "Please upgrade to the latest Python version, or at "
+ f"least to Python 3.9, and then update {_package_label}.",
FutureWarning,
)
if sys.version_info[:2] == (3, 9):
warnings.warn(
f"You are using a Python version ({_py_version_str}) "
+ f"which Google will stop supporting in {_package_label} in "
+ "January 2026. Please "
+ "upgrade to the latest Python version, or at "
+ "least to Python 3.10, before then, and "
+ f"then update {_package_label}.",
FutureWarning,
)

def parse_version_to_tuple(version_string: str):
"""Safely converts a semantic version string to a comparable tuple of integers.
Example: "4.25.8" -> (4, 25, 8)
Ignores non-numeric parts and handles common version formats.
Args:
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
Returns:
Tuple of integers for the parsed version string.
"""
parts = []
for part in version_string.split("."):
try:
parts.append(int(part))
except ValueError:
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
# This is a simplification compared to 'packaging.parse_version', but sufficient
# for comparing strictly numeric semantic versions.
break
return tuple(parts)

def _get_version(dependency_name):
try:
version_string: str = metadata.version(dependency_name)
parsed_version = parse_version_to_tuple(version_string)
return (parsed_version, version_string)
except Exception:
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
# or errors during parse_version_to_tuple
return (None, "--")

_dependency_package = "google.protobuf"
_next_supported_version = "4.25.8"
_next_supported_version_tuple = (4, 25, 8)
_recommendation = " (we recommend 6.x)"
(_version_used, _version_used_string) = _get_version(
_dependency_package
)
if _version_used and _version_used < _next_supported_version_tuple:
warnings.warn(
f"Package {_package_label} depends on "
+ f"{_dependency_package}, currently installed at version "
+ f"{_version_used_string}. Future updates to "
+ f"{_package_label} will require {_dependency_package} at "
+ f"version {_next_supported_version} or higher{_recommendation}."
+ " Please ensure "
+ "that either (a) your Python environment doesn't pin the "
+ f"version of {_dependency_package}, so that updates to "
+ f"{_package_label} can require the higher version, or "
+ "(b) you manually update your Python environment to use at "
+ f"least version {_next_supported_version} of "
+ f"{_dependency_package}.",
FutureWarning,
)
except Exception:
warnings.warn(
"Could not determine the version of Python "
+ "currently being used. To continue receiving "
+ "updates for {_package_label}, ensure you are "
+ "using a supported version of Python; see "
+ "https://devguide.python.org/versions/"
)

__all__ = (
"BookCampaignsOperation",
"BookCampaignsResult",
"QuoteCampaignsOperation",
"QuoteCampaignsResult",
)
15 changes: 15 additions & 0 deletions google/ads/googleads/v23/actions/services/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
30 changes: 30 additions & 0 deletions google/ads/googleads/v23/actions/types/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from .book_campaigns import (
BookCampaignsOperation,
BookCampaignsResult,
)
from .quote_campaigns import (
QuoteCampaignsOperation,
QuoteCampaignsResult,
)

__all__ = (
"BookCampaignsOperation",
"BookCampaignsResult",
"QuoteCampaignsOperation",
"QuoteCampaignsResult",
)
96 changes: 96 additions & 0 deletions google/ads/googleads/v23/actions/types/book_campaigns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

from typing import MutableSequence

import proto # type: ignore

from google.ads.googleads.v23.enums.types import reservation_request_type


__protobuf__ = proto.module(
package="google.ads.googleads.v23.actions",
marshal="google.ads.googleads.v23",
manifest={
"BookCampaignsOperation",
"BookCampaignsResult",
},
)


class BookCampaignsOperation(proto.Message):
r"""Request message for the BookCampaigns action.
Request including this operation can have a latency of up to 30
seconds. This feature is not publicly available.

Attributes:
campaigns (MutableSequence[google.ads.googleads.v23.actions.types.BookCampaignsOperation.Campaign]):
Campaigns to book. Maximum 2 campaigns per
request.
quote_signature (str):
If provided, the signature of the previous
quote. Clients should always provide the quote
signature from previous quotes if they haven't
changed the campaigns to prevent price
fluctuations within a user session.
"""

class Campaign(proto.Message):
r"""A single campaign to book.

Attributes:
campaign (str):
Campaign resource to book. Format:
customers/{customer_id}/campaigns/{campaign_id}
request_type (google.ads.googleads.v23.enums.types.ReservationRequestTypeEnum.ReservationRequestType):
Determines if the current request should book
the inventory or hold it.
"""

campaign: str = proto.Field(
proto.STRING,
number=1,
)
request_type: (
reservation_request_type.ReservationRequestTypeEnum.ReservationRequestType
) = proto.Field(
proto.ENUM,
number=2,
enum=reservation_request_type.ReservationRequestTypeEnum.ReservationRequestType,
)

campaigns: MutableSequence[Campaign] = proto.RepeatedField(
proto.MESSAGE,
number=1,
message=Campaign,
)
quote_signature: str = proto.Field(
proto.STRING,
number=2,
)


class BookCampaignsResult(proto.Message):
r"""Response message for the BookCampaigns action. Note that if the
response contains errors, the action response will not be returned,
but a quote may still be returned in the
ErrorDetails.reservation_error_details field.

"""


__all__ = tuple(sorted(__protobuf__.manifest))
Loading
Loading