• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15syntax = "proto3";
16
17package google.maps.routes.v1;
18
19import "google/api/field_behavior.proto";
20import "google/maps/routes/v1/compute_routes_request.proto";
21import "google/maps/routes/v1/waypoint.proto";
22import "google/protobuf/timestamp.proto";
23
24option cc_enable_arenas = true;
25option csharp_namespace = "Google.Maps.Routes.V1";
26option go_package = "cloud.google.com/go/maps/routes/apiv1/routespb;routespb";
27option java_multiple_files = true;
28option java_outer_classname = "ComputeRouteMatrixRequestProto";
29option java_package = "com.google.maps.routes.v1";
30option objc_class_prefix = "GMRS";
31option php_namespace = "Google\\Maps\\Routes\\V1";
32
33// ComputeRouteMatrix request message
34message ComputeRouteMatrixRequest {
35  // Required. Array of origins, which determines the rows of the response matrix.
36  // Several size restrictions apply to the cardinality of origins and
37  // destinations:
38  //
39  // * The number of elements (origins × destinations) must be no greater than
40  // 625 in any case.
41  // * The number of elements (origins × destinations) must be no greater than
42  // 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`.
43  // * The number of waypoints (origins + destinations) specified as `place_id`
44  // must be no greater than 50.
45  repeated RouteMatrixOrigin origins = 1 [(google.api.field_behavior) = REQUIRED];
46
47  // Required. Array of destinations, which determines the columns of the response matrix.
48  repeated RouteMatrixDestination destinations = 2 [(google.api.field_behavior) = REQUIRED];
49
50  // Optional. Specifies the mode of transportation.
51  RouteTravelMode travel_mode = 3 [(google.api.field_behavior) = OPTIONAL];
52
53  // Optional. Specifies how to compute the route. The server attempts to use the selected
54  // routing preference to compute the route. If the routing preference results
55  // in an error or an extra long latency, an error is returned. In the future,
56  // we might implement a fallback mechanism to use a different option when the
57  // preferred option does not give a valid result. You can specify this option
58  // only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the
59  // request fails.
60  RoutingPreference routing_preference = 4 [(google.api.field_behavior) = OPTIONAL];
61
62  // Optional. The departure time. If you don't set this value, this defaults to the time
63  // that you made the request. If you set this value to a time that has already
64  // occurred, the request fails.
65  google.protobuf.Timestamp departure_time = 5 [(google.api.field_behavior) = OPTIONAL];
66}
67
68// A single origin for ComputeRouteMatrixRequest
69message RouteMatrixOrigin {
70  // Required. Origin waypoint
71  Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED];
72
73  // Optional. Modifiers for every route that takes this as the origin
74  RouteModifiers route_modifiers = 2 [(google.api.field_behavior) = OPTIONAL];
75}
76
77// A single destination for ComputeRouteMatrixRequest
78message RouteMatrixDestination {
79  // Required. Destination waypoint
80  Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED];
81}
82