Skip to content

Commit cfdea2b

Browse files
authored
Changes for release 23_2. (#1065)
1 parent 001e6ae commit cfdea2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+4597
-73
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
* 30.0.0
2+
- Google Ads API v23_2 release.
3+
- Fix config module so that login_customer_id=None doesn't raise an error.
4+
- Rename "gaada" configuration setting to "ads_assistant"
5+
- Set default for brand_guidelines_enabled to True in Pmax examples.
6+
- Fix a small bug in setting the video upload resource name
7+
18
* 29.2.0
29
- Google Ads API v23_1 release.
310
- Update Google Ads API v20, v21, and v22 to include EU political advertising changes.

google/ads/googleads/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import google.ads.googleads.errors
2020
import google.ads.googleads.util
2121

22-
VERSION = "29.2.0"
22+
VERSION = "30.0.0"
2323

2424
# Checks if the current runtime is Python 3.9.
2525
if sys.version_info.major == 3 and sys.version_info.minor <= 9:

google/ads/googleads/v23/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# this code path once we drop support for Python 3.7
2828
import importlib_metadata as metadata
2929

30+
from . import actions
3031
from . import common
3132
from . import enums
3233
from . import errors
@@ -131,6 +132,7 @@ def _get_version(dependency_name):
131132
)
132133

