compute_custom_routes_request.proto 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 google.maps.routes.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/maps/routes/v1/compute_routes_request.proto";
  18. import "google/maps/routes/v1/polyline.proto";
  19. import "google/maps/routes/v1/waypoint.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option cc_enable_arenas = true;
  22. option csharp_namespace = "Google.Maps.Routes.V1";
  23. option go_package = "google.golang.org/genproto/googleapis/maps/routes/v1;routes";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "ComputeCustomRoutesRequestProto";
  26. option java_package = "com.google.maps.routes.v1";
  27. option objc_class_prefix = "GMRS";
  28. option php_namespace = "Google\\Maps\\Routes\\V1";
  29. // ComputeCustomRoutes request message.
  30. message ComputeCustomRoutesRequest {
  31. // Required. Origin waypoint.
  32. Waypoint origin = 1 [(google.api.field_behavior) = REQUIRED];
  33. // Required. Destination waypoint.
  34. Waypoint destination = 2 [(google.api.field_behavior) = REQUIRED];
  35. // Optional. A set of waypoints along the route (excluding terminal points), for either
  36. // stopping at or passing by. Up to 25 intermediate waypoints are supported.
  37. repeated Waypoint intermediates = 3 [(google.api.field_behavior) = OPTIONAL];
  38. // Optional. Specifies the mode of transportation. Only DRIVE is supported now.
  39. RouteTravelMode travel_mode = 4 [(google.api.field_behavior) = OPTIONAL];
  40. // Optional. Specifies how to compute the route. The server attempts to use the selected
  41. // routing preference to compute the route. If the routing preference results
  42. // in an error or an extra long latency, then an error is returned. In the
  43. // future, we might implement a fallback mechanism to use a different option
  44. // when the preferred option does not give a valid result. You can specify
  45. // this option only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`,
  46. // otherwise the request fails.
  47. RoutingPreference routing_preference = 5 [(google.api.field_behavior) = OPTIONAL];
  48. // Optional. Specifies your preference for the quality of the polyline.
  49. PolylineQuality polyline_quality = 6 [(google.api.field_behavior) = OPTIONAL];
  50. // Optional. Specifies the preferred encoding for the polyline.
  51. PolylineEncoding polyline_encoding = 13 [(google.api.field_behavior) = OPTIONAL];
  52. // Optional. The departure time. If you don't set this value, then this value
  53. // defaults to the time that you made the request. If you set this value to a
  54. // time that has already occurred, then the request fails.
  55. google.protobuf.Timestamp departure_time = 7 [(google.api.field_behavior) = OPTIONAL];
  56. // Optional. A set of conditions to satisfy that affect the way routes are calculated.
  57. RouteModifiers route_modifiers = 11 [(google.api.field_behavior) = OPTIONAL];
  58. // Required. A route objective to optimize for.
  59. RouteObjective route_objective = 12 [(google.api.field_behavior) = REQUIRED];
  60. // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
  61. // information, see
  62. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
  63. // [Language Support](https://developers.google.com/maps/faq#languagesupport)
  64. // for the list of supported languages. When you don't provide this value, the
  65. // display language is inferred from the location of the route request.
  66. string language_code = 9 [(google.api.field_behavior) = OPTIONAL];
  67. // Optional. Specifies the units of measure for the display fields. This includes the
  68. // `instruction` field in `NavigationInstruction`. The units of measure used
  69. // for the route, leg, step distance, and duration are not affected by this
  70. // value. If you don't provide this value, then the display units are inferred
  71. // from the location of the request.
  72. Units units = 10 [(google.api.field_behavior) = OPTIONAL];
  73. }
  74. // Encapsulates an objective to optimize for by ComputeCustomRoutes.
  75. message RouteObjective {
  76. // Encapsulates a RateCard route objective.
  77. message RateCard {
  78. // Encapsulates the cost used in the rate card.
  79. message MonetaryCost {
  80. // Required. The cost value in local currency inferred from the request.
  81. double value = 1 [(google.api.field_behavior) = REQUIRED];
  82. }
  83. // Optional. Cost per minute.
  84. MonetaryCost cost_per_minute = 2 [(google.api.field_behavior) = OPTIONAL];
  85. // Optional. Cost per kilometer.
  86. MonetaryCost cost_per_km = 3 [(google.api.field_behavior) = OPTIONAL];
  87. // Optional. Whether to include toll cost in the overall cost.
  88. bool include_tolls = 4 [(google.api.field_behavior) = OPTIONAL];
  89. }
  90. // Customized data layer that customers use to generated route annotations or
  91. // influence the generated route.
  92. message CustomLayer {
  93. // Information about a dataset that customers uploaded in advance. The
  94. // dataset information will be used for generating route annotations or to
  95. // influence routing.
  96. message DatasetInfo {
  97. // Required. ID of a customer uploaded dataset for which will be used to annotate or
  98. // influence the route. If the dataset does not exist or is not yet ready,
  99. // the request will fail.
  100. string dataset_id = 1 [(google.api.field_behavior) = REQUIRED];
  101. }
  102. // Required. A dataset that the customer uploaded in advance.
  103. DatasetInfo dataset_info = 1 [(google.api.field_behavior) = REQUIRED];
  104. }
  105. // The route objective.
  106. oneof objective {
  107. // The RateCard objective.
  108. RateCard rate_card = 1;
  109. }
  110. // Optional. Specifies the custom data layer being used to affect generated routes.
  111. // Customers can turn off the custom layer by not setting this field. Once a
  112. // custom layer is being set, the custom layer will be used to generate route
  113. // annotations (CustomLayerInfo) in the returned routes, the annotations can
  114. // be turned off using `X-Goog-FieldMask` header (see
  115. // https://cloud.google.com/apis/docs/system-parameters).
  116. CustomLayer custom_layer = 2 [(google.api.field_behavior) = OPTIONAL];
  117. }