google-maps-routeoptimization 0.3.0__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/MANIFEST.in +1 -1
  2. {google_maps_routeoptimization-0.3.0/google_maps_routeoptimization.egg-info → google_maps_routeoptimization-0.5.0}/PKG-INFO +20 -20
  3. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/README.rst +14 -11
  4. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization/__init__.py +1 -1
  5. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization/gapic_version.py +2 -2
  6. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/__init__.py +4 -20
  7. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/gapic_version.py +2 -2
  8. {google_maps_routeoptimization-0.3.0/tests/unit → google_maps_routeoptimization-0.5.0/google/maps/routeoptimization_v1/services}/__init__.py +1 -1
  9. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/__init__.py +1 -1
  10. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/async_client.py +29 -19
  11. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/client.py +30 -27
  12. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/__init__.py +1 -1
  13. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/base.py +16 -7
  14. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc.py +18 -14
  15. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc_asyncio.py +17 -13
  16. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/rest.py +21 -23
  17. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/rest_base.py +1 -1
  18. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/types/__init__.py +1 -1
  19. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/types/route_optimization_service.py +73 -62
  20. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0/google_maps_routeoptimization.egg-info}/PKG-INFO +20 -20
  21. google_maps_routeoptimization-0.5.0/google_maps_routeoptimization.egg-info/requires.txt +11 -0
  22. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/setup.py +6 -9
  23. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/tests/__init__.py +1 -1
  24. {google_maps_routeoptimization-0.3.0/tests/unit/gapic → google_maps_routeoptimization-0.5.0/tests/unit}/__init__.py +1 -1
  25. {google_maps_routeoptimization-0.3.0/google/maps/routeoptimization_v1/services → google_maps_routeoptimization-0.5.0/tests/unit/gapic}/__init__.py +1 -1
  26. google_maps_routeoptimization-0.5.0/tests/unit/gapic/routeoptimization_v1/__init__.py +15 -0
  27. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/tests/unit/gapic/routeoptimization_v1/test_route_optimization.py +252 -194
  28. google_maps_routeoptimization-0.3.0/google_maps_routeoptimization.egg-info/requires.txt +0 -11
  29. google_maps_routeoptimization-0.3.0/tests/unit/gapic/routeoptimization_v1/__init__.py +0 -15
  30. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/LICENSE +0 -0
  31. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization/py.typed +0 -0
  32. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/gapic_metadata.json +0 -0
  33. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/py.typed +0 -0
  34. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google_maps_routeoptimization.egg-info/SOURCES.txt +0 -0
  35. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google_maps_routeoptimization.egg-info/dependency_links.txt +0 -0
  36. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google_maps_routeoptimization.egg-info/not-zip-safe +0 -0
  37. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/google_maps_routeoptimization.egg-info/top_level.txt +0 -0
  38. {google_maps_routeoptimization-0.3.0 → google_maps_routeoptimization-0.5.0}/setup.cfg +0 -0
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,20 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-maps-routeoptimization
3
- Version: 0.3.0
3
+ Version: 0.5.0
4
4
  Summary: Google Maps Routeoptimization API client library
5
5
  Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-maps-routeoptimization
6
6
  Author: Google LLC
7
7
  Author-email: googleapis-packages@google.com
8
- License: Apache 2.0
8
+ License: Apache-2.0
9
9
  Platform: Posix; MacOS X; Windows
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.7
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
15
  Classifier: Programming Language :: Python :: 3.10
19
16
  Classifier: Programming Language :: Python :: 3.11
20
17
  Classifier: Programming Language :: Python :: 3.12
@@ -22,15 +19,15 @@ Classifier: Programming Language :: Python :: 3.13
22
19
  Classifier: Programming Language :: Python :: 3.14
23
20
  Classifier: Operating System :: OS Independent
24
21
  Classifier: Topic :: Internet
25
- Requires-Python: >=3.7
22
+ Requires-Python: >=3.10
26
23
  License-File: LICENSE
