123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548 |
- // Copyright 2022 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/tasks.proto";
- import "google/protobuf/field_mask.proto";
- option go_package = "google.golang.org/genproto/googleapis/maps/fleetengine/delivery/v1;delivery";
- 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";
- // 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";
- }
- // Gets all `Task`s with a particular `tracking_id`.
- rpc SearchTasks(SearchTasksRequest) returns (SearchTasksResponse) {
- 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";
- }
- // 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.
- // Next id: 4
- 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 search area to a rectangle defined by the
- // northeast and southwest corner points.
- //
- // When defined, only vehicles located within the search area are returned.
- 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"
- }
- ];
- }
- // The `SearchTasks` request message that contains the `tracking_id`.
- message SearchTasksRequest {
- // 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 {
- // 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
- // [Task
- // list](/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;
- }
|