-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
delivery_api.proto
597 lines (531 loc) · 23 KB
/
delivery_api.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
// 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.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package maps.fleetengine.delivery.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/api/routing.proto";
import "google/geo/type/viewport.proto";
import "google/maps/fleetengine/delivery/v1/delivery_vehicles.proto";
import "google/maps/fleetengine/delivery/v1/header.proto";
import "google/maps/fleetengine/delivery/v1/task_tracking_info.proto";
import "google/maps/fleetengine/delivery/v1/tasks.proto";
import "google/protobuf/field_mask.proto";
option csharp_namespace = "Google.Maps.FleetEngine.Delivery.V1";
option go_package = "cloud.google.com/go/maps/fleetengine/delivery/apiv1/deliverypb;deliverypb";
option java_multiple_files = true;
option java_outer_classname = "DeliveryApi";
option java_package = "google.maps.fleetengine.delivery.v1";
option objc_class_prefix = "CFED";
option (google.api.resource_definition) = {
type: "fleetengine.googleapis.com/Provider"
pattern: "providers/{provider}"
};
// The Last Mile Delivery service.
service DeliveryService {
option (google.api.default_host) = "fleetengine.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Creates and returns a new `DeliveryVehicle`.
rpc CreateDeliveryVehicle(CreateDeliveryVehicleRequest)
returns (DeliveryVehicle) {
option (google.api.http) = {
post: "/v1/{parent=providers/*}/deliveryVehicles"
body: "delivery_vehicle"
};
option (google.api.routing) = {
routing_parameters {
field: "parent"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) =
"parent,delivery_vehicle,delivery_vehicle_id";
}
// Returns the specified `DeliveryVehicle` instance.
rpc GetDeliveryVehicle(GetDeliveryVehicleRequest) returns (DeliveryVehicle) {
option (google.api.http) = {
get: "/v1/{name=providers/*/deliveryVehicles/*}"
};
option (google.api.routing) = {
routing_parameters {
field: "name"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) = "name";
}
// Writes updated `DeliveryVehicle` data to Fleet Engine, and assigns
// `Tasks` to the `DeliveryVehicle`. You cannot update the name of the
// `DeliveryVehicle`. You *can* update `remaining_vehicle_journey_segments`
// though, but it must contain all of the `VehicleJourneySegment`s currently
// on the `DeliveryVehicle`. The `task_id`s are retrieved from
// `remaining_vehicle_journey_segments`, and their corresponding `Tasks` are
// assigned to the `DeliveryVehicle` if they have not yet been assigned.
rpc UpdateDeliveryVehicle(UpdateDeliveryVehicleRequest)
returns (DeliveryVehicle) {
option (google.api.http) = {
patch: "/v1/{delivery_vehicle.name=providers/*/deliveryVehicles/*}"
body: "delivery_vehicle"
};
option (google.api.routing) = {
routing_parameters {
field: "delivery_vehicle.name"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) = "delivery_vehicle,update_mask";
}
// Creates and returns a batch of new `Task` objects.
rpc BatchCreateTasks(BatchCreateTasksRequest)
returns (BatchCreateTasksResponse) {
option (google.api.http) = {
post: "/v1/{parent=providers/*}/tasks:batchCreate"
body: "*"
};
option (google.api.routing) = {
routing_parameters {
field: "parent"
path_template: "{provider_id=providers/*}"
}
};
}
// Creates and returns a new `Task` object.
rpc CreateTask(CreateTaskRequest) returns (Task) {
option (google.api.http) = {
post: "/v1/{parent=providers/*}/tasks"
body: "task"
};
option (google.api.routing) = {
routing_parameters {
field: "parent"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) = "parent,task,task_id";
}
// Gets information about a `Task`.
rpc GetTask(GetTaskRequest) returns (Task) {
option (google.api.http) = {
get: "/v1/{name=providers/*/tasks/*}"
};
option (google.api.routing) = {
routing_parameters {
field: "name"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) = "name";
}
// Deprecated: Use `GetTaskTrackingInfo` instead.
rpc SearchTasks(SearchTasksRequest) returns (SearchTasksResponse) {
option deprecated = true;
option (google.api.http) = {
get: "/v1/{parent=providers/*}/tasks:search"
};
option (google.api.routing) = {
routing_parameters {
field: "parent"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) = "parent";
}
// Updates `Task` data.
rpc UpdateTask(UpdateTaskRequest) returns (Task) {
option (google.api.http) = {
patch: "/v1/{task.name=providers/*/tasks/*}"
body: "task"
};
option (google.api.routing) = {
routing_parameters {
field: "task.name"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) = "task,update_mask";
}
// Gets all `Task`s that meet the specified filtering criteria.
rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) {
option (google.api.http) = {
get: "/v1/{parent=providers/*}/tasks"
};
option (google.api.routing) = {
routing_parameters {
field: "parent"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) = "parent";
}
// Returns the specified `TaskTrackingInfo` instance.
rpc GetTaskTrackingInfo(GetTaskTrackingInfoRequest)
returns (TaskTrackingInfo) {
option (google.api.http) = {
get: "/v1/{name=providers/*/taskTrackingInfo/*}"
};
option (google.api.routing) = {
routing_parameters {
field: "name"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) = "name";
}
// Gets all `DeliveryVehicle`s that meet the specified filtering criteria.
rpc ListDeliveryVehicles(ListDeliveryVehiclesRequest)
returns (ListDeliveryVehiclesResponse) {
option (google.api.http) = {
get: "/v1/{parent=providers/*}/deliveryVehicles"
};
option (google.api.routing) = {
routing_parameters {
field: "parent"
path_template: "{provider_id=providers/*}"
}
};
option (google.api.method_signature) = "parent";
}
}
// The `CreateDeliveryVehicle` request message.
message CreateDeliveryVehicleRequest {
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Must be in the format `providers/{provider}`. The provider must
// be the Google Cloud Project ID. For example, `sample-cloud-project`.
string parent = 3 [(google.api.field_behavior) = REQUIRED];
// Required. The Delivery Vehicle ID must be unique and subject to the
// following restrictions:
//
// * Must be a valid Unicode string.
// * Limited to a maximum length of 64 characters.
// * Normalized according to [Unicode Normalization Form C]
// (http://www.unicode.org/reports/tr15/).
// * May not contain any of the following ASCII characters: '/', ':', '?',
// ',', or '#'.
string delivery_vehicle_id = 4 [(google.api.field_behavior) = REQUIRED];
// Required. The `DeliveryVehicle` entity to create. When creating a new
// delivery vehicle, you may set the following optional fields:
//
// * last_location
// * attributes
//
// Note: The DeliveryVehicle's `name` field is ignored. All other
// DeliveryVehicle fields must not be set; otherwise, an error is returned.
DeliveryVehicle delivery_vehicle = 5 [(google.api.field_behavior) = REQUIRED];
}
// The `GetDeliveryVehicle` request message.
message GetDeliveryVehicleRequest {
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Must be in the format
// `providers/{provider}/deliveryVehicles/{delivery_vehicle}`.
// The `provider` must be the Google Cloud Project ID. For example,
// `sample-cloud-project`.
string name = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "fleetengine.googleapis.com/DeliveryVehicle"
}
];
}
// The `ListDeliveryVehicles` request message.
message ListDeliveryVehiclesRequest {
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Must be in the format `providers/{provider}`.
// The `provider` must be the Google Cloud Project ID.
// For example, `sample-cloud-project`.
string parent = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "fleetengine.googleapis.com/DeliveryVehicle"
}
];
// Optional. The maximum number of vehicles to return. The service may return
// fewer than this number. If you don't specify this number, then the server
// determines the number of results to return.
int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. A page token, received from a previous `ListDeliveryVehicles`
// call. You must provide this in order to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListDeliveryVehicles`
// must match the call that provided the page token.
string page_token = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. A filter query to apply when listing delivery vehicles. See
// http://aip.dev/160 for examples of the filter syntax. If you don't specify
// a value, or if you specify an empty string for the filter, then all
// delivery vehicles are returned.
//
// Note that the only queries supported for `ListDeliveryVehicles` are
// on vehicle attributes (for example, `attributes.<key> = <value>` or
// `attributes.<key1> = <value1> AND attributes.<key2> = <value2>`). Also, all
// attributes are stored as strings, so the only supported comparisons against
// attributes are string comparisons. In order to compare against number or
// boolean values, the values must be explicitly quoted to be treated as
// strings (for example, `attributes.<key> = "10"` or
// `attributes.<key> = "true"`).
//
// The maximum number of restrictions allowed in a filter query is 50. A
// restriction is a part of the query of the form
// `attribute.<KEY> <COMPARATOR> <VALUE>`, for example `attributes.foo = bar`
// is 1 restriction.
string filter = 6 [(google.api.field_behavior) = OPTIONAL];
// Optional. A filter that limits the vehicles returned to those whose last
// known location was in the rectangular area defined by the viewport.
google.geo.type.Viewport viewport = 7
[(google.api.field_behavior) = OPTIONAL];
}
// The `ListDeliveryVehicles` response message.
message ListDeliveryVehiclesResponse {
// The set of delivery vehicles that meet the requested filtering criteria.
// When no filter is specified, the request returns all delivery vehicles. A
// successful response can also be empty. An empty response indicates that no
// delivery vehicles were found meeting the requested filter criteria.
repeated DeliveryVehicle delivery_vehicles = 1;
// You can pass this token in the `ListDeliveryVehiclesRequest` to continue to
// list results. When all of the results are returned, this field won't be in
// the response, or it will be an empty string.
string next_page_token = 2;
// The total number of delivery vehicles that match the request criteria,
// across all pages.
int64 total_size = 3;
}
// The `UpdateDeliveryVehicle` request message.
message UpdateDeliveryVehicleRequest {
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. The `DeliveryVehicle` entity update to apply.
// Note: You cannot update the name of the `DeliveryVehicle`.
DeliveryVehicle delivery_vehicle = 3 [(google.api.field_behavior) = REQUIRED];
// Required. A field mask that indicates which `DeliveryVehicle` fields to
// update. Note that the update_mask must contain at least one field.
//
// This is a comma-separated list of fully qualified names of fields. Example:
// `"remaining_vehicle_journey_segments"`.
google.protobuf.FieldMask update_mask = 4
[(google.api.field_behavior) = REQUIRED];
}
// The `BatchCreateTask` request message.
message BatchCreateTasksRequest {
// Optional. The standard Delivery API request header.
// Note: If you set this field, then the header field in the
// `CreateTaskRequest` messages must either be empty, or it must match this
// field.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. The parent resource shared by all tasks. This value must be in
// the format `providers/{provider}`. The `provider` must be the Google Cloud
// Project ID. For example, `sample-cloud-project`. The parent field in the
// `CreateTaskRequest` messages must either be empty, or it must match this
// field.
string parent = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "fleetengine.googleapis.com/Task"
}
];
// Required. The request message that specifies the resources to create.
// Note: You can create a maximum of 500 tasks in a batch.
repeated CreateTaskRequest requests = 4
[(google.api.field_behavior) = REQUIRED];
}
// The `BatchCreateTask` response message.
message BatchCreateTasksResponse {
// The created Tasks.
repeated Task tasks = 1;
}
// The `CreateTask` request message.
message CreateTaskRequest {
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Must be in the format `providers/{provider}`. The `provider` must
// be the Google Cloud Project ID. For example, `sample-cloud-project`.
string parent = 3 [(google.api.field_behavior) = REQUIRED];
// Required. The Task ID must be unique, but it should be not a shipment
// tracking ID. To store a shipment tracking ID, use the `tracking_id` field.
// Note that multiple tasks can have the same `tracking_id`. Task IDs are
// subject to the following restrictions:
//
// * Must be a valid Unicode string.
// * Limited to a maximum length of 64 characters.
// * Normalized according to [Unicode Normalization Form C]
// (http://www.unicode.org/reports/tr15/).
// * May not contain any of the following ASCII characters: '/', ':', '?',
// ',', or '#'.
string task_id = 5 [(google.api.field_behavior) = REQUIRED];
// Required. The Task entity to create.
// When creating a Task, the following fields are required:
//
// * `type`
// * `state` (must be set to `OPEN`)
// * `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP`
// tasks, but required for all other task types)
// * `planned_location` (optional for `UNAVAILABLE` tasks)
// * `task_duration`
//
// Note: The Task's `name` field is ignored. All other Task fields must not be
// set; otherwise, an error is returned.
Task task = 4 [(google.api.field_behavior) = REQUIRED];
}
// The `GetTask` request message.
message GetTaskRequest {
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Must be in the format `providers/{provider}/tasks/{task}`. The
// `provider` must be the Google Cloud Project ID. For example,
// `sample-cloud-project`.
string name = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "fleetengine.googleapis.com/Task"
}
];
}
// Deprecated: Issue `GetTaskTrackingInfoRequest`s to `GetTaskTrackingInfo`
// instead.
message SearchTasksRequest {
option deprecated = true;
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Must be in the format `providers/{provider}`.
// The provider must be the Google Cloud Project ID. For example,
// `sample-cloud-project`.
string parent = 3 [(google.api.field_behavior) = REQUIRED];
// Required. The identifier of the set of related Tasks being requested.
// Tracking IDs are subject to the following restrictions:
//
// * Must be a valid Unicode string.
// * Limited to a maximum length of 64 characters.
// * Normalized according to [Unicode Normalization Form C]
// (http://www.unicode.org/reports/tr15/).
// * May not contain any of the following ASCII characters: '/', ':', '?',
// ',', or '#'.
string tracking_id = 4 [(google.api.field_behavior) = REQUIRED];
// Optional. The maximum number of Tasks to return. The service may return
// fewer than this value. If you don't specify this value, then the server
// determines the number of results to return.
int32 page_size = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. A page token, received from a previous `SearchTasks` call. You
// must provide this value to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `SearchTasks` must match
// the call that provided the page token.
string page_token = 6 [(google.api.field_behavior) = OPTIONAL];
}
// The `SearchTasks` response. It contains the set of Tasks that meet the search
// criteria in the `SearchTasksRequest`.
message SearchTasksResponse {
option deprecated = true;
// The set of Tasks for the requested `tracking_id`. A successful response can
// also be empty. An empty response indicates that no Tasks are associated
// with the supplied `tracking_id`.
repeated Task tasks = 1;
// Pass this token in the `SearchTasksRequest` to continue to
// list results. If all results have been returned, then this field is either
// an empty string, or it doesn't appear in the response.
string next_page_token = 2;
}
// The `UpdateTask` request message.
message UpdateTaskRequest {
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. The Task associated with the update.
// The following fields are maintained by Fleet Engine. Do not update
// them using `Task.update`.
//
// * `last_location`.
// * `last_location_snappable`.
// * `name`.
// * `remaining_vehicle_journey_segments`.
// * `task_outcome_location_source`.
//
// Note: You cannot change the value of `task_outcome` once you set it.
//
// If the Task has been assigned to a delivery vehicle, then don't set the
// Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop`
// that contains the Task from the delivery vehicle, which automatically sets
// the Task state to CLOSED.
Task task = 3 [(google.api.field_behavior) = REQUIRED];
// Required. The field mask that indicates which Task fields to update.
// Note: The `update_mask` must contain at least one field.
//
// This is a comma-separated list of fully qualified names of fields. Example:
// `"task_outcome,task_outcome_time,task_outcome_location"`.
google.protobuf.FieldMask update_mask = 4
[(google.api.field_behavior) = REQUIRED];
}
// The `ListTasks` request message.
message ListTasksRequest {
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Must be in the format `providers/{provider}`.
// The `provider` must be the Google Cloud Project ID. For example,
// `sample-cloud-project`.
string parent = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "fleetengine.googleapis.com/Task"
}
];
// Optional. The maximum number of Tasks to return. The service may return
// fewer than this value. If you don't specify this value, then the server
// determines the number of results to return.
int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. A page token received from a previous `ListTasks` call.
// You can provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListTasks` must match
// the call that provided the page token.
string page_token = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. A filter query to apply when listing Tasks. See
// http://aip.dev/160 for examples of filter syntax. If you don't specify a
// value, or if you filter on an empty string, then all Tasks are returned.
// For information about the Task properties that you can filter on, see [List
// tasks](https://developers.google.com/maps/documentation/transportation-logistics/last-mile-fleet-solution/fleet-performance/fleet-engine/deliveries_api#list-tasks).
string filter = 6 [(google.api.field_behavior) = OPTIONAL];
}
// The `ListTasks` response that contains the set of Tasks that meet the filter
// criteria in the `ListTasksRequest`.
message ListTasksResponse {
// The set of Tasks that meet the requested filtering criteria. When no filter
// is specified, the request returns all tasks. A successful response can also
// be empty. An empty response indicates that no Tasks were found meeting the
// requested filter criteria.
repeated Task tasks = 1;
// Pass this token in the `ListTasksRequest` to continue to list results.
// If all results have been returned, then this field is either an empty
// string, or it doesn't appear in the response.
string next_page_token = 2;
// The total number of Tasks that match the request criteria, across all
// pages.
int64 total_size = 3;
}
// The `GetTaskTrackingInfoRequest` request message.
message GetTaskTrackingInfoRequest {
// Optional. The standard Delivery API request header.
DeliveryRequestHeader header = 1 [(google.api.field_behavior) = OPTIONAL];
// Required. Must be in the format
// `providers/{provider}/taskTrackingInfo/{tracking_id}`. The `provider`
// must be the Google Cloud Project ID, and the `tracking_id` must be the
// tracking ID associated with the task. An example name can be
// `providers/sample-cloud-project/taskTrackingInfo/sample-tracking-id`.
string name = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "fleetengine.googleapis.com/TaskTrackingInfo"
}
];
}