Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Commit 4688e2a

Browse files
chore: use gapic-generator-python 0.65.1 (#25)
* chore: use gapic-generator-python 0.65.1 PiperOrigin-RevId: 441524537 Source-Link: googleapis/googleapis@2a27391 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab6756a48c89b5bcb9fb73443cb8e55d574f4643 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWI2NzU2YTQ4Yzg5YjViY2I5ZmI3MzQ0M2NiOGU1NWQ1NzRmNDY0MyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent e86df68 commit 4688e2a

File tree

7 files changed

+188
-24
lines changed

7 files changed

+188
-24
lines changed

google/cloud/optimization_v1/services/fleet_routing/async_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from collections import OrderedDict
1717
import functools
1818
import re
19-
from typing import Dict, Optional, Sequence, Tuple, Type, Union
19+
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

2222
from google.api_core.client_options import ClientOptions
@@ -246,7 +246,6 @@ async def optimize_tours(
246246
``Vehicle``\ s that minimizes the total cost where cost has many
247247
components defined in the ``ShipmentModel``.
248248
249-
250249
.. code-block:: python
251250
252251
from google.cloud import optimization_v1
@@ -343,7 +342,6 @@ async def batch_optimize_tours(
343342
containing ``ShipmentRoute``\ s, which are a set of routes to be
344343
performed by vehicles minimizing the overall cost.
345344
346-
347345
.. code-block:: python
348346
349347
from google.cloud import optimization_v1

google/cloud/optimization_v1/services/fleet_routing/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from collections import OrderedDict
1717
import os
1818
import re
19-
from typing import Dict, Optional, Sequence, Tuple, Type, Union
19+
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

2222
from google.api_core import client_options as client_options_lib
@@ -452,7 +452,6 @@ def optimize_tours(
452452
``Vehicle``\ s that minimizes the total cost where cost has many
453453
components defined in the ``ShipmentModel``.
454454
455-
456455
.. code-block:: python
457456
458457
from google.cloud import optimization_v1
@@ -541,7 +540,6 @@ def batch_optimize_tours(
541540
containing ``ShipmentRoute``\ s, which are a set of routes to be
542541
performed by vehicles minimizing the overall cost.
543542
544-
545543
.. code-block:: python
546544
547545
from google.cloud import optimization_v1

google/cloud/optimization_v1/services/fleet_routing/transports/base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def __init__(
8282
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
8383
be used for service account credentials.
8484
"""
85+
8586
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
8687
if ":" not in host:
8788
host += ":443"
@@ -187,5 +188,9 @@ def batch_optimize_tours(
187188
]:
188189
raise NotImplementedError()
189190

191+
@property
192+
def kind(self) -> str:
193+
raise NotImplementedError()
194+
190195

191196
__all__ = ("FleetRoutingTransport",)

google/cloud/optimization_v1/services/fleet_routing/transports/grpc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,5 +348,9 @@ def batch_optimize_tours(
348348
def close(self):
349349
self.grpc_channel.close()
350350

351+
@property
352+
def kind(self) -> str:
353+
return "grpc"
354+
351355

352356
__all__ = ("FleetRoutingGrpcTransport",)

google/cloud/optimization_v1/types/fleet_routing.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ class Metrics(proto.Message):
437437
The latest end time for a used vehicle, computed as the
438438
maximum over all used vehicles of
439439
[ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time].
440-
costs (Sequence[google.cloud.optimization_v1.types.OptimizeToursResponse.Metrics.CostsEntry]):
440+
costs (Mapping[str, float]):
441441
Cost of the solution, broken down by cost-related request
442442
fields. The keys are proto paths, relative to the input
443443
OptimizeToursRequest, e.g. "model.shipments.pickups.cost",
@@ -1130,7 +1130,7 @@ class Shipment(proto.Message):
11301130
the shipment. If not specified, the vehicle only
11311131
needs to visit a location corresponding to the
11321132
pickups.
1133-
load_demands (Sequence[google.cloud.optimization_v1.types.Shipment.LoadDemandsEntry]):
1133+
load_demands (Mapping[str, google.cloud.optimization_v1.types.Shipment.Load]):
11341134
Load demands of the shipment (for example weight, volume,
11351135
number of pallets etc). The keys in the map should be
11361136
identifiers describing the type of the corresponding load,
@@ -1322,7 +1322,7 @@ class VisitRequest(proto.Message):
13221322
pickup or delivery of a shipment. This cost must be in the
13231323
same unit as ``Shipment.penalty_cost`` and must not be
13241324
negative.
1325-
load_demands (Sequence[google.cloud.optimization_v1.types.Shipment.VisitRequest.LoadDemandsEntry]):
1325+
load_demands (Mapping[str, google.cloud.optimization_v1.types.Shipment.Load]):
13261326
Load demands of this visit request. This is just like
13271327
[Shipment.load_demands][google.cloud.optimization.v1.Shipment.load_demands]
13281328
field, except that it only applies to this
@@ -1665,7 +1665,7 @@ class Vehicle(proto.Message):
16651665
This field is a member of `oneof`_ ``_travel_duration_multiple``.
16661666
unloading_policy (google.cloud.optimization_v1.types.Vehicle.UnloadingPolicy):
16671667
Unloading policy enforced on the vehicle.
1668-
load_limits (Sequence[google.cloud.optimization_v1.types.Vehicle.LoadLimitsEntry]):
1668+
load_limits (Mapping[str, google.cloud.optimization_v1.types.Vehicle.LoadLimit]):
16691669
Capacities of the vehicle (weight, volume, # of pallets for
16701670
example). The keys in the map are the identifiers of the
16711671
type of load, consistent with the keys of the
@@ -1728,7 +1728,7 @@ class Vehicle(proto.Message):
17281728
In a given ``OptimizeToursResponse``, the route distance is
17291729
the sum of all its
17301730
[transitions.travel_distance_meters][google.cloud.optimization.v1.ShipmentRoute.Transition.travel_distance_meters].
1731-
extra_visit_duration_for_visit_type (Sequence[google.cloud.optimization_v1.types.Vehicle.ExtraVisitDurationForVisitTypeEntry]):
1731+
extra_visit_duration_for_visit_type (Mapping[str, google.protobuf.duration_pb2.Duration]):
17321732
Specifies a map from visit_types strings to durations. The
17331733
duration is time in addition to
17341734
[VisitRequest.duration][google.cloud.optimization.v1.Shipment.VisitRequest.duration]
@@ -2774,7 +2774,7 @@ class ShipmentRoute(proto.Message):
27742774
or
27752775
[ShipmentRoute.visits][google.cloud.optimization.v1.ShipmentRoute.visits],
27762776
depending on the context.
2777-
route_costs (Sequence[google.cloud.optimization_v1.types.ShipmentRoute.RouteCostsEntry]):
2777+
route_costs (Mapping[str, float]):
27782778
Cost of the route, broken down by cost-related request
27792779
fields. The keys are proto paths, relative to the input
27802780
OptimizeToursRequest, e.g. "model.shipments.pickups.cost",
@@ -2857,7 +2857,7 @@ class Visit(proto.Message):
28572857
Time at which the visit starts. Note that the vehicle may
28582858
arrive earlier than this at the visit location. Times are
28592859
consistent with the ``ShipmentModel``.
2860-
load_demands (Sequence[google.cloud.optimization_v1.types.ShipmentRoute.Visit.LoadDemandsEntry]):
2860+
load_demands (Mapping[str, google.cloud.optimization_v1.types.Shipment.Load]):
28612861
Total visit load demand as the sum of the shipment and the
28622862
visit request ``load_demands``. The values are negative if
28632863
the visit is a delivery. Demands are reported for the same
@@ -3017,7 +3017,7 @@ class Transition(proto.Message):
30173017
[populate_transition_polylines]
30183018
[google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
30193019
is set to true.
3020-
vehicle_loads (Sequence[google.cloud.optimization_v1.types.ShipmentRoute.Transition.VehicleLoadsEntry]):
3020+
vehicle_loads (Mapping[str, google.cloud.optimization_v1.types.ShipmentRoute.VehicleLoad]):
30213021
Vehicle loads during this transition, for each type that
30223022
either appears in this vehicle's
30233023
[Vehicle.load_limits][google.cloud.optimization.v1.Vehicle.load_limits],
@@ -3425,14 +3425,14 @@ class AggregatedMetrics(proto.Message):
34253425
travel_distance_meters (float):
34263426
Total travel distance for a route or a
34273427
solution.
3428-
max_loads (Sequence[google.cloud.optimization_v1.types.AggregatedMetrics.MaxLoadsEntry]):
3428+
max_loads (Mapping[str, google.cloud.optimization_v1.types.ShipmentRoute.VehicleLoad]):
34293429
Maximum load achieved over the entire route (resp.
34303430
solution), for each of the quantities on this route (resp.
34313431
solution), computed as the maximum over all
34323432
[Transition.vehicle_loads][google.cloud.optimization.v1.ShipmentRoute.Transition.vehicle_loads]
34333433
(resp.
34343434
[ShipmentRoute.metrics.max_loads][google.cloud.optimization.v1.AggregatedMetrics.max_loads].
3435-
costs (Sequence[google.cloud.optimization_v1.types.AggregatedMetrics.CostsEntry]):
3435+
costs (Mapping[str, float]):
34363436
Deprecated: Use [ShipmentRoute.route_costs][] and
34373437
[OptimizeToursResponse.Metrics.costs][] instead.
34383438
total_cost (float):

samples/generated_samples/snippet_metadata_optimization_v1.json

Lines changed: 146 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,57 @@
11
{
2+
"clientLibrary": {
3+
"apis": [
4+
{
5+
"id": "google.cloud.optimization.v1",
6+
"version": "v1"
7+
}
8+
],
9+
"language": "PYTHON",
10+
"name": "google-cloud-optimization"
11+
},
212
"snippets": [
313
{
14+
"canonical": true,
415
"clientMethod": {
516
"async": true,
17+
"client": {
18+
"fullName": "google.cloud.optimization_v1.FleetRoutingAsyncClient",
19+
"shortName": "FleetRoutingAsyncClient"
20+
},
21+
"fullName": "google.cloud.optimization_v1.FleetRoutingAsyncClient.batch_optimize_tours",
622
"method": {
23+
"fullName": "google.cloud.optimization.v1.FleetRouting.BatchOptimizeTours",
724
"service": {
25+
"fullName": "google.cloud.optimization.v1.FleetRouting",
826
"shortName": "FleetRouting"
927
},
1028
"shortName": "BatchOptimizeTours"
11-
}
29+
},
30+
"parameters": [
31+
{
32+
"name": "request",
33+
"type": "google.cloud.optimization_v1.types.BatchOptimizeToursRequest"
34+
},
35+
{
36+
"name": "retry",
37+
"type": "google.api_core.retry.Retry"
38+
},
39+
{
40+
"name": "timeout",
41+
"type": "float"
42+
},
43+
{
44+
"name": "metadata",
45+
"type": "Sequence[Tuple[str, str]"
46+
}
47+
],
48+
"resultType": "google.api_core.operation_async.AsyncOperation",
49+
"shortName": "batch_optimize_tours"
1250
},
51+
"description": "Sample for BatchOptimizeTours",
1352
"file": "cloudoptimization_v1_generated_fleet_routing_batch_optimize_tours_async.py",
53+
"language": "PYTHON",
54+
"origin": "API_DEFINITION",
1455
"regionTag": "cloudoptimization_v1_generated_FleetRouting_BatchOptimizeTours_async",
1556
"segments": [
1657
{
@@ -43,18 +84,50 @@
4384
"start": 51,
4485
"type": "RESPONSE_HANDLING"
4586
}
46-
]
87+
],
88+
"title": "cloudoptimization_v1_generated_fleet_routing_batch_optimize_tours_async.py"
4789
},
4890
{
91+
"canonical": true,
4992
"clientMethod": {
93+
"client": {
94+
"fullName": "google.cloud.optimization_v1.FleetRoutingClient",
95+
"shortName": "FleetRoutingClient"
96+
},
97+
"fullName": "google.cloud.optimization_v1.FleetRoutingClient.batch_optimize_tours",
5098
"method": {
99+
"fullName": "google.cloud.optimization.v1.FleetRouting.BatchOptimizeTours",
51100
"service": {
101+
"fullName": "google.cloud.optimization.v1.FleetRouting",
52102
"shortName": "FleetRouting"
53103
},
54104
"shortName": "BatchOptimizeTours"
55-
}
105+
},
106+
"parameters": [
107+
{
108+
"name": "request",
109+
"type": "google.cloud.optimization_v1.types.BatchOptimizeToursRequest"
110+
},
111+
{
112+
"name": "retry",
113+
"type": "google.api_core.retry.Retry"
114+
},
115+
{
116+
"name": "timeout",
117+
"type": "float"
118+
},
119+
{
120+
"name": "metadata",
121+
"type": "Sequence[Tuple[str, str]"
122+
}
123+
],
124+
"resultType": "google.api_core.operation.Operation",
125+
"shortName": "batch_optimize_tours"
56126
},
127+
"description": "Sample for BatchOptimizeTours",
57128
"file": "cloudoptimization_v1_generated_fleet_routing_batch_optimize_tours_sync.py",
129+
"language": "PYTHON",
130+
"origin": "API_DEFINITION",
58131
"regionTag": "cloudoptimization_v1_generated_FleetRouting_BatchOptimizeTours_sync",
59132
"segments": [
60133
{
@@ -87,19 +160,51 @@
87160
"start": 51,
88161
"type": "RESPONSE_HANDLING"
89162
}
90-
]
163+
],
164+
"title": "cloudoptimization_v1_generated_fleet_routing_batch_optimize_tours_sync.py"
91165
},
92166
{
167+
"canonical": true,
93168
"clientMethod": {
94169
"async": true,
170+
"client": {
171+
"fullName": "google.cloud.optimization_v1.FleetRoutingAsyncClient",
172+
"shortName": "FleetRoutingAsyncClient"
173+
},
174+
"fullName": "google.cloud.optimization_v1.FleetRoutingAsyncClient.optimize_tours",
95175
"method": {
176+
"fullName": "google.cloud.optimization.v1.FleetRouting.OptimizeTours",
96177
"service": {
178+
"fullName": "google.cloud.optimization.v1.FleetRouting",
97179
"shortName": "FleetRouting"
98180
},
99181
"shortName": "OptimizeTours"
100-
}
182+
},
183+
"parameters": [
184+
{
185+
"name": "request",
186+
"type": "google.cloud.optimization_v1.types.OptimizeToursRequest"
187+
},
188+
{
189+
"name": "retry",
190+
"type": "google.api_core.retry.Retry"
191+
},
192+
{
193+
"name": "timeout",
194+
"type": "float"
195+
},
196+
{
197+
"name": "metadata",
198+
"type": "Sequence[Tuple[str, str]"
199+
}
200+
],
201+
"resultType": "google.cloud.optimization_v1.types.OptimizeToursResponse",
202+
"shortName": "optimize_tours"
101203
},
204+
"description": "Sample for OptimizeTours",
102205
"file": "cloudoptimization_v1_generated_fleet_routing_optimize_tours_async.py",
206+
"language": "PYTHON",
207+
"origin": "API_DEFINITION",
103208
"regionTag": "cloudoptimization_v1_generated_FleetRouting_OptimizeTours_async",
104209
"segments": [
105210
{
@@ -132,18 +237,50 @@
132237
"start": 42,
133238
"type": "RESPONSE_HANDLING"
134239
}
135-
]
240+
],
241+
"title": "cloudoptimization_v1_generated_fleet_routing_optimize_tours_async.py"
136242
},
137243
{
244+
"canonical": true,
138245
"clientMethod": {
246+
"client": {
247+
"fullName": "google.cloud.optimization_v1.FleetRoutingClient",
248+
"shortName": "FleetRoutingClient"
249+
},
250+
"fullName": "google.cloud.optimization_v1.FleetRoutingClient.optimize_tours",
139251
"method": {
252+
"fullName": "google.cloud.optimization.v1.FleetRouting.OptimizeTours",
140253
"service": {
254+
"fullName": "google.cloud.optimization.v1.FleetRouting",
141255
"shortName": "FleetRouting"
142256
},
143257
"shortName": "OptimizeTours"
144-
}
258+
},
259+
"parameters": [
260+
{
261+
"name": "request",
262+
"type": "google.cloud.optimization_v1.types.OptimizeToursRequest"
263+
},
264+
{
265+
"name": "retry",
266+
"type": "google.api_core.retry.Retry"
267+
},
268+
{
269+
"name": "timeout",
270+
"type": "float"
271+
},
272+
{
273+
"name": "metadata",
274+
"type": "Sequence[Tuple[str, str]"
275+
}
276+
],
277+
"resultType": "google.cloud.optimization_v1.types.OptimizeToursResponse",
278+
"shortName": "optimize_tours"
145279
},
280+
"description": "Sample for OptimizeTours",
146281
"file": "cloudoptimization_v1_generated_fleet_routing_optimize_tours_sync.py",
282+
"language": "PYTHON",
283+
"origin": "API_DEFINITION",
147284
"regionTag": "cloudoptimization_v1_generated_FleetRouting_OptimizeTours_sync",
148285
"segments": [
149286
{
@@ -176,7 +313,8 @@
176313
"start": 42,
177314
"type": "RESPONSE_HANDLING"
178315
}
179-
]
316+
],
317+
"title": "cloudoptimization_v1_generated_fleet_routing_optimize_tours_sync.py"
180318
}
181319
]
182320
}

0 commit comments

Comments
 (0)