delivery_vehicles.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package maps.fleetengine.delivery.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/maps/fleetengine/delivery/v1/common.proto";
  19. import "google/protobuf/duration.proto";
  20. import "google/protobuf/wrappers.proto";
  21. import "google/type/latlng.proto";
  22. option go_package = "google.golang.org/genproto/googleapis/maps/fleetengine/delivery/v1;delivery";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "DeliveryVehicles";
  25. option java_package = "google.maps.fleetengine.delivery.v1";
  26. option objc_class_prefix = "CFED";
  27. // The `DeliveryVehicle` message. A delivery vehicle transports shipments from a
  28. // depot to a delivery location, and from a pickup location to the depot. In
  29. // some cases, delivery vehicles also transport shipments directly from the
  30. // pickup location to the delivery location.
  31. //
  32. // Note: gRPC and REST APIs use different field naming conventions. For example,
  33. // the `DeliveryVehicle.current_route_segment` field in the gRPC API and the
  34. // `DeliveryVehicle.currentRouteSegment` field in the REST API refer to the same
  35. // field.
  36. message DeliveryVehicle {
  37. option (google.api.resource) = {
  38. type: "fleetengine.googleapis.com/DeliveryVehicle"
  39. pattern: "providers/{provider}/deliveryVehicles/{vehicle}"
  40. };
  41. // The unique name of this Delivery Vehicle.
  42. // The format is `providers/{provider}/deliveryVehicles/{vehicle}`.
  43. string name = 1;
  44. // The last reported location of the Delivery Vehicle.
  45. DeliveryVehicleLocation last_location = 2;
  46. // The Delivery Vehicle's navigation status.
  47. DeliveryVehicleNavigationStatus navigation_status = 3;
  48. // The encoded polyline specifying the route that the navigation recommends
  49. // taking to the next waypoint. Your driver app updates this when a
  50. // stop is reached or passed, and when the navigation reroutes. These LatLngs
  51. // are returned in
  52. // `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path`
  53. // (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path`
  54. // (REST) for all active Tasks assigned to the Vehicle.
  55. //
  56. // There are a few cases where this field might not be used to populate
  57. // `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path`
  58. // (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path`
  59. // (REST):
  60. //
  61. // * The endpoint of the `current_route_segment` does not match
  62. // `DeliveryVehicle.remaining_vehicle_journey_segments[0].stop` (gRPC) or
  63. // `DeliveryVehicle.remainingVehicleJourneySegments[0].stop` (REST).
  64. //
  65. // * The driver app has not updated its location recently, so the last
  66. // updated value for this field might be stale.
  67. //
  68. // * The driver app has recently updated its location, but the
  69. // `current_route_segment` is stale, and points to a previous vehicle stop.
  70. //
  71. // In these cases, Fleet Engine populates this field with a route from the
  72. // most recently passed VehicleStop to the upcoming VehicleStop to ensure that
  73. // the consumer of this field has the best available information on the
  74. // current path of the Delivery Vehicle.
  75. bytes current_route_segment = 4;
  76. // The location where the `current_route_segment` ends. This is not currently
  77. // populated by the driver app, but you can supply it on
  78. // `UpdateDeliveryVehicle` calls. It is either the LatLng from the upcoming
  79. // vehicle stop, or the last LatLng of the `current_route_segment`. Fleet
  80. // Engine will then do its best to interpolate to an actual `VehicleStop`.
  81. //
  82. // This field is ignored in `UpdateDeliveryVehicle` calls if the
  83. // `current_route_segment` field is empty.
  84. google.type.LatLng current_route_segment_end_point = 5;
  85. // The remaining driving distance for the `current_route_segment`.
  86. // This value is usually updated by the driver app because it is considered to
  87. // have more accurate information about the current route than Fleet Engine.
  88. // However, it might be populated by Fleet Engine. For more information, see
  89. // [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. This field is returned in
  90. // `Task.remaining_vehicle_journey_segments[0].driving_distance_meters` (gRPC)
  91. // or `Task.remainingVehicleJourneySegments[0].drivingDistanceMeters` (REST)
  92. // for all active Tasks assigned to the Delivery Vehicle.
  93. //
  94. // This field is ignored in `UpdateDeliveryVehicle` calls if the
  95. // `current_route_segment` field is empty.
  96. google.protobuf.Int32Value remaining_distance_meters = 6;
  97. // The remaining driving time for the `current_route_segment`.
  98. // This value is usually updated by the driver app because it is considered to
  99. // have more accurate information about the current route than Fleet Engine.
  100. // However, it might be populated by Fleet Engine. For more information, see
  101. // [DeliveryVehicle.current_route_segment][maps.fleetengine.delivery.v1.DeliveryVehicle.current_route_segment]. This field is
  102. // returned in `Task.remaining_vehicle_journey_segments[0].driving_duration`
  103. // (gRPC) or `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST)
  104. // for all active tasks assigned to the Delivery Vehicle.
  105. //
  106. // This field is ignored in `UpdateDeliveryVehicle` calls if the
  107. // `current_route_segment` field is empty.
  108. google.protobuf.Duration remaining_duration = 7;
  109. // The journey segments assigned to this Delivery Vehicle, starting from the
  110. // Vehicle's most recently reported location.
  111. repeated VehicleJourneySegment remaining_vehicle_journey_segments = 8;
  112. // A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have
  113. // at most 50 attributes, and each attribute must have a unique key.
  114. repeated DeliveryVehicleAttribute attributes = 9;
  115. }
  116. // A location with any additional identifiers.
  117. message LocationInfo {
  118. // The location's coordinates.
  119. google.type.LatLng point = 1;
  120. }
  121. // Represents a Vehicle’s travel segment - from its previous stop to the
  122. // current stop. If it is the first active stop, then it is from the
  123. // Vehicle’s current location to this stop.
  124. message VehicleJourneySegment {
  125. // Specifies the stop location, along with the Tasks associated with
  126. // the stop. Some fields of the VehicleStop might not be present if this
  127. // journey segment is part of `JourneySharingInfo`.
  128. VehicleStop stop = 1;
  129. // Output only. The travel distance from the previous stop to this stop.
  130. // If the current stop is the first stop in the list of journey
  131. // segments, then the starting point is the vehicle's location recorded
  132. // at the time that this stop was added to the list. This field might not be
  133. // present if this journey segment is part of `JourneySharingInfo`.
  134. google.protobuf.Int32Value driving_distance_meters = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  135. // Output only. The travel time from the previous stop to this stop.
  136. // If the current stop is the first stop in the list of journey
  137. // segments, then the starting point is the Vehicle's location recorded
  138. // at the time that this stop was added to the list.
  139. //
  140. // If this field is defined in the path
  141. // `Task.remaining_vehicle_journey_segments[0].driving_duration` (gRPC) or
  142. // `Task.remainingVehicleJourneySegments[0].drivingDuration` (REST),
  143. // then it may be populated with the value from
  144. // `DeliveryVehicle.remaining_duration` (gRPC) or
  145. // `DeliveryVehicle.remainingDuration` (REST).
  146. // This provides the remaining driving duration from the driver app's latest
  147. // known location rather than the driving time from the previous stop.
  148. google.protobuf.Duration driving_duration = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  149. // Output only. The path from the previous stop to this stop. If the current stop is the
  150. // first stop in the list of journey segments, then this is the path from the
  151. // vehicle's current location to this stop at the time that the stop was
  152. // added to the list. This field might not be present if this journey segment
  153. // is part of `JourneySharingInfo`.
  154. //
  155. // If this field is defined in the path
  156. // `Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path`
  157. // (gRPC) or `Task.journeySharingInfo.remainingVehicleJourneySegments[0].path`
  158. // (REST), then it may be populated with the LatLngs decoded from
  159. // `DeliveryVehicle.current_route_segment` (gRPC) or
  160. // `DeliveryVehicle.currentRouteSegment` (REST). This provides the driving
  161. // path from the driver app's latest known location rather than the path from
  162. // the previous stop.
  163. repeated google.type.LatLng path = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  164. }
  165. // Describes a point where a Vehicle stops to perform one or more Tasks.
  166. message VehicleStop {
  167. // Additional information about the Task performed at this stop.
  168. message TaskInfo {
  169. // The Task ID. This field won't be populated in the response of either a
  170. // `GetTask`, or a `SearchTasks` call. Task IDs are subject to the following
  171. // restrictions:
  172. //
  173. // * Must be a valid Unicode string.
  174. // * Limited to a maximum length of 64 characters.
  175. // * Normalized according to [Unicode Normalization Form C]
  176. // (http://www.unicode.org/reports/tr15/).
  177. // * May not contain any of the following ASCII characters: '/', ':', '?',
  178. // ',', or '#'.
  179. string task_id = 1;
  180. // The time required to perform the Task.
  181. google.protobuf.Duration task_duration = 2;
  182. }
  183. // The current state of a `VehicleStop`.
  184. enum State {
  185. // Unknown.
  186. STATE_UNSPECIFIED = 0;
  187. // Created, but not actively routing.
  188. NEW = 1;
  189. // Assigned and actively routing.
  190. ENROUTE = 2;
  191. // Arrived at stop. Assumes that when the Vehicle is routing to the next
  192. // stop, that all previous stops have been completed.
  193. ARRIVED = 3;
  194. }
  195. // Required. The location of the stop. Note that the locations in the Tasks might not
  196. // exactly match this location, but will be within a short distance of it.
  197. // This field won't be populated in the response of either a `GetTask`, or a
  198. // `SearchTasks` call.
  199. LocationInfo planned_location = 1 [(google.api.field_behavior) = REQUIRED];
  200. // The list of Tasks to be performed at this stop. This field won't be
  201. // populated in the response of either a `GetTask`, or a `SearchTasks` call.
  202. repeated TaskInfo tasks = 2;
  203. // The state of the `VehicleStop`. This field won't be populated in the
  204. // response of either a `GetTask`, or a `SearchTasks` call.
  205. State state = 3;
  206. }