google-maps-routeoptimization 0.4.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.
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/MANIFEST.in +1 -1
- {google_maps_routeoptimization-0.4.0/google_maps_routeoptimization.egg-info → google_maps_routeoptimization-0.5.0}/PKG-INFO +19 -17
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/README.rst +14 -11
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization/__init__.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization/gapic_version.py +2 -2
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/__init__.py +4 -21
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/gapic_version.py +2 -2
- {google_maps_routeoptimization-0.4.0/tests/unit → google_maps_routeoptimization-0.5.0/google/maps/routeoptimization_v1/services}/__init__.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/__init__.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/async_client.py +7 -7
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/client.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/__init__.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/base.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc_asyncio.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/rest.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/services/route_optimization/transports/rest_base.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/types/__init__.py +1 -1
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/types/route_optimization_service.py +4 -3
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0/google_maps_routeoptimization.egg-info}/PKG-INFO +19 -17
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google_maps_routeoptimization.egg-info/requires.txt +2 -2
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/setup.py +5 -6
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/tests/__init__.py +1 -1
- {google_maps_routeoptimization-0.4.0/tests/unit/gapic → google_maps_routeoptimization-0.5.0/tests/unit}/__init__.py +1 -1
- {google_maps_routeoptimization-0.4.0/google/maps/routeoptimization_v1/services → google_maps_routeoptimization-0.5.0/tests/unit/gapic}/__init__.py +1 -1
- google_maps_routeoptimization-0.5.0/tests/unit/gapic/routeoptimization_v1/__init__.py +15 -0
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/tests/unit/gapic/routeoptimization_v1/test_route_optimization.py +80 -78
- google_maps_routeoptimization-0.4.0/tests/unit/gapic/routeoptimization_v1/__init__.py +0 -15
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/LICENSE +0 -0
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization/py.typed +0 -0
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/gapic_metadata.json +0 -0
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google/maps/routeoptimization_v1/py.typed +0 -0
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google_maps_routeoptimization.egg-info/SOURCES.txt +0 -0
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google_maps_routeoptimization.egg-info/dependency_links.txt +0 -0
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google_maps_routeoptimization.egg-info/not-zip-safe +0 -0
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/google_maps_routeoptimization.egg-info/top_level.txt +0 -0
- {google_maps_routeoptimization-0.4.0 → google_maps_routeoptimization-0.5.0}/setup.cfg +0 -0
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-maps-routeoptimization
|
|
3
|
-
Version: 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
|
|
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.9
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -20,11 +19,11 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
21
20
|
Classifier: Operating System :: OS Independent
|
|
22
21
|
Classifier: Topic :: Internet
|
|
23
|
-
Requires-Python: >=3.
|
|
22
|
+
Requires-Python: >=3.10
|
|
24
23
|
License-File: LICENSE
|
|
25
|
-
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.
|
|
24
|
+
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.17.1
|
|
26
25
|
Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
|
|
27
|
-
Requires-Dist: grpcio<2.0.0,>=1.
|
|
26
|
+
Requires-Dist: grpcio<2.0.0,>=1.59.0
|
|
28
27
|
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
|
|
29
28
|
Requires-Dist: proto-plus<2.0.0,>=1.22.3
|
|
30
29
|
Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
|
|
@@ -41,12 +40,14 @@ Dynamic: requires-dist
|
|
|
41
40
|
Dynamic: requires-python
|
|
42
41
|
Dynamic: summary
|
|
43
42
|
|
|
44
|
-
Python Client for Route Optimization
|
|
45
|
-
|
|
43
|
+
Python Client for Route Optimization
|
|
44
|
+
====================================
|
|
46
45
|
|
|
47
46
|
|preview| |pypi| |versions|
|
|
48
47
|
|
|
49
|
-
`Route Optimization
|
|
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.
|
|
50
51
|
|
|
51
52
|
- `Client Library Documentation`_
|
|
52
53
|
- `Product Documentation`_
|
|
@@ -57,7 +58,7 @@ Python Client for Route Optimization API
|
|
|
57
58
|
:target: https://pypi.org/project/google-maps-routeoptimization/
|
|
58
59
|
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-maps-routeoptimization.svg
|
|
59
60
|
:target: https://pypi.org/project/google-maps-routeoptimization/
|
|
60
|
-
.. _Route Optimization
|
|
61
|
+
.. _Route Optimization: https://developers.google.com/maps/documentation/route-optimization
|
|
61
62
|
.. _Client Library Documentation: https://googleapis.dev/python/google-maps-routeoptimization/latest
|
|
62
63
|
.. _Product Documentation: https://developers.google.com/maps/documentation/route-optimization
|
|
63
64
|
|
|
@@ -68,12 +69,12 @@ In order to use this library, you first need to go through the following steps:
|
|
|
68
69
|
|
|
69
70
|
1. `Select or create a Cloud Platform project.`_
|
|
70
71
|
2. `Enable billing for your project.`_
|
|
71
|
-
3. `Enable the Route Optimization
|
|
72
|
+
3. `Enable the Route Optimization.`_
|
|
72
73
|
4. `Set up Authentication.`_
|
|
73
74
|
|
|
74
75
|
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
|
|
75
76
|
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
|
|
76
|
-
.. _Enable the Route Optimization
|
|
77
|
+
.. _Enable the Route Optimization.: https://developers.google.com/maps/documentation/route-optimization
|
|
77
78
|
.. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
|
|
78
79
|
|
|
79
80
|
Installation
|
|
@@ -104,14 +105,15 @@ Supported Python Versions
|
|
|
104
105
|
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
|
|
105
106
|
Python.
|
|
106
107
|
|
|
107
|
-
Python >= 3.
|
|
108
|
+
Python >= 3.10, including 3.14
|
|
108
109
|
|
|
109
110
|
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
|
|
110
111
|
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
|
|
111
112
|
|
|
112
113
|
Unsupported Python Versions
|
|
113
114
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
114
|
-
Python <= 3.
|
|
115
|
+
Python <= 3.9
|
|
116
|
+
|
|
115
117
|
|
|
116
118
|
If you are using an `end-of-life`_
|
|
117
119
|
version of Python, we recommend that you update as soon as possible to an actively supported version.
|
|
@@ -140,14 +142,14 @@ Windows
|
|
|
140
142
|
Next Steps
|
|
141
143
|
~~~~~~~~~~
|
|
142
144
|
|
|
143
|
-
- Read the `Client Library Documentation`_ for Route Optimization
|
|
145
|
+
- Read the `Client Library Documentation`_ for Route Optimization
|
|
144
146
|
to see other available methods on the client.
|
|
145
|
-
- Read the `Route Optimization
|
|
147
|
+
- Read the `Route Optimization Product documentation`_ to learn
|
|
146
148
|
more about the product and see How-to Guides.
|
|
147
149
|
- View this `README`_ to see the full list of Cloud
|
|
148
150
|
APIs that we cover.
|
|
149
151
|
|
|
150
|
-
.. _Route Optimization
|
|
152
|
+
.. _Route Optimization Product documentation: https://developers.google.com/maps/documentation/route-optimization
|
|
151
153
|
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
|
|
152
154
|
|
|
153
155
|
Logging
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
Python Client for Route Optimization
|
|
2
|
-
|
|
1
|
+
Python Client for Route Optimization
|
|
2
|
+
====================================
|
|
3
3
|
|
|
4
4
|
|preview| |pypi| |versions|
|
|
5
5
|
|
|
6
|
-
`Route Optimization
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
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
|
|
103
|
+
- Read the `Client Library Documentation`_ for Route Optimization
|
|
101
104
|
to see other available methods on the client.
|
|
102
|
-
- Read the `Route Optimization
|
|
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
|
|
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
|
|
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.
|
|
16
|
+
__version__ = "0.5.0" # {x-release-please-version}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
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,13 +21,7 @@ from google.maps.routeoptimization_v1 import gapic_version as package_version
|
|
|
21
21
|
|
|
22
22
|
__version__ = package_version.__version__
|
|
23
23
|
|
|
24
|
-
|
|
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
|
|
30
|
-
|
|
24
|
+
from importlib import metadata
|
|
31
25
|
|
|
32
26
|
from .services.route_optimization import (
|
|
33
27
|
RouteOptimizationAsyncClient,
|
|
@@ -78,28 +72,17 @@ else: # pragma: NO COVER
|
|
|
78
72
|
# An older version of api_core is installed which does not define the
|
|
79
73
|
# functions above. We do equivalent checks manually.
|
|
80
74
|
try:
|
|
81
|
-
import sys
|
|
82
75
|
import warnings
|
|
83
76
|
|
|
84
77
|
_py_version_str = sys.version.split()[0]
|
|
85
78
|
_package_label = "google.maps.routeoptimization_v1"
|
|
86
|
-
if sys.version_info < (3,
|
|
79
|
+
if sys.version_info < (3, 10):
|
|
87
80
|
warnings.warn(
|
|
88
81
|
"You are using a non-supported Python version "
|
|
89
82
|
+ f"({_py_version_str}). Google will not post any further "
|
|
90
83
|
+ f"updates to {_package_label} supporting this Python version. "
|
|
91
84
|
+ "Please upgrade to the latest Python version, or at "
|
|
92
|
-
+ f"least to Python 3.
|
|
93
|
-
FutureWarning,
|
|
94
|
-
)
|
|
95
|
-
if sys.version_info[:2] == (3, 9):
|
|
96
|
-
warnings.warn(
|
|
97
|
-
f"You are using a Python version ({_py_version_str}) "
|
|
98
|
-
+ f"which Google will stop supporting in {_package_label} in "
|
|
99
|
-
+ "January 2026. Please "
|
|
100
|
-
+ "upgrade to the latest Python version, or at "
|
|
101
|
-
+ "least to Python 3.10, before then, and "
|
|
102
|
-
+ f"then update {_package_label}.",
|
|
85
|
+
+ f"least to Python 3.10, and then update {_package_label}.",
|
|
103
86
|
FutureWarning,
|
|
104
87
|
)
|
|
105
88
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
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.
|
|
16
|
+
__version__ = "0.5.0" # {x-release-please-version}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
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.
|
|
@@ -492,11 +492,11 @@ class RouteOptimizationAsyncClient:
|
|
|
492
492
|
)
|
|
493
493
|
|
|
494
494
|
# Make the request
|
|
495
|
-
operation = client.batch_optimize_tours(request=request)
|
|
495
|
+
operation = await client.batch_optimize_tours(request=request)
|
|
496
496
|
|
|
497
497
|
print("Waiting for operation to complete...")
|
|
498
498
|
|
|
499
|
-
response =
|
|
499
|
+
response = await operation.result()
|
|
500
500
|
|
|
501
501
|
# Handle the response
|
|
502
502
|
print(response)
|
|
@@ -621,11 +621,11 @@ class RouteOptimizationAsyncClient:
|
|
|
621
621
|
)
|
|
622
622
|
|
|
623
623
|
# Make the request
|
|
624
|
-
operation = client.optimize_tours_long_running(request=request)
|
|
624
|
+
operation = await client.optimize_tours_long_running(request=request)
|
|
625
625
|
|
|
626
626
|
print("Waiting for operation to complete...")
|
|
627
627
|
|
|
628
|
-
response =
|
|
628
|
+
response = await operation.result()
|
|
629
629
|
|
|
630
630
|
# Handle the response
|
|
631
631
|
print(response)
|
|
@@ -754,11 +754,11 @@ class RouteOptimizationAsyncClient:
|
|
|
754
754
|
)
|
|
755
755
|
|
|
756
756
|
# Make the request
|
|
757
|
-
operation = client.optimize_tours_uri(request=request)
|
|
757
|
+
operation = await client.optimize_tours_uri(request=request)
|
|
758
758
|
|
|
759
759
|
print("Waiting for operation to complete...")
|
|
760
760
|
|
|
761
|
-
response =
|
|
761
|
+
response = await operation.result()
|
|
762
762
|
|
|
763
763
|
# Handle the response
|
|
764
764
|
print(response)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
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.
|
|
@@ -4020,8 +4020,9 @@ class VehicleFullness(proto.Message):
|
|
|
4020
4020
|
|
|
4021
4021
|
This field is a member of `oneof`_ ``_max_load``.
|
|
4022
4022
|
active_span (float):
|
|
4023
|
-
The ratio (vehicle_end_time - vehicle_start_time) / (latest_vehicle_end_time - earliest_vehicle_start_time) for a given vehicle. If the denominator is not present, it uses
|
|
4024
|
-
|
|
4023
|
+
The ratio (vehicle_end_time - vehicle_start_time) / (latest_vehicle_end_time - earliest_vehicle_start_time) for a given vehicle. If the denominator is not present, it uses ([ShipmentModel.global_end_time][google.maps.routeoptimization.v1.ShipmentModel.global_end_time]
|
|
4024
|
+
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
4025
|
+
|
|
4025
4026
|
[ShipmentModel.global_start_time][google.maps.routeoptimization.v1.ShipmentModel.global_start_time])
|
|
4026
4027
|
instead.
|
|
4027
4028
|
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-maps-routeoptimization
|
|
3
|
-
Version: 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
|
|
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.9
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -20,11 +19,11 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
21
20
|
Classifier: Operating System :: OS Independent
|
|
22
21
|
Classifier: Topic :: Internet
|
|
23
|
-
Requires-Python: >=3.
|
|
22
|
+
Requires-Python: >=3.10
|
|
24
23
|
License-File: LICENSE
|
|
25
|
-
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.
|
|
24
|
+
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.17.1
|
|
26
25
|
Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
|
|
27
|
-
Requires-Dist: grpcio<2.0.0,>=1.
|
|
26
|
+
Requires-Dist: grpcio<2.0.0,>=1.59.0
|
|
28
27
|
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
|
|
29
28
|
Requires-Dist: proto-plus<2.0.0,>=1.22.3
|
|
30
29
|
Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
|
|
@@ -41,12 +40,14 @@ Dynamic: requires-dist
|
|
|
41
40
|
Dynamic: requires-python
|
|
42
41
|
Dynamic: summary
|
|
43
42
|
|
|
44
|
-
Python Client for Route Optimization
|
|
45
|
-
|
|
43
|
+
Python Client for Route Optimization
|
|
44
|
+
====================================
|
|
46
45
|
|
|
47
46
|
|preview| |pypi| |versions|
|
|
48
47
|
|
|
49
|
-
`Route Optimization
|
|
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.
|
|
50
51
|
|
|
51
52
|
- `Client Library Documentation`_
|
|
52
53
|
- `Product Documentation`_
|
|
@@ -57,7 +58,7 @@ Python Client for Route Optimization API
|
|
|
57
58
|
:target: https://pypi.org/project/google-maps-routeoptimization/
|
|
58
59
|
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-maps-routeoptimization.svg
|
|
59
60
|
:target: https://pypi.org/project/google-maps-routeoptimization/
|
|
60
|
-
.. _Route Optimization
|
|
61
|
+
.. _Route Optimization: https://developers.google.com/maps/documentation/route-optimization
|
|
61
62
|
.. _Client Library Documentation: https://googleapis.dev/python/google-maps-routeoptimization/latest
|
|
62
63
|
.. _Product Documentation: https://developers.google.com/maps/documentation/route-optimization
|
|
63
64
|
|
|
@@ -68,12 +69,12 @@ In order to use this library, you first need to go through the following steps:
|
|
|
68
69
|
|
|
69
70
|
1. `Select or create a Cloud Platform project.`_
|
|
70
71
|
2. `Enable billing for your project.`_
|
|
71
|
-
3. `Enable the Route Optimization
|
|
72
|
+
3. `Enable the Route Optimization.`_
|
|
72
73
|
4. `Set up Authentication.`_
|
|
73
74
|
|
|
74
75
|
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
|
|
75
76
|
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
|
|
76
|
-
.. _Enable the Route Optimization
|
|
77
|
+
.. _Enable the Route Optimization.: https://developers.google.com/maps/documentation/route-optimization
|
|
77
78
|
.. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
|
|
78
79
|
|
|
79
80
|
Installation
|
|
@@ -104,14 +105,15 @@ Supported Python Versions
|
|
|
104
105
|
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
|
|
105
106
|
Python.
|
|
106
107
|
|
|
107
|
-
Python >= 3.
|
|
108
|
+
Python >= 3.10, including 3.14
|
|
108
109
|
|
|
109
110
|
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
|
|
110
111
|
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
|
|
111
112
|
|
|
112
113
|
Unsupported Python Versions
|
|
113
114
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
114
|
-
Python <= 3.
|
|
115
|
+
Python <= 3.9
|
|
116
|
+
|
|
115
117
|
|
|
116
118
|
If you are using an `end-of-life`_
|
|
117
119
|
version of Python, we recommend that you update as soon as possible to an actively supported version.
|
|
@@ -140,14 +142,14 @@ Windows
|
|
|
140
142
|
Next Steps
|
|
141
143
|
~~~~~~~~~~
|
|
142
144
|
|
|
143
|
-
- Read the `Client Library Documentation`_ for Route Optimization
|
|
145
|
+
- Read the `Client Library Documentation`_ for Route Optimization
|
|
144
146
|
to see other available methods on the client.
|
|
145
|
-
- Read the `Route Optimization
|
|
147
|
+
- Read the `Route Optimization Product documentation`_ to learn
|
|
146
148
|
more about the product and see How-to Guides.
|
|
147
149
|
- View this `README`_ to see the full list of Cloud
|
|
148
150
|
APIs that we cover.
|
|
149
151
|
|
|
150
|
-
.. _Route Optimization
|
|
152
|
+
.. _Route Optimization Product documentation: https://developers.google.com/maps/documentation/route-optimization
|
|
151
153
|
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
|
|
152
154
|
|
|
153
155
|
Logging
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
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.
|
|
@@ -41,11 +41,11 @@ else:
|
|
|
41
41
|
release_status = "Development Status :: 5 - Production/Stable"
|
|
42
42
|
|
|
43
43
|
dependencies = [
|
|
44
|
-
"google-api-core[grpc] >= 2.
|
|
44
|
+
"google-api-core[grpc] >= 2.17.1, <3.0.0",
|
|
45
45
|
# Exclude incompatible versions of `google-auth`
|
|
46
46
|
# See https://github.com/googleapis/google-cloud-python/issues/12364
|
|
47
47
|
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
|
|
48
|
-
"grpcio >= 1.
|
|
48
|
+
"grpcio >= 1.59.0, < 2.0.0",
|
|
49
49
|
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
|
|
50
50
|
"proto-plus >= 1.22.3, <2.0.0",
|
|
51
51
|
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
|
|
@@ -73,7 +73,7 @@ setuptools.setup(
|
|
|
73
73
|
long_description=readme,
|
|
74
74
|
author="Google LLC",
|
|
75
75
|
author_email="googleapis-packages@google.com",
|
|
76
|
-
license="Apache
|
|
76
|
+
license="Apache-2.0",
|
|
77
77
|
url=url,
|
|
78
78
|
classifiers=[
|
|
79
79
|
release_status,
|
|
@@ -81,7 +81,6 @@ setuptools.setup(
|
|
|
81
81
|
"License :: OSI Approved :: Apache Software License",
|
|
82
82
|
"Programming Language :: Python",
|
|
83
83
|
"Programming Language :: Python :: 3",
|
|
84
|
-
"Programming Language :: Python :: 3.9",
|
|
85
84
|
"Programming Language :: Python :: 3.10",
|
|
86
85
|
"Programming Language :: Python :: 3.11",
|
|
87
86
|
"Programming Language :: Python :: 3.12",
|
|
@@ -92,7 +91,7 @@ setuptools.setup(
|
|
|
92
91
|
],
|
|
93
92
|
platforms="Posix; MacOS X; Windows",
|
|
94
93
|
packages=packages,
|
|
95
|
-
python_requires=">=3.
|
|
94
|
+
python_requires=">=3.10",
|
|
96
95
|
install_requires=dependencies,
|
|
97
96
|
extras_require=extras,
|
|
98
97
|
include_package_data=True,
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
#
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright
|
|
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,18 +13,13 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
# try/except added for compatibility with python < 3.8
|
|
19
|
-
try:
|
|
20
|
-
from unittest import mock
|
|
21
|
-
from unittest.mock import AsyncMock # pragma: NO COVER
|
|
22
|
-
except ImportError: # pragma: NO COVER
|
|
23
|
-
import mock
|
|
24
|
-
|
|
16
|
+
import asyncio
|
|
25
17
|
import json
|
|
26
18
|
import math
|
|
19
|
+
import os
|
|
27
20
|
from collections.abc import AsyncIterable, Iterable, Mapping, Sequence
|
|
21
|
+
from unittest import mock
|
|
22
|
+
from unittest.mock import AsyncMock
|
|
28
23
|
|
|
29
24
|
import grpc
|
|
30
25
|
import pytest
|
|
@@ -120,6 +115,21 @@ def modify_default_endpoint_template(client):
|
|
|
120
115
|
)
|
|
121
116
|
|
|
122
117
|
|
|
118
|
+
@pytest.fixture(autouse=True)
|
|
119
|
+
def set_event_loop():
|
|
120
|
+
try:
|
|
121
|
+
asyncio.get_running_loop()
|
|
122
|
+
yield
|
|
123
|
+
except RuntimeError:
|
|
124
|
+
loop = asyncio.new_event_loop()
|
|
125
|
+
asyncio.set_event_loop(loop)
|
|
126
|
+
try:
|
|
127
|
+
yield
|
|
128
|
+
finally:
|
|
129
|
+
loop.close()
|
|
130
|
+
asyncio.set_event_loop(None)
|
|
131
|
+
|
|
132
|
+
|
|
123
133
|
def test__get_default_mtls_endpoint():
|
|
124
134
|
api_endpoint = "example.googleapis.com"
|
|
125
135
|
api_mtls_endpoint = "example.mtls.googleapis.com"
|
|
@@ -1361,8 +1371,8 @@ def test_route_optimization_client_create_channel_credentials_file(
|
|
|
1361
1371
|
@pytest.mark.parametrize(
|
|
1362
1372
|
"request_type",
|
|
1363
1373
|
[
|
|
1364
|
-
route_optimization_service.OptimizeToursRequest,
|
|
1365
|
-
|
|
1374
|
+
route_optimization_service.OptimizeToursRequest(),
|
|
1375
|
+
{},
|
|
1366
1376
|
],
|
|
1367
1377
|
)
|
|
1368
1378
|
def test_optimize_tours(request_type, transport: str = "grpc"):
|
|
@@ -1373,7 +1383,7 @@ def test_optimize_tours(request_type, transport: str = "grpc"):
|
|
|
1373
1383
|
|
|
1374
1384
|
# Everything is optional in proto3 as far as the runtime is concerned,
|
|
1375
1385
|
# and we are mocking out the actual API, so just send an empty request.
|
|
1376
|
-
request = request_type
|
|
1386
|
+
request = request_type
|
|
1377
1387
|
|
|
1378
1388
|
# Mock the actual call within the gRPC stub, and fake the request.
|
|
1379
1389
|
with mock.patch.object(type(client.transport.optimize_tours), "__call__") as call:
|
|
@@ -1418,10 +1428,11 @@ def test_optimize_tours_non_empty_request_with_auto_populated_field():
|
|
|
1418
1428
|
client.optimize_tours(request=request)
|
|
1419
1429
|
call.assert_called()
|
|
1420
1430
|
_, args, _ = call.mock_calls[0]
|
|
1421
|
-
|
|
1431
|
+
request_msg = route_optimization_service.OptimizeToursRequest(
|
|
1422
1432
|
parent="parent_value",
|
|
1423
1433
|
label="label_value",
|
|
1424
1434
|
)
|
|
1435
|
+
assert args[0] == request_msg
|
|
1425
1436
|
|
|
1426
1437
|
|
|
1427
1438
|
def test_optimize_tours_use_cached_wrapped_rpc():
|
|
@@ -1502,10 +1513,14 @@ async def test_optimize_tours_async_use_cached_wrapped_rpc(
|
|
|
1502
1513
|
|
|
1503
1514
|
|
|
1504
1515
|
@pytest.mark.asyncio
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
)
|
|
1516
|
+
@pytest.mark.parametrize(
|
|
1517
|
+
"request_type",
|
|
1518
|
+
[
|
|
1519
|
+
route_optimization_service.OptimizeToursRequest(),
|
|
1520
|
+
{},
|
|
1521
|
+
],
|
|
1522
|
+
)
|
|
1523
|
+
async def test_optimize_tours_async(request_type, transport: str = "grpc_asyncio"):
|
|
1509
1524
|
client = RouteOptimizationAsyncClient(
|
|
1510
1525
|
credentials=async_anonymous_credentials(),
|
|
1511
1526
|
transport=transport,
|
|
@@ -1513,7 +1528,7 @@ async def test_optimize_tours_async(
|
|
|
1513
1528
|
|
|
1514
1529
|
# Everything is optional in proto3 as far as the runtime is concerned,
|
|
1515
1530
|
# and we are mocking out the actual API, so just send an empty request.
|
|
1516
|
-
request = request_type
|
|
1531
|
+
request = request_type
|
|
1517
1532
|
|
|
1518
1533
|
# Mock the actual call within the gRPC stub, and fake the request.
|
|
1519
1534
|
with mock.patch.object(type(client.transport.optimize_tours), "__call__") as call:
|
|
@@ -1536,11 +1551,6 @@ async def test_optimize_tours_async(
|
|
|
1536
1551
|
assert response.request_label == "request_label_value"
|
|
1537
1552
|
|
|
1538
1553
|
|
|
1539
|
-
@pytest.mark.asyncio
|
|
1540
|
-
async def test_optimize_tours_async_from_dict():
|
|
1541
|
-
await test_optimize_tours_async(request_type=dict)
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
1554
|
def test_optimize_tours_field_headers():
|
|
1545
1555
|
client = RouteOptimizationClient(
|
|
1546
1556
|
credentials=ga_credentials.AnonymousCredentials(),
|
|
@@ -1605,8 +1615,8 @@ async def test_optimize_tours_field_headers_async():
|
|
|
1605
1615
|
@pytest.mark.parametrize(
|
|
1606
1616
|
"request_type",
|
|
1607
1617
|
[
|
|
1608
|
-
route_optimization_service.BatchOptimizeToursRequest,
|
|
1609
|
-
|
|
1618
|
+
route_optimization_service.BatchOptimizeToursRequest(),
|
|
1619
|
+
{},
|
|
1610
1620
|
],
|
|
1611
1621
|
)
|
|
1612
1622
|
def test_batch_optimize_tours(request_type, transport: str = "grpc"):
|
|
@@ -1617,7 +1627,7 @@ def test_batch_optimize_tours(request_type, transport: str = "grpc"):
|
|
|
1617
1627
|
|
|
1618
1628
|
# Everything is optional in proto3 as far as the runtime is concerned,
|
|
1619
1629
|
# and we are mocking out the actual API, so just send an empty request.
|
|
1620
|
-
request = request_type
|
|
1630
|
+
request = request_type
|
|
1621
1631
|
|
|
1622
1632
|
# Mock the actual call within the gRPC stub, and fake the request.
|
|
1623
1633
|
with mock.patch.object(
|
|
@@ -1662,9 +1672,10 @@ def test_batch_optimize_tours_non_empty_request_with_auto_populated_field():
|
|
|
1662
1672
|
client.batch_optimize_tours(request=request)
|
|
1663
1673
|
call.assert_called()
|
|
1664
1674
|
_, args, _ = call.mock_calls[0]
|
|
1665
|
-
|
|
1675
|
+
request_msg = route_optimization_service.BatchOptimizeToursRequest(
|
|
1666
1676
|
parent="parent_value",
|
|
1667
1677
|
)
|
|
1678
|
+
assert args[0] == request_msg
|
|
1668
1679
|
|
|
1669
1680
|
|
|
1670
1681
|
def test_batch_optimize_tours_use_cached_wrapped_rpc():
|
|
@@ -1759,9 +1770,15 @@ async def test_batch_optimize_tours_async_use_cached_wrapped_rpc(
|
|
|
1759
1770
|
|
|
1760
1771
|
|
|
1761
1772
|
@pytest.mark.asyncio
|
|
1773
|
+
@pytest.mark.parametrize(
|
|
1774
|
+
"request_type",
|
|
1775
|
+
[
|
|
1776
|
+
route_optimization_service.BatchOptimizeToursRequest(),
|
|
1777
|
+
{},
|
|
1778
|
+
],
|
|
1779
|
+
)
|
|
1762
1780
|
async def test_batch_optimize_tours_async(
|
|
1763
|
-
transport: str = "grpc_asyncio"
|
|
1764
|
-
request_type=route_optimization_service.BatchOptimizeToursRequest,
|
|
1781
|
+
request_type, transport: str = "grpc_asyncio"
|
|
1765
1782
|
):
|
|
1766
1783
|
client = RouteOptimizationAsyncClient(
|
|
1767
1784
|
credentials=async_anonymous_credentials(),
|
|
@@ -1770,7 +1787,7 @@ async def test_batch_optimize_tours_async(
|
|
|
1770
1787
|
|
|
1771
1788
|
# Everything is optional in proto3 as far as the runtime is concerned,
|
|
1772
1789
|
# and we are mocking out the actual API, so just send an empty request.
|
|
1773
|
-
request = request_type
|
|
1790
|
+
request = request_type
|
|
1774
1791
|
|
|
1775
1792
|
# Mock the actual call within the gRPC stub, and fake the request.
|
|
1776
1793
|
with mock.patch.object(
|
|
@@ -1792,11 +1809,6 @@ async def test_batch_optimize_tours_async(
|
|
|
1792
1809
|
assert isinstance(response, future.Future)
|
|
1793
1810
|
|
|
1794
1811
|
|
|
1795
|
-
@pytest.mark.asyncio
|
|
1796
|
-
async def test_batch_optimize_tours_async_from_dict():
|
|
1797
|
-
await test_batch_optimize_tours_async(request_type=dict)
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
1812
|
def test_batch_optimize_tours_field_headers():
|
|
1801
1813
|
client = RouteOptimizationClient(
|
|
1802
1814
|
credentials=ga_credentials.AnonymousCredentials(),
|
|
@@ -1865,8 +1877,8 @@ async def test_batch_optimize_tours_field_headers_async():
|
|
|
1865
1877
|
@pytest.mark.parametrize(
|
|
1866
1878
|
"request_type",
|
|
1867
1879
|
[
|
|
1868
|
-
route_optimization_service.OptimizeToursRequest,
|
|
1869
|
-
|
|
1880
|
+
route_optimization_service.OptimizeToursRequest(),
|
|
1881
|
+
{},
|
|
1870
1882
|
],
|
|
1871
1883
|
)
|
|
1872
1884
|
def test_optimize_tours_long_running(request_type, transport: str = "grpc"):
|
|
@@ -1877,7 +1889,7 @@ def test_optimize_tours_long_running(request_type, transport: str = "grpc"):
|
|
|
1877
1889
|
|
|
1878
1890
|
# Everything is optional in proto3 as far as the runtime is concerned,
|
|
1879
1891
|
# and we are mocking out the actual API, so just send an empty request.
|
|
1880
|
-
request = request_type
|
|
1892
|
+
request = request_type
|
|
1881
1893
|
|
|
1882
1894
|
# Mock the actual call within the gRPC stub, and fake the request.
|
|
1883
1895
|
with mock.patch.object(
|
|
@@ -1923,10 +1935,11 @@ def test_optimize_tours_long_running_non_empty_request_with_auto_populated_field
|
|
|
1923
1935
|
client.optimize_tours_long_running(request=request)
|
|
1924
1936
|
call.assert_called()
|
|
1925
1937
|
_, args, _ = call.mock_calls[0]
|
|
1926
|
-
|
|
1938
|
+
request_msg = route_optimization_service.OptimizeToursRequest(
|
|
1927
1939
|
parent="parent_value",
|
|
1928
1940
|
label="label_value",
|
|
1929
1941
|
)
|
|
1942
|
+
assert args[0] == request_msg
|
|
1930
1943
|
|
|
1931
1944
|
|
|
1932
1945
|
def test_optimize_tours_long_running_use_cached_wrapped_rpc():
|
|
@@ -2022,9 +2035,15 @@ async def test_optimize_tours_long_running_async_use_cached_wrapped_rpc(
|
|
|
2022
2035
|
|
|
2023
2036
|
|
|
2024
2037
|
@pytest.mark.asyncio
|
|
2038
|
+
@pytest.mark.parametrize(
|
|
2039
|
+
"request_type",
|
|
2040
|
+
[
|
|
2041
|
+
route_optimization_service.OptimizeToursRequest(),
|
|
2042
|
+
{},
|
|
2043
|
+
],
|
|
2044
|
+
)
|
|
2025
2045
|
async def test_optimize_tours_long_running_async(
|
|
2026
|
-
transport: str = "grpc_asyncio"
|
|
2027
|
-
request_type=route_optimization_service.OptimizeToursRequest,
|
|
2046
|
+
request_type, transport: str = "grpc_asyncio"
|
|
2028
2047
|
):
|
|
2029
2048
|
client = RouteOptimizationAsyncClient(
|
|
2030
2049
|
credentials=async_anonymous_credentials(),
|
|
@@ -2033,7 +2052,7 @@ async def test_optimize_tours_long_running_async(
|
|
|
2033
2052
|
|
|
2034
2053
|
# Everything is optional in proto3 as far as the runtime is concerned,
|
|
2035
2054
|
# and we are mocking out the actual API, so just send an empty request.
|
|
2036
|
-
request = request_type
|
|
2055
|
+
request = request_type
|
|
2037
2056
|
|
|
2038
2057
|
# Mock the actual call within the gRPC stub, and fake the request.
|
|
2039
2058
|
with mock.patch.object(
|
|
@@ -2055,11 +2074,6 @@ async def test_optimize_tours_long_running_async(
|
|
|
2055
2074
|
assert isinstance(response, future.Future)
|
|
2056
2075
|
|
|
2057
2076
|
|
|
2058
|
-
@pytest.mark.asyncio
|
|
2059
|
-
async def test_optimize_tours_long_running_async_from_dict():
|
|
2060
|
-
await test_optimize_tours_long_running_async(request_type=dict)
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
2077
|
def test_optimize_tours_long_running_field_headers():
|
|
2064
2078
|
client = RouteOptimizationClient(
|
|
2065
2079
|
credentials=ga_credentials.AnonymousCredentials(),
|
|
@@ -2128,8 +2142,8 @@ async def test_optimize_tours_long_running_field_headers_async():
|
|
|
2128
2142
|
@pytest.mark.parametrize(
|
|
2129
2143
|
"request_type",
|
|
2130
2144
|
[
|
|
2131
|
-
route_optimization_service.OptimizeToursUriRequest,
|
|
2132
|
-
|
|
2145
|
+
route_optimization_service.OptimizeToursUriRequest(),
|
|
2146
|
+
{},
|
|
2133
2147
|
],
|
|
2134
2148
|
)
|
|
2135
2149
|
def test_optimize_tours_uri(request_type, transport: str = "grpc"):
|
|
@@ -2140,7 +2154,7 @@ def test_optimize_tours_uri(request_type, transport: str = "grpc"):
|
|
|
2140
2154
|
|
|
2141
2155
|
# Everything is optional in proto3 as far as the runtime is concerned,
|
|
2142
2156
|
# and we are mocking out the actual API, so just send an empty request.
|
|
2143
|
-
request = request_type
|
|
2157
|
+
request = request_type
|
|
2144
2158
|
|
|
2145
2159
|
# Mock the actual call within the gRPC stub, and fake the request.
|
|
2146
2160
|
with mock.patch.object(
|
|
@@ -2185,9 +2199,10 @@ def test_optimize_tours_uri_non_empty_request_with_auto_populated_field():
|
|
|
2185
2199
|
client.optimize_tours_uri(request=request)
|
|
2186
2200
|
call.assert_called()
|
|
2187
2201
|
_, args, _ = call.mock_calls[0]
|
|
2188
|
-
|
|
2202
|
+
request_msg = route_optimization_service.OptimizeToursUriRequest(
|
|
2189
2203
|
parent="parent_value",
|
|
2190
2204
|
)
|
|
2205
|
+
assert args[0] == request_msg
|
|
2191
2206
|
|
|
2192
2207
|
|
|
2193
2208
|
def test_optimize_tours_uri_use_cached_wrapped_rpc():
|
|
@@ -2282,10 +2297,14 @@ async def test_optimize_tours_uri_async_use_cached_wrapped_rpc(
|
|
|
2282
2297
|
|
|
2283
2298
|
|
|
2284
2299
|
@pytest.mark.asyncio
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
)
|
|
2300
|
+
@pytest.mark.parametrize(
|
|
2301
|
+
"request_type",
|
|
2302
|
+
[
|
|
2303
|
+
route_optimization_service.OptimizeToursUriRequest(),
|
|
2304
|
+
{},
|
|
2305
|
+
],
|
|
2306
|
+
)
|
|
2307
|
+
async def test_optimize_tours_uri_async(request_type, transport: str = "grpc_asyncio"):
|
|
2289
2308
|
client = RouteOptimizationAsyncClient(
|
|
2290
2309
|
credentials=async_anonymous_credentials(),
|
|
2291
2310
|
transport=transport,
|
|
@@ -2293,7 +2312,7 @@ async def test_optimize_tours_uri_async(
|
|
|
2293
2312
|
|
|
2294
2313
|
# Everything is optional in proto3 as far as the runtime is concerned,
|
|
2295
2314
|
# and we are mocking out the actual API, so just send an empty request.
|
|
2296
|
-
request = request_type
|
|
2315
|
+
request = request_type
|
|
2297
2316
|
|
|
2298
2317
|
# Mock the actual call within the gRPC stub, and fake the request.
|
|
2299
2318
|
with mock.patch.object(
|
|
@@ -2315,11 +2334,6 @@ async def test_optimize_tours_uri_async(
|
|
|
2315
2334
|
assert isinstance(response, future.Future)
|
|
2316
2335
|
|
|
2317
2336
|
|
|
2318
|
-
@pytest.mark.asyncio
|
|
2319
|
-
async def test_optimize_tours_uri_async_from_dict():
|
|
2320
|
-
await test_optimize_tours_uri_async(request_type=dict)
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
2337
|
def test_optimize_tours_uri_field_headers():
|
|
2324
2338
|
client = RouteOptimizationClient(
|
|
2325
2339
|
credentials=ga_credentials.AnonymousCredentials(),
|
|
@@ -2496,7 +2510,7 @@ def test_optimize_tours_rest_required_fields(
|
|
|
2496
2510
|
|
|
2497
2511
|
expected_params = [("$alt", "json;enum-encoding=int")]
|
|
2498
2512
|
actual_params = req.call_args.kwargs["params"]
|
|
2499
|
-
assert expected_params == actual_params
|
|
2513
|
+
assert sorted(expected_params) == sorted(actual_params)
|
|
2500
2514
|
|
|
2501
2515
|
|
|
2502
2516
|
def test_optimize_tours_rest_unset_required_fields():
|
|
@@ -2622,7 +2636,7 @@ def test_batch_optimize_tours_rest_required_fields(
|
|
|
2622
2636
|
|
|
2623
2637
|
expected_params = [("$alt", "json;enum-encoding=int")]
|
|
2624
2638
|
actual_params = req.call_args.kwargs["params"]
|
|
2625
|
-
assert expected_params == actual_params
|
|
2639
|
+
assert sorted(expected_params) == sorted(actual_params)
|
|
2626
2640
|
|
|
2627
2641
|
|
|
2628
2642
|
def test_batch_optimize_tours_rest_unset_required_fields():
|
|
@@ -2757,7 +2771,7 @@ def test_optimize_tours_long_running_rest_required_fields(
|
|
|
2757
2771
|
|
|
2758
2772
|
expected_params = [("$alt", "json;enum-encoding=int")]
|
|
2759
2773
|
actual_params = req.call_args.kwargs["params"]
|
|
2760
|
-
assert expected_params == actual_params
|
|
2774
|
+
assert sorted(expected_params) == sorted(actual_params)
|
|
2761
2775
|
|
|
2762
2776
|
|
|
2763
2777
|
def test_optimize_tours_long_running_rest_unset_required_fields():
|
|
@@ -2883,7 +2897,7 @@ def test_optimize_tours_uri_rest_required_fields(
|
|
|
2883
2897
|
|
|
2884
2898
|
expected_params = [("$alt", "json;enum-encoding=int")]
|
|
2885
2899
|
actual_params = req.call_args.kwargs["params"]
|
|
2886
|
-
assert expected_params == actual_params
|
|
2900
|
+
assert sorted(expected_params) == sorted(actual_params)
|
|
2887
2901
|
|
|
2888
2902
|
|
|
2889
2903
|
def test_optimize_tours_uri_rest_unset_required_fields():
|
|
@@ -3027,7 +3041,6 @@ def test_optimize_tours_empty_call_grpc():
|
|
|
3027
3041
|
call.assert_called()
|
|
3028
3042
|
_, args, _ = call.mock_calls[0]
|
|
3029
3043
|
request_msg = route_optimization_service.OptimizeToursRequest()
|
|
3030
|
-
|
|
3031
3044
|
assert args[0] == request_msg
|
|
3032
3045
|
|
|
3033
3046
|
|
|
@@ -3050,7 +3063,6 @@ def test_batch_optimize_tours_empty_call_grpc():
|
|
|
3050
3063
|
call.assert_called()
|
|
3051
3064
|
_, args, _ = call.mock_calls[0]
|
|
3052
3065
|
request_msg = route_optimization_service.BatchOptimizeToursRequest()
|
|
3053
|
-
|
|
3054
3066
|
assert args[0] == request_msg
|
|
3055
3067
|
|
|
3056
3068
|
|
|
@@ -3073,7 +3085,6 @@ def test_optimize_tours_long_running_empty_call_grpc():
|
|
|
3073
3085
|
call.assert_called()
|
|
3074
3086
|
_, args, _ = call.mock_calls[0]
|
|
3075
3087
|
request_msg = route_optimization_service.OptimizeToursRequest()
|
|
3076
|
-
|
|
3077
3088
|
assert args[0] == request_msg
|
|
3078
3089
|
|
|
3079
3090
|
|
|
@@ -3096,7 +3107,6 @@ def test_optimize_tours_uri_empty_call_grpc():
|
|
|
3096
3107
|
call.assert_called()
|
|
3097
3108
|
_, args, _ = call.mock_calls[0]
|
|
3098
3109
|
request_msg = route_optimization_service.OptimizeToursUriRequest()
|
|
3099
|
-
|
|
3100
3110
|
assert args[0] == request_msg
|
|
3101
3111
|
|
|
3102
3112
|
|
|
@@ -3137,7 +3147,6 @@ async def test_optimize_tours_empty_call_grpc_asyncio():
|
|
|
3137
3147
|
call.assert_called()
|
|
3138
3148
|
_, args, _ = call.mock_calls[0]
|
|
3139
3149
|
request_msg = route_optimization_service.OptimizeToursRequest()
|
|
3140
|
-
|
|
3141
3150
|
assert args[0] == request_msg
|
|
3142
3151
|
|
|
3143
3152
|
|
|
@@ -3164,7 +3173,6 @@ async def test_batch_optimize_tours_empty_call_grpc_asyncio():
|
|
|
3164
3173
|
call.assert_called()
|
|
3165
3174
|
_, args, _ = call.mock_calls[0]
|
|
3166
3175
|
request_msg = route_optimization_service.BatchOptimizeToursRequest()
|
|
3167
|
-
|
|
3168
3176
|
assert args[0] == request_msg
|
|
3169
3177
|
|
|
3170
3178
|
|
|
@@ -3191,7 +3199,6 @@ async def test_optimize_tours_long_running_empty_call_grpc_asyncio():
|
|
|
3191
3199
|
call.assert_called()
|
|
3192
3200
|
_, args, _ = call.mock_calls[0]
|
|
3193
3201
|
request_msg = route_optimization_service.OptimizeToursRequest()
|
|
3194
|
-
|
|
3195
3202
|
assert args[0] == request_msg
|
|
3196
3203
|
|
|
3197
3204
|
|
|
@@ -3218,7 +3225,6 @@ async def test_optimize_tours_uri_empty_call_grpc_asyncio():
|
|
|
3218
3225
|
call.assert_called()
|
|
3219
3226
|
_, args, _ = call.mock_calls[0]
|
|
3220
3227
|
request_msg = route_optimization_service.OptimizeToursUriRequest()
|
|
3221
|
-
|
|
3222
3228
|
assert args[0] == request_msg
|
|
3223
3229
|
|
|
3224
3230
|
|
|
@@ -3831,7 +3837,6 @@ def test_optimize_tours_empty_call_rest():
|
|
|
3831
3837
|
call.assert_called()
|
|
3832
3838
|
_, args, _ = call.mock_calls[0]
|
|
3833
3839
|
request_msg = route_optimization_service.OptimizeToursRequest()
|
|
3834
|
-
|
|
3835
3840
|
assert args[0] == request_msg
|
|
3836
3841
|
|
|
3837
3842
|
|
|
@@ -3853,7 +3858,6 @@ def test_batch_optimize_tours_empty_call_rest():
|
|
|
3853
3858
|
call.assert_called()
|
|
3854
3859
|
_, args, _ = call.mock_calls[0]
|
|
3855
3860
|
request_msg = route_optimization_service.BatchOptimizeToursRequest()
|
|
3856
|
-
|
|
3857
3861
|
assert args[0] == request_msg
|
|
3858
3862
|
|
|
3859
3863
|
|
|
@@ -3875,7 +3879,6 @@ def test_optimize_tours_long_running_empty_call_rest():
|
|
|
3875
3879
|
call.assert_called()
|
|
3876
3880
|
_, args, _ = call.mock_calls[0]
|
|
3877
3881
|
request_msg = route_optimization_service.OptimizeToursRequest()
|
|
3878
|
-
|
|
3879
3882
|
assert args[0] == request_msg
|
|
3880
3883
|
|
|
3881
3884
|
|
|
@@ -3897,7 +3900,6 @@ def test_optimize_tours_uri_empty_call_rest():
|
|
|
3897
3900
|
call.assert_called()
|
|
3898
3901
|
_, args, _ = call.mock_calls[0]
|
|
3899
3902
|
request_msg = route_optimization_service.OptimizeToursUriRequest()
|
|
3900
|
-
|
|
3901
3903
|
assert args[0] == request_msg
|
|
3902
3904
|
|
|
3903
3905
|
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
#
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|