133134
__all__ = (
135+
"actions",
134136
"common",
135137
"enums",
136138
"errors",
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
from google.ads.googleads.v23 import gapic_version as package_version
17+
18+
import google.api_core as api_core
19+
import sys
20+
21+
__version__ = package_version.__version__
22+
23+
if sys.version_info >= (3, 8): # pragma: NO COVER
24+
from importlib import metadata
25+
else: # pragma: NO COVER
26+
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
27+
# this code path once we drop support for Python 3.7
28+
import importlib_metadata as metadata
29+
30+
31+
from .types.book_campaigns import BookCampaignsOperation
32+
from .types.book_campaigns import BookCampaignsResult
33+
from .types.quote_campaigns import QuoteCampaignsOperation
34+
from .types.quote_campaigns import QuoteCampaignsResult
35+
36+
if hasattr(api_core, "check_python_version") and hasattr(
37+
api_core, "check_dependency_versions"
38+
): # pragma: NO COVER
39+
api_core.check_python_version("google.ads.googleads.v23") # type: ignore
40+
api_core.check_dependency_versions("google.ads.googleads.v23") # type: ignore
41+
else: # pragma: NO COVER
42+
# An older version of api_core is installed which does not define the
43+
# functions above. We do equivalent checks manually.
44+
try:
45+
import warnings
46+
import sys
47+
48+
_py_version_str = sys.version.split()[0]
49+
_package_label = "google.ads.googleads.v23"
50+
if sys.version_info < (3, 9):
51+
warnings.warn(
52+
"You are using a non-supported Python version "
53+
+ f"({_py_version_str}). Google will not post any further "
54+
+ f"updates to {_package_label} supporting this Python version. "
55+
+ "Please upgrade to the latest Python version, or at "
56+
+ f"least to Python 3.9, and then update {_package_label}.",
57+
FutureWarning,
58+
)
59+
if sys.version_info[:2] == (3, 9):
60+
warnings.warn(
61+
f"You are using a Python version ({_py_version_str}) "
62+
+ f"which Google will stop supporting in {_package_label} in "
63+
+ "January 2026. Please "
64+
+ "upgrade to the latest Python version, or at "
65+
+ "least to Python 3.10, before then, and "
66+
+ f"then update {_package_label}.",
67+
FutureWarning,
68+
)
69+
70+
def parse_version_to_tuple(version_string: str):
71+
"""Safely converts a semantic version string to a comparable tuple of integers.
72+
Example: "4.25.8" -> (4, 25, 8)
73+
Ignores non-numeric parts and handles common version formats.
74+
Args:
75+
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
76+
Returns:
77+
Tuple of integers for the parsed version string.
78+
"""
79+
parts = []
80+
for part in version_string.split("."):
81+
try:
82+
parts.append(int(part))
83+
except ValueError:
84+
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
85+
# This is a simplification compared to 'packaging.parse_version', but sufficient
86+
# for comparing strictly numeric semantic versions.
87+
break
88+
return tuple(parts)
89+
90+
def _get_version(dependency_name):
91+
try:
92+
version_string: str = metadata.version(dependency_name)
93+
parsed_version = parse_version_to_tuple(version_string)
94+
return (parsed_version, version_string)
95+
except Exception:
96+
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
97+
# or errors during parse_version_to_tuple
98+
return (None, "--")
99+
100+
_dependency_package = "google.protobuf"
101+
_next_supported_version = "4.25.8"
102+
_next_supported_version_tuple = (4, 25, 8)
103+
_recommendation = " (we recommend 6.x)"
104+
(_version_used, _version_used_string) = _get_version(
105+
_dependency_package
106+
)
107+
if _version_used and _version_used < _next_supported_version_tuple:
108+
warnings.warn(
109+
f"Package {_package_label} depends on "
110+
+ f"{_dependency_package}, currently installed at version "
111+
+ f"{_version_used_string}. Future updates to "
112+
+ f"{_package_label} will require {_dependency_package} at "
113+
+ f"version {_next_supported_version} or higher{_recommendation}."
114+
+ " Please ensure "
115+
+ "that either (a) your Python environment doesn't pin the "
116+
+ f"version of {_dependency_package}, so that updates to "
117+
+ f"{_package_label} can require the higher version, or "
118+
+ "(b) you manually update your Python environment to use at "
119+
+ f"least version {_next_supported_version} of "
120+
+ f"{_dependency_package}.",
121+
FutureWarning,
122+
)
123+
except Exception:
124+
warnings.warn(
125+
"Could not determine the version of Python "
126+
+ "currently being used. To continue receiving "
127+
+ "updates for {_package_label}, ensure you are "
128+
+ "using a supported version of Python; see "
129+
+ "https://devguide.python.org/versions/"
130+
)
131+
132+
__all__ = (
133+
"BookCampaignsOperation",
134+
"BookCampaignsResult",
135+
"QuoteCampaignsOperation",
136+
"QuoteCampaignsResult",
137+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
from .book_campaigns import (
17+
BookCampaignsOperation,
18+
BookCampaignsResult,
19+
)
20+
from .quote_campaigns import (
21+
QuoteCampaignsOperation,
22+
QuoteCampaignsResult,
23+
)
24+
25+
__all__ = (
26+
"BookCampaignsOperation",
27+
"BookCampaignsResult",
28+
"QuoteCampaignsOperation",
29+
"QuoteCampaignsResult",
30+
)
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
from __future__ import annotations
17+
18+
from typing import MutableSequence
19+
20+
import proto # type: ignore
21+
22+
from google.ads.googleads.v23.enums.types import reservation_request_type
23+
24+
25+
__protobuf__ = proto.module(
26+
package="google.ads.googleads.v23.actions",
27+
marshal="google.ads.googleads.v23",
28+
manifest={
29+
"BookCampaignsOperation",
30+
"BookCampaignsResult",
31+
},
32+
)
33+
34+
35+
class BookCampaignsOperation(proto.Message):
36+
r"""Request message for the BookCampaigns action.
37+
Request including this operation can have a latency of up to 30
38+
seconds. This feature is not publicly available.
39+
40+
Attributes:
41+
campaigns (MutableSequence[google.ads.googleads.v23.actions.types.BookCampaignsOperation.Campaign]):
42+
Campaigns to book. Maximum 2 campaigns per
43+
request.
44+
quote_signature (str):
45+
If provided, the signature of the previous
46+
quote. Clients should always provide the quote
47+
signature from previous quotes if they haven't
48+
changed the campaigns to prevent price
49+
fluctuations within a user session.
50+
"""
51+
52+
class Campaign(proto.Message):
53+
r"""A single campaign to book.
54+
55+
Attributes:
56+
campaign (str):
57+
Campaign resource to book. Format:
58+
customers/{customer_id}/campaigns/{campaign_id}
59+
request_type (google.ads.googleads.v23.enums.types.ReservationRequestTypeEnum.ReservationRequestType):
60+
Determines if the current request should book
61+
the inventory or hold it.
62+
"""
63+
64+
campaign: str = proto.Field(
65+
proto.STRING,
66+
number=1,
67+
)
68+
request_type: (
69+
reservation_request_type.ReservationRequestTypeEnum.ReservationRequestType
70+
) = proto.Field(
71+
proto.ENUM,
72+
number=2,
73+
enum=reservation_request_type.ReservationRequestTypeEnum.ReservationRequestType,
74+
)
75+
76+
campaigns: MutableSequence[Campaign] = proto.RepeatedField(
77+
proto.MESSAGE,
78+
number=1,
79+
message=Campaign,
80+
)
81+
quote_signature: str = proto.Field(
82+
proto.STRING,
83+
number=2,
84+
)
85+
86+
87+
class BookCampaignsResult(proto.Message):
88+
r"""Response message for the BookCampaigns action. Note that if the
89+
response contains errors, the action response will not be returned,
90+
but a quote may still be returned in the
91+
ErrorDetails.reservation_error_details field.
92+
93+
"""
94+
95+
96+
__all__ = tuple(sorted(__protobuf__.manifest))

0 commit comments

Comments
 (0)