27
- Requires-Dist: google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.10.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,<3.0.0,>=1.34.1
24
+ Requires-Dist: google-api-core[grpc]<3.0.0,>=2.17.1
28
25
  Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
29
- Requires-Dist: grpcio<2.0.0,>=1.33.2
26
+ Requires-Dist: grpcio<2.0.0,>=1.59.0
30
27
  Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
31
28
  Requires-Dist: proto-plus<2.0.0,>=1.22.3
32
29
  Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
33
- Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<7.0.0,>=3.20.2
30
+ Requires-Dist: protobuf<8.0.0,>=4.25.8
34
31
  Dynamic: author
35
32
  Dynamic: author-email
36
33
  Dynamic: classifier
@@ -43,12 +40,14 @@ Dynamic: requires-dist
43
40
  Dynamic: requires-python
44
41
  Dynamic: summary
45
42
 
46
- Python Client for Route Optimization API
47
- ========================================
43
+ Python Client for Route Optimization
44
+ ====================================
48
45
 
49
46
  |preview| |pypi| |versions|
50
47
 
51
- `Route Optimization API`_: The Route Optimization API assigns tasks and routes to a vehicle fleet, optimizing against the objectives and constraints that you supply for your transportation goals.
48
+ `Route Optimization`_: The Route Optimization API assigns tasks and routes to a vehicle fleet,
49
+ optimizing against the objectives and constraints that you supply for your
50
+ transportation goals.
52
51
 
53
52
  - `Client Library Documentation`_
54
53
  - `Product Documentation`_
@@ -59,7 +58,7 @@ Python Client for Route Optimization API
59
58
  :target: https://pypi.org/project/google-maps-routeoptimization/
60
59
  .. |versions| image:: https://img.shields.io/pypi/pyversions/google-maps-routeoptimization.svg
61
60
  :target: https://pypi.org/project/google-maps-routeoptimization/
62
- .. _Route Optimization API: https://developers.google.com/maps/documentation/route-optimization
61
+ .. _Route Optimization: https://developers.google.com/maps/documentation/route-optimization
63
62
  .. _Client Library Documentation: https://googleapis.dev/python/google-maps-routeoptimization/latest
64
63
  .. _Product Documentation: https://developers.google.com/maps/documentation/route-optimization
65
64
 
@@ -70,12 +69,12 @@ In order to use this library, you first need to go through the following steps:
70
69
 
71
70
  1. `Select or create a Cloud Platform project.`_
72
71
  2. `Enable billing for your project.`_
73
- 3. `Enable the Route Optimization API.`_
72
+ 3. `Enable the Route Optimization.`_
74
73
  4. `Set up Authentication.`_
75
74
 
76
75
  .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
77
76
  .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
78
- .. _Enable the Route Optimization API.: https://developers.google.com/maps/documentation/route-optimization
77
+ .. _Enable the Route Optimization.: https://developers.google.com/maps/documentation/route-optimization
79
78
  .. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
80
79
 
81
80
  Installation
@@ -106,14 +105,15 @@ Supported Python Versions
106
105
  Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
107
106
  Python.
108
107
 
109
- Python >= 3.7, including 3.14
108
+ Python >= 3.10, including 3.14
110
109
 
111
110
  .. _active: https://devguide.python.org/devcycle/#in-development-main-branch
112
111
  .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
113
112
 
114
113
  Unsupported Python Versions
115
114
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
116
- Python <= 3.6
115
+ Python <= 3.9
116
+
117
117
 
118
118
  If you are using an `end-of-life`_
119
119
  version of Python, we recommend that you update as soon as possible to an actively supported version.
@@ -142,14 +142,14 @@ Windows
142
142
  Next Steps
143
143
  ~~~~~~~~~~
144
144
 
145
- - Read the `Client Library Documentation`_ for Route Optimization API
145
+ - Read the `Client Library Documentation`_ for Route Optimization
146
146
  to see other available methods on the client.
147
- - Read the `Route Optimization API Product documentation`_ to learn
147
+ - Read the `Route Optimization Product documentation`_ to learn
148
148
  more about the product and see How-to Guides.
