diff --git a/google/cloud/optimization_v1/services/fleet_routing/async_client.py b/google/cloud/optimization_v1/services/fleet_routing/async_client.py index e776f69..6545dc4 100644 --- a/google/cloud/optimization_v1/services/fleet_routing/async_client.py +++ b/google/cloud/optimization_v1/services/fleet_routing/async_client.py @@ -152,7 +152,7 @@ def get_mtls_endpoint_and_cert_source( The API endpoint is determined in the following order: (1) if `client_options.api_endpoint` if provided, use the provided one. (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the - default mTLS endpoint; if the environment variabel is "never", use the default API + default mTLS endpoint; if the environment variable is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint. diff --git a/google/cloud/optimization_v1/services/fleet_routing/client.py b/google/cloud/optimization_v1/services/fleet_routing/client.py index b62c361..91b21d3 100644 --- a/google/cloud/optimization_v1/services/fleet_routing/client.py +++ b/google/cloud/optimization_v1/services/fleet_routing/client.py @@ -290,7 +290,7 @@ def get_mtls_endpoint_and_cert_source( The API endpoint is determined in the following order: (1) if `client_options.api_endpoint` if provided, use the provided one. (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the - default mTLS endpoint; if the environment variabel is "never", use the default API + default mTLS endpoint; if the environment variable is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint. diff --git a/google/cloud/optimization_v1/types/fleet_routing.py b/google/cloud/optimization_v1/types/fleet_routing.py index 7168b98..638d473 100644 --- a/google/cloud/optimization_v1/types/fleet_routing.py +++ b/google/cloud/optimization_v1/types/fleet_routing.py @@ -57,6 +57,9 @@ class OptimizeToursRequest(proto.Message): defines the shipment model to solve as well as optimization parameters. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: parent (str): Required. Target project and location to make a call. @@ -616,6 +619,9 @@ class ShipmentModel(proto.Message): - the unperformed shipment penalties. - the cost of the global duration of the shipments + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: shipments (MutableSequence[google.cloud.optimization_v1.types.Shipment]): Set of shipments which must be performed in @@ -874,6 +880,9 @@ class PrecedenceRule(proto.Message): Furthermore, precedences only apply when both shipments are performed and are otherwise ignored. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: first_index (int): Shipment index of the "first" event. This @@ -1139,6 +1148,9 @@ class Shipment(proto.Message): visit one of its delivery locations later on (and therefore re-increase its spare capacities accordingly). + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: pickups (MutableSequence[google.cloud.optimization_v1.types.Shipment.VisitRequest]): Set of pickup alternatives associated to the @@ -1595,6 +1607,9 @@ class Vehicle(proto.Message): ``end_location`` for this vehicle. A route is a sequence of visits (see ``ShipmentRoute``). + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: travel_mode (google.cloud.optimization_v1.types.Vehicle.TravelMode): The travel mode which affects the roads usable by the @@ -1826,6 +1841,9 @@ class LoadLimit(proto.Message): only carry up to 3500 kg". See [load_limits][google.cloud.optimization.v1.Vehicle.load_limits]. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: max_load (int): The maximum acceptable amount of load. @@ -1855,6 +1873,8 @@ class LoadLimit(proto.Message): class Interval(proto.Message): r"""Interval of acceptable load amounts. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: min_ (int): A minimum acceptable load. Must be ≥ 0. If they're both @@ -1914,6 +1934,9 @@ class DurationLimit(proto.Message): When a soft limit field is defined, both the soft max threshold and its associated cost must be defined together. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: max_duration (google.protobuf.duration_pb2.Duration): A hard limit constraining the duration to be at most @@ -2163,6 +2186,9 @@ class TimeWindow(proto.Message): 0 <= `start_time` <= `soft_start_time` <= `end_time` and 0 <= `start_time` <= `soft_end_time` <= `end_time`. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: start_time (google.protobuf.timestamp_pb2.Timestamp): The hard time window start time. If unspecified it will be @@ -2260,6 +2286,8 @@ class CapacityQuantity(proto.Message): class CapacityQuantityInterval(proto.Message): r"""Deprecated: Use [Vehicle.LoadLimit.Interval][] instead. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: type_ (str): @@ -2295,6 +2323,9 @@ class DistanceLimit(proto.Message): ``cost_per_kilometer_above_soft_max`` must be defined and be nonnegative. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: max_meters (int): A hard limit constraining the distance to be at most @@ -2489,6 +2520,9 @@ class Location(proto.Message): r"""Encapsulates a location (a geographic point, and an optional heading). + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: lat_lng (google.type.latlng_pb2.LatLng): The waypoint's geographic coordinates. @@ -3354,6 +3388,9 @@ class Reason(proto.Message): 3) and at least one vehicle's distance limit would be exceeded (including vehicle 1). + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: code (google.cloud.optimization_v1.types.SkippedShipment.Reason.Code): Refer to the comments of Code. diff --git a/samples/generated_samples/snippet_metadata_google.cloud.optimization.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.optimization.v1.json index cf0b058..d38082d 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.optimization.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.optimization.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-optimization", - "version": "1.2.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/setup.py b/setup.py index d9c153f..30c559e 100644 --- a/setup.py +++ b/setup.py @@ -40,6 +40,7 @@ dependencies = [ "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", ] url = "https://github.com/googleapis/python-optimization" @@ -79,6 +80,7 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Operating System :: OS Independent", "Topic :: Internet", ], diff --git a/testing/constraints-3.12.txt b/testing/constraints-3.12.txt new file mode 100644 index 0000000..ed7f9ae --- /dev/null +++ b/testing/constraints-3.12.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf