@googlemaps/routeoptimization 0.1.0
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.
- package/CHANGELOG.md +10 -0
- package/LICENSE +202 -0
- package/README.md +365 -0
- package/build/protos/google/maps/routeoptimization/v1/route_optimization_service.proto +2537 -0
- package/build/protos/protos.d.ts +13382 -0
- package/build/protos/protos.js +36681 -0
- package/build/protos/protos.json +3583 -0
- package/build/src/index.d.ts +11 -0
- package/build/src/index.js +28 -0
- package/build/src/index.js.map +1 -0
- package/build/src/v1/index.d.ts +1 -0
- package/build/src/v1/index.js +23 -0
- package/build/src/v1/index.js.map +1 -0
- package/build/src/v1/route_optimization_client.d.ts +529 -0
- package/build/src/v1/route_optimization_client.js +508 -0
- package/build/src/v1/route_optimization_client.js.map +1 -0
- package/build/src/v1/route_optimization_client_config.json +47 -0
- package/package.json +70 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as v1 from './v1';
|
|
2
|
+
declare const RouteOptimizationClient: typeof v1.RouteOptimizationClient;
|
|
3
|
+
type RouteOptimizationClient = v1.RouteOptimizationClient;
|
|
4
|
+
export { v1, RouteOptimizationClient };
|
|
5
|
+
declare const _default: {
|
|
6
|
+
v1: typeof v1;
|
|
7
|
+
RouteOptimizationClient: typeof v1.RouteOptimizationClient;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
import * as protos from '../protos/protos';
|
|
11
|
+
export { protos };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2024 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
|
+
// https://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
|
+
//
|
|
16
|
+
// ** This file is automatically generated by synthtool. **
|
|
17
|
+
// ** https://github.com/googleapis/synthtool **
|
|
18
|
+
// ** All changes to this file may be overwritten. **
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.protos = exports.RouteOptimizationClient = exports.v1 = void 0;
|
|
21
|
+
const v1 = require("./v1");
|
|
22
|
+
exports.v1 = v1;
|
|
23
|
+
const RouteOptimizationClient = v1.RouteOptimizationClient;
|
|
24
|
+
exports.RouteOptimizationClient = RouteOptimizationClient;
|
|
25
|
+
exports.default = { v1, RouteOptimizationClient };
|
|
26
|
+
const protos = require("../protos/protos");
|
|
27
|
+
exports.protos = protos;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,kDAAkD;AAClD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,2DAA2D;AAC3D,gDAAgD;AAChD,qDAAqD;;;AAErD,2BAA2B;AAKnB,gBAAE;AAHV,MAAM,uBAAuB,GAAG,EAAE,CAAC,uBAAuB,CAAC;AAG/C,0DAAuB;AACnC,kBAAe,EAAC,EAAE,EAAE,uBAAuB,EAAC,CAAC;AAC7C,2CAA2C;AACnC,wBAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RouteOptimizationClient } from './route_optimization_client';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2024 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
|
+
// https://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
|
+
//
|
|
16
|
+
// ** This file is automatically generated by gapic-generator-typescript. **
|
|
17
|
+
// ** https://github.com/googleapis/gapic-generator-typescript **
|
|
18
|
+
// ** All changes to this file may be overwritten. **
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.RouteOptimizationClient = void 0;
|
|
21
|
+
var route_optimization_client_1 = require("./route_optimization_client");
|
|
22
|
+
Object.defineProperty(exports, "RouteOptimizationClient", { enumerable: true, get: function () { return route_optimization_client_1.RouteOptimizationClient; } });
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,kDAAkD;AAClD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,4EAA4E;AAC5E,iEAAiE;AACjE,qDAAqD;;;AAErD,yEAAoE;AAA5D,oIAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
import type * as gax from 'google-gax';
|
|
2
|
+
import type { Callback, CallOptions, Descriptors, ClientOptions, LROperation } from 'google-gax';
|
|
3
|
+
import * as protos from '../../protos/protos';
|
|
4
|
+
/**
|
|
5
|
+
* A service for optimizing vehicle tours.
|
|
6
|
+
*
|
|
7
|
+
* Validity of certain types of fields:
|
|
8
|
+
*
|
|
9
|
+
* * `google.protobuf.Timestamp`
|
|
10
|
+
* * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
|
|
11
|
+
* * seconds must be in [0, 253402300799],
|
|
12
|
+
* i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
|
|
13
|
+
* * nanos must be unset or set to 0.
|
|
14
|
+
* * `google.protobuf.Duration`
|
|
15
|
+
* * seconds must be in [0, 253402300799],
|
|
16
|
+
* i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
|
|
17
|
+
* * nanos must be unset or set to 0.
|
|
18
|
+
* * `google.type.LatLng`
|
|
19
|
+
* * latitude must be in [-90.0, 90.0].
|
|
20
|
+
* * longitude must be in [-180.0, 180.0].
|
|
21
|
+
* * at least one of latitude and longitude must be non-zero.
|
|
22
|
+
*
|
|
23
|
+
* @class
|
|
24
|
+
* @memberof v1
|
|
25
|
+
*/
|
|
26
|
+
export declare class RouteOptimizationClient {
|
|
27
|
+
private _terminated;
|
|
28
|
+
private _opts;
|
|
29
|
+
private _providedCustomServicePath;
|
|
30
|
+
private _gaxModule;
|
|
31
|
+
private _gaxGrpc;
|
|
32
|
+
private _protos;
|
|
33
|
+
private _defaults;
|
|
34
|
+
private _universeDomain;
|
|
35
|
+
private _servicePath;
|
|
36
|
+
auth: gax.GoogleAuth;
|
|
37
|
+
descriptors: Descriptors;
|
|
38
|
+
warn: (code: string, message: string, warnType?: string) => void;
|
|
39
|
+
innerApiCalls: {
|
|
40
|
+
[name: string]: Function;
|
|
41
|
+
};
|
|
42
|
+
operationsClient: gax.OperationsClient;
|
|
43
|
+
routeOptimizationStub?: Promise<{
|
|
44
|
+
[name: string]: Function;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Construct an instance of RouteOptimizationClient.
|
|
48
|
+
*
|
|
49
|
+
* @param {object} [options] - The configuration object.
|
|
50
|
+
* The options accepted by the constructor are described in detail
|
|
51
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
52
|
+
* The common options are:
|
|
53
|
+
* @param {object} [options.credentials] - Credentials object.
|
|
54
|
+
* @param {string} [options.credentials.client_email]
|
|
55
|
+
* @param {string} [options.credentials.private_key]
|
|
56
|
+
* @param {string} [options.email] - Account email address. Required when
|
|
57
|
+
* using a .pem or .p12 keyFilename.
|
|
58
|
+
* @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
|
|
59
|
+
* .p12 key downloaded from the Google Developers Console. If you provide
|
|
60
|
+
* a path to a JSON file, the projectId option below is not necessary.
|
|
61
|
+
* NOTE: .pem and .p12 require you to specify options.email as well.
|
|
62
|
+
* @param {number} [options.port] - The port on which to connect to
|
|
63
|
+
* the remote host.
|
|
64
|
+
* @param {string} [options.projectId] - The project ID from the Google
|
|
65
|
+
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
|
66
|
+
* the environment variable GCLOUD_PROJECT for your project ID. If your
|
|
67
|
+
* app is running in an environment which supports
|
|
68
|
+
* {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
|
|
69
|
+
* your project ID will be detected automatically.
|
|
70
|
+
* @param {string} [options.apiEndpoint] - The domain name of the
|
|
71
|
+
* API remote host.
|
|
72
|
+
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
73
|
+
* Follows the structure of {@link gapicConfig}.
|
|
74
|
+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
|
75
|
+
* For more information, please check the
|
|
76
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
77
|
+
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
|
78
|
+
* need to avoid loading the default gRPC version and want to use the fallback
|
|
79
|
+
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
|
80
|
+
* ```
|
|
81
|
+
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
|
82
|
+
* const client = new RouteOptimizationClient({fallback: true}, gax);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
|
|
86
|
+
/**
|
|
87
|
+
* Initialize the client.
|
|
88
|
+
* Performs asynchronous operations (such as authentication) and prepares the client.
|
|
89
|
+
* This function will be called automatically when any class method is called for the
|
|
90
|
+
* first time, but if you need to initialize it before calling an actual method,
|
|
91
|
+
* feel free to call initialize() directly.
|
|
92
|
+
*
|
|
93
|
+
* You can await on this method if you want to make sure the client is initialized.
|
|
94
|
+
*
|
|
95
|
+
* @returns {Promise} A promise that resolves to an authenticated service stub.
|
|
96
|
+
*/
|
|
97
|
+
initialize(): Promise<{
|
|
98
|
+
[name: string]: Function;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* The DNS address for this API service.
|
|
102
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
103
|
+
* @returns {string} The DNS address for this service.
|
|
104
|
+
*/
|
|
105
|
+
static get servicePath(): string;
|
|
106
|
+
/**
|
|
107
|
+
* The DNS address for this API service - same as servicePath.
|
|
108
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
109
|
+
* @returns {string} The DNS address for this service.
|
|
110
|
+
*/
|
|
111
|
+
static get apiEndpoint(): string;
|
|
112
|
+
/**
|
|
113
|
+
* The DNS address for this API service.
|
|
114
|
+
* @returns {string} The DNS address for this service.
|
|
115
|
+
*/
|
|
116
|
+
get apiEndpoint(): string;
|
|
117
|
+
get universeDomain(): string;
|
|
118
|
+
/**
|
|
119
|
+
* The port for this API service.
|
|
120
|
+
* @returns {number} The default port for this service.
|
|
121
|
+
*/
|
|
122
|
+
static get port(): number;
|
|
123
|
+
/**
|
|
124
|
+
* The scopes needed to make gRPC calls for every method defined
|
|
125
|
+
* in this service.
|
|
126
|
+
* @returns {string[]} List of default scopes.
|
|
127
|
+
*/
|
|
128
|
+
static get scopes(): string[];
|
|
129
|
+
getProjectId(): Promise<string>;
|
|
130
|
+
getProjectId(callback: Callback<string, undefined, undefined>): void;
|
|
131
|
+
/**
|
|
132
|
+
* Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
|
|
133
|
+
* `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
|
|
134
|
+
* routes to be performed by vehicles minimizing the overall cost.
|
|
135
|
+
*
|
|
136
|
+
* A `ShipmentModel` model consists mainly of `Shipment`s that need to be
|
|
137
|
+
* carried out and `Vehicle`s that can be used to transport the `Shipment`s.
|
|
138
|
+
* The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
|
|
139
|
+
* they assign a series of `Visit`s to each vehicle, where a `Visit`
|
|
140
|
+
* corresponds to a `VisitRequest`, which is a pickup or delivery for a
|
|
141
|
+
* `Shipment`.
|
|
142
|
+
*
|
|
143
|
+
* The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
|
|
144
|
+
* minimizes the total cost where cost has many components defined in the
|
|
145
|
+
* `ShipmentModel`.
|
|
146
|
+
*
|
|
147
|
+
* @param {Object} request
|
|
148
|
+
* The request object that will be sent.
|
|
149
|
+
* @param {string} request.parent
|
|
150
|
+
* Required. Target project or location to make a call.
|
|
151
|
+
*
|
|
152
|
+
* Format:
|
|
153
|
+
* * `projects/{project-id}`
|
|
154
|
+
* * `projects/{project-id}/locations/{location-id}`
|
|
155
|
+
*
|
|
156
|
+
* If no location is specified, a region will be chosen automatically.
|
|
157
|
+
* @param {google.protobuf.Duration} request.timeout
|
|
158
|
+
* If this timeout is set, the server returns a response before the timeout
|
|
159
|
+
* period has elapsed or the server deadline for synchronous requests is
|
|
160
|
+
* reached, whichever is sooner.
|
|
161
|
+
*
|
|
162
|
+
* For asynchronous requests, the server will generate a solution (if
|
|
163
|
+
* possible) before the timeout has elapsed.
|
|
164
|
+
* @param {google.maps.routeoptimization.v1.ShipmentModel} request.model
|
|
165
|
+
* Shipment model to solve.
|
|
166
|
+
* @param {google.maps.routeoptimization.v1.OptimizeToursRequest.SolvingMode} request.solvingMode
|
|
167
|
+
* By default, the solving mode is `DEFAULT_SOLVE` (0).
|
|
168
|
+
* @param {google.maps.routeoptimization.v1.OptimizeToursRequest.SearchMode} request.searchMode
|
|
169
|
+
* Search mode used to solve the request.
|
|
170
|
+
* @param {number[]} request.injectedFirstSolutionRoutes
|
|
171
|
+
* Guide the optimization algorithm in finding a first solution that is
|
|
172
|
+
* similar to a previous solution.
|
|
173
|
+
*
|
|
174
|
+
* The model is constrained when the first solution is built.
|
|
175
|
+
* Any shipments not performed on a route are implicitly skipped in the first
|
|
176
|
+
* solution, but they may be performed in successive solutions.
|
|
177
|
+
*
|
|
178
|
+
* The solution must satisfy some basic validity assumptions:
|
|
179
|
+
*
|
|
180
|
+
* * for all routes, `vehicle_index` must be in range and not be duplicated.
|
|
181
|
+
* * for all visits, `shipment_index` and `visit_request_index` must be
|
|
182
|
+
* in range.
|
|
183
|
+
* * a shipment may only be referenced on one route.
|
|
184
|
+
* * the pickup of a pickup-delivery shipment must be performed before
|
|
185
|
+
* the delivery.
|
|
186
|
+
* * no more than one pickup alternative or delivery alternative of
|
|
187
|
+
* a shipment may be performed.
|
|
188
|
+
* * for all routes, times are increasing (i.e., `vehicle_start_time
|
|
189
|
+
* <= visits[0].start_time <= visits[1].start_time ...
|
|
190
|
+
* <= vehicle_end_time`).
|
|
191
|
+
* * a shipment may only be performed on a vehicle that is allowed. A
|
|
192
|
+
* vehicle is allowed if
|
|
193
|
+
* {@link protos.google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices|Shipment.allowed_vehicle_indices}
|
|
194
|
+
* is empty or its `vehicle_index` is included in
|
|
195
|
+
* {@link protos.google.maps.routeoptimization.v1.Shipment.allowed_vehicle_indices|Shipment.allowed_vehicle_indices}.
|
|
196
|
+
*
|
|
197
|
+
* If the injected solution is not feasible, a validation error is not
|
|
198
|
+
* necessarily returned and an error indicating infeasibility may be returned
|
|
199
|
+
* instead.
|
|
200
|
+
* @param {google.maps.routeoptimization.v1.InjectedSolutionConstraint} request.injectedSolutionConstraint
|
|
201
|
+
* Constrain the optimization algorithm to find a final solution that is
|
|
202
|
+
* similar to a previous solution. For example, this may be used to freeze
|
|
203
|
+
* portions of routes which have already been completed or which are to be
|
|
204
|
+
* completed but must not be modified.
|
|
205
|
+
*
|
|
206
|
+
* If the injected solution is not feasible, a validation error is not
|
|
207
|
+
* necessarily returned and an error indicating infeasibility may be returned
|
|
208
|
+
* instead.
|
|
209
|
+
* @param {number[]} request.refreshDetailsRoutes
|
|
210
|
+
* If non-empty, the given routes will be refreshed, without modifying their
|
|
211
|
+
* underlying sequence of visits or travel times: only other details will be
|
|
212
|
+
* updated. This does not solve the model.
|
|
213
|
+
*
|
|
214
|
+
* As of 2020/11, this only populates the polylines of non-empty routes and
|
|
215
|
+
* requires that `populate_polylines` is true.
|
|
216
|
+
*
|
|
217
|
+
* The `route_polyline` fields of the passed-in routes may be inconsistent
|
|
218
|
+
* with route `transitions`.
|
|
219
|
+
*
|
|
220
|
+
* This field must not be used together with `injected_first_solution_routes`
|
|
221
|
+
* or `injected_solution_constraint`.
|
|
222
|
+
*
|
|
223
|
+
* `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
|
|
224
|
+
* Polylines are still populated between all visits in all non-empty routes
|
|
225
|
+
* regardless of whether the related shipments or vehicles are ignored.
|
|
226
|
+
* @param {boolean} request.interpretInjectedSolutionsUsingLabels
|
|
227
|
+
* If true:
|
|
228
|
+
*
|
|
229
|
+
* * uses
|
|
230
|
+
* {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label|ShipmentRoute.vehicle_label}
|
|
231
|
+
* instead of `vehicle_index` to
|
|
232
|
+
* match routes in an injected solution with vehicles in the request;
|
|
233
|
+
* reuses the mapping of original
|
|
234
|
+
* {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index|ShipmentRoute.vehicle_index}
|
|
235
|
+
* to new
|
|
236
|
+
* {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.vehicle_index|ShipmentRoute.vehicle_index}
|
|
237
|
+
* to update
|
|
238
|
+
* {@link protos.google.maps.routeoptimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices|ConstraintRelaxation.vehicle_indices}
|
|
239
|
+
* if non-empty, but the mapping must be unambiguous (i.e., multiple
|
|
240
|
+
* `ShipmentRoute`s must not share the same original `vehicle_index`).
|
|
241
|
+
* * uses
|
|
242
|
+
* {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label|ShipmentRoute.Visit.shipment_label}
|
|
243
|
+
* instead of `shipment_index`
|
|
244
|
+
* to match visits in an injected solution with shipments in the request;
|
|
245
|
+
* * uses
|
|
246
|
+
* {@link protos.google.maps.routeoptimization.v1.SkippedShipment.label|SkippedShipment.label}
|
|
247
|
+
* instead of
|
|
248
|
+
* {@link protos.google.maps.routeoptimization.v1.SkippedShipment.index|SkippedShipment.index}
|
|
249
|
+
* to
|
|
250
|
+
* match skipped shipments in the injected solution with request
|
|
251
|
+
* shipments.
|
|
252
|
+
*
|
|
253
|
+
* This interpretation applies to the `injected_first_solution_routes`,
|
|
254
|
+
* `injected_solution_constraint`, and `refresh_details_routes` fields.
|
|
255
|
+
* It can be used when shipment or vehicle indices in the request have
|
|
256
|
+
* changed since the solution was created, perhaps because shipments or
|
|
257
|
+
* vehicles have been removed from or added to the request.
|
|
258
|
+
*
|
|
259
|
+
* If true, labels in the following categories must appear at most once in
|
|
260
|
+
* their category:
|
|
261
|
+
*
|
|
262
|
+
* * {@link protos.google.maps.routeoptimization.v1.Vehicle.label|Vehicle.label} in the
|
|
263
|
+
* request;
|
|
264
|
+
* * {@link protos.google.maps.routeoptimization.v1.Shipment.label|Shipment.label} in
|
|
265
|
+
* the request;
|
|
266
|
+
* * {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.vehicle_label|ShipmentRoute.vehicle_label} in the injected solution;
|
|
267
|
+
* * {@link protos.google.maps.routeoptimization.v1.SkippedShipment.label|SkippedShipment.label} and {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.Visit.shipment_label|ShipmentRoute.Visit.shipment_label} in
|
|
268
|
+
* the injected solution (except pickup/delivery visit pairs, whose
|
|
269
|
+
* `shipment_label` must appear twice).
|
|
270
|
+
*
|
|
271
|
+
* If a `vehicle_label` in the injected solution does not correspond to a
|
|
272
|
+
* request vehicle, the corresponding route is removed from the solution
|
|
273
|
+
* along with its visits. If a `shipment_label` in the injected solution does
|
|
274
|
+
* not correspond to a request shipment, the corresponding visit is removed
|
|
275
|
+
* from the solution. If a
|
|
276
|
+
* {@link protos.google.maps.routeoptimization.v1.SkippedShipment.label|SkippedShipment.label}
|
|
277
|
+
* in the injected solution does not correspond to a request shipment, the
|
|
278
|
+
* `SkippedShipment` is removed from the solution.
|
|
279
|
+
*
|
|
280
|
+
* Removing route visits or entire routes from an injected solution may
|
|
281
|
+
* have an effect on the implied constraints, which may lead to change in
|
|
282
|
+
* solution, validation errors, or infeasibility.
|
|
283
|
+
*
|
|
284
|
+
* NOTE: The caller must ensure that each
|
|
285
|
+
* {@link protos.google.maps.routeoptimization.v1.Vehicle.label|Vehicle.label} (resp.
|
|
286
|
+
* {@link protos.google.maps.routeoptimization.v1.Shipment.label|Shipment.label}) uniquely
|
|
287
|
+
* identifies a vehicle (resp. shipment) entity used across the two relevant
|
|
288
|
+
* requests: the past request that produced the `OptimizeToursResponse` used
|
|
289
|
+
* in the injected solution and the current request that includes the injected
|
|
290
|
+
* solution. The uniqueness checks described above are not enough to guarantee
|
|
291
|
+
* this requirement.
|
|
292
|
+
* @param {boolean} request.considerRoadTraffic
|
|
293
|
+
* Consider traffic estimation in calculating `ShipmentRoute` fields
|
|
294
|
+
* {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration|Transition.travel_duration},
|
|
295
|
+
* {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.Visit.start_time|Visit.start_time},
|
|
296
|
+
* and `vehicle_end_time`; in setting the
|
|
297
|
+
* {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.has_traffic_infeasibilities|ShipmentRoute.has_traffic_infeasibilities}
|
|
298
|
+
* field, and in calculating the
|
|
299
|
+
* {@link protos.google.maps.routeoptimization.v1.OptimizeToursResponse.total_cost|OptimizeToursResponse.total_cost}
|
|
300
|
+
* field.
|
|
301
|
+
* @param {boolean} request.populatePolylines
|
|
302
|
+
* If true, polylines will be populated in response `ShipmentRoute`s.
|
|
303
|
+
* @param {boolean} request.populateTransitionPolylines
|
|
304
|
+
* If true, polylines will be populated in response
|
|
305
|
+
* {@link protos.google.maps.routeoptimization.v1.ShipmentRoute.transitions|ShipmentRoute.transitions}.
|
|
306
|
+
* @param {boolean} request.allowLargeDeadlineDespiteInterruptionRisk
|
|
307
|
+
* If this is set, then the request can have a deadline
|
|
308
|
+
* (see https://grpc.io/blog/deadlines) of up to 60 minutes.
|
|
309
|
+
* Otherwise, the maximum deadline is only 30 minutes.
|
|
310
|
+
* Note that long-lived requests have a significantly larger (but still small)
|
|
311
|
+
* risk of interruption.
|
|
312
|
+
* @param {boolean} request.useGeodesicDistances
|
|
313
|
+
* If true, travel distances will be computed using geodesic distances instead
|
|
314
|
+
* of Google Maps distances, and travel times will be computed using geodesic
|
|
315
|
+
* distances with a speed defined by `geodesic_meters_per_second`.
|
|
316
|
+
* @param {number} request.geodesicMetersPerSecond
|
|
317
|
+
* When `use_geodesic_distances` is true, this field must be set and defines
|
|
318
|
+
* the speed applied to compute travel times. Its value must be at least 1.0
|
|
319
|
+
* meters/seconds.
|
|
320
|
+
* @param {number} request.maxValidationErrors
|
|
321
|
+
* Truncates the number of validation errors returned. These errors are
|
|
322
|
+
* typically attached to an INVALID_ARGUMENT error payload as a BadRequest
|
|
323
|
+
* error detail (https://cloud.google.com/apis/design/errors#error_details),
|
|
324
|
+
* unless solving_mode=VALIDATE_ONLY: see the
|
|
325
|
+
* {@link protos.google.maps.routeoptimization.v1.OptimizeToursResponse.validation_errors|OptimizeToursResponse.validation_errors}
|
|
326
|
+
* field.
|
|
327
|
+
* This defaults to 100 and is capped at 10,000.
|
|
328
|
+
* @param {string} request.label
|
|
329
|
+
* Label that may be used to identify this request, reported back in the
|
|
330
|
+
* {@link protos.google.maps.routeoptimization.v1.OptimizeToursResponse.request_label|OptimizeToursResponse.request_label}.
|
|
331
|
+
* @param {object} [options]
|
|
332
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
333
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
334
|
+
* The first element of the array is an object representing {@link protos.google.maps.routeoptimization.v1.OptimizeToursResponse|OptimizeToursResponse}.
|
|
335
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
336
|
+
* for more details and examples.
|
|
337
|
+
* @example <caption>include:samples/generated/v1/route_optimization.optimize_tours.js</caption>
|
|
338
|
+
* region_tag:routeoptimization_v1_generated_RouteOptimization_OptimizeTours_async
|
|
339
|
+
*/
|
|
340
|
+
optimizeTours(request?: protos.google.maps.routeoptimization.v1.IOptimizeToursRequest, options?: CallOptions): Promise<[
|
|
341
|
+
protos.google.maps.routeoptimization.v1.IOptimizeToursResponse,
|
|
342
|
+
protos.google.maps.routeoptimization.v1.IOptimizeToursRequest | undefined,
|
|
343
|
+
{} | undefined
|
|
344
|
+
]>;
|
|
345
|
+
optimizeTours(request: protos.google.maps.routeoptimization.v1.IOptimizeToursRequest, options: CallOptions, callback: Callback<protos.google.maps.routeoptimization.v1.IOptimizeToursResponse, protos.google.maps.routeoptimization.v1.IOptimizeToursRequest | null | undefined, {} | null | undefined>): void;
|
|
346
|
+
optimizeTours(request: protos.google.maps.routeoptimization.v1.IOptimizeToursRequest, callback: Callback<protos.google.maps.routeoptimization.v1.IOptimizeToursResponse, protos.google.maps.routeoptimization.v1.IOptimizeToursRequest | null | undefined, {} | null | undefined>): void;
|
|
347
|
+
/**
|
|
348
|
+
* Optimizes vehicle tours for one or more `OptimizeToursRequest`
|
|
349
|
+
* messages as a batch.
|
|
350
|
+
*
|
|
351
|
+
* This method is a Long Running Operation (LRO). The inputs for optimization
|
|
352
|
+
* (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
|
|
353
|
+
* messages) are read/written from/to Cloud Storage in user-specified
|
|
354
|
+
* format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
|
|
355
|
+
* contains a `ShipmentModel` and returns an `OptimizeToursResponse`
|
|
356
|
+
* containing `ShipmentRoute`s, which are a set of routes to be performed by
|
|
357
|
+
* vehicles minimizing the overall cost.
|
|
358
|
+
*
|
|
359
|
+
* @param {Object} request
|
|
360
|
+
* The request object that will be sent.
|
|
361
|
+
* @param {string} request.parent
|
|
362
|
+
* Required. Target project and location to make a call.
|
|
363
|
+
*
|
|
364
|
+
* Format:
|
|
365
|
+
* * `projects/{project-id}`
|
|
366
|
+
* * `projects/{project-id}/locations/{location-id}`
|
|
367
|
+
*
|
|
368
|
+
* If no location is specified, a region will be chosen automatically.
|
|
369
|
+
* @param {number[]} request.modelConfigs
|
|
370
|
+
* Required. Input/Output information each purchase model, such as file paths
|
|
371
|
+
* and data formats.
|
|
372
|
+
* @param {object} [options]
|
|
373
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
374
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
375
|
+
* The first element of the array is an object representing
|
|
376
|
+
* a long running operation. Its `promise()` method returns a promise
|
|
377
|
+
* you can `await` for.
|
|
378
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
|
|
379
|
+
* for more details and examples.
|
|
380
|
+
* @example <caption>include:samples/generated/v1/route_optimization.batch_optimize_tours.js</caption>
|
|
381
|
+
* region_tag:routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_async
|
|
382
|
+
*/
|
|
383
|
+
batchOptimizeTours(request?: protos.google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, options?: CallOptions): Promise<[
|
|
384
|
+
LROperation<protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata>,
|
|
385
|
+
protos.google.longrunning.IOperation | undefined,
|
|
386
|
+
{} | undefined
|
|
387
|
+
]>;
|
|
388
|
+
batchOptimizeTours(request: protos.google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, options: CallOptions, callback: Callback<LROperation<protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
|
389
|
+
batchOptimizeTours(request: protos.google.maps.routeoptimization.v1.IBatchOptimizeToursRequest, callback: Callback<LROperation<protos.google.maps.routeoptimization.v1.IBatchOptimizeToursResponse, protos.google.maps.routeoptimization.v1.IBatchOptimizeToursMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
|
390
|
+
/**
|
|
391
|
+
* Check the status of the long running operation returned by `batchOptimizeTours()`.
|
|
392
|
+
* @param {String} name
|
|
393
|
+
* The operation name that will be passed.
|
|
394
|
+
* @returns {Promise} - The promise which resolves to an object.
|
|
395
|
+
* The decoded operation object has result and metadata field to get information from.
|
|
396
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
|
|
397
|
+
* for more details and examples.
|
|
398
|
+
* @example <caption>include:samples/generated/v1/route_optimization.batch_optimize_tours.js</caption>
|
|
399
|
+
* region_tag:routeoptimization_v1_generated_RouteOptimization_BatchOptimizeTours_async
|
|
400
|
+
*/
|
|
401
|
+
checkBatchOptimizeToursProgress(name: string): Promise<LROperation<protos.google.maps.routeoptimization.v1.BatchOptimizeToursResponse, protos.google.maps.routeoptimization.v1.BatchOptimizeToursMetadata>>;
|
|
402
|
+
/**
|
|
403
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
|
404
|
+
* method to poll the operation result at intervals as recommended by the API
|
|
405
|
+
* service.
|
|
406
|
+
*
|
|
407
|
+
* @param {Object} request - The request object that will be sent.
|
|
408
|
+
* @param {string} request.name - The name of the operation resource.
|
|
409
|
+
* @param {Object=} options
|
|
410
|
+
* Optional parameters. You can override the default settings for this call,
|
|
411
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
412
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
413
|
+
* for the details.
|
|
414
|
+
* @param {function(?Error, ?Object)=} callback
|
|
415
|
+
* The function which will be called with the result of the API call.
|
|
416
|
+
*
|
|
417
|
+
* The second parameter to the callback is an object representing
|
|
418
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
419
|
+
* @return {Promise} - The promise which resolves to an array.
|
|
420
|
+
* The first element of the array is an object representing
|
|
421
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
422
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* ```
|
|
426
|
+
* const client = longrunning.operationsClient();
|
|
427
|
+
* const name = '';
|
|
428
|
+
* const [response] = await client.getOperation({name});
|
|
429
|
+
* // doThingsWith(response)
|
|
430
|
+
* ```
|
|
431
|
+
*/
|
|
432
|
+
getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
|
|
433
|
+
/**
|
|
434
|
+
* Lists operations that match the specified filter in the request. If the
|
|
435
|
+
* server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
|
|
436
|
+
*
|
|
437
|
+
* For-await-of syntax is used with the iterable to recursively get response element on-demand.
|
|
438
|
+
*
|
|
439
|
+
* @param {Object} request - The request object that will be sent.
|
|
440
|
+
* @param {string} request.name - The name of the operation collection.
|
|
441
|
+
* @param {string} request.filter - The standard list filter.
|
|
442
|
+
* @param {number=} request.pageSize -
|
|
443
|
+
* The maximum number of resources contained in the underlying API
|
|
444
|
+
* response. If page streaming is performed per-resource, this
|
|
445
|
+
* parameter does not affect the return value. If page streaming is
|
|
446
|
+
* performed per-page, this determines the maximum number of
|
|
447
|
+
* resources in a page.
|
|
448
|
+
* @param {Object=} options
|
|
449
|
+
* Optional parameters. You can override the default settings for this call,
|
|
450
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
451
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
|
452
|
+
* details.
|
|
453
|
+
* @returns {Object}
|
|
454
|
+
* An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```
|
|
458
|
+
* const client = longrunning.operationsClient();
|
|
459
|
+
* for await (const response of client.listOperationsAsync(request));
|
|
460
|
+
* // doThingsWith(response)
|
|
461
|
+
* ```
|
|
462
|
+
*/
|
|
463
|
+
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
|
|
464
|
+
/**
|
|
465
|
+
* Starts asynchronous cancellation on a long-running operation. The server
|
|
466
|
+
* makes a best effort to cancel the operation, but success is not
|
|
467
|
+
* guaranteed. If the server doesn't support this method, it returns
|
|
468
|
+
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
|
469
|
+
* {@link Operations.GetOperation} or
|
|
470
|
+
* other methods to check whether the cancellation succeeded or whether the
|
|
471
|
+
* operation completed despite cancellation. On successful cancellation,
|
|
472
|
+
* the operation is not deleted; instead, it becomes an operation with
|
|
473
|
+
* an {@link Operation.error} value with a {@link google.rpc.Status.code} of
|
|
474
|
+
* 1, corresponding to `Code.CANCELLED`.
|
|
475
|
+
*
|
|
476
|
+
* @param {Object} request - The request object that will be sent.
|
|
477
|
+
* @param {string} request.name - The name of the operation resource to be cancelled.
|
|
478
|
+
* @param {Object=} options
|
|
479
|
+
* Optional parameters. You can override the default settings for this call,
|
|
480
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
481
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
|
482
|
+
* details.
|
|
483
|
+
* @param {function(?Error)=} callback
|
|
484
|
+
* The function which will be called with the result of the API call.
|
|
485
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
486
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
487
|
+
* call.
|
|
488
|
+
*
|
|
489
|
+
* @example
|
|
490
|
+
* ```
|
|
491
|
+
* const client = longrunning.operationsClient();
|
|
492
|
+
* await client.cancelOperation({name: ''});
|
|
493
|
+
* ```
|
|
494
|
+
*/
|
|
495
|
+
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
|
|
496
|
+
/**
|
|
497
|
+
* Deletes a long-running operation. This method indicates that the client is
|
|
498
|
+
* no longer interested in the operation result. It does not cancel the
|
|
499
|
+
* operation. If the server doesn't support this method, it returns
|
|
500
|
+
* `google.rpc.Code.UNIMPLEMENTED`.
|
|
501
|
+
*
|
|
502
|
+
* @param {Object} request - The request object that will be sent.
|
|
503
|
+
* @param {string} request.name - The name of the operation resource to be deleted.
|
|
504
|
+
* @param {Object=} options
|
|
505
|
+
* Optional parameters. You can override the default settings for this call,
|
|
506
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
507
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
508
|
+
* for the details.
|
|
509
|
+
* @param {function(?Error)=} callback
|
|
510
|
+
* The function which will be called with the result of the API call.
|
|
511
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
512
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
513
|
+
* call.
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```
|
|
517
|
+
* const client = longrunning.operationsClient();
|
|
518
|
+
* await client.deleteOperation({name: ''});
|
|
519
|
+
* ```
|
|
520
|
+
*/
|
|
521
|
+
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
|
|
522
|
+
/**
|
|
523
|
+
* Terminate the gRPC channel and close the client.
|
|
524
|
+
*
|
|
525
|
+
* The client will no longer be usable and all future behavior is undefined.
|
|
526
|
+
* @returns {Promise} A promise that resolves when the client is closed.
|
|
527
|
+
*/
|
|
528
|
+
close(): Promise<void>;
|
|
529
|
+
}
|