From 083c3528fb32cc692df4c33cfbba3d2cca371e59 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 09:57:47 -0400 Subject: [PATCH] feat: [optimization] added support for walking mode and cost_per_kilometer_below_soft_max (#4620) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: added support for walking mode and cost_per_kilometer_below_soft_max Clients can now use walking as the travel mode. And clients can set a cost per kilometer bounded by the soft max. PiperOrigin-RevId: 563199524 Source-Link: https://github.com/googleapis/googleapis/commit/757899999e0bc85a0acee96b784290fc340061f0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ba24bb374d50f1333eba36cf29988a054ba4ffff Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW9wdGltaXphdGlvbi8uT3dsQm90LnlhbWwiLCJoIjoiYmEyNGJiMzc0ZDUwZjEzMzNlYmEzNmNmMjk5ODhhMDU0YmE0ZmZmZiJ9 * 🦉 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 --- .../cloud/optimization/v1/async_model.proto | 2 +- .../cloud/optimization/v1/fleet_routing.proto | 46 +++++--- .../protos/protos.d.ts | 30 ++++-- .../protos/protos.js | 101 +++++++++++++----- .../protos/protos.json | 37 ++++--- .../v1/fleet_routing.optimize_tours.js | 20 ++-- ...metadata_google.cloud.optimization.v1.json | 8 +- .../src/v1/fleet_routing_client.ts | 16 +-- 8 files changed, 175 insertions(+), 85 deletions(-) diff --git a/packages/google-cloud-optimization/protos/google/cloud/optimization/v1/async_model.proto b/packages/google-cloud-optimization/protos/google/cloud/optimization/v1/async_model.proto index a3da0e47970..5706871e12e 100644 --- a/packages/google-cloud-optimization/protos/google/cloud/optimization/v1/async_model.proto +++ b/packages/google-cloud-optimization/protos/google/cloud/optimization/v1/async_model.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-optimization/protos/google/cloud/optimization/v1/fleet_routing.proto b/packages/google-cloud-optimization/protos/google/cloud/optimization/v1/fleet_routing.proto index cef17ad7ef3..3ab8254a50d 100644 --- a/packages/google-cloud-optimization/protos/google/cloud/optimization/v1/fleet_routing.proto +++ b/packages/google-cloud-optimization/protos/google/cloud/optimization/v1/fleet_routing.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -122,12 +122,20 @@ message OptimizeToursRequest { VALIDATE_ONLY = 1; // Only populates + // [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors] + // or // [OptimizeToursResponse.skipped_shipments][google.cloud.optimization.v1.OptimizeToursResponse.skipped_shipments], // and doesn't actually solve the rest of the request (`status` and `routes` // are unset in the response). + // If infeasibilities in `injected_solution_constraint` routes are detected + // they are populated in the + // [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors] + // field and + // [OptimizeToursResponse.skipped_shipments][google.cloud.optimization.v1.OptimizeToursResponse.skipped_shipments] + // is left empty. // // *IMPORTANT*: not all infeasible shipments are returned here, but only the - // ones that are detected as infeasible as a preprocessing. + // ones that are detected as infeasible during preprocessing. DETECT_SOME_INFEASIBLE_SHIPMENTS = 2; } @@ -165,15 +173,6 @@ message OptimizeToursRequest { // By default, the solving mode is `DEFAULT_SOLVE` (0). SolvingMode solving_mode = 4; - // Truncates the number of validation errors returned. These errors are - // typically attached to an INVALID_ARGUMENT error payload as a BadRequest - // error detail (https://cloud.google.com/apis/design/errors#error_details), - // unless solving_mode=VALIDATE_ONLY: see the - // [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors] - // field. - // This defaults to 100 and is capped at 10,000. - optional int32 max_validation_errors = 5; - // Search mode used to solve the request. SearchMode search_mode = 6; @@ -339,6 +338,15 @@ message OptimizeToursRequest { // meters/seconds. optional double geodesic_meters_per_second = 16; + // Truncates the number of validation errors returned. These errors are + // typically attached to an INVALID_ARGUMENT error payload as a BadRequest + // error detail (https://cloud.google.com/apis/design/errors#error_details), + // unless solving_mode=VALIDATE_ONLY: see the + // [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors] + // field. + // This defaults to 100 and is capped at 10,000. + optional int32 max_validation_errors = 5; + // Label that may be used to identify this request, reported back in the // [OptimizeToursResponse.request_label][google.cloud.optimization.v1.OptimizeToursResponse.request_label]. string label = 17; @@ -1131,6 +1139,9 @@ message Vehicle { // Travel mode corresponding to driving directions (car, ...). DRIVING = 1; + + // Travel mode corresponding to walking directions. + WALKING = 2; } // Policy on how a vehicle can be unloaded. Applies only to shipments having @@ -1565,6 +1576,15 @@ message DistanceLimit { // nonnegative. optional int64 soft_max_meters = 2; + // Cost per kilometer incurred, increasing up to `soft_max_meters`, with + // formula: + // ``` + // min(distance_meters, soft_max_meters) / 1000.0 * + // cost_per_kilometer_below_soft_max. + // ``` + // This cost is not supported in `route_distance_limit`. + optional double cost_per_kilometer_below_soft_max = 4; + // Cost per kilometer incurred if distance is above `soft_max_meters` limit. // The additional cost is 0 if the distance is under the limit, otherwise the // formula used to compute the cost is the following: @@ -2395,7 +2415,8 @@ message InjectedSolutionConstraint { RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1; // Same as `RELAX_VISIT_TIMES_AFTER_THRESHOLD`, but the visit sequence - // is also relaxed: visits remain simply bound to their vehicle. + // is also relaxed: visits can only be performed by this vehicle, but + // can potentially become unperformed. RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2; // Same as `RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD`, but the @@ -2533,6 +2554,7 @@ message OptimizeToursValidationError { // * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005; // * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006; // * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008; + // * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010; // * SHIPMENT_MODEL_ERROR = 22; // * SHIPMENT_MODEL_TOO_LARGE = 2200; // * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201; diff --git a/packages/google-cloud-optimization/protos/protos.d.ts b/packages/google-cloud-optimization/protos/protos.d.ts index 3b9d88347c6..d18ce659436 100644 --- a/packages/google-cloud-optimization/protos/protos.d.ts +++ b/packages/google-cloud-optimization/protos/protos.d.ts @@ -647,9 +647,6 @@ export namespace google { /** OptimizeToursRequest solvingMode */ solvingMode?: (google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode|keyof typeof google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode|null); - /** OptimizeToursRequest maxValidationErrors */ - maxValidationErrors?: (number|null); - /** OptimizeToursRequest searchMode */ searchMode?: (google.cloud.optimization.v1.OptimizeToursRequest.SearchMode|keyof typeof google.cloud.optimization.v1.OptimizeToursRequest.SearchMode|null); @@ -683,6 +680,9 @@ export namespace google { /** OptimizeToursRequest geodesicMetersPerSecond */ geodesicMetersPerSecond?: (number|null); + /** OptimizeToursRequest maxValidationErrors */ + maxValidationErrors?: (number|null); + /** OptimizeToursRequest label */ label?: (string|null); @@ -711,9 +711,6 @@ export namespace google { /** OptimizeToursRequest solvingMode. */ public solvingMode: (google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode|keyof typeof google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode); - /** OptimizeToursRequest maxValidationErrors. */ - public maxValidationErrors?: (number|null); - /** OptimizeToursRequest searchMode. */ public searchMode: (google.cloud.optimization.v1.OptimizeToursRequest.SearchMode|keyof typeof google.cloud.optimization.v1.OptimizeToursRequest.SearchMode); @@ -747,18 +744,21 @@ export namespace google { /** OptimizeToursRequest geodesicMetersPerSecond. */ public geodesicMetersPerSecond?: (number|null); + /** OptimizeToursRequest maxValidationErrors. */ + public maxValidationErrors?: (number|null); + /** OptimizeToursRequest label. */ public label: string; /** OptimizeToursRequest populateTravelStepPolylines. */ public populateTravelStepPolylines: boolean; - /** OptimizeToursRequest _maxValidationErrors. */ - public _maxValidationErrors?: "maxValidationErrors"; - /** OptimizeToursRequest _geodesicMetersPerSecond. */ public _geodesicMetersPerSecond?: "geodesicMetersPerSecond"; + /** OptimizeToursRequest _maxValidationErrors. */ + public _maxValidationErrors?: "maxValidationErrors"; + /** * Creates a new OptimizeToursRequest instance using the specified properties. * @param [properties] Properties to set @@ -3208,7 +3208,8 @@ export namespace google { /** TravelMode enum. */ enum TravelMode { TRAVEL_MODE_UNSPECIFIED = 0, - DRIVING = 1 + DRIVING = 1, + WALKING = 2 } /** UnloadingPolicy enum. */ @@ -3939,6 +3940,9 @@ export namespace google { /** DistanceLimit softMaxMeters */ softMaxMeters?: (number|Long|string|null); + /** DistanceLimit costPerKilometerBelowSoftMax */ + costPerKilometerBelowSoftMax?: (number|null); + /** DistanceLimit costPerKilometerAboveSoftMax */ costPerKilometerAboveSoftMax?: (number|null); } @@ -3958,6 +3962,9 @@ export namespace google { /** DistanceLimit softMaxMeters. */ public softMaxMeters?: (number|Long|string|null); + /** DistanceLimit costPerKilometerBelowSoftMax. */ + public costPerKilometerBelowSoftMax?: (number|null); + /** DistanceLimit costPerKilometerAboveSoftMax. */ public costPerKilometerAboveSoftMax?: (number|null); @@ -3967,6 +3974,9 @@ export namespace google { /** DistanceLimit _softMaxMeters. */ public _softMaxMeters?: "softMaxMeters"; + /** DistanceLimit _costPerKilometerBelowSoftMax. */ + public _costPerKilometerBelowSoftMax?: "costPerKilometerBelowSoftMax"; + /** DistanceLimit _costPerKilometerAboveSoftMax. */ public _costPerKilometerAboveSoftMax?: "costPerKilometerAboveSoftMax"; diff --git a/packages/google-cloud-optimization/protos/protos.js b/packages/google-cloud-optimization/protos/protos.js index f400bb5d3f9..422d3b9884d 100644 --- a/packages/google-cloud-optimization/protos/protos.js +++ b/packages/google-cloud-optimization/protos/protos.js @@ -1486,7 +1486,6 @@ * @property {google.protobuf.IDuration|null} [timeout] OptimizeToursRequest timeout * @property {google.cloud.optimization.v1.IShipmentModel|null} [model] OptimizeToursRequest model * @property {google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode|null} [solvingMode] OptimizeToursRequest solvingMode - * @property {number|null} [maxValidationErrors] OptimizeToursRequest maxValidationErrors * @property {google.cloud.optimization.v1.OptimizeToursRequest.SearchMode|null} [searchMode] OptimizeToursRequest searchMode * @property {Array.|null} [injectedFirstSolutionRoutes] OptimizeToursRequest injectedFirstSolutionRoutes * @property {google.cloud.optimization.v1.IInjectedSolutionConstraint|null} [injectedSolutionConstraint] OptimizeToursRequest injectedSolutionConstraint @@ -1498,6 +1497,7 @@ * @property {boolean|null} [allowLargeDeadlineDespiteInterruptionRisk] OptimizeToursRequest allowLargeDeadlineDespiteInterruptionRisk * @property {boolean|null} [useGeodesicDistances] OptimizeToursRequest useGeodesicDistances * @property {number|null} [geodesicMetersPerSecond] OptimizeToursRequest geodesicMetersPerSecond + * @property {number|null} [maxValidationErrors] OptimizeToursRequest maxValidationErrors * @property {string|null} [label] OptimizeToursRequest label * @property {boolean|null} [populateTravelStepPolylines] OptimizeToursRequest populateTravelStepPolylines */ @@ -1551,14 +1551,6 @@ */ OptimizeToursRequest.prototype.solvingMode = 0; - /** - * OptimizeToursRequest maxValidationErrors. - * @member {number|null|undefined} maxValidationErrors - * @memberof google.cloud.optimization.v1.OptimizeToursRequest - * @instance - */ - OptimizeToursRequest.prototype.maxValidationErrors = null; - /** * OptimizeToursRequest searchMode. * @member {google.cloud.optimization.v1.OptimizeToursRequest.SearchMode} searchMode @@ -1647,6 +1639,14 @@ */ OptimizeToursRequest.prototype.geodesicMetersPerSecond = null; + /** + * OptimizeToursRequest maxValidationErrors. + * @member {number|null|undefined} maxValidationErrors + * @memberof google.cloud.optimization.v1.OptimizeToursRequest + * @instance + */ + OptimizeToursRequest.prototype.maxValidationErrors = null; + /** * OptimizeToursRequest label. * @member {string} label @@ -1667,24 +1667,24 @@ var $oneOfFields; /** - * OptimizeToursRequest _maxValidationErrors. - * @member {"maxValidationErrors"|undefined} _maxValidationErrors + * OptimizeToursRequest _geodesicMetersPerSecond. + * @member {"geodesicMetersPerSecond"|undefined} _geodesicMetersPerSecond * @memberof google.cloud.optimization.v1.OptimizeToursRequest * @instance */ - Object.defineProperty(OptimizeToursRequest.prototype, "_maxValidationErrors", { - get: $util.oneOfGetter($oneOfFields = ["maxValidationErrors"]), + Object.defineProperty(OptimizeToursRequest.prototype, "_geodesicMetersPerSecond", { + get: $util.oneOfGetter($oneOfFields = ["geodesicMetersPerSecond"]), set: $util.oneOfSetter($oneOfFields) }); /** - * OptimizeToursRequest _geodesicMetersPerSecond. - * @member {"geodesicMetersPerSecond"|undefined} _geodesicMetersPerSecond + * OptimizeToursRequest _maxValidationErrors. + * @member {"maxValidationErrors"|undefined} _maxValidationErrors * @memberof google.cloud.optimization.v1.OptimizeToursRequest * @instance */ - Object.defineProperty(OptimizeToursRequest.prototype, "_geodesicMetersPerSecond", { - get: $util.oneOfGetter($oneOfFields = ["geodesicMetersPerSecond"]), + Object.defineProperty(OptimizeToursRequest.prototype, "_maxValidationErrors", { + get: $util.oneOfGetter($oneOfFields = ["maxValidationErrors"]), set: $util.oneOfSetter($oneOfFields) }); @@ -1800,10 +1800,6 @@ message.solvingMode = reader.int32(); break; } - case 5: { - message.maxValidationErrors = reader.int32(); - break; - } case 6: { message.searchMode = reader.int32(); break; @@ -1852,6 +1848,10 @@ message.geodesicMetersPerSecond = reader.double(); break; } + case 5: { + message.maxValidationErrors = reader.int32(); + break; + } case 17: { message.label = reader.string(); break; @@ -1918,11 +1918,6 @@ case 2: break; } - if (message.maxValidationErrors != null && message.hasOwnProperty("maxValidationErrors")) { - properties._maxValidationErrors = 1; - if (!$util.isInteger(message.maxValidationErrors)) - return "maxValidationErrors: integer expected"; - } if (message.searchMode != null && message.hasOwnProperty("searchMode")) switch (message.searchMode) { default: @@ -1978,6 +1973,11 @@ if (typeof message.geodesicMetersPerSecond !== "number") return "geodesicMetersPerSecond: number expected"; } + if (message.maxValidationErrors != null && message.hasOwnProperty("maxValidationErrors")) { + properties._maxValidationErrors = 1; + if (!$util.isInteger(message.maxValidationErrors)) + return "maxValidationErrors: integer expected"; + } if (message.label != null && message.hasOwnProperty("label")) if (!$util.isString(message.label)) return "label: string expected"; @@ -2031,8 +2031,6 @@ message.solvingMode = 2; break; } - if (object.maxValidationErrors != null) - message.maxValidationErrors = object.maxValidationErrors | 0; switch (object.searchMode) { default: if (typeof object.searchMode === "number") { @@ -2092,6 +2090,8 @@ message.useGeodesicDistances = Boolean(object.useGeodesicDistances); if (object.geodesicMetersPerSecond != null) message.geodesicMetersPerSecond = Number(object.geodesicMetersPerSecond); + if (object.maxValidationErrors != null) + message.maxValidationErrors = object.maxValidationErrors | 0; if (object.label != null) message.label = String(object.label); if (object.populateTravelStepPolylines != null) @@ -8893,6 +8893,7 @@ return "travelMode: enum value expected"; case 0: case 1: + case 2: break; } if (message.startLocation != null && message.hasOwnProperty("startLocation")) { @@ -9086,6 +9087,10 @@ case 1: message.travelMode = 1; break; + case "WALKING": + case 2: + message.travelMode = 2; + break; } if (object.startLocation != null) { if (typeof object.startLocation !== "object") @@ -9428,11 +9433,13 @@ * @enum {number} * @property {number} TRAVEL_MODE_UNSPECIFIED=0 TRAVEL_MODE_UNSPECIFIED value * @property {number} DRIVING=1 DRIVING value + * @property {number} WALKING=2 WALKING value */ Vehicle.TravelMode = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "TRAVEL_MODE_UNSPECIFIED"] = 0; values[valuesById[1] = "DRIVING"] = 1; + values[valuesById[2] = "WALKING"] = 2; return values; })(); @@ -11343,6 +11350,7 @@ * @interface IDistanceLimit * @property {number|Long|null} [maxMeters] DistanceLimit maxMeters * @property {number|Long|null} [softMaxMeters] DistanceLimit softMaxMeters + * @property {number|null} [costPerKilometerBelowSoftMax] DistanceLimit costPerKilometerBelowSoftMax * @property {number|null} [costPerKilometerAboveSoftMax] DistanceLimit costPerKilometerAboveSoftMax */ @@ -11377,6 +11385,14 @@ */ DistanceLimit.prototype.softMaxMeters = null; + /** + * DistanceLimit costPerKilometerBelowSoftMax. + * @member {number|null|undefined} costPerKilometerBelowSoftMax + * @memberof google.cloud.optimization.v1.DistanceLimit + * @instance + */ + DistanceLimit.prototype.costPerKilometerBelowSoftMax = null; + /** * DistanceLimit costPerKilometerAboveSoftMax. * @member {number|null|undefined} costPerKilometerAboveSoftMax @@ -11410,6 +11426,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * DistanceLimit _costPerKilometerBelowSoftMax. + * @member {"costPerKilometerBelowSoftMax"|undefined} _costPerKilometerBelowSoftMax + * @memberof google.cloud.optimization.v1.DistanceLimit + * @instance + */ + Object.defineProperty(DistanceLimit.prototype, "_costPerKilometerBelowSoftMax", { + get: $util.oneOfGetter($oneOfFields = ["costPerKilometerBelowSoftMax"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * DistanceLimit _costPerKilometerAboveSoftMax. * @member {"costPerKilometerAboveSoftMax"|undefined} _costPerKilometerAboveSoftMax @@ -11451,6 +11478,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.softMaxMeters); if (message.costPerKilometerAboveSoftMax != null && Object.hasOwnProperty.call(message, "costPerKilometerAboveSoftMax")) writer.uint32(/* id 3, wireType 1 =*/25).double(message.costPerKilometerAboveSoftMax); + if (message.costPerKilometerBelowSoftMax != null && Object.hasOwnProperty.call(message, "costPerKilometerBelowSoftMax")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.costPerKilometerBelowSoftMax); return writer; }; @@ -11493,6 +11522,10 @@ message.softMaxMeters = reader.int64(); break; } + case 4: { + message.costPerKilometerBelowSoftMax = reader.double(); + break; + } case 3: { message.costPerKilometerAboveSoftMax = reader.double(); break; @@ -11543,6 +11576,11 @@ if (!$util.isInteger(message.softMaxMeters) && !(message.softMaxMeters && $util.isInteger(message.softMaxMeters.low) && $util.isInteger(message.softMaxMeters.high))) return "softMaxMeters: integer|Long expected"; } + if (message.costPerKilometerBelowSoftMax != null && message.hasOwnProperty("costPerKilometerBelowSoftMax")) { + properties._costPerKilometerBelowSoftMax = 1; + if (typeof message.costPerKilometerBelowSoftMax !== "number") + return "costPerKilometerBelowSoftMax: number expected"; + } if (message.costPerKilometerAboveSoftMax != null && message.hasOwnProperty("costPerKilometerAboveSoftMax")) { properties._costPerKilometerAboveSoftMax = 1; if (typeof message.costPerKilometerAboveSoftMax !== "number") @@ -11581,6 +11619,8 @@ message.softMaxMeters = object.softMaxMeters; else if (typeof object.softMaxMeters === "object") message.softMaxMeters = new $util.LongBits(object.softMaxMeters.low >>> 0, object.softMaxMeters.high >>> 0).toNumber(); + if (object.costPerKilometerBelowSoftMax != null) + message.costPerKilometerBelowSoftMax = Number(object.costPerKilometerBelowSoftMax); if (object.costPerKilometerAboveSoftMax != null) message.costPerKilometerAboveSoftMax = Number(object.costPerKilometerAboveSoftMax); return message; @@ -11620,6 +11660,11 @@ if (options.oneofs) object._costPerKilometerAboveSoftMax = "costPerKilometerAboveSoftMax"; } + if (message.costPerKilometerBelowSoftMax != null && message.hasOwnProperty("costPerKilometerBelowSoftMax")) { + object.costPerKilometerBelowSoftMax = options.json && !isFinite(message.costPerKilometerBelowSoftMax) ? String(message.costPerKilometerBelowSoftMax) : message.costPerKilometerBelowSoftMax; + if (options.oneofs) + object._costPerKilometerBelowSoftMax = "costPerKilometerBelowSoftMax"; + } return object; }; diff --git a/packages/google-cloud-optimization/protos/protos.json b/packages/google-cloud-optimization/protos/protos.json index 381127a8f06..606f6778c93 100644 --- a/packages/google-cloud-optimization/protos/protos.json +++ b/packages/google-cloud-optimization/protos/protos.json @@ -174,14 +174,14 @@ }, "OptimizeToursRequest": { "oneofs": { - "_maxValidationErrors": { + "_geodesicMetersPerSecond": { "oneof": [ - "maxValidationErrors" + "geodesicMetersPerSecond" ] }, - "_geodesicMetersPerSecond": { + "_maxValidationErrors": { "oneof": [ - "geodesicMetersPerSecond" + "maxValidationErrors" ] } }, @@ -205,13 +205,6 @@ "type": "SolvingMode", "id": 4 }, - "maxValidationErrors": { - "type": "int32", - "id": 5, - "options": { - "proto3_optional": true - } - }, "searchMode": { "type": "SearchMode", "id": 6 @@ -261,6 +254,13 @@ "proto3_optional": true } }, + "maxValidationErrors": { + "type": "int32", + "id": 5, + "options": { + "proto3_optional": true + } + }, "label": { "type": "string", "id": 17 @@ -986,7 +986,8 @@ "TravelMode": { "values": { "TRAVEL_MODE_UNSPECIFIED": 0, - "DRIVING": 1 + "DRIVING": 1, + "WALKING": 2 } }, "UnloadingPolicy": { @@ -1208,6 +1209,11 @@ "softMaxMeters" ] }, + "_costPerKilometerBelowSoftMax": { + "oneof": [ + "costPerKilometerBelowSoftMax" + ] + }, "_costPerKilometerAboveSoftMax": { "oneof": [ "costPerKilometerAboveSoftMax" @@ -1229,6 +1235,13 @@ "proto3_optional": true } }, + "costPerKilometerBelowSoftMax": { + "type": "double", + "id": 4, + "options": { + "proto3_optional": true + } + }, "costPerKilometerAboveSoftMax": { "type": "double", "id": 3, diff --git a/packages/google-cloud-optimization/samples/generated/v1/fleet_routing.optimize_tours.js b/packages/google-cloud-optimization/samples/generated/v1/fleet_routing.optimize_tours.js index 0caaa8a2573..001b961600a 100644 --- a/packages/google-cloud-optimization/samples/generated/v1/fleet_routing.optimize_tours.js +++ b/packages/google-cloud-optimization/samples/generated/v1/fleet_routing.optimize_tours.js @@ -50,16 +50,6 @@ function main(parent) { * By default, the solving mode is `DEFAULT_SOLVE` (0). */ // const solvingMode = {} - /** - * Truncates the number of validation errors returned. These errors are - * typically attached to an INVALID_ARGUMENT error payload as a BadRequest - * error detail (https://cloud.google.com/apis/design/errors#error_details), - * unless solving_mode=VALIDATE_ONLY: see the - * OptimizeToursResponse.validation_errors google.cloud.optimization.v1.OptimizeToursResponse.validation_errors - * field. - * This defaults to 100 and is capped at 10,000. - */ - // const maxValidationErrors = 1234 /** * Search mode used to solve the request. */ @@ -220,6 +210,16 @@ function main(parent) { * meters/seconds. */ // const geodesicMetersPerSecond = 1234 + /** + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * OptimizeToursResponse.validation_errors google.cloud.optimization.v1.OptimizeToursResponse.validation_errors + * field. + * This defaults to 100 and is capped at 10,000. + */ + // const maxValidationErrors = 1234 /** * Label that may be used to identify this request, reported back in the * OptimizeToursResponse.request_label google.cloud.optimization.v1.OptimizeToursResponse.request_label. diff --git a/packages/google-cloud-optimization/samples/generated/v1/snippet_metadata_google.cloud.optimization.v1.json b/packages/google-cloud-optimization/samples/generated/v1/snippet_metadata_google.cloud.optimization.v1.json index 005e8a9a1f1..ad97ec199b2 100644 --- a/packages/google-cloud-optimization/samples/generated/v1/snippet_metadata_google.cloud.optimization.v1.json +++ b/packages/google-cloud-optimization/samples/generated/v1/snippet_metadata_google.cloud.optimization.v1.json @@ -47,10 +47,6 @@ "name": "solving_mode", "type": ".google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode" }, - { - "name": "max_validation_errors", - "type": "TYPE_INT32" - }, { "name": "search_mode", "type": ".google.cloud.optimization.v1.OptimizeToursRequest.SearchMode" @@ -95,6 +91,10 @@ "name": "geodesic_meters_per_second", "type": "TYPE_DOUBLE" }, + { + "name": "max_validation_errors", + "type": "TYPE_INT32" + }, { "name": "label", "type": "TYPE_STRING" diff --git a/packages/google-cloud-optimization/src/v1/fleet_routing_client.ts b/packages/google-cloud-optimization/src/v1/fleet_routing_client.ts index 3e783af1a08..a826c693d26 100644 --- a/packages/google-cloud-optimization/src/v1/fleet_routing_client.ts +++ b/packages/google-cloud-optimization/src/v1/fleet_routing_client.ts @@ -394,14 +394,6 @@ export class FleetRoutingClient { * Shipment model to solve. * @param {google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode} request.solvingMode * By default, the solving mode is `DEFAULT_SOLVE` (0). - * @param {number} request.maxValidationErrors - * Truncates the number of validation errors returned. These errors are - * typically attached to an INVALID_ARGUMENT error payload as a BadRequest - * error detail (https://cloud.google.com/apis/design/errors#error_details), - * unless solving_mode=VALIDATE_ONLY: see the - * {@link protos.google.cloud.optimization.v1.OptimizeToursResponse.validation_errors|OptimizeToursResponse.validation_errors} - * field. - * This defaults to 100 and is capped at 10,000. * @param {google.cloud.optimization.v1.OptimizeToursRequest.SearchMode} request.searchMode * Search mode used to solve the request. * @param {number[]} request.injectedFirstSolutionRoutes @@ -556,6 +548,14 @@ export class FleetRoutingClient { * When `use_geodesic_distances` is true, this field must be set and defines * the speed applied to compute travel times. Its value must be at least 1.0 * meters/seconds. + * @param {number} request.maxValidationErrors + * Truncates the number of validation errors returned. These errors are + * typically attached to an INVALID_ARGUMENT error payload as a BadRequest + * error detail (https://cloud.google.com/apis/design/errors#error_details), + * unless solving_mode=VALIDATE_ONLY: see the + * {@link protos.google.cloud.optimization.v1.OptimizeToursResponse.validation_errors|OptimizeToursResponse.validation_errors} + * field. + * This defaults to 100 and is capped at 10,000. * @param {string} request.label * Label that may be used to identify this request, reported back in the * {@link protos.google.cloud.optimization.v1.OptimizeToursResponse.request_label|OptimizeToursResponse.request_label}.