149
149
  - View this `README`_ to see the full list of Cloud
150
150
  APIs that we cover.
151
151
 
152
- .. _Route Optimization API Product documentation: https://developers.google.com/maps/documentation/route-optimization
152
+ .. _Route Optimization Product documentation: https://developers.google.com/maps/documentation/route-optimization
153
153
  .. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
154
154
 
155
155
  Logging
@@ -1,9 +1,11 @@
1
- Python Client for Route Optimization API
2
- ========================================
1
+ Python Client for Route Optimization
2
+ ====================================
3
3
 
4
4
  |preview| |pypi| |versions|
5
5
 
6
- `Route Optimization API`_: The Route Optimization API assigns tasks and routes to a vehicle fleet, optimizing against the objectives and constraints that you supply for your transportation goals.
6
+ `Route Optimization`_: The Route Optimization API assigns tasks and routes to a vehicle fleet,
7
+ optimizing against the objectives and constraints that you supply for your
8
+ transportation goals.
7
9
 
8
10
  - `Client Library Documentation`_
9
11
  - `Product Documentation`_
@@ -14,7 +16,7 @@ Python Client for Route Optimization API
14
16
  :target: https://pypi.org/project/google-maps-routeoptimization/
15
17
  .. |versions| image:: https://img.shields.io/pypi/pyversions/google-maps-routeoptimization.svg
16
18
  :target: https://pypi.org/project/google-maps-routeoptimization/
17
- .. _Route Optimization API: https://developers.google.com/maps/documentation/route-optimization
19
+ .. _Route Optimization: https://developers.google.com/maps/documentation/route-optimization
18
20
  .. _Client Library Documentation: https://googleapis.dev/python/google-maps-routeoptimization/latest
19
21
  .. _Product Documentation: https://developers.google.com/maps/documentation/route-optimization
20
22
 
@@ -25,12 +27,12 @@ In order to use this library, you first need to go through the following steps:
25
27
 
26
28
  1. `Select or create a Cloud Platform project.`_
27
29
  2. `Enable billing for your project.`_
28
- 3. `Enable the Route Optimization API.`_
30
+ 3. `Enable the Route Optimization.`_
29
31
  4. `Set up Authentication.`_
30
32
 
31
33
  .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
32
34
  .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
33
- .. _Enable the Route Optimization API.: https://developers.google.com/maps/documentation/route-optimization
35
+ .. _Enable the Route Optimization.: https://developers.google.com/maps/documentation/route-optimization
34
36
  .. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
35
37
 
36
38
  Installation
@@ -61,14 +63,15 @@ Supported Python Versions
61
63
  Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
62
64
  Python.
63
65
 
64
- Python >= 3.7, including 3.14
66
+ Python >= 3.10, including 3.14
65
67
 
66
68
  .. _active: https://devguide.python.org/devcycle/#in-development-main-branch
67
69
  .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
68
70
 
69
71
  Unsupported Python Versions
70
72
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
71
- Python <= 3.6
73
+ Python <= 3.9
74
+
72
75
 
73
76
  If you are using an `end-of-life`_
74
77
  version of Python, we recommend that you update as soon as possible to an actively supported version.
@@ -97,14 +100,14 @@ Windows
97
100
  Next Steps
98
101
  ~~~~~~~~~~
99
102
 
100
- - Read the `Client Library Documentation`_ for Route Optimization API
103
+ - Read the `Client Library Documentation`_ for Route Optimization
101
104
  to see other available methods on the client.
102
- - Read the `Route Optimization API Product documentation`_ to learn
105
+ - Read the `Route Optimization Product documentation`_ to learn
103
106
  more about the product and see How-to Guides.
104
107
  - View this `README`_ to see the full list of Cloud
105
108
  APIs that we cover.
106
109
 
107
- .. _Route Optimization API Product documentation: https://developers.google.com/maps/documentation/route-optimization
110
+ .. _Route Optimization Product documentation: https://developers.google.com/maps/documentation/route-optimization
108
111
  .. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
