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/maps/routes/v1/fallback_info.proto"; 20import "google/maps/routes/v1/route.proto"; 21import "google/protobuf/duration.proto"; 22import "google/rpc/status.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 = "ComputeRouteMatrixElementProto"; 29option java_package = "com.google.maps.routes.v1"; 30option objc_class_prefix = "GMRS"; 31option php_namespace = "Google\\Maps\\Routes\\V1"; 32 33// Encapsulates route information computed for an origin/destination pair in the 34// ComputeRouteMatrix API. This proto can be streamed to the client. 35message RouteMatrixElement { 36 // Zero-based index of the origin in the request. 37 int32 origin_index = 1; 38 39 // Zero-based index of the destination in the request. 40 int32 destination_index = 2; 41 42 // Error status code for this element. 43 google.rpc.Status status = 3; 44 45 // Indicates whether the route was found or not. Independent of status. 46 RouteMatrixElementCondition condition = 9; 47 48 // The travel distance of the route, in meters. 49 int32 distance_meters = 4; 50 51 // The length of time needed to navigate the route. If you set the 52 // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as 53 // `static_duration`. If you set the `routing_preference` to either 54 // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated 55 // taking traffic conditions into account. 56 google.protobuf.Duration duration = 5; 57 58 // The duration of traveling through the route without taking traffic 59 // conditions into consideration. 60 google.protobuf.Duration static_duration = 6; 61 62 // Additional information about the route. For example: restriction 63 // information and toll information 64 RouteTravelAdvisory travel_advisory = 7; 65 66 // In some cases when the server is not able to compute the route with the 67 // given preferences for this particular origin/destination pair, it may 68 // fall back to using a different mode of computation. When fallback mode is 69 // used, this field contains detailed information about the fallback response. 70 // Otherwise this field is unset. 71 FallbackInfo fallback_info = 8; 72} 73 74// The condition of the route being returned. 75enum RouteMatrixElementCondition { 76 // Only used when the `status` of the element is not OK. 77 ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0; 78 79 // A route was found, and the corresponding information was filled out for the 80 // element. 81 ROUTE_EXISTS = 1; 82 83 // No route could be found. Fields containing route information, such as 84 // `distance_meters` or `duration`, will not be filled out in the element. 85 ROUTE_NOT_FOUND = 2; 86} 87