#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::redundant_explicit_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_rpc;
extern crate google_cloud_type;
extern crate google_geo_type;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FallbackInfo {
pub routing_mode: crate::model::FallbackRoutingMode,
pub reason: crate::model::FallbackReason,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FallbackInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_routing_mode<T: std::convert::Into<crate::model::FallbackRoutingMode>>(
mut self,
v: T,
) -> Self {
self.routing_mode = v.into();
self
}
pub fn set_reason<T: std::convert::Into<crate::model::FallbackReason>>(mut self, v: T) -> Self {
self.reason = v.into();
self
}
}
impl wkt::message::Message for FallbackInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.FallbackInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GeocodingResults {
pub origin: std::option::Option<crate::model::GeocodedWaypoint>,
pub destination: std::option::Option<crate::model::GeocodedWaypoint>,
pub intermediates: std::vec::Vec<crate::model::GeocodedWaypoint>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GeocodingResults {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_origin<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GeocodedWaypoint>,
{
self.origin = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_origin<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GeocodedWaypoint>,
{
self.origin = v.map(|x| x.into());
self
}
pub fn set_destination<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GeocodedWaypoint>,
{
self.destination = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GeocodedWaypoint>,
{
self.destination = v.map(|x| x.into());
self
}
pub fn set_intermediates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GeocodedWaypoint>,
{
use std::iter::Iterator;
self.intermediates = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GeocodingResults {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.GeocodingResults"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GeocodedWaypoint {
pub geocoder_status: std::option::Option<google_cloud_rpc::model::Status>,
pub intermediate_waypoint_request_index: std::option::Option<i32>,
pub r#type: std::vec::Vec<std::string::String>,
pub partial_match: bool,
pub place_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GeocodedWaypoint {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_geocoder_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.geocoder_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_geocoder_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.geocoder_status = v.map(|x| x.into());
self
}
pub fn set_intermediate_waypoint_request_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.intermediate_waypoint_request_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_intermediate_waypoint_request_index<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<i32>,
{
self.intermediate_waypoint_request_index = v.map(|x| x.into());
self
}
pub fn set_type<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.r#type = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_partial_match<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.partial_match = v.into();
self
}
pub fn set_place_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.place_id = v.into();
self
}
}
impl wkt::message::Message for GeocodedWaypoint {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.GeocodedWaypoint"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocalizedTime {
pub time: std::option::Option<google_cloud_type::model::LocalizedText>,
pub time_zone: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LocalizedTime {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.time = v.map(|x| x.into());
self
}
pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time_zone = v.into();
self
}
}
impl wkt::message::Message for LocalizedTime {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.LocalizedTime"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Location {
pub lat_lng: std::option::Option<google_cloud_type::model::LatLng>,
pub heading: std::option::Option<wkt::Int32Value>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Location {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lat_lng<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LatLng>,
{
self.lat_lng = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_lat_lng<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LatLng>,
{
self.lat_lng = v.map(|x| x.into());
self
}
pub fn set_heading<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.heading = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_heading<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Int32Value>,
{
self.heading = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Location {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.Location"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NavigationInstruction {
pub maneuver: crate::model::Maneuver,
pub instructions: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NavigationInstruction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_maneuver<T: std::convert::Into<crate::model::Maneuver>>(mut self, v: T) -> Self {
self.maneuver = v.into();
self
}
pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instructions = v.into();
self
}
}
impl wkt::message::Message for NavigationInstruction {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.NavigationInstruction"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Polyline {
pub polyline_type: std::option::Option<crate::model::polyline::PolylineType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Polyline {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_polyline_type<
T: std::convert::Into<std::option::Option<crate::model::polyline::PolylineType>>,
>(
mut self,
v: T,
) -> Self {
self.polyline_type = v.into();
self
}
pub fn encoded_polyline(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.polyline_type.as_ref().and_then(|v| match v {
crate::model::polyline::PolylineType::EncodedPolyline(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_encoded_polyline<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.polyline_type = std::option::Option::Some(
crate::model::polyline::PolylineType::EncodedPolyline(v.into()),
);
self
}
pub fn geo_json_linestring(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
#[allow(unreachable_patterns)]
self.polyline_type.as_ref().and_then(|v| match v {
crate::model::polyline::PolylineType::GeoJsonLinestring(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_geo_json_linestring<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.polyline_type = std::option::Option::Some(
crate::model::polyline::PolylineType::GeoJsonLinestring(v.into()),
);
self
}
}
impl wkt::message::Message for Polyline {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.Polyline"
}
}
pub mod polyline {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PolylineType {
EncodedPolyline(std::string::String),
GeoJsonLinestring(std::boxed::Box<wkt::Struct>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolylineDetails {
pub tunnel_info: std::vec::Vec<crate::model::polyline_details::TunnelInfo>,
pub flyover_info: std::vec::Vec<crate::model::polyline_details::FlyoverInfo>,
pub narrow_road_info: std::vec::Vec<crate::model::polyline_details::NarrowRoadInfo>,
pub bridge_info: std::vec::Vec<crate::model::polyline_details::BridgeInfo>,
pub skyway_info: std::vec::Vec<crate::model::polyline_details::SkywayInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolylineDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tunnel_info<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::polyline_details::TunnelInfo>,
{
use std::iter::Iterator;
self.tunnel_info = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_flyover_info<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::polyline_details::FlyoverInfo>,
{
use std::iter::Iterator;
self.flyover_info = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_narrow_road_info<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::polyline_details::NarrowRoadInfo>,
{
use std::iter::Iterator;
self.narrow_road_info = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_bridge_info<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::polyline_details::BridgeInfo>,
{
use std::iter::Iterator;
self.bridge_info = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_skyway_info<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::polyline_details::SkywayInfo>,
{
use std::iter::Iterator;
self.skyway_info = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PolylineDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.PolylineDetails"
}
}
pub mod polyline_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolylinePointIndex {
pub start_index: std::option::Option<i32>,
pub end_index: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolylinePointIndex {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.start_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.start_index = v.map(|x| x.into());
self
}
pub fn set_end_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.end_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.end_index = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PolylinePointIndex {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.PolylineDetails.PolylinePointIndex"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TunnelInfo {
pub tunnel_presence: crate::model::polyline_details::RoadFeatureState,
pub polyline_point_index:
std::option::Option<crate::model::polyline_details::PolylinePointIndex>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TunnelInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tunnel_presence<
T: std::convert::Into<crate::model::polyline_details::RoadFeatureState>,
>(
mut self,
v: T,
) -> Self {
self.tunnel_presence = v.into();
self
}
pub fn set_polyline_point_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_polyline_point_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TunnelInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.PolylineDetails.TunnelInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BridgeInfo {
pub bridge_presence: crate::model::polyline_details::RoadFeatureState,
pub polyline_point_index:
std::option::Option<crate::model::polyline_details::PolylinePointIndex>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BridgeInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bridge_presence<
T: std::convert::Into<crate::model::polyline_details::RoadFeatureState>,
>(
mut self,
v: T,
) -> Self {
self.bridge_presence = v.into();
self
}
pub fn set_polyline_point_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_polyline_point_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BridgeInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.PolylineDetails.BridgeInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SkywayInfo {
pub skyway_presence: crate::model::polyline_details::RoadFeatureState,
pub polyline_point_index:
std::option::Option<crate::model::polyline_details::PolylinePointIndex>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SkywayInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_skyway_presence<
T: std::convert::Into<crate::model::polyline_details::RoadFeatureState>,
>(
mut self,
v: T,
) -> Self {
self.skyway_presence = v.into();
self
}
pub fn set_polyline_point_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_polyline_point_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SkywayInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.PolylineDetails.SkywayInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FlyoverInfo {
pub flyover_presence: crate::model::polyline_details::RoadFeatureState,
pub polyline_point_index:
std::option::Option<crate::model::polyline_details::PolylinePointIndex>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FlyoverInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_flyover_presence<
T: std::convert::Into<crate::model::polyline_details::RoadFeatureState>,
>(
mut self,
v: T,
) -> Self {
self.flyover_presence = v.into();
self
}
pub fn set_polyline_point_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_polyline_point_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for FlyoverInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.PolylineDetails.FlyoverInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NarrowRoadInfo {
pub narrow_road_presence: crate::model::polyline_details::RoadFeatureState,
pub polyline_point_index:
std::option::Option<crate::model::polyline_details::PolylinePointIndex>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NarrowRoadInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_narrow_road_presence<
T: std::convert::Into<crate::model::polyline_details::RoadFeatureState>,
>(
mut self,
v: T,
) -> Self {
self.narrow_road_presence = v.into();
self
}
pub fn set_polyline_point_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_polyline_point_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::polyline_details::PolylinePointIndex>,
{
self.polyline_point_index = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for NarrowRoadInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.PolylineDetails.NarrowRoadInfo"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RoadFeatureState {
Unspecified,
Exists,
DoesNotExist,
UnknownValue(road_feature_state::UnknownValue),
}
#[doc(hidden)]
pub mod road_feature_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RoadFeatureState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Exists => std::option::Option::Some(1),
Self::DoesNotExist => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ROAD_FEATURE_STATE_UNSPECIFIED"),
Self::Exists => std::option::Option::Some("EXISTS"),
Self::DoesNotExist => std::option::Option::Some("DOES_NOT_EXIST"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RoadFeatureState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RoadFeatureState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RoadFeatureState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Exists,
2 => Self::DoesNotExist,
_ => Self::UnknownValue(road_feature_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RoadFeatureState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ROAD_FEATURE_STATE_UNSPECIFIED" => Self::Unspecified,
"EXISTS" => Self::Exists,
"DOES_NOT_EXIST" => Self::DoesNotExist,
_ => Self::UnknownValue(road_feature_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RoadFeatureState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Exists => serializer.serialize_i32(1),
Self::DoesNotExist => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RoadFeatureState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoadFeatureState>::new(
".google.maps.routing.v2.PolylineDetails.RoadFeatureState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Route {
pub route_labels: std::vec::Vec<crate::model::RouteLabel>,
pub legs: std::vec::Vec<crate::model::RouteLeg>,
pub distance_meters: i32,
pub duration: std::option::Option<wkt::Duration>,
pub static_duration: std::option::Option<wkt::Duration>,
pub polyline: std::option::Option<crate::model::Polyline>,
pub description: std::string::String,
pub warnings: std::vec::Vec<std::string::String>,
pub viewport: std::option::Option<google_geo_type::model::Viewport>,
pub travel_advisory: std::option::Option<crate::model::RouteTravelAdvisory>,
pub optimized_intermediate_waypoint_index: std::vec::Vec<i32>,
pub localized_values: std::option::Option<crate::model::route::RouteLocalizedValues>,
pub route_token: std::string::String,
pub polyline_details: std::option::Option<crate::model::PolylineDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Route {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_route_labels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RouteLabel>,
{
use std::iter::Iterator;
self.route_labels = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_legs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RouteLeg>,
{
use std::iter::Iterator;
self.legs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_distance_meters<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.distance_meters = v.into();
self
}
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = v.map(|x| x.into());
self
}
pub fn set_static_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.static_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_static_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.static_duration = v.map(|x| x.into());
self
}
pub fn set_polyline<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Polyline>,
{
self.polyline = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_polyline<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Polyline>,
{
self.polyline = v.map(|x| x.into());
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_viewport<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_geo_type::model::Viewport>,
{
self.viewport = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_viewport<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_geo_type::model::Viewport>,
{
self.viewport = v.map(|x| x.into());
self
}
pub fn set_travel_advisory<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RouteTravelAdvisory>,
{
self.travel_advisory = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_travel_advisory<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RouteTravelAdvisory>,
{
self.travel_advisory = v.map(|x| x.into());
self
}
pub fn set_optimized_intermediate_waypoint_index<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<i32>,
{
use std::iter::Iterator;
self.optimized_intermediate_waypoint_index = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_localized_values<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::route::RouteLocalizedValues>,
{
self.localized_values = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_localized_values<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::route::RouteLocalizedValues>,
{
self.localized_values = v.map(|x| x.into());
self
}
pub fn set_route_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.route_token = v.into();
self
}
pub fn set_polyline_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PolylineDetails>,
{
self.polyline_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_polyline_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PolylineDetails>,
{
self.polyline_details = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Route {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.Route"
}
}
pub mod route {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteLocalizedValues {
pub distance: std::option::Option<google_cloud_type::model::LocalizedText>,
pub duration: std::option::Option<google_cloud_type::model::LocalizedText>,
pub static_duration: std::option::Option<google_cloud_type::model::LocalizedText>,
pub transit_fare: std::option::Option<google_cloud_type::model::LocalizedText>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteLocalizedValues {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_distance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.distance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_distance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.distance = v.map(|x| x.into());
self
}
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.duration = v.map(|x| x.into());
self
}
pub fn set_static_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.static_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_static_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.static_duration = v.map(|x| x.into());
self
}
pub fn set_transit_fare<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.transit_fare = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transit_fare<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.transit_fare = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RouteLocalizedValues {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.Route.RouteLocalizedValues"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteTravelAdvisory {
pub toll_info: std::option::Option<crate::model::TollInfo>,
pub speed_reading_intervals: std::vec::Vec<crate::model::SpeedReadingInterval>,
pub fuel_consumption_microliters: i64,
pub route_restrictions_partially_ignored: bool,
pub transit_fare: std::option::Option<google_cloud_type::model::Money>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteTravelAdvisory {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_toll_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TollInfo>,
{
self.toll_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_toll_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TollInfo>,
{
self.toll_info = v.map(|x| x.into());
self
}
pub fn set_speed_reading_intervals<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SpeedReadingInterval>,
{
use std::iter::Iterator;
self.speed_reading_intervals = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_fuel_consumption_microliters<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.fuel_consumption_microliters = v.into();
self
}
pub fn set_route_restrictions_partially_ignored<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.route_restrictions_partially_ignored = v.into();
self
}
pub fn set_transit_fare<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.transit_fare = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transit_fare<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Money>,
{
self.transit_fare = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RouteTravelAdvisory {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteTravelAdvisory"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteLegTravelAdvisory {
pub toll_info: std::option::Option<crate::model::TollInfo>,
pub speed_reading_intervals: std::vec::Vec<crate::model::SpeedReadingInterval>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteLegTravelAdvisory {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_toll_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TollInfo>,
{
self.toll_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_toll_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TollInfo>,
{
self.toll_info = v.map(|x| x.into());
self
}
pub fn set_speed_reading_intervals<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SpeedReadingInterval>,
{
use std::iter::Iterator;
self.speed_reading_intervals = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RouteLegTravelAdvisory {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLegTravelAdvisory"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteLegStepTravelAdvisory {
pub speed_reading_intervals: std::vec::Vec<crate::model::SpeedReadingInterval>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteLegStepTravelAdvisory {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_speed_reading_intervals<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SpeedReadingInterval>,
{
use std::iter::Iterator;
self.speed_reading_intervals = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RouteLegStepTravelAdvisory {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLegStepTravelAdvisory"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteLeg {
pub distance_meters: i32,
pub duration: std::option::Option<wkt::Duration>,
pub static_duration: std::option::Option<wkt::Duration>,
pub polyline: std::option::Option<crate::model::Polyline>,
pub start_location: std::option::Option<crate::model::Location>,
pub end_location: std::option::Option<crate::model::Location>,
pub steps: std::vec::Vec<crate::model::RouteLegStep>,
pub travel_advisory: std::option::Option<crate::model::RouteLegTravelAdvisory>,
pub localized_values: std::option::Option<crate::model::route_leg::RouteLegLocalizedValues>,
pub steps_overview: std::option::Option<crate::model::route_leg::StepsOverview>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteLeg {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_distance_meters<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.distance_meters = v.into();
self
}
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = v.map(|x| x.into());
self
}
pub fn set_static_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.static_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_static_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.static_duration = v.map(|x| x.into());
self
}
pub fn set_polyline<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Polyline>,
{
self.polyline = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_polyline<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Polyline>,
{
self.polyline = v.map(|x| x.into());
self
}
pub fn set_start_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.start_location = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.start_location = v.map(|x| x.into());
self
}
pub fn set_end_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.end_location = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.end_location = v.map(|x| x.into());
self
}
pub fn set_steps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RouteLegStep>,
{
use std::iter::Iterator;
self.steps = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_travel_advisory<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RouteLegTravelAdvisory>,
{
self.travel_advisory = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_travel_advisory<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RouteLegTravelAdvisory>,
{
self.travel_advisory = v.map(|x| x.into());
self
}
pub fn set_localized_values<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::route_leg::RouteLegLocalizedValues>,
{
self.localized_values = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_localized_values<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::route_leg::RouteLegLocalizedValues>,
{
self.localized_values = v.map(|x| x.into());
self
}
pub fn set_steps_overview<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::route_leg::StepsOverview>,
{
self.steps_overview = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_steps_overview<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::route_leg::StepsOverview>,
{
self.steps_overview = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RouteLeg {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLeg"
}
}
pub mod route_leg {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteLegLocalizedValues {
pub distance: std::option::Option<google_cloud_type::model::LocalizedText>,
pub duration: std::option::Option<google_cloud_type::model::LocalizedText>,
pub static_duration: std::option::Option<google_cloud_type::model::LocalizedText>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteLegLocalizedValues {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_distance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.distance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_distance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.distance = v.map(|x| x.into());
self
}
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.duration = v.map(|x| x.into());
self
}
pub fn set_static_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.static_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_static_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.static_duration = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RouteLegLocalizedValues {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLeg.RouteLegLocalizedValues"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StepsOverview {
pub multi_modal_segments:
std::vec::Vec<crate::model::route_leg::steps_overview::MultiModalSegment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StepsOverview {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_multi_modal_segments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::route_leg::steps_overview::MultiModalSegment>,
{
use std::iter::Iterator;
self.multi_modal_segments = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for StepsOverview {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLeg.StepsOverview"
}
}
pub mod steps_overview {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MultiModalSegment {
pub step_start_index: std::option::Option<i32>,
pub step_end_index: std::option::Option<i32>,
pub navigation_instruction: std::option::Option<crate::model::NavigationInstruction>,
pub travel_mode: crate::model::RouteTravelMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MultiModalSegment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_step_start_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.step_start_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_step_start_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.step_start_index = v.map(|x| x.into());
self
}
pub fn set_step_end_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.step_end_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_step_end_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.step_end_index = v.map(|x| x.into());
self
}
pub fn set_navigation_instruction<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NavigationInstruction>,
{
self.navigation_instruction = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_navigation_instruction<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::NavigationInstruction>,
{
self.navigation_instruction = v.map(|x| x.into());
self
}
pub fn set_travel_mode<T: std::convert::Into<crate::model::RouteTravelMode>>(
mut self,
v: T,
) -> Self {
self.travel_mode = v.into();
self
}
}
impl wkt::message::Message for MultiModalSegment {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLeg.StepsOverview.MultiModalSegment"
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteLegStep {
pub distance_meters: i32,
pub static_duration: std::option::Option<wkt::Duration>,
pub polyline: std::option::Option<crate::model::Polyline>,
pub start_location: std::option::Option<crate::model::Location>,
pub end_location: std::option::Option<crate::model::Location>,
pub navigation_instruction: std::option::Option<crate::model::NavigationInstruction>,
pub travel_advisory: std::option::Option<crate::model::RouteLegStepTravelAdvisory>,
pub localized_values:
std::option::Option<crate::model::route_leg_step::RouteLegStepLocalizedValues>,
pub transit_details: std::option::Option<crate::model::RouteLegStepTransitDetails>,
pub travel_mode: crate::model::RouteTravelMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteLegStep {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_distance_meters<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.distance_meters = v.into();
self
}
pub fn set_static_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.static_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_static_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.static_duration = v.map(|x| x.into());
self
}
pub fn set_polyline<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Polyline>,
{
self.polyline = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_polyline<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Polyline>,
{
self.polyline = v.map(|x| x.into());
self
}
pub fn set_start_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.start_location = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.start_location = v.map(|x| x.into());
self
}
pub fn set_end_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.end_location = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.end_location = v.map(|x| x.into());
self
}
pub fn set_navigation_instruction<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NavigationInstruction>,
{
self.navigation_instruction = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_navigation_instruction<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NavigationInstruction>,
{
self.navigation_instruction = v.map(|x| x.into());
self
}
pub fn set_travel_advisory<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RouteLegStepTravelAdvisory>,
{
self.travel_advisory = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_travel_advisory<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RouteLegStepTravelAdvisory>,
{
self.travel_advisory = v.map(|x| x.into());
self
}
pub fn set_localized_values<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::route_leg_step::RouteLegStepLocalizedValues>,
{
self.localized_values = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_localized_values<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::route_leg_step::RouteLegStepLocalizedValues>,
{
self.localized_values = v.map(|x| x.into());
self
}
pub fn set_transit_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RouteLegStepTransitDetails>,
{
self.transit_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transit_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RouteLegStepTransitDetails>,
{
self.transit_details = v.map(|x| x.into());
self
}
pub fn set_travel_mode<T: std::convert::Into<crate::model::RouteTravelMode>>(
mut self,
v: T,
) -> Self {
self.travel_mode = v.into();
self
}
}
impl wkt::message::Message for RouteLegStep {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLegStep"
}
}
pub mod route_leg_step {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteLegStepLocalizedValues {
pub distance: std::option::Option<google_cloud_type::model::LocalizedText>,
pub static_duration: std::option::Option<google_cloud_type::model::LocalizedText>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteLegStepLocalizedValues {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_distance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.distance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_distance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.distance = v.map(|x| x.into());
self
}
pub fn set_static_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.static_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_static_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.static_duration = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RouteLegStepLocalizedValues {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLegStep.RouteLegStepLocalizedValues"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteLegStepTransitDetails {
pub stop_details:
std::option::Option<crate::model::route_leg_step_transit_details::TransitStopDetails>,
pub localized_values: std::option::Option<
crate::model::route_leg_step_transit_details::TransitDetailsLocalizedValues,
>,
pub headsign: std::string::String,
pub headway: std::option::Option<wkt::Duration>,
pub transit_line: std::option::Option<crate::model::TransitLine>,
pub stop_count: i32,
pub trip_short_text: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteLegStepTransitDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_stop_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::route_leg_step_transit_details::TransitStopDetails>,
{
self.stop_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_stop_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::route_leg_step_transit_details::TransitStopDetails>,
{
self.stop_details = v.map(|x| x.into());
self
}
pub fn set_localized_values<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::route_leg_step_transit_details::TransitDetailsLocalizedValues,
>,
{
self.localized_values = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_localized_values<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::route_leg_step_transit_details::TransitDetailsLocalizedValues,
>,
{
self.localized_values = v.map(|x| x.into());
self
}
pub fn set_headsign<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.headsign = v.into();
self
}
pub fn set_headway<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.headway = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_headway<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.headway = v.map(|x| x.into());
self
}
pub fn set_transit_line<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransitLine>,
{
self.transit_line = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transit_line<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransitLine>,
{
self.transit_line = v.map(|x| x.into());
self
}
pub fn set_stop_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.stop_count = v.into();
self
}
pub fn set_trip_short_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.trip_short_text = v.into();
self
}
}
impl wkt::message::Message for RouteLegStepTransitDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLegStepTransitDetails"
}
}
pub mod route_leg_step_transit_details {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransitStopDetails {
pub arrival_stop: std::option::Option<crate::model::TransitStop>,
pub arrival_time: std::option::Option<wkt::Timestamp>,
pub departure_stop: std::option::Option<crate::model::TransitStop>,
pub departure_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransitStopDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_arrival_stop<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransitStop>,
{
self.arrival_stop = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_arrival_stop<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransitStop>,
{
self.arrival_stop = v.map(|x| x.into());
self
}
pub fn set_arrival_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.arrival_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_arrival_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.arrival_time = v.map(|x| x.into());
self
}
pub fn set_departure_stop<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransitStop>,
{
self.departure_stop = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_departure_stop<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransitStop>,
{
self.departure_stop = v.map(|x| x.into());
self
}
pub fn set_departure_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.departure_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_departure_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.departure_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TransitStopDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLegStepTransitDetails.TransitStopDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransitDetailsLocalizedValues {
pub arrival_time: std::option::Option<crate::model::LocalizedTime>,
pub departure_time: std::option::Option<crate::model::LocalizedTime>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransitDetailsLocalizedValues {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_arrival_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LocalizedTime>,
{
self.arrival_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_arrival_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LocalizedTime>,
{
self.arrival_time = v.map(|x| x.into());
self
}
pub fn set_departure_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LocalizedTime>,
{
self.departure_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_departure_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LocalizedTime>,
{
self.departure_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TransitDetailsLocalizedValues {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteLegStepTransitDetails.TransitDetailsLocalizedValues"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteModifiers {
pub avoid_tolls: bool,
pub avoid_highways: bool,
pub avoid_ferries: bool,
pub avoid_indoor: bool,
pub vehicle_info: std::option::Option<crate::model::VehicleInfo>,
pub toll_passes: std::vec::Vec<crate::model::TollPass>,
pub avoid_tunnels: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteModifiers {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_avoid_tolls<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.avoid_tolls = v.into();
self
}
pub fn set_avoid_highways<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.avoid_highways = v.into();
self
}
pub fn set_avoid_ferries<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.avoid_ferries = v.into();
self
}
pub fn set_avoid_indoor<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.avoid_indoor = v.into();
self
}
pub fn set_vehicle_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VehicleInfo>,
{
self.vehicle_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vehicle_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VehicleInfo>,
{
self.vehicle_info = v.map(|x| x.into());
self
}
pub fn set_toll_passes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TollPass>,
{
use std::iter::Iterator;
self.toll_passes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_avoid_tunnels<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.avoid_tunnels = v.into();
self
}
}
impl wkt::message::Message for RouteModifiers {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteModifiers"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeRoutesRequest {
pub origin: std::option::Option<crate::model::Waypoint>,
pub destination: std::option::Option<crate::model::Waypoint>,
pub intermediates: std::vec::Vec<crate::model::Waypoint>,
pub travel_mode: crate::model::RouteTravelMode,
pub routing_preference: crate::model::RoutingPreference,
pub polyline_quality: crate::model::PolylineQuality,
pub polyline_encoding: crate::model::PolylineEncoding,
pub departure_time: std::option::Option<wkt::Timestamp>,
pub arrival_time: std::option::Option<wkt::Timestamp>,
pub compute_alternative_routes: bool,
pub route_modifiers: std::option::Option<crate::model::RouteModifiers>,
pub language_code: std::string::String,
pub region_code: std::string::String,
pub units: crate::model::Units,
pub optimize_waypoint_order: bool,
pub requested_reference_routes:
std::vec::Vec<crate::model::compute_routes_request::ReferenceRoute>,
pub extra_computations: std::vec::Vec<crate::model::compute_routes_request::ExtraComputation>,
pub traffic_model: crate::model::TrafficModel,
pub transit_preferences: std::option::Option<crate::model::TransitPreferences>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeRoutesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_origin<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Waypoint>,
{
self.origin = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_origin<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Waypoint>,
{
self.origin = v.map(|x| x.into());
self
}
pub fn set_destination<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Waypoint>,
{
self.destination = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Waypoint>,
{
self.destination = v.map(|x| x.into());
self
}
pub fn set_intermediates<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Waypoint>,
{
use std::iter::Iterator;
self.intermediates = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_travel_mode<T: std::convert::Into<crate::model::RouteTravelMode>>(
mut self,
v: T,
) -> Self {
self.travel_mode = v.into();
self
}
pub fn set_routing_preference<T: std::convert::Into<crate::model::RoutingPreference>>(
mut self,
v: T,
) -> Self {
self.routing_preference = v.into();
self
}
pub fn set_polyline_quality<T: std::convert::Into<crate::model::PolylineQuality>>(
mut self,
v: T,
) -> Self {
self.polyline_quality = v.into();
self
}
pub fn set_polyline_encoding<T: std::convert::Into<crate::model::PolylineEncoding>>(
mut self,
v: T,
) -> Self {
self.polyline_encoding = v.into();
self
}
pub fn set_departure_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.departure_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_departure_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.departure_time = v.map(|x| x.into());
self
}
pub fn set_arrival_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.arrival_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_arrival_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.arrival_time = v.map(|x| x.into());
self
}
pub fn set_compute_alternative_routes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.compute_alternative_routes = v.into();
self
}
pub fn set_route_modifiers<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RouteModifiers>,
{
self.route_modifiers = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_route_modifiers<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RouteModifiers>,
{
self.route_modifiers = v.map(|x| x.into());
self
}
pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.language_code = v.into();
self
}
pub fn set_region_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region_code = v.into();
self
}
pub fn set_units<T: std::convert::Into<crate::model::Units>>(mut self, v: T) -> Self {
self.units = v.into();
self
}
pub fn set_optimize_waypoint_order<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.optimize_waypoint_order = v.into();
self
}
pub fn set_requested_reference_routes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::compute_routes_request::ReferenceRoute>,
{
use std::iter::Iterator;
self.requested_reference_routes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_extra_computations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::compute_routes_request::ExtraComputation>,
{
use std::iter::Iterator;
self.extra_computations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_traffic_model<T: std::convert::Into<crate::model::TrafficModel>>(
mut self,
v: T,
) -> Self {
self.traffic_model = v.into();
self
}
pub fn set_transit_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransitPreferences>,
{
self.transit_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transit_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransitPreferences>,
{
self.transit_preferences = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ComputeRoutesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.ComputeRoutesRequest"
}
}
pub mod compute_routes_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ReferenceRoute {
Unspecified,
FuelEfficient,
ShorterDistance,
UnknownValue(reference_route::UnknownValue),
}
#[doc(hidden)]
pub mod reference_route {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ReferenceRoute {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::FuelEfficient => std::option::Option::Some(1),
Self::ShorterDistance => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("REFERENCE_ROUTE_UNSPECIFIED"),
Self::FuelEfficient => std::option::Option::Some("FUEL_EFFICIENT"),
Self::ShorterDistance => std::option::Option::Some("SHORTER_DISTANCE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ReferenceRoute {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ReferenceRoute {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ReferenceRoute {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::FuelEfficient,
2 => Self::ShorterDistance,
_ => Self::UnknownValue(reference_route::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ReferenceRoute {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REFERENCE_ROUTE_UNSPECIFIED" => Self::Unspecified,
"FUEL_EFFICIENT" => Self::FuelEfficient,
"SHORTER_DISTANCE" => Self::ShorterDistance,
_ => Self::UnknownValue(reference_route::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ReferenceRoute {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::FuelEfficient => serializer.serialize_i32(1),
Self::ShorterDistance => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ReferenceRoute {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReferenceRoute>::new(
".google.maps.routing.v2.ComputeRoutesRequest.ReferenceRoute",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExtraComputation {
Unspecified,
Tolls,
FuelConsumption,
TrafficOnPolyline,
HtmlFormattedNavigationInstructions,
FlyoverInfoOnPolyline,
NarrowRoadInfoOnPolyline,
TunnelInfoOnPolyline,
BridgeInfoOnPolyline,
SkywayInfoOnPolyline,
UnknownValue(extra_computation::UnknownValue),
}
#[doc(hidden)]
pub mod extra_computation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExtraComputation {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Tolls => std::option::Option::Some(1),
Self::FuelConsumption => std::option::Option::Some(2),
Self::TrafficOnPolyline => std::option::Option::Some(3),
Self::HtmlFormattedNavigationInstructions => std::option::Option::Some(4),
Self::FlyoverInfoOnPolyline => std::option::Option::Some(7),
Self::NarrowRoadInfoOnPolyline => std::option::Option::Some(8),
Self::TunnelInfoOnPolyline => std::option::Option::Some(9),
Self::BridgeInfoOnPolyline => std::option::Option::Some(10),
Self::SkywayInfoOnPolyline => std::option::Option::Some(11),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EXTRA_COMPUTATION_UNSPECIFIED"),
Self::Tolls => std::option::Option::Some("TOLLS"),
Self::FuelConsumption => std::option::Option::Some("FUEL_CONSUMPTION"),
Self::TrafficOnPolyline => std::option::Option::Some("TRAFFIC_ON_POLYLINE"),
Self::HtmlFormattedNavigationInstructions => {
std::option::Option::Some("HTML_FORMATTED_NAVIGATION_INSTRUCTIONS")
}
Self::FlyoverInfoOnPolyline => {
std::option::Option::Some("FLYOVER_INFO_ON_POLYLINE")
}
Self::NarrowRoadInfoOnPolyline => {
std::option::Option::Some("NARROW_ROAD_INFO_ON_POLYLINE")
}
Self::TunnelInfoOnPolyline => std::option::Option::Some("TUNNEL_INFO_ON_POLYLINE"),
Self::BridgeInfoOnPolyline => std::option::Option::Some("BRIDGE_INFO_ON_POLYLINE"),
Self::SkywayInfoOnPolyline => std::option::Option::Some("SKYWAY_INFO_ON_POLYLINE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExtraComputation {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExtraComputation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExtraComputation {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Tolls,
2 => Self::FuelConsumption,
3 => Self::TrafficOnPolyline,
4 => Self::HtmlFormattedNavigationInstructions,
7 => Self::FlyoverInfoOnPolyline,
8 => Self::NarrowRoadInfoOnPolyline,
9 => Self::TunnelInfoOnPolyline,
10 => Self::BridgeInfoOnPolyline,
11 => Self::SkywayInfoOnPolyline,
_ => Self::UnknownValue(extra_computation::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExtraComputation {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXTRA_COMPUTATION_UNSPECIFIED" => Self::Unspecified,
"TOLLS" => Self::Tolls,
"FUEL_CONSUMPTION" => Self::FuelConsumption,
"TRAFFIC_ON_POLYLINE" => Self::TrafficOnPolyline,
"HTML_FORMATTED_NAVIGATION_INSTRUCTIONS" => {
Self::HtmlFormattedNavigationInstructions
}
"FLYOVER_INFO_ON_POLYLINE" => Self::FlyoverInfoOnPolyline,
"NARROW_ROAD_INFO_ON_POLYLINE" => Self::NarrowRoadInfoOnPolyline,
"TUNNEL_INFO_ON_POLYLINE" => Self::TunnelInfoOnPolyline,
"BRIDGE_INFO_ON_POLYLINE" => Self::BridgeInfoOnPolyline,
"SKYWAY_INFO_ON_POLYLINE" => Self::SkywayInfoOnPolyline,
_ => Self::UnknownValue(extra_computation::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExtraComputation {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Tolls => serializer.serialize_i32(1),
Self::FuelConsumption => serializer.serialize_i32(2),
Self::TrafficOnPolyline => serializer.serialize_i32(3),
Self::HtmlFormattedNavigationInstructions => serializer.serialize_i32(4),
Self::FlyoverInfoOnPolyline => serializer.serialize_i32(7),
Self::NarrowRoadInfoOnPolyline => serializer.serialize_i32(8),
Self::TunnelInfoOnPolyline => serializer.serialize_i32(9),
Self::BridgeInfoOnPolyline => serializer.serialize_i32(10),
Self::SkywayInfoOnPolyline => serializer.serialize_i32(11),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExtraComputation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExtraComputation>::new(
".google.maps.routing.v2.ComputeRoutesRequest.ExtraComputation",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeRoutesResponse {
pub routes: std::vec::Vec<crate::model::Route>,
pub fallback_info: std::option::Option<crate::model::FallbackInfo>,
pub geocoding_results: std::option::Option<crate::model::GeocodingResults>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeRoutesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_routes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Route>,
{
use std::iter::Iterator;
self.routes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_fallback_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FallbackInfo>,
{
self.fallback_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_fallback_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FallbackInfo>,
{
self.fallback_info = v.map(|x| x.into());
self
}
pub fn set_geocoding_results<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GeocodingResults>,
{
self.geocoding_results = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_geocoding_results<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GeocodingResults>,
{
self.geocoding_results = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ComputeRoutesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.ComputeRoutesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComputeRouteMatrixRequest {
pub origins: std::vec::Vec<crate::model::RouteMatrixOrigin>,
pub destinations: std::vec::Vec<crate::model::RouteMatrixDestination>,
pub travel_mode: crate::model::RouteTravelMode,
pub routing_preference: crate::model::RoutingPreference,
pub departure_time: std::option::Option<wkt::Timestamp>,
pub arrival_time: std::option::Option<wkt::Timestamp>,
pub language_code: std::string::String,
pub region_code: std::string::String,
pub units: crate::model::Units,
pub extra_computations:
std::vec::Vec<crate::model::compute_route_matrix_request::ExtraComputation>,
pub traffic_model: crate::model::TrafficModel,
pub transit_preferences: std::option::Option<crate::model::TransitPreferences>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ComputeRouteMatrixRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_origins<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RouteMatrixOrigin>,
{
use std::iter::Iterator;
self.origins = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RouteMatrixDestination>,
{
use std::iter::Iterator;
self.destinations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_travel_mode<T: std::convert::Into<crate::model::RouteTravelMode>>(
mut self,
v: T,
) -> Self {
self.travel_mode = v.into();
self
}
pub fn set_routing_preference<T: std::convert::Into<crate::model::RoutingPreference>>(
mut self,
v: T,
) -> Self {
self.routing_preference = v.into();
self
}
pub fn set_departure_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.departure_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_departure_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.departure_time = v.map(|x| x.into());
self
}
pub fn set_arrival_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.arrival_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_arrival_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.arrival_time = v.map(|x| x.into());
self
}
pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.language_code = v.into();
self
}
pub fn set_region_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region_code = v.into();
self
}
pub fn set_units<T: std::convert::Into<crate::model::Units>>(mut self, v: T) -> Self {
self.units = v.into();
self
}
pub fn set_extra_computations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::compute_route_matrix_request::ExtraComputation>,
{
use std::iter::Iterator;
self.extra_computations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_traffic_model<T: std::convert::Into<crate::model::TrafficModel>>(
mut self,
v: T,
) -> Self {
self.traffic_model = v.into();
self
}
pub fn set_transit_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransitPreferences>,
{
self.transit_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transit_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransitPreferences>,
{
self.transit_preferences = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ComputeRouteMatrixRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.ComputeRouteMatrixRequest"
}
}
pub mod compute_route_matrix_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExtraComputation {
Unspecified,
Tolls,
UnknownValue(extra_computation::UnknownValue),
}
#[doc(hidden)]
pub mod extra_computation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExtraComputation {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Tolls => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EXTRA_COMPUTATION_UNSPECIFIED"),
Self::Tolls => std::option::Option::Some("TOLLS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExtraComputation {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExtraComputation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExtraComputation {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Tolls,
_ => Self::UnknownValue(extra_computation::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExtraComputation {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXTRA_COMPUTATION_UNSPECIFIED" => Self::Unspecified,
"TOLLS" => Self::Tolls,
_ => Self::UnknownValue(extra_computation::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExtraComputation {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Tolls => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExtraComputation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExtraComputation>::new(
".google.maps.routing.v2.ComputeRouteMatrixRequest.ExtraComputation",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteMatrixOrigin {
pub waypoint: std::option::Option<crate::model::Waypoint>,
pub route_modifiers: std::option::Option<crate::model::RouteModifiers>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteMatrixOrigin {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_waypoint<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Waypoint>,
{
self.waypoint = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_waypoint<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Waypoint>,
{
self.waypoint = v.map(|x| x.into());
self
}
pub fn set_route_modifiers<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RouteModifiers>,
{
self.route_modifiers = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_route_modifiers<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RouteModifiers>,
{
self.route_modifiers = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RouteMatrixOrigin {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteMatrixOrigin"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteMatrixDestination {
pub waypoint: std::option::Option<crate::model::Waypoint>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteMatrixDestination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_waypoint<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Waypoint>,
{
self.waypoint = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_waypoint<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Waypoint>,
{
self.waypoint = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RouteMatrixDestination {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteMatrixDestination"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteMatrixElement {
pub origin_index: std::option::Option<i32>,
pub destination_index: std::option::Option<i32>,
pub status: std::option::Option<google_cloud_rpc::model::Status>,
pub condition: crate::model::RouteMatrixElementCondition,
pub distance_meters: i32,
pub duration: std::option::Option<wkt::Duration>,
pub static_duration: std::option::Option<wkt::Duration>,
pub travel_advisory: std::option::Option<crate::model::RouteTravelAdvisory>,
pub fallback_info: std::option::Option<crate::model::FallbackInfo>,
pub localized_values: std::option::Option<crate::model::route_matrix_element::LocalizedValues>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteMatrixElement {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_origin_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.origin_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_origin_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.origin_index = v.map(|x| x.into());
self
}
pub fn set_destination_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.destination_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.destination_index = v.map(|x| x.into());
self
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_condition<T: std::convert::Into<crate::model::RouteMatrixElementCondition>>(
mut self,
v: T,
) -> Self {
self.condition = v.into();
self
}
pub fn set_distance_meters<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.distance_meters = v.into();
self
}
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.duration = v.map(|x| x.into());
self
}
pub fn set_static_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.static_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_static_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.static_duration = v.map(|x| x.into());
self
}
pub fn set_travel_advisory<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RouteTravelAdvisory>,
{
self.travel_advisory = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_travel_advisory<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RouteTravelAdvisory>,
{
self.travel_advisory = v.map(|x| x.into());
self
}
pub fn set_fallback_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FallbackInfo>,
{
self.fallback_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_fallback_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FallbackInfo>,
{
self.fallback_info = v.map(|x| x.into());
self
}
pub fn set_localized_values<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::route_matrix_element::LocalizedValues>,
{
self.localized_values = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_localized_values<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::route_matrix_element::LocalizedValues>,
{
self.localized_values = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RouteMatrixElement {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteMatrixElement"
}
}
pub mod route_matrix_element {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocalizedValues {
pub distance: std::option::Option<google_cloud_type::model::LocalizedText>,
pub duration: std::option::Option<google_cloud_type::model::LocalizedText>,
pub static_duration: std::option::Option<google_cloud_type::model::LocalizedText>,
pub transit_fare: std::option::Option<google_cloud_type::model::LocalizedText>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LocalizedValues {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_distance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.distance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_distance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.distance = v.map(|x| x.into());
self
}
pub fn set_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.duration = v.map(|x| x.into());
self
}
pub fn set_static_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.static_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_static_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.static_duration = v.map(|x| x.into());
self
}
pub fn set_transit_fare<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.transit_fare = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_transit_fare<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.transit_fare = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for LocalizedValues {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.RouteMatrixElement.LocalizedValues"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpeedReadingInterval {
pub start_polyline_point_index: std::option::Option<i32>,
pub end_polyline_point_index: std::option::Option<i32>,
pub speed_type: std::option::Option<crate::model::speed_reading_interval::SpeedType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpeedReadingInterval {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_polyline_point_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.start_polyline_point_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_polyline_point_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.start_polyline_point_index = v.map(|x| x.into());
self
}
pub fn set_end_polyline_point_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.end_polyline_point_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_polyline_point_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.end_polyline_point_index = v.map(|x| x.into());
self
}
pub fn set_speed_type<
T: std::convert::Into<std::option::Option<crate::model::speed_reading_interval::SpeedType>>,
>(
mut self,
v: T,
) -> Self {
self.speed_type = v.into();
self
}
pub fn speed(&self) -> std::option::Option<&crate::model::speed_reading_interval::Speed> {
#[allow(unreachable_patterns)]
self.speed_type.as_ref().and_then(|v| match v {
crate::model::speed_reading_interval::SpeedType::Speed(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_speed<T: std::convert::Into<crate::model::speed_reading_interval::Speed>>(
mut self,
v: T,
) -> Self {
self.speed_type = std::option::Option::Some(
crate::model::speed_reading_interval::SpeedType::Speed(v.into()),
);
self
}
}
impl wkt::message::Message for SpeedReadingInterval {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.SpeedReadingInterval"
}
}
pub mod speed_reading_interval {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Speed {
Unspecified,
Normal,
Slow,
TrafficJam,
UnknownValue(speed::UnknownValue),
}
#[doc(hidden)]
pub mod speed {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Speed {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Normal => std::option::Option::Some(1),
Self::Slow => std::option::Option::Some(2),
Self::TrafficJam => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SPEED_UNSPECIFIED"),
Self::Normal => std::option::Option::Some("NORMAL"),
Self::Slow => std::option::Option::Some("SLOW"),
Self::TrafficJam => std::option::Option::Some("TRAFFIC_JAM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Speed {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Speed {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Speed {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Normal,
2 => Self::Slow,
3 => Self::TrafficJam,
_ => Self::UnknownValue(speed::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Speed {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SPEED_UNSPECIFIED" => Self::Unspecified,
"NORMAL" => Self::Normal,
"SLOW" => Self::Slow,
"TRAFFIC_JAM" => Self::TrafficJam,
_ => Self::UnknownValue(speed::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Speed {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Normal => serializer.serialize_i32(1),
Self::Slow => serializer.serialize_i32(2),
Self::TrafficJam => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Speed {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Speed>::new(
".google.maps.routing.v2.SpeedReadingInterval.Speed",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SpeedType {
Speed(crate::model::speed_reading_interval::Speed),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TollInfo {
pub estimated_price: std::vec::Vec<google_cloud_type::model::Money>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TollInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_estimated_price<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_type::model::Money>,
{
use std::iter::Iterator;
self.estimated_price = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TollInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.TollInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransitAgency {
pub name: std::string::String,
pub phone_number: std::string::String,
pub uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransitAgency {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_phone_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phone_number = v.into();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
}
impl wkt::message::Message for TransitAgency {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.TransitAgency"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransitLine {
pub agencies: std::vec::Vec<crate::model::TransitAgency>,
pub name: std::string::String,
pub uri: std::string::String,
pub color: std::string::String,
pub icon_uri: std::string::String,
pub name_short: std::string::String,
pub text_color: std::string::String,
pub vehicle: std::option::Option<crate::model::TransitVehicle>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransitLine {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_agencies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TransitAgency>,
{
use std::iter::Iterator;
self.agencies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_color<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.color = v.into();
self
}
pub fn set_icon_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.icon_uri = v.into();
self
}
pub fn set_name_short<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name_short = v.into();
self
}
pub fn set_text_color<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text_color = v.into();
self
}
pub fn set_vehicle<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TransitVehicle>,
{
self.vehicle = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vehicle<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TransitVehicle>,
{
self.vehicle = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TransitLine {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.TransitLine"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransitStop {
pub name: std::string::String,
pub location: std::option::Option<crate::model::Location>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransitStop {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.location = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Location>,
{
self.location = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TransitStop {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.TransitStop"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransitVehicle {
pub name: std::option::Option<google_cloud_type::model::LocalizedText>,
pub r#type: crate::model::transit_vehicle::TransitVehicleType,
pub icon_uri: std::string::String,
pub local_icon_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransitVehicle {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.name = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::LocalizedText>,
{
self.name = v.map(|x| x.into());
self
}
pub fn set_type<T: std::convert::Into<crate::model::transit_vehicle::TransitVehicleType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_icon_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.icon_uri = v.into();
self
}
pub fn set_local_icon_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.local_icon_uri = v.into();
self
}
}
impl wkt::message::Message for TransitVehicle {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.TransitVehicle"
}
}
pub mod transit_vehicle {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TransitVehicleType {
Unspecified,
Bus,
CableCar,
CommuterTrain,
Ferry,
Funicular,
GondolaLift,
HeavyRail,
HighSpeedTrain,
IntercityBus,
LongDistanceTrain,
MetroRail,
Monorail,
Other,
Rail,
ShareTaxi,
Subway,
Tram,
Trolleybus,
UnknownValue(transit_vehicle_type::UnknownValue),
}
#[doc(hidden)]
pub mod transit_vehicle_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TransitVehicleType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Bus => std::option::Option::Some(1),
Self::CableCar => std::option::Option::Some(2),
Self::CommuterTrain => std::option::Option::Some(3),
Self::Ferry => std::option::Option::Some(4),
Self::Funicular => std::option::Option::Some(5),
Self::GondolaLift => std::option::Option::Some(6),
Self::HeavyRail => std::option::Option::Some(7),
Self::HighSpeedTrain => std::option::Option::Some(8),
Self::IntercityBus => std::option::Option::Some(9),
Self::LongDistanceTrain => std::option::Option::Some(10),
Self::MetroRail => std::option::Option::Some(11),
Self::Monorail => std::option::Option::Some(12),
Self::Other => std::option::Option::Some(13),
Self::Rail => std::option::Option::Some(14),
Self::ShareTaxi => std::option::Option::Some(15),
Self::Subway => std::option::Option::Some(16),
Self::Tram => std::option::Option::Some(17),
Self::Trolleybus => std::option::Option::Some(18),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TRANSIT_VEHICLE_TYPE_UNSPECIFIED"),
Self::Bus => std::option::Option::Some("BUS"),
Self::CableCar => std::option::Option::Some("CABLE_CAR"),
Self::CommuterTrain => std::option::Option::Some("COMMUTER_TRAIN"),
Self::Ferry => std::option::Option::Some("FERRY"),
Self::Funicular => std::option::Option::Some("FUNICULAR"),
Self::GondolaLift => std::option::Option::Some("GONDOLA_LIFT"),
Self::HeavyRail => std::option::Option::Some("HEAVY_RAIL"),
Self::HighSpeedTrain => std::option::Option::Some("HIGH_SPEED_TRAIN"),
Self::IntercityBus => std::option::Option::Some("INTERCITY_BUS"),
Self::LongDistanceTrain => std::option::Option::Some("LONG_DISTANCE_TRAIN"),
Self::MetroRail => std::option::Option::Some("METRO_RAIL"),
Self::Monorail => std::option::Option::Some("MONORAIL"),
Self::Other => std::option::Option::Some("OTHER"),
Self::Rail => std::option::Option::Some("RAIL"),
Self::ShareTaxi => std::option::Option::Some("SHARE_TAXI"),
Self::Subway => std::option::Option::Some("SUBWAY"),
Self::Tram => std::option::Option::Some("TRAM"),
Self::Trolleybus => std::option::Option::Some("TROLLEYBUS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TransitVehicleType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TransitVehicleType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TransitVehicleType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Bus,
2 => Self::CableCar,
3 => Self::CommuterTrain,
4 => Self::Ferry,
5 => Self::Funicular,
6 => Self::GondolaLift,
7 => Self::HeavyRail,
8 => Self::HighSpeedTrain,
9 => Self::IntercityBus,
10 => Self::LongDistanceTrain,
11 => Self::MetroRail,
12 => Self::Monorail,
13 => Self::Other,
14 => Self::Rail,
15 => Self::ShareTaxi,
16 => Self::Subway,
17 => Self::Tram,
18 => Self::Trolleybus,
_ => Self::UnknownValue(transit_vehicle_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TransitVehicleType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRANSIT_VEHICLE_TYPE_UNSPECIFIED" => Self::Unspecified,
"BUS" => Self::Bus,
"CABLE_CAR" => Self::CableCar,
"COMMUTER_TRAIN" => Self::CommuterTrain,
"FERRY" => Self::Ferry,
"FUNICULAR" => Self::Funicular,
"GONDOLA_LIFT" => Self::GondolaLift,
"HEAVY_RAIL" => Self::HeavyRail,
"HIGH_SPEED_TRAIN" => Self::HighSpeedTrain,
"INTERCITY_BUS" => Self::IntercityBus,
"LONG_DISTANCE_TRAIN" => Self::LongDistanceTrain,
"METRO_RAIL" => Self::MetroRail,
"MONORAIL" => Self::Monorail,
"OTHER" => Self::Other,
"RAIL" => Self::Rail,
"SHARE_TAXI" => Self::ShareTaxi,
"SUBWAY" => Self::Subway,
"TRAM" => Self::Tram,
"TROLLEYBUS" => Self::Trolleybus,
_ => Self::UnknownValue(transit_vehicle_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TransitVehicleType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Bus => serializer.serialize_i32(1),
Self::CableCar => serializer.serialize_i32(2),
Self::CommuterTrain => serializer.serialize_i32(3),
Self::Ferry => serializer.serialize_i32(4),
Self::Funicular => serializer.serialize_i32(5),
Self::GondolaLift => serializer.serialize_i32(6),
Self::HeavyRail => serializer.serialize_i32(7),
Self::HighSpeedTrain => serializer.serialize_i32(8),
Self::IntercityBus => serializer.serialize_i32(9),
Self::LongDistanceTrain => serializer.serialize_i32(10),
Self::MetroRail => serializer.serialize_i32(11),
Self::Monorail => serializer.serialize_i32(12),
Self::Other => serializer.serialize_i32(13),
Self::Rail => serializer.serialize_i32(14),
Self::ShareTaxi => serializer.serialize_i32(15),
Self::Subway => serializer.serialize_i32(16),
Self::Tram => serializer.serialize_i32(17),
Self::Trolleybus => serializer.serialize_i32(18),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TransitVehicleType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransitVehicleType>::new(
".google.maps.routing.v2.TransitVehicle.TransitVehicleType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TransitPreferences {
pub allowed_travel_modes: std::vec::Vec<crate::model::transit_preferences::TransitTravelMode>,
pub routing_preference: crate::model::transit_preferences::TransitRoutingPreference,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TransitPreferences {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allowed_travel_modes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::transit_preferences::TransitTravelMode>,
{
use std::iter::Iterator;
self.allowed_travel_modes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_routing_preference<
T: std::convert::Into<crate::model::transit_preferences::TransitRoutingPreference>,
>(
mut self,
v: T,
) -> Self {
self.routing_preference = v.into();
self
}
}
impl wkt::message::Message for TransitPreferences {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.TransitPreferences"
}
}
pub mod transit_preferences {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TransitTravelMode {
Unspecified,
Bus,
Subway,
Train,
LightRail,
Rail,
UnknownValue(transit_travel_mode::UnknownValue),
}
#[doc(hidden)]
pub mod transit_travel_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TransitTravelMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Bus => std::option::Option::Some(1),
Self::Subway => std::option::Option::Some(2),
Self::Train => std::option::Option::Some(3),
Self::LightRail => std::option::Option::Some(4),
Self::Rail => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TRANSIT_TRAVEL_MODE_UNSPECIFIED"),
Self::Bus => std::option::Option::Some("BUS"),
Self::Subway => std::option::Option::Some("SUBWAY"),
Self::Train => std::option::Option::Some("TRAIN"),
Self::LightRail => std::option::Option::Some("LIGHT_RAIL"),
Self::Rail => std::option::Option::Some("RAIL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TransitTravelMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TransitTravelMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TransitTravelMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Bus,
2 => Self::Subway,
3 => Self::Train,
4 => Self::LightRail,
5 => Self::Rail,
_ => Self::UnknownValue(transit_travel_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TransitTravelMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRANSIT_TRAVEL_MODE_UNSPECIFIED" => Self::Unspecified,
"BUS" => Self::Bus,
"SUBWAY" => Self::Subway,
"TRAIN" => Self::Train,
"LIGHT_RAIL" => Self::LightRail,
"RAIL" => Self::Rail,
_ => Self::UnknownValue(transit_travel_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TransitTravelMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Bus => serializer.serialize_i32(1),
Self::Subway => serializer.serialize_i32(2),
Self::Train => serializer.serialize_i32(3),
Self::LightRail => serializer.serialize_i32(4),
Self::Rail => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TransitTravelMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransitTravelMode>::new(
".google.maps.routing.v2.TransitPreferences.TransitTravelMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TransitRoutingPreference {
Unspecified,
LessWalking,
FewerTransfers,
UnknownValue(transit_routing_preference::UnknownValue),
}
#[doc(hidden)]
pub mod transit_routing_preference {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TransitRoutingPreference {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::LessWalking => std::option::Option::Some(1),
Self::FewerTransfers => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED")
}
Self::LessWalking => std::option::Option::Some("LESS_WALKING"),
Self::FewerTransfers => std::option::Option::Some("FEWER_TRANSFERS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TransitRoutingPreference {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TransitRoutingPreference {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TransitRoutingPreference {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::LessWalking,
2 => Self::FewerTransfers,
_ => Self::UnknownValue(transit_routing_preference::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TransitRoutingPreference {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED" => Self::Unspecified,
"LESS_WALKING" => Self::LessWalking,
"FEWER_TRANSFERS" => Self::FewerTransfers,
_ => Self::UnknownValue(transit_routing_preference::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TransitRoutingPreference {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::LessWalking => serializer.serialize_i32(1),
Self::FewerTransfers => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TransitRoutingPreference {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<TransitRoutingPreference>::new(
".google.maps.routing.v2.TransitPreferences.TransitRoutingPreference",
),
)
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VehicleInfo {
pub emission_type: crate::model::VehicleEmissionType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VehicleInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_emission_type<T: std::convert::Into<crate::model::VehicleEmissionType>>(
mut self,
v: T,
) -> Self {
self.emission_type = v.into();
self
}
}
impl wkt::message::Message for VehicleInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.VehicleInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Waypoint {
pub via: bool,
pub vehicle_stopover: bool,
pub side_of_road: bool,
pub location_type: std::option::Option<crate::model::waypoint::LocationType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Waypoint {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_via<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.via = v.into();
self
}
pub fn set_vehicle_stopover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.vehicle_stopover = v.into();
self
}
pub fn set_side_of_road<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.side_of_road = v.into();
self
}
pub fn set_location_type<
T: std::convert::Into<std::option::Option<crate::model::waypoint::LocationType>>,
>(
mut self,
v: T,
) -> Self {
self.location_type = v.into();
self
}
pub fn location(&self) -> std::option::Option<&std::boxed::Box<crate::model::Location>> {
#[allow(unreachable_patterns)]
self.location_type.as_ref().and_then(|v| match v {
crate::model::waypoint::LocationType::Location(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_location<T: std::convert::Into<std::boxed::Box<crate::model::Location>>>(
mut self,
v: T,
) -> Self {
self.location_type =
std::option::Option::Some(crate::model::waypoint::LocationType::Location(v.into()));
self
}
pub fn place_id(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.location_type.as_ref().and_then(|v| match v {
crate::model::waypoint::LocationType::PlaceId(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_place_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location_type =
std::option::Option::Some(crate::model::waypoint::LocationType::PlaceId(v.into()));
self
}
pub fn address(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.location_type.as_ref().and_then(|v| match v {
crate::model::waypoint::LocationType::Address(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location_type =
std::option::Option::Some(crate::model::waypoint::LocationType::Address(v.into()));
self
}
pub fn navigation_point_token(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.location_type.as_ref().and_then(|v| match v {
crate::model::waypoint::LocationType::NavigationPointToken(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_navigation_point_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.location_type = std::option::Option::Some(
crate::model::waypoint::LocationType::NavigationPointToken(v.into()),
);
self
}
}
impl wkt::message::Message for Waypoint {
fn typename() -> &'static str {
"type.googleapis.com/google.maps.routing.v2.Waypoint"
}
}
pub mod waypoint {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LocationType {
Location(std::boxed::Box<crate::model::Location>),
PlaceId(std::string::String),
Address(std::string::String),
NavigationPointToken(std::string::String),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FallbackReason {
Unspecified,
ServerError,
LatencyExceeded,
UnknownValue(fallback_reason::UnknownValue),
}
#[doc(hidden)]
pub mod fallback_reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FallbackReason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ServerError => std::option::Option::Some(1),
Self::LatencyExceeded => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FALLBACK_REASON_UNSPECIFIED"),
Self::ServerError => std::option::Option::Some("SERVER_ERROR"),
Self::LatencyExceeded => std::option::Option::Some("LATENCY_EXCEEDED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FallbackReason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FallbackReason {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FallbackReason {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ServerError,
2 => Self::LatencyExceeded,
_ => Self::UnknownValue(fallback_reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FallbackReason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FALLBACK_REASON_UNSPECIFIED" => Self::Unspecified,
"SERVER_ERROR" => Self::ServerError,
"LATENCY_EXCEEDED" => Self::LatencyExceeded,
_ => Self::UnknownValue(fallback_reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FallbackReason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ServerError => serializer.serialize_i32(1),
Self::LatencyExceeded => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FallbackReason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FallbackReason>::new(
".google.maps.routing.v2.FallbackReason",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FallbackRoutingMode {
Unspecified,
FallbackTrafficUnaware,
FallbackTrafficAware,
UnknownValue(fallback_routing_mode::UnknownValue),
}
#[doc(hidden)]
pub mod fallback_routing_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FallbackRoutingMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::FallbackTrafficUnaware => std::option::Option::Some(1),
Self::FallbackTrafficAware => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FALLBACK_ROUTING_MODE_UNSPECIFIED"),
Self::FallbackTrafficUnaware => std::option::Option::Some("FALLBACK_TRAFFIC_UNAWARE"),
Self::FallbackTrafficAware => std::option::Option::Some("FALLBACK_TRAFFIC_AWARE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FallbackRoutingMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FallbackRoutingMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FallbackRoutingMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::FallbackTrafficUnaware,
2 => Self::FallbackTrafficAware,
_ => Self::UnknownValue(fallback_routing_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FallbackRoutingMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FALLBACK_ROUTING_MODE_UNSPECIFIED" => Self::Unspecified,
"FALLBACK_TRAFFIC_UNAWARE" => Self::FallbackTrafficUnaware,
"FALLBACK_TRAFFIC_AWARE" => Self::FallbackTrafficAware,
_ => Self::UnknownValue(fallback_routing_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FallbackRoutingMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::FallbackTrafficUnaware => serializer.serialize_i32(1),
Self::FallbackTrafficAware => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FallbackRoutingMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FallbackRoutingMode>::new(
".google.maps.routing.v2.FallbackRoutingMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Maneuver {
Unspecified,
TurnSlightLeft,
TurnSharpLeft,
UturnLeft,
TurnLeft,
TurnSlightRight,
TurnSharpRight,
UturnRight,
TurnRight,
Straight,
RampLeft,
RampRight,
Merge,
ForkLeft,
ForkRight,
Ferry,
FerryTrain,
RoundaboutLeft,
RoundaboutRight,
Depart,
NameChange,
UnknownValue(maneuver::UnknownValue),
}
#[doc(hidden)]
pub mod maneuver {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Maneuver {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::TurnSlightLeft => std::option::Option::Some(1),
Self::TurnSharpLeft => std::option::Option::Some(2),
Self::UturnLeft => std::option::Option::Some(3),
Self::TurnLeft => std::option::Option::Some(4),
Self::TurnSlightRight => std::option::Option::Some(5),
Self::TurnSharpRight => std::option::Option::Some(6),
Self::UturnRight => std::option::Option::Some(7),
Self::TurnRight => std::option::Option::Some(8),
Self::Straight => std::option::Option::Some(9),
Self::RampLeft => std::option::Option::Some(10),
Self::RampRight => std::option::Option::Some(11),
Self::Merge => std::option::Option::Some(12),
Self::ForkLeft => std::option::Option::Some(13),
Self::ForkRight => std::option::Option::Some(14),
Self::Ferry => std::option::Option::Some(15),
Self::FerryTrain => std::option::Option::Some(16),
Self::RoundaboutLeft => std::option::Option::Some(17),
Self::RoundaboutRight => std::option::Option::Some(18),
Self::Depart => std::option::Option::Some(19),
Self::NameChange => std::option::Option::Some(20),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MANEUVER_UNSPECIFIED"),
Self::TurnSlightLeft => std::option::Option::Some("TURN_SLIGHT_LEFT"),
Self::TurnSharpLeft => std::option::Option::Some("TURN_SHARP_LEFT"),
Self::UturnLeft => std::option::Option::Some("UTURN_LEFT"),
Self::TurnLeft => std::option::Option::Some("TURN_LEFT"),
Self::TurnSlightRight => std::option::Option::Some("TURN_SLIGHT_RIGHT"),
Self::TurnSharpRight => std::option::Option::Some("TURN_SHARP_RIGHT"),
Self::UturnRight => std::option::Option::Some("UTURN_RIGHT"),
Self::TurnRight => std::option::Option::Some("TURN_RIGHT"),
Self::Straight => std::option::Option::Some("STRAIGHT"),
Self::RampLeft => std::option::Option::Some("RAMP_LEFT"),
Self::RampRight => std::option::Option::Some("RAMP_RIGHT"),
Self::Merge => std::option::Option::Some("MERGE"),
Self::ForkLeft => std::option::Option::Some("FORK_LEFT"),
Self::ForkRight => std::option::Option::Some("FORK_RIGHT"),
Self::Ferry => std::option::Option::Some("FERRY"),
Self::FerryTrain => std::option::Option::Some("FERRY_TRAIN"),
Self::RoundaboutLeft => std::option::Option::Some("ROUNDABOUT_LEFT"),
Self::RoundaboutRight => std::option::Option::Some("ROUNDABOUT_RIGHT"),
Self::Depart => std::option::Option::Some("DEPART"),
Self::NameChange => std::option::Option::Some("NAME_CHANGE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Maneuver {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Maneuver {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Maneuver {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::TurnSlightLeft,
2 => Self::TurnSharpLeft,
3 => Self::UturnLeft,
4 => Self::TurnLeft,
5 => Self::TurnSlightRight,
6 => Self::TurnSharpRight,
7 => Self::UturnRight,
8 => Self::TurnRight,
9 => Self::Straight,
10 => Self::RampLeft,
11 => Self::RampRight,
12 => Self::Merge,
13 => Self::ForkLeft,
14 => Self::ForkRight,
15 => Self::Ferry,
16 => Self::FerryTrain,
17 => Self::RoundaboutLeft,
18 => Self::RoundaboutRight,
19 => Self::Depart,
20 => Self::NameChange,
_ => Self::UnknownValue(maneuver::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Maneuver {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MANEUVER_UNSPECIFIED" => Self::Unspecified,
"TURN_SLIGHT_LEFT" => Self::TurnSlightLeft,
"TURN_SHARP_LEFT" => Self::TurnSharpLeft,
"UTURN_LEFT" => Self::UturnLeft,
"TURN_LEFT" => Self::TurnLeft,
"TURN_SLIGHT_RIGHT" => Self::TurnSlightRight,
"TURN_SHARP_RIGHT" => Self::TurnSharpRight,
"UTURN_RIGHT" => Self::UturnRight,
"TURN_RIGHT" => Self::TurnRight,
"STRAIGHT" => Self::Straight,
"RAMP_LEFT" => Self::RampLeft,
"RAMP_RIGHT" => Self::RampRight,
"MERGE" => Self::Merge,
"FORK_LEFT" => Self::ForkLeft,
"FORK_RIGHT" => Self::ForkRight,
"FERRY" => Self::Ferry,
"FERRY_TRAIN" => Self::FerryTrain,
"ROUNDABOUT_LEFT" => Self::RoundaboutLeft,
"ROUNDABOUT_RIGHT" => Self::RoundaboutRight,
"DEPART" => Self::Depart,
"NAME_CHANGE" => Self::NameChange,
_ => Self::UnknownValue(maneuver::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Maneuver {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::TurnSlightLeft => serializer.serialize_i32(1),
Self::TurnSharpLeft => serializer.serialize_i32(2),
Self::UturnLeft => serializer.serialize_i32(3),
Self::TurnLeft => serializer.serialize_i32(4),
Self::TurnSlightRight => serializer.serialize_i32(5),
Self::TurnSharpRight => serializer.serialize_i32(6),
Self::UturnRight => serializer.serialize_i32(7),
Self::TurnRight => serializer.serialize_i32(8),
Self::Straight => serializer.serialize_i32(9),
Self::RampLeft => serializer.serialize_i32(10),
Self::RampRight => serializer.serialize_i32(11),
Self::Merge => serializer.serialize_i32(12),
Self::ForkLeft => serializer.serialize_i32(13),
Self::ForkRight => serializer.serialize_i32(14),
Self::Ferry => serializer.serialize_i32(15),
Self::FerryTrain => serializer.serialize_i32(16),
Self::RoundaboutLeft => serializer.serialize_i32(17),
Self::RoundaboutRight => serializer.serialize_i32(18),
Self::Depart => serializer.serialize_i32(19),
Self::NameChange => serializer.serialize_i32(20),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Maneuver {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Maneuver>::new(
".google.maps.routing.v2.Maneuver",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PolylineQuality {
Unspecified,
HighQuality,
Overview,
UnknownValue(polyline_quality::UnknownValue),
}
#[doc(hidden)]
pub mod polyline_quality {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PolylineQuality {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::HighQuality => std::option::Option::Some(1),
Self::Overview => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("POLYLINE_QUALITY_UNSPECIFIED"),
Self::HighQuality => std::option::Option::Some("HIGH_QUALITY"),
Self::Overview => std::option::Option::Some("OVERVIEW"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PolylineQuality {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PolylineQuality {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PolylineQuality {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::HighQuality,
2 => Self::Overview,
_ => Self::UnknownValue(polyline_quality::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PolylineQuality {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POLYLINE_QUALITY_UNSPECIFIED" => Self::Unspecified,
"HIGH_QUALITY" => Self::HighQuality,
"OVERVIEW" => Self::Overview,
_ => Self::UnknownValue(polyline_quality::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PolylineQuality {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::HighQuality => serializer.serialize_i32(1),
Self::Overview => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PolylineQuality {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolylineQuality>::new(
".google.maps.routing.v2.PolylineQuality",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PolylineEncoding {
Unspecified,
EncodedPolyline,
GeoJsonLinestring,
UnknownValue(polyline_encoding::UnknownValue),
}
#[doc(hidden)]
pub mod polyline_encoding {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PolylineEncoding {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::EncodedPolyline => std::option::Option::Some(1),
Self::GeoJsonLinestring => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("POLYLINE_ENCODING_UNSPECIFIED"),
Self::EncodedPolyline => std::option::Option::Some("ENCODED_POLYLINE"),
Self::GeoJsonLinestring => std::option::Option::Some("GEO_JSON_LINESTRING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PolylineEncoding {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PolylineEncoding {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PolylineEncoding {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::EncodedPolyline,
2 => Self::GeoJsonLinestring,
_ => Self::UnknownValue(polyline_encoding::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PolylineEncoding {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POLYLINE_ENCODING_UNSPECIFIED" => Self::Unspecified,
"ENCODED_POLYLINE" => Self::EncodedPolyline,
"GEO_JSON_LINESTRING" => Self::GeoJsonLinestring,
_ => Self::UnknownValue(polyline_encoding::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PolylineEncoding {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::EncodedPolyline => serializer.serialize_i32(1),
Self::GeoJsonLinestring => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PolylineEncoding {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolylineEncoding>::new(
".google.maps.routing.v2.PolylineEncoding",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RouteLabel {
Unspecified,
DefaultRoute,
DefaultRouteAlternate,
FuelEfficient,
ShorterDistance,
UnknownValue(route_label::UnknownValue),
}
#[doc(hidden)]
pub mod route_label {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RouteLabel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DefaultRoute => std::option::Option::Some(1),
Self::DefaultRouteAlternate => std::option::Option::Some(2),
Self::FuelEfficient => std::option::Option::Some(3),
Self::ShorterDistance => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ROUTE_LABEL_UNSPECIFIED"),
Self::DefaultRoute => std::option::Option::Some("DEFAULT_ROUTE"),
Self::DefaultRouteAlternate => std::option::Option::Some("DEFAULT_ROUTE_ALTERNATE"),
Self::FuelEfficient => std::option::Option::Some("FUEL_EFFICIENT"),
Self::ShorterDistance => std::option::Option::Some("SHORTER_DISTANCE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RouteLabel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RouteLabel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RouteLabel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DefaultRoute,
2 => Self::DefaultRouteAlternate,
3 => Self::FuelEfficient,
4 => Self::ShorterDistance,
_ => Self::UnknownValue(route_label::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RouteLabel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ROUTE_LABEL_UNSPECIFIED" => Self::Unspecified,
"DEFAULT_ROUTE" => Self::DefaultRoute,
"DEFAULT_ROUTE_ALTERNATE" => Self::DefaultRouteAlternate,
"FUEL_EFFICIENT" => Self::FuelEfficient,
"SHORTER_DISTANCE" => Self::ShorterDistance,
_ => Self::UnknownValue(route_label::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RouteLabel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DefaultRoute => serializer.serialize_i32(1),
Self::DefaultRouteAlternate => serializer.serialize_i32(2),
Self::FuelEfficient => serializer.serialize_i32(3),
Self::ShorterDistance => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RouteLabel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteLabel>::new(
".google.maps.routing.v2.RouteLabel",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RouteTravelMode {
TravelModeUnspecified,
Drive,
Bicycle,
Walk,
TwoWheeler,
Transit,
UnknownValue(route_travel_mode::UnknownValue),
}
#[doc(hidden)]
pub mod route_travel_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RouteTravelMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::TravelModeUnspecified => std::option::Option::Some(0),
Self::Drive => std::option::Option::Some(1),
Self::Bicycle => std::option::Option::Some(2),
Self::Walk => std::option::Option::Some(3),
Self::TwoWheeler => std::option::Option::Some(4),
Self::Transit => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::TravelModeUnspecified => std::option::Option::Some("TRAVEL_MODE_UNSPECIFIED"),
Self::Drive => std::option::Option::Some("DRIVE"),
Self::Bicycle => std::option::Option::Some("BICYCLE"),
Self::Walk => std::option::Option::Some("WALK"),
Self::TwoWheeler => std::option::Option::Some("TWO_WHEELER"),
Self::Transit => std::option::Option::Some("TRANSIT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RouteTravelMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RouteTravelMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RouteTravelMode {
fn from(value: i32) -> Self {
match value {
0 => Self::TravelModeUnspecified,
1 => Self::Drive,
2 => Self::Bicycle,
3 => Self::Walk,
4 => Self::TwoWheeler,
7 => Self::Transit,
_ => Self::UnknownValue(route_travel_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RouteTravelMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRAVEL_MODE_UNSPECIFIED" => Self::TravelModeUnspecified,
"DRIVE" => Self::Drive,
"BICYCLE" => Self::Bicycle,
"WALK" => Self::Walk,
"TWO_WHEELER" => Self::TwoWheeler,
"TRANSIT" => Self::Transit,
_ => Self::UnknownValue(route_travel_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RouteTravelMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::TravelModeUnspecified => serializer.serialize_i32(0),
Self::Drive => serializer.serialize_i32(1),
Self::Bicycle => serializer.serialize_i32(2),
Self::Walk => serializer.serialize_i32(3),
Self::TwoWheeler => serializer.serialize_i32(4),
Self::Transit => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RouteTravelMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteTravelMode>::new(
".google.maps.routing.v2.RouteTravelMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RouteMatrixElementCondition {
Unspecified,
RouteExists,
RouteNotFound,
UnknownValue(route_matrix_element_condition::UnknownValue),
}
#[doc(hidden)]
pub mod route_matrix_element_condition {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RouteMatrixElementCondition {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RouteExists => std::option::Option::Some(1),
Self::RouteNotFound => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED")
}
Self::RouteExists => std::option::Option::Some("ROUTE_EXISTS"),
Self::RouteNotFound => std::option::Option::Some("ROUTE_NOT_FOUND"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RouteMatrixElementCondition {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RouteMatrixElementCondition {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RouteMatrixElementCondition {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RouteExists,
2 => Self::RouteNotFound,
_ => Self::UnknownValue(route_matrix_element_condition::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RouteMatrixElementCondition {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED" => Self::Unspecified,
"ROUTE_EXISTS" => Self::RouteExists,
"ROUTE_NOT_FOUND" => Self::RouteNotFound,
_ => Self::UnknownValue(route_matrix_element_condition::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RouteMatrixElementCondition {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::RouteExists => serializer.serialize_i32(1),
Self::RouteNotFound => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RouteMatrixElementCondition {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<RouteMatrixElementCondition>::new(
".google.maps.routing.v2.RouteMatrixElementCondition",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RoutingPreference {
Unspecified,
TrafficUnaware,
TrafficAware,
TrafficAwareOptimal,
UnknownValue(routing_preference::UnknownValue),
}
#[doc(hidden)]
pub mod routing_preference {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RoutingPreference {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::TrafficUnaware => std::option::Option::Some(1),
Self::TrafficAware => std::option::Option::Some(2),
Self::TrafficAwareOptimal => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ROUTING_PREFERENCE_UNSPECIFIED"),
Self::TrafficUnaware => std::option::Option::Some("TRAFFIC_UNAWARE"),
Self::TrafficAware => std::option::Option::Some("TRAFFIC_AWARE"),
Self::TrafficAwareOptimal => std::option::Option::Some("TRAFFIC_AWARE_OPTIMAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RoutingPreference {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RoutingPreference {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RoutingPreference {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::TrafficUnaware,
2 => Self::TrafficAware,
3 => Self::TrafficAwareOptimal,
_ => Self::UnknownValue(routing_preference::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RoutingPreference {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ROUTING_PREFERENCE_UNSPECIFIED" => Self::Unspecified,
"TRAFFIC_UNAWARE" => Self::TrafficUnaware,
"TRAFFIC_AWARE" => Self::TrafficAware,
"TRAFFIC_AWARE_OPTIMAL" => Self::TrafficAwareOptimal,
_ => Self::UnknownValue(routing_preference::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RoutingPreference {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::TrafficUnaware => serializer.serialize_i32(1),
Self::TrafficAware => serializer.serialize_i32(2),
Self::TrafficAwareOptimal => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RoutingPreference {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingPreference>::new(
".google.maps.routing.v2.RoutingPreference",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TollPass {
Unspecified,
AuEtollTag,
AuEwayTag,
AuLinkt,
ArTelepase,
BrAutoExpreso,
BrConectcar,
BrMoveMais,
BrPassaRapido,
BrSemParar,
BrTaggy,
BrVeloe,
CaUsAkwasasneSeawayCorporateCard,
CaUsAkwasasneSeawayTransitCard,
CaUsBlueWaterEdgePass,
CaUsConnexion,
CaUsNexusCard,
IdEToll,
InFastag,
InLocalHpPlateExempt,
JpEtc,
JpEtc2,
MxIave,
MxPase,
MxQuickpass,
MxSistemaTelepeajeChihuahua,
MxTagIave,
MxTagTelevia,
MxTelevia,
MxViapass,
UsAlFreedomPass,
UsAkAntonAndersonTunnelBookOf10Tickets,
UsCaFastrak,
UsCaFastrakCavSticker,
UsCoExpresstoll,
UsCoGoPass,
UsDeEzpassde,
UsFlBobSikesTollBridgePass,
UsFlDunesCommunityDevelopmentDistrictExpresscard,
UsFlEpass,
UsFlGibaTollPass,
UsFlLeeway,
UsFlSunpass,
UsFlSunpassPro,
UsIlEzpassil,
UsIlIpass,
UsInEzpassin,
UsKsBestpassHorizon,
UsKsKtag,
UsKsNationalpass,
UsKsPrepassElitepass,
UsKyRiverlink,
UsLaGeauxpass,
UsLaTollTag,
UsMaEzpassma,
UsMdEzpassmd,
UsMeEzpassme,
UsMiAmbassadorBridgePremierCommuterCard,
UsMiBcpass,
UsMiBreakaway,
UsMiGrosseIleTollBridgePassTag,
#[deprecated]
UsMiIqProxCard,
UsMiIqTag,
UsMiMackinacBridgeMacPass,
UsMiNexpressToll,
UsMnEzpassmn,
UsNcEzpassnc,
UsNcPeachPass,
UsNcQuickPass,
UsNhEzpassnh,
UsNjDownbeachExpressPass,
UsNjEzpassnj,
UsNyExpresspass,
UsNyEzpassny,
UsOhEzpassoh,
UsPaEzpasspa,
UsRiEzpassri,
UsScPalpass,
UsTxAviTag,
UsTxBancpass,
UsTxDelRioPass,
UsTxEfastPass,
UsTxEaglePassExpressCard,
UsTxEptoll,
UsTxEzCross,
UsTxEztag,
UsTxFuegoTag,
UsTxLaredoTradeTag,
UsTxPluspass,
UsTxTolltag,
UsTxTxtag,
UsTxXpressCard,
UsUtAdamsAveParkwayExpresscard,
UsVaEzpassva,
UsWaBreezeby,
UsWaGoodToGo,
UsWvEzpasswv,
UsWvMemorialBridgeTickets,
UsWvMovPass,
UsWvNewellTollBridgeTicket,
UnknownValue(toll_pass::UnknownValue),
}
#[doc(hidden)]
pub mod toll_pass {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TollPass {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AuEtollTag => std::option::Option::Some(82),
Self::AuEwayTag => std::option::Option::Some(83),
Self::AuLinkt => std::option::Option::Some(2),
Self::ArTelepase => std::option::Option::Some(3),
Self::BrAutoExpreso => std::option::Option::Some(81),
Self::BrConectcar => std::option::Option::Some(7),
Self::BrMoveMais => std::option::Option::Some(8),
Self::BrPassaRapido => std::option::Option::Some(88),
Self::BrSemParar => std::option::Option::Some(9),
Self::BrTaggy => std::option::Option::Some(10),
Self::BrVeloe => std::option::Option::Some(11),
Self::CaUsAkwasasneSeawayCorporateCard => std::option::Option::Some(84),
Self::CaUsAkwasasneSeawayTransitCard => std::option::Option::Some(85),
Self::CaUsBlueWaterEdgePass => std::option::Option::Some(18),
Self::CaUsConnexion => std::option::Option::Some(19),
Self::CaUsNexusCard => std::option::Option::Some(20),
Self::IdEToll => std::option::Option::Some(16),
Self::InFastag => std::option::Option::Some(78),
Self::InLocalHpPlateExempt => std::option::Option::Some(79),
Self::JpEtc => std::option::Option::Some(98),
Self::JpEtc2 => std::option::Option::Some(99),
Self::MxIave => std::option::Option::Some(90),
Self::MxPase => std::option::Option::Some(91),
Self::MxQuickpass => std::option::Option::Some(93),
Self::MxSistemaTelepeajeChihuahua => std::option::Option::Some(89),
Self::MxTagIave => std::option::Option::Some(12),
Self::MxTagTelevia => std::option::Option::Some(13),
Self::MxTelevia => std::option::Option::Some(92),
Self::MxViapass => std::option::Option::Some(14),
Self::UsAlFreedomPass => std::option::Option::Some(21),
Self::UsAkAntonAndersonTunnelBookOf10Tickets => std::option::Option::Some(22),
Self::UsCaFastrak => std::option::Option::Some(4),
Self::UsCaFastrakCavSticker => std::option::Option::Some(86),
Self::UsCoExpresstoll => std::option::Option::Some(23),
Self::UsCoGoPass => std::option::Option::Some(24),
Self::UsDeEzpassde => std::option::Option::Some(25),
Self::UsFlBobSikesTollBridgePass => std::option::Option::Some(65),
Self::UsFlDunesCommunityDevelopmentDistrictExpresscard => std::option::Option::Some(66),
Self::UsFlEpass => std::option::Option::Some(67),
Self::UsFlGibaTollPass => std::option::Option::Some(68),
Self::UsFlLeeway => std::option::Option::Some(69),
Self::UsFlSunpass => std::option::Option::Some(70),
Self::UsFlSunpassPro => std::option::Option::Some(71),
Self::UsIlEzpassil => std::option::Option::Some(73),
Self::UsIlIpass => std::option::Option::Some(72),
Self::UsInEzpassin => std::option::Option::Some(26),
Self::UsKsBestpassHorizon => std::option::Option::Some(27),
Self::UsKsKtag => std::option::Option::Some(28),
Self::UsKsNationalpass => std::option::Option::Some(29),
Self::UsKsPrepassElitepass => std::option::Option::Some(30),
Self::UsKyRiverlink => std::option::Option::Some(31),
Self::UsLaGeauxpass => std::option::Option::Some(32),
Self::UsLaTollTag => std::option::Option::Some(33),
Self::UsMaEzpassma => std::option::Option::Some(6),
Self::UsMdEzpassmd => std::option::Option::Some(34),
Self::UsMeEzpassme => std::option::Option::Some(35),
Self::UsMiAmbassadorBridgePremierCommuterCard => std::option::Option::Some(36),
Self::UsMiBcpass => std::option::Option::Some(94),
Self::UsMiBreakaway => std::option::Option::Some(101),
Self::UsMiGrosseIleTollBridgePassTag => std::option::Option::Some(37),
Self::UsMiIqProxCard => std::option::Option::Some(38),
Self::UsMiIqTag => std::option::Option::Some(95),
Self::UsMiMackinacBridgeMacPass => std::option::Option::Some(39),
Self::UsMiNexpressToll => std::option::Option::Some(40),
Self::UsMnEzpassmn => std::option::Option::Some(41),
Self::UsNcEzpassnc => std::option::Option::Some(42),
Self::UsNcPeachPass => std::option::Option::Some(87),
Self::UsNcQuickPass => std::option::Option::Some(43),
Self::UsNhEzpassnh => std::option::Option::Some(80),
Self::UsNjDownbeachExpressPass => std::option::Option::Some(75),
Self::UsNjEzpassnj => std::option::Option::Some(74),
Self::UsNyExpresspass => std::option::Option::Some(76),
Self::UsNyEzpassny => std::option::Option::Some(77),
Self::UsOhEzpassoh => std::option::Option::Some(44),
Self::UsPaEzpasspa => std::option::Option::Some(45),
Self::UsRiEzpassri => std::option::Option::Some(46),
Self::UsScPalpass => std::option::Option::Some(47),
Self::UsTxAviTag => std::option::Option::Some(97),
Self::UsTxBancpass => std::option::Option::Some(48),
Self::UsTxDelRioPass => std::option::Option::Some(49),
Self::UsTxEfastPass => std::option::Option::Some(50),
Self::UsTxEaglePassExpressCard => std::option::Option::Some(51),
Self::UsTxEptoll => std::option::Option::Some(52),
Self::UsTxEzCross => std::option::Option::Some(53),
Self::UsTxEztag => std::option::Option::Some(54),
Self::UsTxFuegoTag => std::option::Option::Some(96),
Self::UsTxLaredoTradeTag => std::option::Option::Some(55),
Self::UsTxPluspass => std::option::Option::Some(56),
Self::UsTxTolltag => std::option::Option::Some(57),
Self::UsTxTxtag => std::option::Option::Some(58),
Self::UsTxXpressCard => std::option::Option::Some(59),
Self::UsUtAdamsAveParkwayExpresscard => std::option::Option::Some(60),
Self::UsVaEzpassva => std::option::Option::Some(61),
Self::UsWaBreezeby => std::option::Option::Some(17),
Self::UsWaGoodToGo => std::option::Option::Some(1),
Self::UsWvEzpasswv => std::option::Option::Some(62),
Self::UsWvMemorialBridgeTickets => std::option::Option::Some(63),
Self::UsWvMovPass => std::option::Option::Some(100),
Self::UsWvNewellTollBridgeTicket => std::option::Option::Some(64),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TOLL_PASS_UNSPECIFIED"),
Self::AuEtollTag => std::option::Option::Some("AU_ETOLL_TAG"),
Self::AuEwayTag => std::option::Option::Some("AU_EWAY_TAG"),
Self::AuLinkt => std::option::Option::Some("AU_LINKT"),
Self::ArTelepase => std::option::Option::Some("AR_TELEPASE"),
Self::BrAutoExpreso => std::option::Option::Some("BR_AUTO_EXPRESO"),
Self::BrConectcar => std::option::Option::Some("BR_CONECTCAR"),
Self::BrMoveMais => std::option::Option::Some("BR_MOVE_MAIS"),
Self::BrPassaRapido => std::option::Option::Some("BR_PASSA_RAPIDO"),
Self::BrSemParar => std::option::Option::Some("BR_SEM_PARAR"),
Self::BrTaggy => std::option::Option::Some("BR_TAGGY"),
Self::BrVeloe => std::option::Option::Some("BR_VELOE"),
Self::CaUsAkwasasneSeawayCorporateCard => {
std::option::Option::Some("CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD")
}
Self::CaUsAkwasasneSeawayTransitCard => {
std::option::Option::Some("CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD")
}
Self::CaUsBlueWaterEdgePass => std::option::Option::Some("CA_US_BLUE_WATER_EDGE_PASS"),
Self::CaUsConnexion => std::option::Option::Some("CA_US_CONNEXION"),
Self::CaUsNexusCard => std::option::Option::Some("CA_US_NEXUS_CARD"),
Self::IdEToll => std::option::Option::Some("ID_E_TOLL"),
Self::InFastag => std::option::Option::Some("IN_FASTAG"),
Self::InLocalHpPlateExempt => std::option::Option::Some("IN_LOCAL_HP_PLATE_EXEMPT"),
Self::JpEtc => std::option::Option::Some("JP_ETC"),
Self::JpEtc2 => std::option::Option::Some("JP_ETC2"),
Self::MxIave => std::option::Option::Some("MX_IAVE"),
Self::MxPase => std::option::Option::Some("MX_PASE"),
Self::MxQuickpass => std::option::Option::Some("MX_QUICKPASS"),
Self::MxSistemaTelepeajeChihuahua => {
std::option::Option::Some("MX_SISTEMA_TELEPEAJE_CHIHUAHUA")
}
Self::MxTagIave => std::option::Option::Some("MX_TAG_IAVE"),
Self::MxTagTelevia => std::option::Option::Some("MX_TAG_TELEVIA"),
Self::MxTelevia => std::option::Option::Some("MX_TELEVIA"),
Self::MxViapass => std::option::Option::Some("MX_VIAPASS"),
Self::UsAlFreedomPass => std::option::Option::Some("US_AL_FREEDOM_PASS"),
Self::UsAkAntonAndersonTunnelBookOf10Tickets => {
std::option::Option::Some("US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS")
}
Self::UsCaFastrak => std::option::Option::Some("US_CA_FASTRAK"),
Self::UsCaFastrakCavSticker => std::option::Option::Some("US_CA_FASTRAK_CAV_STICKER"),
Self::UsCoExpresstoll => std::option::Option::Some("US_CO_EXPRESSTOLL"),
Self::UsCoGoPass => std::option::Option::Some("US_CO_GO_PASS"),
Self::UsDeEzpassde => std::option::Option::Some("US_DE_EZPASSDE"),
Self::UsFlBobSikesTollBridgePass => {
std::option::Option::Some("US_FL_BOB_SIKES_TOLL_BRIDGE_PASS")
}
Self::UsFlDunesCommunityDevelopmentDistrictExpresscard => {
std::option::Option::Some("US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD")
}
Self::UsFlEpass => std::option::Option::Some("US_FL_EPASS"),
Self::UsFlGibaTollPass => std::option::Option::Some("US_FL_GIBA_TOLL_PASS"),
Self::UsFlLeeway => std::option::Option::Some("US_FL_LEEWAY"),
Self::UsFlSunpass => std::option::Option::Some("US_FL_SUNPASS"),
Self::UsFlSunpassPro => std::option::Option::Some("US_FL_SUNPASS_PRO"),
Self::UsIlEzpassil => std::option::Option::Some("US_IL_EZPASSIL"),
Self::UsIlIpass => std::option::Option::Some("US_IL_IPASS"),
Self::UsInEzpassin => std::option::Option::Some("US_IN_EZPASSIN"),
Self::UsKsBestpassHorizon => std::option::Option::Some("US_KS_BESTPASS_HORIZON"),
Self::UsKsKtag => std::option::Option::Some("US_KS_KTAG"),
Self::UsKsNationalpass => std::option::Option::Some("US_KS_NATIONALPASS"),
Self::UsKsPrepassElitepass => std::option::Option::Some("US_KS_PREPASS_ELITEPASS"),
Self::UsKyRiverlink => std::option::Option::Some("US_KY_RIVERLINK"),
Self::UsLaGeauxpass => std::option::Option::Some("US_LA_GEAUXPASS"),
Self::UsLaTollTag => std::option::Option::Some("US_LA_TOLL_TAG"),
Self::UsMaEzpassma => std::option::Option::Some("US_MA_EZPASSMA"),
Self::UsMdEzpassmd => std::option::Option::Some("US_MD_EZPASSMD"),
Self::UsMeEzpassme => std::option::Option::Some("US_ME_EZPASSME"),
Self::UsMiAmbassadorBridgePremierCommuterCard => {
std::option::Option::Some("US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD")
}
Self::UsMiBcpass => std::option::Option::Some("US_MI_BCPASS"),
Self::UsMiBreakaway => std::option::Option::Some("US_MI_BREAKAWAY"),
Self::UsMiGrosseIleTollBridgePassTag => {
std::option::Option::Some("US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG")
}
Self::UsMiIqProxCard => std::option::Option::Some("US_MI_IQ_PROX_CARD"),
Self::UsMiIqTag => std::option::Option::Some("US_MI_IQ_TAG"),
Self::UsMiMackinacBridgeMacPass => {
std::option::Option::Some("US_MI_MACKINAC_BRIDGE_MAC_PASS")
}
Self::UsMiNexpressToll => std::option::Option::Some("US_MI_NEXPRESS_TOLL"),
Self::UsMnEzpassmn => std::option::Option::Some("US_MN_EZPASSMN"),
Self::UsNcEzpassnc => std::option::Option::Some("US_NC_EZPASSNC"),
Self::UsNcPeachPass => std::option::Option::Some("US_NC_PEACH_PASS"),
Self::UsNcQuickPass => std::option::Option::Some("US_NC_QUICK_PASS"),
Self::UsNhEzpassnh => std::option::Option::Some("US_NH_EZPASSNH"),
Self::UsNjDownbeachExpressPass => {
std::option::Option::Some("US_NJ_DOWNBEACH_EXPRESS_PASS")
}
Self::UsNjEzpassnj => std::option::Option::Some("US_NJ_EZPASSNJ"),
Self::UsNyExpresspass => std::option::Option::Some("US_NY_EXPRESSPASS"),
Self::UsNyEzpassny => std::option::Option::Some("US_NY_EZPASSNY"),
Self::UsOhEzpassoh => std::option::Option::Some("US_OH_EZPASSOH"),
Self::UsPaEzpasspa => std::option::Option::Some("US_PA_EZPASSPA"),
Self::UsRiEzpassri => std::option::Option::Some("US_RI_EZPASSRI"),
Self::UsScPalpass => std::option::Option::Some("US_SC_PALPASS"),
Self::UsTxAviTag => std::option::Option::Some("US_TX_AVI_TAG"),
Self::UsTxBancpass => std::option::Option::Some("US_TX_BANCPASS"),
Self::UsTxDelRioPass => std::option::Option::Some("US_TX_DEL_RIO_PASS"),
Self::UsTxEfastPass => std::option::Option::Some("US_TX_EFAST_PASS"),
Self::UsTxEaglePassExpressCard => {
std::option::Option::Some("US_TX_EAGLE_PASS_EXPRESS_CARD")
}
Self::UsTxEptoll => std::option::Option::Some("US_TX_EPTOLL"),
Self::UsTxEzCross => std::option::Option::Some("US_TX_EZ_CROSS"),
Self::UsTxEztag => std::option::Option::Some("US_TX_EZTAG"),
Self::UsTxFuegoTag => std::option::Option::Some("US_TX_FUEGO_TAG"),
Self::UsTxLaredoTradeTag => std::option::Option::Some("US_TX_LAREDO_TRADE_TAG"),
Self::UsTxPluspass => std::option::Option::Some("US_TX_PLUSPASS"),
Self::UsTxTolltag => std::option::Option::Some("US_TX_TOLLTAG"),
Self::UsTxTxtag => std::option::Option::Some("US_TX_TXTAG"),
Self::UsTxXpressCard => std::option::Option::Some("US_TX_XPRESS_CARD"),
Self::UsUtAdamsAveParkwayExpresscard => {
std::option::Option::Some("US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD")
}
Self::UsVaEzpassva => std::option::Option::Some("US_VA_EZPASSVA"),
Self::UsWaBreezeby => std::option::Option::Some("US_WA_BREEZEBY"),
Self::UsWaGoodToGo => std::option::Option::Some("US_WA_GOOD_TO_GO"),
Self::UsWvEzpasswv => std::option::Option::Some("US_WV_EZPASSWV"),
Self::UsWvMemorialBridgeTickets => {
std::option::Option::Some("US_WV_MEMORIAL_BRIDGE_TICKETS")
}
Self::UsWvMovPass => std::option::Option::Some("US_WV_MOV_PASS"),
Self::UsWvNewellTollBridgeTicket => {
std::option::Option::Some("US_WV_NEWELL_TOLL_BRIDGE_TICKET")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TollPass {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TollPass {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TollPass {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::UsWaGoodToGo,
2 => Self::AuLinkt,
3 => Self::ArTelepase,
4 => Self::UsCaFastrak,
6 => Self::UsMaEzpassma,
7 => Self::BrConectcar,
8 => Self::BrMoveMais,
9 => Self::BrSemParar,
10 => Self::BrTaggy,
11 => Self::BrVeloe,
12 => Self::MxTagIave,
13 => Self::MxTagTelevia,
14 => Self::MxViapass,
16 => Self::IdEToll,
17 => Self::UsWaBreezeby,
18 => Self::CaUsBlueWaterEdgePass,
19 => Self::CaUsConnexion,
20 => Self::CaUsNexusCard,
21 => Self::UsAlFreedomPass,
22 => Self::UsAkAntonAndersonTunnelBookOf10Tickets,
23 => Self::UsCoExpresstoll,
24 => Self::UsCoGoPass,
25 => Self::UsDeEzpassde,
26 => Self::UsInEzpassin,
27 => Self::UsKsBestpassHorizon,
28 => Self::UsKsKtag,
29 => Self::UsKsNationalpass,
30 => Self::UsKsPrepassElitepass,
31 => Self::UsKyRiverlink,
32 => Self::UsLaGeauxpass,
33 => Self::UsLaTollTag,
34 => Self::UsMdEzpassmd,
35 => Self::UsMeEzpassme,
36 => Self::UsMiAmbassadorBridgePremierCommuterCard,
37 => Self::UsMiGrosseIleTollBridgePassTag,
38 => Self::UsMiIqProxCard,
39 => Self::UsMiMackinacBridgeMacPass,
40 => Self::UsMiNexpressToll,
41 => Self::UsMnEzpassmn,
42 => Self::UsNcEzpassnc,
43 => Self::UsNcQuickPass,
44 => Self::UsOhEzpassoh,
45 => Self::UsPaEzpasspa,
46 => Self::UsRiEzpassri,
47 => Self::UsScPalpass,
48 => Self::UsTxBancpass,
49 => Self::UsTxDelRioPass,
50 => Self::UsTxEfastPass,
51 => Self::UsTxEaglePassExpressCard,
52 => Self::UsTxEptoll,
53 => Self::UsTxEzCross,
54 => Self::UsTxEztag,
55 => Self::UsTxLaredoTradeTag,
56 => Self::UsTxPluspass,
57 => Self::UsTxTolltag,
58 => Self::UsTxTxtag,
59 => Self::UsTxXpressCard,
60 => Self::UsUtAdamsAveParkwayExpresscard,
61 => Self::UsVaEzpassva,
62 => Self::UsWvEzpasswv,
63 => Self::UsWvMemorialBridgeTickets,
64 => Self::UsWvNewellTollBridgeTicket,
65 => Self::UsFlBobSikesTollBridgePass,
66 => Self::UsFlDunesCommunityDevelopmentDistrictExpresscard,
67 => Self::UsFlEpass,
68 => Self::UsFlGibaTollPass,
69 => Self::UsFlLeeway,
70 => Self::UsFlSunpass,
71 => Self::UsFlSunpassPro,
72 => Self::UsIlIpass,
73 => Self::UsIlEzpassil,
74 => Self::UsNjEzpassnj,
75 => Self::UsNjDownbeachExpressPass,
76 => Self::UsNyExpresspass,
77 => Self::UsNyEzpassny,
78 => Self::InFastag,
79 => Self::InLocalHpPlateExempt,
80 => Self::UsNhEzpassnh,
81 => Self::BrAutoExpreso,
82 => Self::AuEtollTag,
83 => Self::AuEwayTag,
84 => Self::CaUsAkwasasneSeawayCorporateCard,
85 => Self::CaUsAkwasasneSeawayTransitCard,
86 => Self::UsCaFastrakCavSticker,
87 => Self::UsNcPeachPass,
88 => Self::BrPassaRapido,
89 => Self::MxSistemaTelepeajeChihuahua,
90 => Self::MxIave,
91 => Self::MxPase,
92 => Self::MxTelevia,
93 => Self::MxQuickpass,
94 => Self::UsMiBcpass,
95 => Self::UsMiIqTag,
96 => Self::UsTxFuegoTag,
97 => Self::UsTxAviTag,
98 => Self::JpEtc,
99 => Self::JpEtc2,
100 => Self::UsWvMovPass,
101 => Self::UsMiBreakaway,
_ => Self::UnknownValue(toll_pass::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TollPass {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TOLL_PASS_UNSPECIFIED" => Self::Unspecified,
"AU_ETOLL_TAG" => Self::AuEtollTag,
"AU_EWAY_TAG" => Self::AuEwayTag,
"AU_LINKT" => Self::AuLinkt,
"AR_TELEPASE" => Self::ArTelepase,
"BR_AUTO_EXPRESO" => Self::BrAutoExpreso,
"BR_CONECTCAR" => Self::BrConectcar,
"BR_MOVE_MAIS" => Self::BrMoveMais,
"BR_PASSA_RAPIDO" => Self::BrPassaRapido,
"BR_SEM_PARAR" => Self::BrSemParar,
"BR_TAGGY" => Self::BrTaggy,
"BR_VELOE" => Self::BrVeloe,
"CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD" => Self::CaUsAkwasasneSeawayCorporateCard,
"CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD" => Self::CaUsAkwasasneSeawayTransitCard,
"CA_US_BLUE_WATER_EDGE_PASS" => Self::CaUsBlueWaterEdgePass,
"CA_US_CONNEXION" => Self::CaUsConnexion,
"CA_US_NEXUS_CARD" => Self::CaUsNexusCard,
"ID_E_TOLL" => Self::IdEToll,
"IN_FASTAG" => Self::InFastag,
"IN_LOCAL_HP_PLATE_EXEMPT" => Self::InLocalHpPlateExempt,
"JP_ETC" => Self::JpEtc,
"JP_ETC2" => Self::JpEtc2,
"MX_IAVE" => Self::MxIave,
"MX_PASE" => Self::MxPase,
"MX_QUICKPASS" => Self::MxQuickpass,
"MX_SISTEMA_TELEPEAJE_CHIHUAHUA" => Self::MxSistemaTelepeajeChihuahua,
"MX_TAG_IAVE" => Self::MxTagIave,
"MX_TAG_TELEVIA" => Self::MxTagTelevia,
"MX_TELEVIA" => Self::MxTelevia,
"MX_VIAPASS" => Self::MxViapass,
"US_AL_FREEDOM_PASS" => Self::UsAlFreedomPass,
"US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS" => {
Self::UsAkAntonAndersonTunnelBookOf10Tickets
}
"US_CA_FASTRAK" => Self::UsCaFastrak,
"US_CA_FASTRAK_CAV_STICKER" => Self::UsCaFastrakCavSticker,
"US_CO_EXPRESSTOLL" => Self::UsCoExpresstoll,
"US_CO_GO_PASS" => Self::UsCoGoPass,
"US_DE_EZPASSDE" => Self::UsDeEzpassde,
"US_FL_BOB_SIKES_TOLL_BRIDGE_PASS" => Self::UsFlBobSikesTollBridgePass,
"US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD" => {
Self::UsFlDunesCommunityDevelopmentDistrictExpresscard
}
"US_FL_EPASS" => Self::UsFlEpass,
"US_FL_GIBA_TOLL_PASS" => Self::UsFlGibaTollPass,
"US_FL_LEEWAY" => Self::UsFlLeeway,
"US_FL_SUNPASS" => Self::UsFlSunpass,
"US_FL_SUNPASS_PRO" => Self::UsFlSunpassPro,
"US_IL_EZPASSIL" => Self::UsIlEzpassil,
"US_IL_IPASS" => Self::UsIlIpass,
"US_IN_EZPASSIN" => Self::UsInEzpassin,
"US_KS_BESTPASS_HORIZON" => Self::UsKsBestpassHorizon,
"US_KS_KTAG" => Self::UsKsKtag,
"US_KS_NATIONALPASS" => Self::UsKsNationalpass,
"US_KS_PREPASS_ELITEPASS" => Self::UsKsPrepassElitepass,
"US_KY_RIVERLINK" => Self::UsKyRiverlink,
"US_LA_GEAUXPASS" => Self::UsLaGeauxpass,
"US_LA_TOLL_TAG" => Self::UsLaTollTag,
"US_MA_EZPASSMA" => Self::UsMaEzpassma,
"US_MD_EZPASSMD" => Self::UsMdEzpassmd,
"US_ME_EZPASSME" => Self::UsMeEzpassme,
"US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD" => {
Self::UsMiAmbassadorBridgePremierCommuterCard
}
"US_MI_BCPASS" => Self::UsMiBcpass,
"US_MI_BREAKAWAY" => Self::UsMiBreakaway,
"US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG" => Self::UsMiGrosseIleTollBridgePassTag,
"US_MI_IQ_PROX_CARD" => Self::UsMiIqProxCard,
"US_MI_IQ_TAG" => Self::UsMiIqTag,
"US_MI_MACKINAC_BRIDGE_MAC_PASS" => Self::UsMiMackinacBridgeMacPass,
"US_MI_NEXPRESS_TOLL" => Self::UsMiNexpressToll,
"US_MN_EZPASSMN" => Self::UsMnEzpassmn,
"US_NC_EZPASSNC" => Self::UsNcEzpassnc,
"US_NC_PEACH_PASS" => Self::UsNcPeachPass,
"US_NC_QUICK_PASS" => Self::UsNcQuickPass,
"US_NH_EZPASSNH" => Self::UsNhEzpassnh,
"US_NJ_DOWNBEACH_EXPRESS_PASS" => Self::UsNjDownbeachExpressPass,
"US_NJ_EZPASSNJ" => Self::UsNjEzpassnj,
"US_NY_EXPRESSPASS" => Self::UsNyExpresspass,
"US_NY_EZPASSNY" => Self::UsNyEzpassny,
"US_OH_EZPASSOH" => Self::UsOhEzpassoh,
"US_PA_EZPASSPA" => Self::UsPaEzpasspa,
"US_RI_EZPASSRI" => Self::UsRiEzpassri,
"US_SC_PALPASS" => Self::UsScPalpass,
"US_TX_AVI_TAG" => Self::UsTxAviTag,
"US_TX_BANCPASS" => Self::UsTxBancpass,
"US_TX_DEL_RIO_PASS" => Self::UsTxDelRioPass,
"US_TX_EFAST_PASS" => Self::UsTxEfastPass,
"US_TX_EAGLE_PASS_EXPRESS_CARD" => Self::UsTxEaglePassExpressCard,
"US_TX_EPTOLL" => Self::UsTxEptoll,
"US_TX_EZ_CROSS" => Self::UsTxEzCross,
"US_TX_EZTAG" => Self::UsTxEztag,
"US_TX_FUEGO_TAG" => Self::UsTxFuegoTag,
"US_TX_LAREDO_TRADE_TAG" => Self::UsTxLaredoTradeTag,
"US_TX_PLUSPASS" => Self::UsTxPluspass,
"US_TX_TOLLTAG" => Self::UsTxTolltag,
"US_TX_TXTAG" => Self::UsTxTxtag,
"US_TX_XPRESS_CARD" => Self::UsTxXpressCard,
"US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD" => Self::UsUtAdamsAveParkwayExpresscard,
"US_VA_EZPASSVA" => Self::UsVaEzpassva,
"US_WA_BREEZEBY" => Self::UsWaBreezeby,
"US_WA_GOOD_TO_GO" => Self::UsWaGoodToGo,
"US_WV_EZPASSWV" => Self::UsWvEzpasswv,
"US_WV_MEMORIAL_BRIDGE_TICKETS" => Self::UsWvMemorialBridgeTickets,
"US_WV_MOV_PASS" => Self::UsWvMovPass,
"US_WV_NEWELL_TOLL_BRIDGE_TICKET" => Self::UsWvNewellTollBridgeTicket,
_ => Self::UnknownValue(toll_pass::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TollPass {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::AuEtollTag => serializer.serialize_i32(82),
Self::AuEwayTag => serializer.serialize_i32(83),
Self::AuLinkt => serializer.serialize_i32(2),
Self::ArTelepase => serializer.serialize_i32(3),
Self::BrAutoExpreso => serializer.serialize_i32(81),
Self::BrConectcar => serializer.serialize_i32(7),
Self::BrMoveMais => serializer.serialize_i32(8),
Self::BrPassaRapido => serializer.serialize_i32(88),
Self::BrSemParar => serializer.serialize_i32(9),
Self::BrTaggy => serializer.serialize_i32(10),
Self::BrVeloe => serializer.serialize_i32(11),
Self::CaUsAkwasasneSeawayCorporateCard => serializer.serialize_i32(84),
Self::CaUsAkwasasneSeawayTransitCard => serializer.serialize_i32(85),
Self::CaUsBlueWaterEdgePass => serializer.serialize_i32(18),
Self::CaUsConnexion => serializer.serialize_i32(19),
Self::CaUsNexusCard => serializer.serialize_i32(20),
Self::IdEToll => serializer.serialize_i32(16),
Self::InFastag => serializer.serialize_i32(78),
Self::InLocalHpPlateExempt => serializer.serialize_i32(79),
Self::JpEtc => serializer.serialize_i32(98),
Self::JpEtc2 => serializer.serialize_i32(99),
Self::MxIave => serializer.serialize_i32(90),
Self::MxPase => serializer.serialize_i32(91),
Self::MxQuickpass => serializer.serialize_i32(93),
Self::MxSistemaTelepeajeChihuahua => serializer.serialize_i32(89),
Self::MxTagIave => serializer.serialize_i32(12),
Self::MxTagTelevia => serializer.serialize_i32(13),
Self::MxTelevia => serializer.serialize_i32(92),
Self::MxViapass => serializer.serialize_i32(14),
Self::UsAlFreedomPass => serializer.serialize_i32(21),
Self::UsAkAntonAndersonTunnelBookOf10Tickets => serializer.serialize_i32(22),
Self::UsCaFastrak => serializer.serialize_i32(4),
Self::UsCaFastrakCavSticker => serializer.serialize_i32(86),
Self::UsCoExpresstoll => serializer.serialize_i32(23),
Self::UsCoGoPass => serializer.serialize_i32(24),
Self::UsDeEzpassde => serializer.serialize_i32(25),
Self::UsFlBobSikesTollBridgePass => serializer.serialize_i32(65),
Self::UsFlDunesCommunityDevelopmentDistrictExpresscard => serializer.serialize_i32(66),
Self::UsFlEpass => serializer.serialize_i32(67),
Self::UsFlGibaTollPass => serializer.serialize_i32(68),
Self::UsFlLeeway => serializer.serialize_i32(69),
Self::UsFlSunpass => serializer.serialize_i32(70),
Self::UsFlSunpassPro => serializer.serialize_i32(71),
Self::UsIlEzpassil => serializer.serialize_i32(73),
Self::UsIlIpass => serializer.serialize_i32(72),
Self::UsInEzpassin => serializer.serialize_i32(26),
Self::UsKsBestpassHorizon => serializer.serialize_i32(27),
Self::UsKsKtag => serializer.serialize_i32(28),
Self::UsKsNationalpass => serializer.serialize_i32(29),
Self::UsKsPrepassElitepass => serializer.serialize_i32(30),
Self::UsKyRiverlink => serializer.serialize_i32(31),
Self::UsLaGeauxpass => serializer.serialize_i32(32),
Self::UsLaTollTag => serializer.serialize_i32(33),
Self::UsMaEzpassma => serializer.serialize_i32(6),
Self::UsMdEzpassmd => serializer.serialize_i32(34),
Self::UsMeEzpassme => serializer.serialize_i32(35),
Self::UsMiAmbassadorBridgePremierCommuterCard => serializer.serialize_i32(36),
Self::UsMiBcpass => serializer.serialize_i32(94),
Self::UsMiBreakaway => serializer.serialize_i32(101),
Self::UsMiGrosseIleTollBridgePassTag => serializer.serialize_i32(37),
Self::UsMiIqProxCard => serializer.serialize_i32(38),
Self::UsMiIqTag => serializer.serialize_i32(95),
Self::UsMiMackinacBridgeMacPass => serializer.serialize_i32(39),
Self::UsMiNexpressToll => serializer.serialize_i32(40),
Self::UsMnEzpassmn => serializer.serialize_i32(41),
Self::UsNcEzpassnc => serializer.serialize_i32(42),
Self::UsNcPeachPass => serializer.serialize_i32(87),
Self::UsNcQuickPass => serializer.serialize_i32(43),
Self::UsNhEzpassnh => serializer.serialize_i32(80),
Self::UsNjDownbeachExpressPass => serializer.serialize_i32(75),
Self::UsNjEzpassnj => serializer.serialize_i32(74),
Self::UsNyExpresspass => serializer.serialize_i32(76),
Self::UsNyEzpassny => serializer.serialize_i32(77),
Self::UsOhEzpassoh => serializer.serialize_i32(44),
Self::UsPaEzpasspa => serializer.serialize_i32(45),
Self::UsRiEzpassri => serializer.serialize_i32(46),
Self::UsScPalpass => serializer.serialize_i32(47),
Self::UsTxAviTag => serializer.serialize_i32(97),
Self::UsTxBancpass => serializer.serialize_i32(48),
Self::UsTxDelRioPass => serializer.serialize_i32(49),
Self::UsTxEfastPass => serializer.serialize_i32(50),
Self::UsTxEaglePassExpressCard => serializer.serialize_i32(51),
Self::UsTxEptoll => serializer.serialize_i32(52),
Self::UsTxEzCross => serializer.serialize_i32(53),
Self::UsTxEztag => serializer.serialize_i32(54),
Self::UsTxFuegoTag => serializer.serialize_i32(96),
Self::UsTxLaredoTradeTag => serializer.serialize_i32(55),
Self::UsTxPluspass => serializer.serialize_i32(56),
Self::UsTxTolltag => serializer.serialize_i32(57),
Self::UsTxTxtag => serializer.serialize_i32(58),
Self::UsTxXpressCard => serializer.serialize_i32(59),
Self::UsUtAdamsAveParkwayExpresscard => serializer.serialize_i32(60),
Self::UsVaEzpassva => serializer.serialize_i32(61),
Self::UsWaBreezeby => serializer.serialize_i32(17),
Self::UsWaGoodToGo => serializer.serialize_i32(1),
Self::UsWvEzpasswv => serializer.serialize_i32(62),
Self::UsWvMemorialBridgeTickets => serializer.serialize_i32(63),
Self::UsWvMovPass => serializer.serialize_i32(100),
Self::UsWvNewellTollBridgeTicket => serializer.serialize_i32(64),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TollPass {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TollPass>::new(
".google.maps.routing.v2.TollPass",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TrafficModel {
Unspecified,
BestGuess,
Pessimistic,
Optimistic,
UnknownValue(traffic_model::UnknownValue),
}
#[doc(hidden)]
pub mod traffic_model {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TrafficModel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::BestGuess => std::option::Option::Some(1),
Self::Pessimistic => std::option::Option::Some(2),
Self::Optimistic => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TRAFFIC_MODEL_UNSPECIFIED"),
Self::BestGuess => std::option::Option::Some("BEST_GUESS"),
Self::Pessimistic => std::option::Option::Some("PESSIMISTIC"),
Self::Optimistic => std::option::Option::Some("OPTIMISTIC"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TrafficModel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TrafficModel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TrafficModel {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::BestGuess,
2 => Self::Pessimistic,
3 => Self::Optimistic,
_ => Self::UnknownValue(traffic_model::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TrafficModel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRAFFIC_MODEL_UNSPECIFIED" => Self::Unspecified,
"BEST_GUESS" => Self::BestGuess,
"PESSIMISTIC" => Self::Pessimistic,
"OPTIMISTIC" => Self::Optimistic,
_ => Self::UnknownValue(traffic_model::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TrafficModel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::BestGuess => serializer.serialize_i32(1),
Self::Pessimistic => serializer.serialize_i32(2),
Self::Optimistic => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TrafficModel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TrafficModel>::new(
".google.maps.routing.v2.TrafficModel",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Units {
Unspecified,
Metric,
Imperial,
UnknownValue(units::UnknownValue),
}
#[doc(hidden)]
pub mod units {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Units {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Metric => std::option::Option::Some(1),
Self::Imperial => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("UNITS_UNSPECIFIED"),
Self::Metric => std::option::Option::Some("METRIC"),
Self::Imperial => std::option::Option::Some("IMPERIAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Units {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Units {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Units {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Metric,
2 => Self::Imperial,
_ => Self::UnknownValue(units::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Units {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"UNITS_UNSPECIFIED" => Self::Unspecified,
"METRIC" => Self::Metric,
"IMPERIAL" => Self::Imperial,
_ => Self::UnknownValue(units::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Units {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Metric => serializer.serialize_i32(1),
Self::Imperial => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Units {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Units>::new(
".google.maps.routing.v2.Units",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VehicleEmissionType {
Unspecified,
Gasoline,
Electric,
Hybrid,
Diesel,
UnknownValue(vehicle_emission_type::UnknownValue),
}
#[doc(hidden)]
pub mod vehicle_emission_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VehicleEmissionType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Gasoline => std::option::Option::Some(1),
Self::Electric => std::option::Option::Some(2),
Self::Hybrid => std::option::Option::Some(3),
Self::Diesel => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("VEHICLE_EMISSION_TYPE_UNSPECIFIED"),
Self::Gasoline => std::option::Option::Some("GASOLINE"),
Self::Electric => std::option::Option::Some("ELECTRIC"),
Self::Hybrid => std::option::Option::Some("HYBRID"),
Self::Diesel => std::option::Option::Some("DIESEL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VehicleEmissionType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VehicleEmissionType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for VehicleEmissionType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Gasoline,
2 => Self::Electric,
3 => Self::Hybrid,
4 => Self::Diesel,
_ => Self::UnknownValue(vehicle_emission_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VehicleEmissionType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VEHICLE_EMISSION_TYPE_UNSPECIFIED" => Self::Unspecified,
"GASOLINE" => Self::Gasoline,
"ELECTRIC" => Self::Electric,
"HYBRID" => Self::Hybrid,
"DIESEL" => Self::Diesel,
_ => Self::UnknownValue(vehicle_emission_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VehicleEmissionType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Gasoline => serializer.serialize_i32(1),
Self::Electric => serializer.serialize_i32(2),
Self::Hybrid => serializer.serialize_i32(3),
Self::Diesel => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VehicleEmissionType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VehicleEmissionType>::new(
".google.maps.routing.v2.VehicleEmissionType",
))
}
}