109
112
 
110
113
  Logging
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.3.0" # {x-release-please-version}
16
+ __version__ = "0.5.0" # {x-release-please-version}
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -21,12 +21,7 @@ from google.maps.routeoptimization_v1 import gapic_version as package_version
21
21
 
22
22
  __version__ = package_version.__version__
23
23
 
24
- if sys.version_info >= (3, 8): # pragma: NO COVER
25
- from importlib import metadata
26
- else: # pragma: NO COVER
27
- # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
28
- # this code path once we drop support for Python 3.7
29
- import importlib_metadata as metadata
24
+ from importlib import metadata
30
25
 
31
26
  from .services.route_optimization import (
32
27
  RouteOptimizationAsyncClient,
@@ -77,28 +72,17 @@ else: # pragma: NO COVER
77
72
  # An older version of api_core is installed which does not define the
78
73
  # functions above. We do equivalent checks manually.
79
74
  try:
80
- import sys
81
75
  import warnings
82
76
 
83
77
  _py_version_str = sys.version.split()[0]
84
78
  _package_label = "google.maps.routeoptimization_v1"
85
- if sys.version_info < (3, 9):
79
+ if sys.version_info < (3, 10):
86
80
  warnings.warn(
87
81
  "You are using a non-supported Python version "
88
82
  + f"({_py_version_str}). Google will not post any further "
89
83
  + f"updates to {_package_label} supporting this Python version. "
90
84
  + "Please upgrade to the latest Python version, or at "
91
- + f"least to Python 3.9, and then update {_package_label}.",
92
- FutureWarning,
93
- )
94
- if sys.version_info[:2] == (3, 9):
95
- warnings.warn(
96
- f"You are using a Python version ({_py_version_str}) "
97
- + f"which Google will stop supporting in {_package_label} in "
98
- + "January 2026. Please "
99
- + "upgrade to the latest Python version, or at "
100
- + "least to Python 3.10, before then, and "
101
- + f"then update {_package_label}.",
85
+ + f"least to Python 3.10, and then update {_package_label}.",
102
86
  FutureWarning,
103
87
  )
104
88
 
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.3.0" # {x-release-please-version}
16
+ __version__ = "0.5.0" # {x-release-please-version}
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -13,9 +13,9 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- from collections import OrderedDict
17
16
  import logging as std_logging
18
17
  import re
18
+ from collections import OrderedDict
19
19
  from typing import (
20
20
  Callable,
21
21
  Dict,
@@ -29,13 +29,13 @@ from typing import (
29
29
  Union,
30
30
  )
31
31
 
32
+ import google.protobuf
32
33
  from google.api_core import exceptions as core_exceptions
33
34
  from google.api_core import gapic_v1
34
35
  from google.api_core import retry_async as retries
35
36
  from google.api_core.client_options import ClientOptions
36
37
  from google.auth import credentials as ga_credentials # type: ignore
37
38
  from google.oauth2 import service_account # type: ignore
38
- import google.protobuf
39
39
 
40
40
  from google.maps.routeoptimization_v1 import gapic_version as package_version
41
41
 
@@ -44,8 +44,8 @@ try:
44
44
  except AttributeError: # pragma: NO COVER
45
45
  OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
46
46
 
47
- from google.api_core import operation # type: ignore
48
- from google.api_core import operation_async # type: ignore
47
+ import google.api_core.operation as operation # type: ignore
48
+ import google.api_core.operation_async as operation_async # type: ignore
49
49
  from google.longrunning import operations_pb2 # type: ignore
50
50
 
51
51
  from google.maps.routeoptimization_v1.types import route_optimization_service
@@ -136,7 +136,10 @@ class RouteOptimizationAsyncClient:
136
136
  Returns:
137
137
  RouteOptimizationAsyncClient: The constructed client.
138
138
  """
139
- return RouteOptimizationClient.from_service_account_info.__func__(RouteOptimizationAsyncClient, info, *args, **kwargs) # type: ignore
139
+ sa_info_func = (
140
+ RouteOptimizationClient.from_service_account_info.__func__ # type: ignore
141
+ )
142
+ return sa_info_func(RouteOptimizationAsyncClient, info, *args, **kwargs)
140
143
 
141
144
  @classmethod
142
145
  def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -152,7 +155,10 @@ class RouteOptimizationAsyncClient:
152
155
  Returns:
153
156
  RouteOptimizationAsyncClient: The constructed client.
154
157
  """
155
- return RouteOptimizationClient.from_service_account_file.__func__(RouteOptimizationAsyncClient, filename, *args, **kwargs) # type: ignore
158
+ sa_file_func = (
159
+ RouteOptimizationClient.from_service_account_file.__func__ # type: ignore
160
+ )
161
+ return sa_file_func(RouteOptimizationAsyncClient, filename, *args, **kwargs)
156
162
 
157
163
  from_service_account_json = from_service_account_file
158
164
 
@@ -202,7 +208,7 @@ class RouteOptimizationAsyncClient:
202
208
  return self._client.transport
203
209
 
204
210
  @property
205
- def api_endpoint(self):
211
+ def api_endpoint(self) -> str:
206
212
  """Return the API endpoint used by the client instance.
207
213
 
208
214
  Returns:
@@ -486,11 +492,11 @@ class RouteOptimizationAsyncClient:
486
492
  )
487
493
 
488
494
  # Make the request
489
- operation = client.batch_optimize_tours(request=request)
495
+ operation = await client.batch_optimize_tours(request=request)
490
496
 
491
497
  print("Waiting for operation to complete...")
492
498
 
493
- response = (await operation).result()
499
+ response = await operation.result()
494
500
 
495
501
  # Handle the response
496
502
  print(response)
@@ -615,11 +621,11 @@ class RouteOptimizationAsyncClient:
615
621
  )
616
622
 
617
623
  # Make the request
618
- operation = client.optimize_tours_long_running(request=request)
624
+ operation = await client.optimize_tours_long_running(request=request)
619
625
 
620
626
  print("Waiting for operation to complete...")
621
627
 
622
- response = (await operation).result()
628
+ response = await operation.result()
623
629
 
624
630
  # Handle the response
625
631
  print(response)
@@ -748,11 +754,11 @@ class RouteOptimizationAsyncClient:
748
754
  )
749
755
 
750
756
  # Make the request
751
- operation = client.optimize_tours_uri(request=request)
757
+ operation = await client.optimize_tours_uri(request=request)
752
758
 
753
759
  print("Waiting for operation to complete...")
754
760
 
755
- response = (await operation).result()
761
+ response = await operation.result()
756
762
 
757
763
  # Handle the response
758
764
  print(response)
@@ -819,7 +825,7 @@ class RouteOptimizationAsyncClient:
819
825
 
820
826
  async def get_operation(
821
827
  self,
822
- request: Optional[operations_pb2.GetOperationRequest] = None,
828
+ request: Optional[Union[operations_pb2.GetOperationRequest, dict]] = None,
823
829
  *,
824
830
  retry: OptionalRetry = gapic_v1.method.DEFAULT,
825
831
  timeout: Union[float, object] = gapic_v1.method.DEFAULT,
@@ -845,8 +851,12 @@ class RouteOptimizationAsyncClient:
845
851
  # Create or coerce a protobuf request object.
846
852
  # The request isn't a proto-plus wrapped type,
847
853
  # so it must be constructed via keyword expansion.
848
- if isinstance(request, dict):
849
- request = operations_pb2.GetOperationRequest(**request)
854
+ if request is None:
855
+ request_pb = operations_pb2.GetOperationRequest()
856
+ elif isinstance(request, dict):
857
+ request_pb = operations_pb2.GetOperationRequest(**request)
858
+ else:
859
+ request_pb = request
850
860
 
851
861
  # Wrap the RPC method; this adds retry and timeout information,
852
862
  # and friendly error handling.
@@ -855,7 +865,7 @@ class RouteOptimizationAsyncClient:
855
865
  # Certain fields should be provided within the metadata header;
856
866
  # add these here.
857
867
  metadata = tuple(metadata) + (
858
- gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
868
+ gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
859
869
  )
860
870
 
861
871
  # Validate the universe domain.
@@ -863,7 +873,7 @@ class RouteOptimizationAsyncClient:
863
873
 
864
874
  # Send the request.
865
875
  response = await rpc(
866
- request,
876
+ request_pb,
867
877
  retry=retry,
868
878
  timeout=timeout,
869
879
  metadata=metadata,
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -13,12 +13,13 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- from collections import OrderedDict
17
- from http import HTTPStatus
18
16
  import json
19
17
  import logging as std_logging
20
18
  import os
21
19
  import re
20
+ import warnings
21
+ from collections import OrderedDict
22
+ from http import HTTPStatus
22
23
  from typing import (
23
24
  Callable,
24
25
  Dict,
@@ -32,8 +33,8 @@ from typing import (
32
33
  Union,
33
34
  cast,
34
35
  )
35
- import warnings
36
36
 
37
+ import google.protobuf
37
38
  from google.api_core import client_options as client_options_lib
38
39
  from google.api_core import exceptions as core_exceptions
39
40
  from google.api_core import gapic_v1
@@ -43,7 +44,6 @@ from google.auth.exceptions import MutualTLSChannelError # type: ignore
43
44
  from google.auth.transport import mtls # type: ignore
44
45
  from google.auth.transport.grpc import SslCredentials # type: ignore
45
46
  from google.oauth2 import service_account # type: ignore
46
- import google.protobuf
47
47
 
48
48
  from google.maps.routeoptimization_v1 import gapic_version as package_version
49
49
 
@@ -61,8 +61,8 @@ except ImportError: # pragma: NO COVER
61
61
 
62
62
  _LOGGER = std_logging.getLogger(__name__)
63
63
 
64
- from google.api_core import operation # type: ignore
65
- from google.api_core import operation_async # type: ignore
64
+ import google.api_core.operation as operation # type: ignore
65
+ import google.api_core.operation_async as operation_async # type: ignore
66
66
  from google.longrunning import operations_pb2 # type: ignore
67
67
 
68
68
  from google.maps.routeoptimization_v1.types import route_optimization_service
@@ -81,9 +81,7 @@ class RouteOptimizationClientMeta(type):
81
81
  objects.
82
82
  """
83
83
 
84
- _transport_registry = (
85
- OrderedDict()
86
- ) # type: Dict[str, Type[RouteOptimizationTransport]]
84
+ _transport_registry = OrderedDict() # type: Dict[str, Type[RouteOptimizationTransport]]
87
85
  _transport_registry["grpc"] = RouteOptimizationGrpcTransport
88
86
  _transport_registry["grpc_asyncio"] = RouteOptimizationGrpcAsyncIOTransport
89
87
  _transport_registry["rest"] = RouteOptimizationRestTransport
@@ -136,7 +134,7 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
136
134
  """
137
135
 
138
136
  @staticmethod
139
- def _get_default_mtls_endpoint(api_endpoint):
137
+ def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]:
140
138
  """Converts api endpoint to mTLS endpoint.
141
139
 
142
140
  Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
@@ -144,7 +142,7 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
144
142
  Args:
145
143
  api_endpoint (Optional[str]): the api endpoint to convert.
146
144
  Returns:
147
- str: converted mTLS api endpoint.
145
+ Optional[str]: converted mTLS api endpoint.
148
146
  """
149
147
  if not api_endpoint:
150
148
  return api_endpoint
@@ -154,6 +152,10 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
154
152
  )
155
153
 
156
154
  m = mtls_endpoint_re.match(api_endpoint)
155
+ if m is None:
156
+ # Could not parse api_endpoint; return as-is.
157
+ return api_endpoint
158
+
157
159
  name, mtls, sandbox, googledomain = m.groups()
158
160
  if mtls or not googledomain:
159
161
  return api_endpoint
@@ -439,7 +441,7 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
439
441
  @staticmethod
440
442
  def _get_api_endpoint(
441
443
  api_override, client_cert_source, universe_domain, use_mtls_endpoint
442
- ):
444
+ ) -> str:
443
445
  """Return the API endpoint used by the client.
444
446
 
445
447
  Args:
@@ -536,7 +538,7 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
536
538
  error._details.append(json.dumps(cred_info))
537
539
 
538
540
  @property
539
- def api_endpoint(self):
541
+ def api_endpoint(self) -> str:
540
542
  """Return the API endpoint used by the client instance.
541
543
 
542
544
  Returns:
@@ -627,18 +629,16 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
627
629
 
628
630
  universe_domain_opt = getattr(self._client_options, "universe_domain", None)
629
631
 
630
- (
631
- self._use_client_cert,
632
- self._use_mtls_endpoint,
633
- self._universe_domain_env,
634
- ) = RouteOptimizationClient._read_environment_variables()
632
+ self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env = (
633
+ RouteOptimizationClient._read_environment_variables()
634
+ )
635
635
  self._client_cert_source = RouteOptimizationClient._get_client_cert_source(
636
636
  self._client_options.client_cert_source, self._use_client_cert
637
637
  )
638
638
  self._universe_domain = RouteOptimizationClient._get_universe_domain(
639
639
  universe_domain_opt, self._universe_domain_env
640
640
  )
641
- self._api_endpoint = None # updated below, depending on `transport`
641
+ self._api_endpoint: str = "" # updated below, depending on `transport`
642
642
 
643
643
  # Initialize the universe domain validation.
644
644
  self._is_universe_domain_valid = False
@@ -666,8 +666,7 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
666
666
  )
667
667
  if self._client_options.scopes:
668
668
  raise ValueError(
669
- "When providing a transport instance, provide its scopes "
670
- "directly."
669
+ "When providing a transport instance, provide its scopes directly."
671
670
  )
672
671
  self._transport = cast(RouteOptimizationTransport, transport)
673
672
  self._api_endpoint = self._transport.host
@@ -1248,7 +1247,7 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
1248
1247
 
1249
1248
  def get_operation(
1250
1249
  self,
1251
- request: Optional[operations_pb2.GetOperationRequest] = None,
1250
+ request: Optional[Union[operations_pb2.GetOperationRequest, dict]] = None,
1252
1251
  *,
1253
1252
  retry: OptionalRetry = gapic_v1.method.DEFAULT,
1254
1253
  timeout: Union[float, object] = gapic_v1.method.DEFAULT,
@@ -1274,8 +1273,12 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
1274
1273
  # Create or coerce a protobuf request object.
1275
1274
  # The request isn't a proto-plus wrapped type,
1276
1275
  # so it must be constructed via keyword expansion.
1277
- if isinstance(request, dict):
1278
- request = operations_pb2.GetOperationRequest(**request)
1276
+ if request is None:
1277
+ request_pb = operations_pb2.GetOperationRequest()
1278
+ elif isinstance(request, dict):
1279
+ request_pb = operations_pb2.GetOperationRequest(**request)
1280
+ else:
1281
+ request_pb = request
1279
1282
 
1280
1283
  # Wrap the RPC method; this adds retry and timeout information,
1281
1284
  # and friendly error handling.
@@ -1284,7 +1287,7 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
1284
1287
  # Certain fields should be provided within the metadata header;
1285
1288
  # add these here.
1286
1289
  metadata = tuple(metadata) + (
1287
- gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1290
+ gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
1288
1291
  )
1289
1292
 
1290
1293
  # Validate the universe domain.
@@ -1293,7 +1296,7 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
1293
1296
  try:
1294
1297
  # Send the request.
1295
1298
  response = rpc(
1296
- request,
1299
+ request_pb,
1297
1300
  retry=retry,
1298
1301
  timeout=timeout,
1299
1302
  metadata=metadata,
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright 2025 Google LLC
2
+ # Copyright 2026 Google LLC
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.