Skip to content

Commit f0f214b

Browse files
authored
feat(google/maps/mapmanagement/v2): onboard a new library (#18173)
PiperOrigin-RevId: 963642371 Fixes b/545715827
1 parent b430e50 commit f0f214b

58 files changed

Lines changed: 32071 additions & 11 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"packages/google-cloud-workloadidentity": "0.1.0",
32
"packages/google-cloud-ftp": "0.1.0",
3+
"packages/google-cloud-workloadidentity": "0.1.0",
44
"packages/google-crc32c": "1.8.0",
5+
"packages/google-maps-mapmanagement": "0.1.0",
56
"preview-packages/google-cloud-compute": "1.51.0-preview.1"
6-
}
7+
}

librarian.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,7 @@ libraries:
23562356
- name: google-maps-mapmanagement
23572357
version: 0.1.0
23582358
apis:
2359+
- path: google/maps/mapmanagement/v2
23592360
- path: google/maps/mapmanagement/v2beta
23602361
copyright_year: "2026"
23612362
python:

packages/google-maps-mapmanagement/docs/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
.. include:: multiprocessing.rst
44

5+
This package includes clients for multiple versions of Map Management.
6+
By default, you will get version ``mapmanagement_v2beta``.
7+
58

69
API Reference
710
-------------
@@ -11,6 +14,14 @@ API Reference
1114
mapmanagement_v2beta/services_
1215
mapmanagement_v2beta/types_
1316

17+
API Reference
18+
-------------
19+
.. toctree::
20+
:maxdepth: 2
21+
22+
mapmanagement_v2/services_
23+
mapmanagement_v2/types_
24+
1425

1526
Changelog
1627
---------
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
MapManagement
2+
-------------------------------
3+
4+
.. automodule:: google.maps.mapmanagement_v2.services.map_management
5+
:members:
6+
:inherited-members:
7+
8+
.. automodule:: google.maps.mapmanagement_v2.services.map_management.pagers
9+
:members:
10+
:inherited-members:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Services for Google Maps Mapmanagement v2 API
2+
=============================================
3+
.. toctree::
4+
:maxdepth: 2
5+
6+
map_management
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Types for Google Maps Mapmanagement v2 API
2+
==========================================
3+
4+
.. automodule:: google.maps.mapmanagement_v2.types
5+
:members:
6+
:show-inheritance:
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2026 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+
import sys
17+
18+
import google.api_core as api_core
19+
20+
from google.maps.mapmanagement_v2 import gapic_version as package_version
21+
22+
__version__ = package_version.__version__
23+
24+
from importlib import metadata
25+
26+
# PEP 0810: Explicit Lazy Imports
27+
# Python 3.15+ natively intercepts and defers these imports.
28+
# Developers can disable this behavior and force eager imports.
29+
# For more information, see:
30+
# https://docs.python.org/3.15/library/sys.html#sys.set_lazy_imports_filter
31+
# Older Python versions safely ignore this variable.
32+
__lazy_modules__ = {
33+
"google.maps.mapmanagement_v2.services.map_management",
34+
"google.maps.mapmanagement_v2.types.map_management_service",
35+
}
36+
37+
38+
from .services.map_management import MapManagementAsyncClient, MapManagementClient
39+
from .types.map_management_service import (
40+
CreateMapConfigRequest,
41+
CreateMapContextConfigRequest,
42+
CreateStyleConfigRequest,
43+
DeleteMapConfigRequest,
44+
DeleteMapContextConfigRequest,
45+
DeleteStyleConfigRequest,
46+
GetMapConfigRequest,
47+
GetMapContextConfigRequest,
48+
GetStyleConfigRequest,
49+
ListMapConfigsRequest,
50+
ListMapConfigsResponse,
51+
ListMapContextConfigsRequest,
52+
ListMapContextConfigsResponse,
53+
ListStyleConfigsRequest,
54+
ListStyleConfigsResponse,
55+
MapConfig,
56+
MapContextConfig,
57+
MapFeatures,
58+
MapRenderingType,
59+
StyleConfig,
60+
StyleConfigView,
61+
UpdateMapConfigRequest,
62+
UpdateMapContextConfigRequest,
63+
UpdateStyleConfigRequest,
64+
)
65+
66+
if hasattr(api_core, "check_python_version") and hasattr(
67+
api_core, "check_dependency_versions"
68+
): # pragma: NO COVER
69+
api_core.check_python_version("google.maps.mapmanagement_v2") # type: ignore
70+
api_core.check_dependency_versions("google.maps.mapmanagement_v2") # type: ignore
71+
else: # pragma: NO COVER
72+
# An older version of api_core is installed which does not define the
73+
# functions above. We do equivalent checks manually.
74+
try:
75+
import warnings
76+
77+
_py_version_str = sys.version.split()[0]
78+
_package_label = "google.maps.mapmanagement_v2"
79+
if sys.version_info < (3, 10):
80+
warnings.warn(
81+
"You are using a non-supported Python version "
82+
+ f"({_py_version_str}). Google will not post any further "
83+
+ f"updates to {_package_label} supporting this Python version. "
84+
+ "Please upgrade to the latest Python version, or at "
85+
+ f"least to Python 3.10, and then update {_package_label}.",
86+
FutureWarning,
87+
)
88+
89+
def parse_version_to_tuple(version_string: str):
90+
"""Safely converts a semantic version string to a comparable tuple of integers.
91+
Example: "6.33.5" -> (6, 33, 5)
92+
Ignores non-numeric parts and handles common version formats.
93+
Args:
94+
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
95+
Returns:
96+
Tuple of integers for the parsed version string.
97+
"""
98+
parts = []
99+
for part in version_string.split("."):
100+
try:
101+
parts.append(int(part))
102+
except ValueError:
103+
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
104+
# This is a simplification compared to 'packaging.parse_version', but sufficient
105+
# for comparing strictly numeric semantic versions.
106+
break
107+
return tuple(parts)
108+
109+
def _get_version(dependency_name):
110+
try:
111+
version_string: str = metadata.version(dependency_name)
112+
parsed_version = parse_version_to_tuple(version_string)
113+
return (parsed_version, version_string)
114+
except Exception:
115+
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
116+
# or errors during parse_version_to_tuple
117+
return (None, "--")
118+
119+
_dependency_package = "google.protobuf"
120+
_next_supported_version = "6.33.5"
121+
_next_supported_version_tuple = (6, 33, 5)
122+
_recommendation = " (we recommend 7.x)"
123+
(_version_used, _version_used_string) = _get_version(_dependency_package)
124+
if _version_used and _version_used < _next_supported_version_tuple:
125+
warnings.warn(
126+
f"Package {_package_label} depends on "
127+
+ f"{_dependency_package}, currently installed at version "
128+
+ f"{_version_used_string}. Future updates to "
129+
+ f"{_package_label} will require {_dependency_package} at "
130+
+ f"version {_next_supported_version} or higher{_recommendation}."
131+
+ " Please ensure "
132+
+ "that either (a) your Python environment doesn't pin the "
133+
+ f"version of {_dependency_package}, so that updates to "
134+
+ f"{_package_label} can require the higher version, or "
135+
+ "(b) you manually update your Python environment to use at "
136+
+ f"least version {_next_supported_version} of "
137+
+ f"{_dependency_package}.",
138+
FutureWarning,
139+
)
140+
except Exception:
141+
warnings.warn(
142+
"Could not determine the version of Python "
143+
+ "currently being used. To continue receiving "
144+
+ "updates for {_package_label}, ensure you are "
145+
+ "using a supported version of Python; see "
146+
+ "https://devguide.python.org/versions/"
147+
)
148+
149+
__all__ = (
150+
"MapManagementAsyncClient",
151+
"CreateMapConfigRequest",
152+
"CreateMapContextConfigRequest",
153+
"CreateStyleConfigRequest",
154+
"DeleteMapConfigRequest",
155+
"DeleteMapContextConfigRequest",
156+
"DeleteStyleConfigRequest",
157+
"GetMapConfigRequest",
158+
"GetMapContextConfigRequest",
159+
"GetStyleConfigRequest",
160+
"ListMapConfigsRequest",
161+
"ListMapConfigsResponse",
162+
"ListMapContextConfigsRequest",
163+
"ListMapContextConfigsResponse",
164+
"ListStyleConfigsRequest",
165+
"ListStyleConfigsResponse",
166+
"MapConfig",
167+
"MapContextConfig",
168+
"MapFeatures",
169+
"MapManagementClient",
170+
"MapRenderingType",
171+
"StyleConfig",
172+
"StyleConfigView",
173+
"UpdateMapConfigRequest",
174+
"UpdateMapContextConfigRequest",
175+
"UpdateStyleConfigRequest",
176+
)

0 commit comments

Comments
 (0)