#[allow(unused_imports)]
use super::*;
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::AddressDescriptor {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__landmarks,
__areas,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AddressDescriptor")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"landmarks" => Ok(__FieldTag::__landmarks),
"areas" => Ok(__FieldTag::__areas),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AddressDescriptor;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AddressDescriptor")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__landmarks => {
if !fields.insert(__FieldTag::__landmarks) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for landmarks",
));
}
result.landmarks = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::address_descriptor::Landmark>,
>>()?
.unwrap_or_default();
}
__FieldTag::__areas => {
if !fields.insert(__FieldTag::__areas) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for areas",
));
}
result.areas = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::address_descriptor::Area>,
>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::address_descriptor::Landmark {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__place_id,
__display_name,
__types,
__spatial_relationship,
__straight_line_distance_meters,
__travel_distance_meters,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Landmark")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"placeId" => Ok(__FieldTag::__place_id),
"place_id" => Ok(__FieldTag::__place_id),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"types" => Ok(__FieldTag::__types),
"spatialRelationship" => Ok(__FieldTag::__spatial_relationship),
"spatial_relationship" => Ok(__FieldTag::__spatial_relationship),
"straightLineDistanceMeters" => {
Ok(__FieldTag::__straight_line_distance_meters)
}
"straight_line_distance_meters" => {
Ok(__FieldTag::__straight_line_distance_meters)
}
"travelDistanceMeters" => Ok(__FieldTag::__travel_distance_meters),
"travel_distance_meters" => Ok(__FieldTag::__travel_distance_meters),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::address_descriptor::Landmark;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Landmark")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__place_id => {
if !fields.insert(__FieldTag::__place_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for place_id",
));
}
result.place_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__display_name => {
if !fields.insert(__FieldTag::__display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for display_name",
));
}
result.display_name = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__types => {
if !fields.insert(__FieldTag::__types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for types",
));
}
result.types = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__spatial_relationship => {
if !fields.insert(__FieldTag::__spatial_relationship) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for spatial_relationship",
));
}
result.spatial_relationship = map
.next_value::<std::option::Option<
crate::model::address_descriptor::landmark::SpatialRelationship,
>>()?
.unwrap_or_default();
}
__FieldTag::__straight_line_distance_meters => {
if !fields.insert(__FieldTag::__straight_line_distance_meters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for straight_line_distance_meters",
));
}
struct __With(std::option::Option<f32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F32> >::deserialize(deserializer).map(__With)
}
}
result.straight_line_distance_meters =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__travel_distance_meters => {
if !fields.insert(__FieldTag::__travel_distance_meters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for travel_distance_meters",
));
}
struct __With(std::option::Option<f32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F32> >::deserialize(deserializer).map(__With)
}
}
result.travel_distance_meters = map.next_value::<__With>()?.0;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::address_descriptor::Area {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__place_id,
__display_name,
__containment,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Area")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"placeId" => Ok(__FieldTag::__place_id),
"place_id" => Ok(__FieldTag::__place_id),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"containment" => Ok(__FieldTag::__containment),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::address_descriptor::Area;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Area")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__place_id => {
if !fields.insert(__FieldTag::__place_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for place_id",
));
}
result.place_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__display_name => {
if !fields.insert(__FieldTag::__display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for display_name",
));
}
result.display_name = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__containment => {
if !fields.insert(__FieldTag::__containment) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for containment",
));
}
result.containment = map
.next_value::<std::option::Option<
crate::model::address_descriptor::area::Containment,
>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::AuthorAttribution {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__display_name,
__uri,
__photo_uri,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AuthorAttribution")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"uri" => Ok(__FieldTag::__uri),
"photoUri" => Ok(__FieldTag::__photo_uri),
"photo_uri" => Ok(__FieldTag::__photo_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AuthorAttribution;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AuthorAttribution")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__display_name => {
if !fields.insert(__FieldTag::__display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for display_name",
));
}
result.display_name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__uri => {
if !fields.insert(__FieldTag::__uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for uri",
));
}
result.uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__photo_uri => {
if !fields.insert(__FieldTag::__photo_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for photo_uri",
));
}
result.photo_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::ContentBlock {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__content,
__referenced_places,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ContentBlock")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"content" => Ok(__FieldTag::__content),
"referencedPlaces" => Ok(__FieldTag::__referenced_places),
"referenced_places" => Ok(__FieldTag::__referenced_places),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ContentBlock;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ContentBlock")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__content => {
if !fields.insert(__FieldTag::__content) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for content",
));
}
result.content = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__referenced_places => {
if !fields.insert(__FieldTag::__referenced_places) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for referenced_places",
));
}
result.referenced_places = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::ContextualContent {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__reviews,
__photos,
__justifications,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ContextualContent")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"reviews" => Ok(__FieldTag::__reviews),
"photos" => Ok(__FieldTag::__photos),
"justifications" => Ok(__FieldTag::__justifications),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ContextualContent;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ContextualContent")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__reviews => {
if !fields.insert(__FieldTag::__reviews) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reviews",
));
}
result.reviews = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Review>>>()?.unwrap_or_default();
}
__FieldTag::__photos => {
if !fields.insert(__FieldTag::__photos) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for photos",
));
}
result.photos = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Photo>>>()?.unwrap_or_default();
}
__FieldTag::__justifications => {
if !fields.insert(__FieldTag::__justifications) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for justifications",
));
}
result.justifications = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::contextual_content::Justification>,
>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::contextual_content::Justification {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__review_justification,
__business_availability_attributes_justification,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Justification")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"reviewJustification" => Ok(__FieldTag::__review_justification),
"review_justification" => Ok(__FieldTag::__review_justification),
"businessAvailabilityAttributesJustification" => {
Ok(__FieldTag::__business_availability_attributes_justification)
}
"business_availability_attributes_justification" => {
Ok(__FieldTag::__business_availability_attributes_justification)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::contextual_content::Justification;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Justification")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__review_justification => {
if !fields.insert(__FieldTag::__review_justification) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for review_justification",
));
}
if result.justification.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `justification`, a oneof with full ID .google.maps.places.v1.ContextualContent.Justification.review_justification, latest field was reviewJustification",
));
}
result.justification = std::option::Option::Some(
crate::model::contextual_content::justification::Justification::ReviewJustification(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::contextual_content::justification::ReviewJustification>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__business_availability_attributes_justification => {
if !fields.insert(
__FieldTag::__business_availability_attributes_justification,
) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for business_availability_attributes_justification",
));
}
if result.justification.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `justification`, a oneof with full ID .google.maps.places.v1.ContextualContent.Justification.business_availability_attributes_justification, latest field was businessAvailabilityAttributesJustification",
));
}
result.justification = std::option::Option::Some(
crate::model::contextual_content::justification::Justification::BusinessAvailabilityAttributesJustification(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::contextual_content::justification::BusinessAvailabilityAttributesJustification>>>()?.unwrap_or_default()
),
);
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de>
for super::contextual_content::justification::ReviewJustification
{
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__highlighted_text,
__review,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ReviewJustification")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"highlightedText" => Ok(__FieldTag::__highlighted_text),
"highlighted_text" => Ok(__FieldTag::__highlighted_text),
"review" => Ok(__FieldTag::__review),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::contextual_content::justification::ReviewJustification;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ReviewJustification")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__highlighted_text => {
if !fields.insert(__FieldTag::__highlighted_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for highlighted_text",
));
}
result.highlighted_text = map.next_value::<std::option::Option<crate::model::contextual_content::justification::review_justification::HighlightedText>>()?
;
}
__FieldTag::__review => {
if !fields.insert(__FieldTag::__review) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for review",
));
}
result.review =
map.next_value::<std::option::Option<crate::model::Review>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de>
for super::contextual_content::justification::review_justification::HighlightedText
{
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__text,
__highlighted_text_ranges,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for HighlightedText")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"text" => Ok(__FieldTag::__text),
"highlightedTextRanges" => Ok(__FieldTag::__highlighted_text_ranges),
"highlighted_text_ranges" => Ok(__FieldTag::__highlighted_text_ranges),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value =
super::contextual_content::justification::review_justification::HighlightedText;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct HighlightedText")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__text => {
if !fields.insert(__FieldTag::__text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text",
));
}
result.text = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__highlighted_text_ranges => {
if !fields.insert(__FieldTag::__highlighted_text_ranges) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for highlighted_text_ranges",
));
}
result.highlighted_text_ranges = map.next_value::<std::option::Option<std::vec::Vec<crate::model::contextual_content::justification::review_justification::highlighted_text::HighlightedTextRange>>>()?.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::contextual_content::justification::review_justification::highlighted_text::HighlightedTextRange {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__start_index,
__end_index,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for HighlightedTextRange")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"startIndex" => Ok(__FieldTag::__start_index),
"start_index" => Ok(__FieldTag::__start_index),
"endIndex" => Ok(__FieldTag::__end_index),
"end_index" => Ok(__FieldTag::__end_index),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::contextual_content::justification::review_justification::highlighted_text::HighlightedTextRange;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct HighlightedTextRange")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
use std::option::Option::Some;
#[allow(unused_imports)]
use serde::de::Error;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__start_index => {
if !fields.insert(__FieldTag::__start_index) {
return std::result::Result::Err(A::Error::duplicate_field("multiple values for start_index"));
}
struct __With( std::option::Option<i32> );
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.start_index = map.next_value::< __With >()?.0.unwrap_or_default();
},
__FieldTag::__end_index => {
if !fields.insert(__FieldTag::__end_index) {
return std::result::Result::Err(A::Error::duplicate_field("multiple values for end_index"));
}
struct __With( std::option::Option<i32> );
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.end_index = map.next_value::< __With >()?.0.unwrap_or_default();
},
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
},
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de>
for super::contextual_content::justification::BusinessAvailabilityAttributesJustification
{
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__takeout,
__delivery,
__dine_in,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str(
"a field name for BusinessAvailabilityAttributesJustification",
)
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"takeout" => Ok(__FieldTag::__takeout),
"delivery" => Ok(__FieldTag::__delivery),
"dineIn" => Ok(__FieldTag::__dine_in),
"dine_in" => Ok(__FieldTag::__dine_in),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::contextual_content::justification::BusinessAvailabilityAttributesJustification;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BusinessAvailabilityAttributesJustification")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__takeout => {
if !fields.insert(__FieldTag::__takeout) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for takeout",
));
}
result.takeout = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__delivery => {
if !fields.insert(__FieldTag::__delivery) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for delivery",
));
}
result.delivery = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__dine_in => {
if !fields.insert(__FieldTag::__dine_in) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for dine_in",
));
}
result.dine_in = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::EVChargeOptions {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__connector_count,
__connector_aggregation,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for EVChargeOptions")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"connectorCount" => Ok(__FieldTag::__connector_count),
"connector_count" => Ok(__FieldTag::__connector_count),
"connectorAggregation" => Ok(__FieldTag::__connector_aggregation),
"connector_aggregation" => Ok(__FieldTag::__connector_aggregation),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::EVChargeOptions;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct EVChargeOptions")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__connector_count => {
if !fields.insert(__FieldTag::__connector_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for connector_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.connector_count =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__connector_aggregation => {
if !fields.insert(__FieldTag::__connector_aggregation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for connector_aggregation",
));
}
result.connector_aggregation = map
.next_value::<std::option::Option<
std::vec::Vec<
crate::model::ev_charge_options::ConnectorAggregation,
>,
>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::ev_charge_options::ConnectorAggregation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__type,
__max_charge_rate_kw,
__count,
__available_count,
__out_of_service_count,
__availability_last_update_time,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ConnectorAggregation")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"type" => Ok(__FieldTag::__type),
"maxChargeRateKw" => Ok(__FieldTag::__max_charge_rate_kw),
"max_charge_rate_kw" => Ok(__FieldTag::__max_charge_rate_kw),
"count" => Ok(__FieldTag::__count),
"availableCount" => Ok(__FieldTag::__available_count),
"available_count" => Ok(__FieldTag::__available_count),
"outOfServiceCount" => Ok(__FieldTag::__out_of_service_count),
"out_of_service_count" => Ok(__FieldTag::__out_of_service_count),
"availabilityLastUpdateTime" => {
Ok(__FieldTag::__availability_last_update_time)
}
"availability_last_update_time" => {
Ok(__FieldTag::__availability_last_update_time)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ev_charge_options::ConnectorAggregation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ConnectorAggregation")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__type => {
if !fields.insert(__FieldTag::__type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for type",
));
}
result.r#type = map
.next_value::<std::option::Option<crate::model::EVConnectorType>>()?
.unwrap_or_default();
}
__FieldTag::__max_charge_rate_kw => {
if !fields.insert(__FieldTag::__max_charge_rate_kw) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_charge_rate_kw",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.max_charge_rate_kw =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__count => {
if !fields.insert(__FieldTag::__count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.count = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__available_count => {
if !fields.insert(__FieldTag::__available_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for available_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.available_count = map.next_value::<__With>()?.0;
}
__FieldTag::__out_of_service_count => {
if !fields.insert(__FieldTag::__out_of_service_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for out_of_service_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.out_of_service_count = map.next_value::<__With>()?.0;
}
__FieldTag::__availability_last_update_time => {
if !fields.insert(__FieldTag::__availability_last_update_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for availability_last_update_time",
));
}
result.availability_last_update_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::FuelOptions {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__fuel_prices,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for FuelOptions")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"fuelPrices" => Ok(__FieldTag::__fuel_prices),
"fuel_prices" => Ok(__FieldTag::__fuel_prices),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::FuelOptions;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct FuelOptions")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__fuel_prices => {
if !fields.insert(__FieldTag::__fuel_prices) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for fuel_prices",
));
}
result.fuel_prices = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::fuel_options::FuelPrice>,
>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::fuel_options::FuelPrice {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__type,
__price,
__update_time,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for FuelPrice")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"type" => Ok(__FieldTag::__type),
"price" => Ok(__FieldTag::__price),
"updateTime" => Ok(__FieldTag::__update_time),
"update_time" => Ok(__FieldTag::__update_time),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::fuel_options::FuelPrice;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct FuelPrice")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__type => {
if !fields.insert(__FieldTag::__type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for type",
));
}
result.r#type = map
.next_value::<std::option::Option<
crate::model::fuel_options::fuel_price::FuelType,
>>()?
.unwrap_or_default();
}
__FieldTag::__price => {
if !fields.insert(__FieldTag::__price) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for price",
));
}
result.price = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__update_time => {
if !fields.insert(__FieldTag::__update_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_time",
));
}
result.update_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::Circle {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__center,
__radius,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Circle")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"center" => Ok(__FieldTag::__center),
"radius" => Ok(__FieldTag::__radius),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Circle;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Circle")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__center => {
if !fields.insert(__FieldTag::__center) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for center",
));
}
result.center = map.next_value::<std::option::Option<google_cloud_type::model::LatLng>>()?
;
}
__FieldTag::__radius => {
if !fields.insert(__FieldTag::__radius) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for radius",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.radius = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::Photo {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__width_px,
__height_px,
__author_attributions,
__flag_content_uri,
__google_maps_uri,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Photo")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"widthPx" => Ok(__FieldTag::__width_px),
"width_px" => Ok(__FieldTag::__width_px),
"heightPx" => Ok(__FieldTag::__height_px),
"height_px" => Ok(__FieldTag::__height_px),
"authorAttributions" => Ok(__FieldTag::__author_attributions),
"author_attributions" => Ok(__FieldTag::__author_attributions),
"flagContentUri" => Ok(__FieldTag::__flag_content_uri),
"flag_content_uri" => Ok(__FieldTag::__flag_content_uri),
"googleMapsUri" => Ok(__FieldTag::__google_maps_uri),
"google_maps_uri" => Ok(__FieldTag::__google_maps_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Photo;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Photo")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__width_px => {
if !fields.insert(__FieldTag::__width_px) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for width_px",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.width_px = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__height_px => {
if !fields.insert(__FieldTag::__height_px) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for height_px",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.height_px = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__author_attributions => {
if !fields.insert(__FieldTag::__author_attributions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for author_attributions",
));
}
result.author_attributions =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::AuthorAttribution>,
>>()?
.unwrap_or_default();
}
__FieldTag::__flag_content_uri => {
if !fields.insert(__FieldTag::__flag_content_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for flag_content_uri",
));
}
result.flag_content_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__google_maps_uri => {
if !fields.insert(__FieldTag::__google_maps_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for google_maps_uri",
));
}
result.google_maps_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::Place {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__id,
__display_name,
__types,
__primary_type,
__primary_type_display_name,
__google_maps_type_label,
__national_phone_number,
__international_phone_number,
__formatted_address,
__short_formatted_address,
__postal_address,
__address_components,
__plus_code,
__location,
__viewport,
__rating,
__google_maps_uri,
__website_uri,
__reviews,
__regular_opening_hours,
__utc_offset_minutes,
__time_zone,
__photos,
__adr_format_address,
__business_status,
__opening_date,
__price_level,
__attributions,
__user_rating_count,
__icon_mask_base_uri,
__icon_background_color,
__takeout,
__delivery,
__dine_in,
__curbside_pickup,
__reservable,
__serves_breakfast,
__serves_lunch,
__serves_dinner,
__serves_beer,
__serves_wine,
__serves_brunch,
__serves_vegetarian_food,
__current_opening_hours,
__current_secondary_opening_hours,
__regular_secondary_opening_hours,
__editorial_summary,
__outdoor_seating,
__live_music,
__menu_for_children,
__serves_cocktails,
__serves_dessert,
__serves_coffee,
__good_for_children,
__allows_dogs,
__restroom,
__good_for_groups,
__good_for_watching_sports,
__payment_options,
__parking_options,
__sub_destinations,
__accessibility_options,
__fuel_options,
__ev_charge_options,
__generative_summary,
__containing_places,
__pure_service_area_business,
__address_descriptor,
__google_maps_links,
__price_range,
__review_summary,
__ev_charge_amenity_summary,
__neighborhood_summary,
__consumer_alert,
__moved_place,
__moved_place_id,
__transit_station,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Place")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"id" => Ok(__FieldTag::__id),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"types" => Ok(__FieldTag::__types),
"primaryType" => Ok(__FieldTag::__primary_type),
"primary_type" => Ok(__FieldTag::__primary_type),
"primaryTypeDisplayName" => Ok(__FieldTag::__primary_type_display_name),
"primary_type_display_name" => {
Ok(__FieldTag::__primary_type_display_name)
}
"googleMapsTypeLabel" => Ok(__FieldTag::__google_maps_type_label),
"google_maps_type_label" => Ok(__FieldTag::__google_maps_type_label),
"nationalPhoneNumber" => Ok(__FieldTag::__national_phone_number),
"national_phone_number" => Ok(__FieldTag::__national_phone_number),
"internationalPhoneNumber" => {
Ok(__FieldTag::__international_phone_number)
}
"international_phone_number" => {
Ok(__FieldTag::__international_phone_number)
}
"formattedAddress" => Ok(__FieldTag::__formatted_address),
"formatted_address" => Ok(__FieldTag::__formatted_address),
"shortFormattedAddress" => Ok(__FieldTag::__short_formatted_address),
"short_formatted_address" => Ok(__FieldTag::__short_formatted_address),
"postalAddress" => Ok(__FieldTag::__postal_address),
"postal_address" => Ok(__FieldTag::__postal_address),
"addressComponents" => Ok(__FieldTag::__address_components),
"address_components" => Ok(__FieldTag::__address_components),
"plusCode" => Ok(__FieldTag::__plus_code),
"plus_code" => Ok(__FieldTag::__plus_code),
"location" => Ok(__FieldTag::__location),
"viewport" => Ok(__FieldTag::__viewport),
"rating" => Ok(__FieldTag::__rating),
"googleMapsUri" => Ok(__FieldTag::__google_maps_uri),
"google_maps_uri" => Ok(__FieldTag::__google_maps_uri),
"websiteUri" => Ok(__FieldTag::__website_uri),
"website_uri" => Ok(__FieldTag::__website_uri),
"reviews" => Ok(__FieldTag::__reviews),
"regularOpeningHours" => Ok(__FieldTag::__regular_opening_hours),
"regular_opening_hours" => Ok(__FieldTag::__regular_opening_hours),
"utcOffsetMinutes" => Ok(__FieldTag::__utc_offset_minutes),
"utc_offset_minutes" => Ok(__FieldTag::__utc_offset_minutes),
"timeZone" => Ok(__FieldTag::__time_zone),
"time_zone" => Ok(__FieldTag::__time_zone),
"photos" => Ok(__FieldTag::__photos),
"adrFormatAddress" => Ok(__FieldTag::__adr_format_address),
"adr_format_address" => Ok(__FieldTag::__adr_format_address),
"businessStatus" => Ok(__FieldTag::__business_status),
"business_status" => Ok(__FieldTag::__business_status),
"openingDate" => Ok(__FieldTag::__opening_date),
"opening_date" => Ok(__FieldTag::__opening_date),
"priceLevel" => Ok(__FieldTag::__price_level),
"price_level" => Ok(__FieldTag::__price_level),
"attributions" => Ok(__FieldTag::__attributions),
"userRatingCount" => Ok(__FieldTag::__user_rating_count),
"user_rating_count" => Ok(__FieldTag::__user_rating_count),
"iconMaskBaseUri" => Ok(__FieldTag::__icon_mask_base_uri),
"icon_mask_base_uri" => Ok(__FieldTag::__icon_mask_base_uri),
"iconBackgroundColor" => Ok(__FieldTag::__icon_background_color),
"icon_background_color" => Ok(__FieldTag::__icon_background_color),
"takeout" => Ok(__FieldTag::__takeout),
"delivery" => Ok(__FieldTag::__delivery),
"dineIn" => Ok(__FieldTag::__dine_in),
"dine_in" => Ok(__FieldTag::__dine_in),
"curbsidePickup" => Ok(__FieldTag::__curbside_pickup),
"curbside_pickup" => Ok(__FieldTag::__curbside_pickup),
"reservable" => Ok(__FieldTag::__reservable),
"servesBreakfast" => Ok(__FieldTag::__serves_breakfast),
"serves_breakfast" => Ok(__FieldTag::__serves_breakfast),
"servesLunch" => Ok(__FieldTag::__serves_lunch),
"serves_lunch" => Ok(__FieldTag::__serves_lunch),
"servesDinner" => Ok(__FieldTag::__serves_dinner),
"serves_dinner" => Ok(__FieldTag::__serves_dinner),
"servesBeer" => Ok(__FieldTag::__serves_beer),
"serves_beer" => Ok(__FieldTag::__serves_beer),
"servesWine" => Ok(__FieldTag::__serves_wine),
"serves_wine" => Ok(__FieldTag::__serves_wine),
"servesBrunch" => Ok(__FieldTag::__serves_brunch),
"serves_brunch" => Ok(__FieldTag::__serves_brunch),
"servesVegetarianFood" => Ok(__FieldTag::__serves_vegetarian_food),
"serves_vegetarian_food" => Ok(__FieldTag::__serves_vegetarian_food),
"currentOpeningHours" => Ok(__FieldTag::__current_opening_hours),
"current_opening_hours" => Ok(__FieldTag::__current_opening_hours),
"currentSecondaryOpeningHours" => {
Ok(__FieldTag::__current_secondary_opening_hours)
}
"current_secondary_opening_hours" => {
Ok(__FieldTag::__current_secondary_opening_hours)
}
"regularSecondaryOpeningHours" => {
Ok(__FieldTag::__regular_secondary_opening_hours)
}
"regular_secondary_opening_hours" => {
Ok(__FieldTag::__regular_secondary_opening_hours)
}
"editorialSummary" => Ok(__FieldTag::__editorial_summary),
"editorial_summary" => Ok(__FieldTag::__editorial_summary),
"outdoorSeating" => Ok(__FieldTag::__outdoor_seating),
"outdoor_seating" => Ok(__FieldTag::__outdoor_seating),
"liveMusic" => Ok(__FieldTag::__live_music),
"live_music" => Ok(__FieldTag::__live_music),
"menuForChildren" => Ok(__FieldTag::__menu_for_children),
"menu_for_children" => Ok(__FieldTag::__menu_for_children),
"servesCocktails" => Ok(__FieldTag::__serves_cocktails),
"serves_cocktails" => Ok(__FieldTag::__serves_cocktails),
"servesDessert" => Ok(__FieldTag::__serves_dessert),
"serves_dessert" => Ok(__FieldTag::__serves_dessert),
"servesCoffee" => Ok(__FieldTag::__serves_coffee),
"serves_coffee" => Ok(__FieldTag::__serves_coffee),
"goodForChildren" => Ok(__FieldTag::__good_for_children),
"good_for_children" => Ok(__FieldTag::__good_for_children),
"allowsDogs" => Ok(__FieldTag::__allows_dogs),
"allows_dogs" => Ok(__FieldTag::__allows_dogs),
"restroom" => Ok(__FieldTag::__restroom),
"goodForGroups" => Ok(__FieldTag::__good_for_groups),
"good_for_groups" => Ok(__FieldTag::__good_for_groups),
"goodForWatchingSports" => Ok(__FieldTag::__good_for_watching_sports),
"good_for_watching_sports" => {
Ok(__FieldTag::__good_for_watching_sports)
}
"paymentOptions" => Ok(__FieldTag::__payment_options),
"payment_options" => Ok(__FieldTag::__payment_options),
"parkingOptions" => Ok(__FieldTag::__parking_options),
"parking_options" => Ok(__FieldTag::__parking_options),
"subDestinations" => Ok(__FieldTag::__sub_destinations),
"sub_destinations" => Ok(__FieldTag::__sub_destinations),
"accessibilityOptions" => Ok(__FieldTag::__accessibility_options),
"accessibility_options" => Ok(__FieldTag::__accessibility_options),
"fuelOptions" => Ok(__FieldTag::__fuel_options),
"fuel_options" => Ok(__FieldTag::__fuel_options),
"evChargeOptions" => Ok(__FieldTag::__ev_charge_options),
"ev_charge_options" => Ok(__FieldTag::__ev_charge_options),
"generativeSummary" => Ok(__FieldTag::__generative_summary),
"generative_summary" => Ok(__FieldTag::__generative_summary),
"containingPlaces" => Ok(__FieldTag::__containing_places),
"containing_places" => Ok(__FieldTag::__containing_places),
"pureServiceAreaBusiness" => {
Ok(__FieldTag::__pure_service_area_business)
}
"pure_service_area_business" => {
Ok(__FieldTag::__pure_service_area_business)
}
"addressDescriptor" => Ok(__FieldTag::__address_descriptor),
"address_descriptor" => Ok(__FieldTag::__address_descriptor),
"googleMapsLinks" => Ok(__FieldTag::__google_maps_links),
"google_maps_links" => Ok(__FieldTag::__google_maps_links),
"priceRange" => Ok(__FieldTag::__price_range),
"price_range" => Ok(__FieldTag::__price_range),
"reviewSummary" => Ok(__FieldTag::__review_summary),
"review_summary" => Ok(__FieldTag::__review_summary),
"evChargeAmenitySummary" => Ok(__FieldTag::__ev_charge_amenity_summary),
"ev_charge_amenity_summary" => {
Ok(__FieldTag::__ev_charge_amenity_summary)
}
"neighborhoodSummary" => Ok(__FieldTag::__neighborhood_summary),
"neighborhood_summary" => Ok(__FieldTag::__neighborhood_summary),
"consumerAlert" => Ok(__FieldTag::__consumer_alert),
"consumer_alert" => Ok(__FieldTag::__consumer_alert),
"movedPlace" => Ok(__FieldTag::__moved_place),
"moved_place" => Ok(__FieldTag::__moved_place),
"movedPlaceId" => Ok(__FieldTag::__moved_place_id),
"moved_place_id" => Ok(__FieldTag::__moved_place_id),
"transitStation" => Ok(__FieldTag::__transit_station),
"transit_station" => Ok(__FieldTag::__transit_station),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Place;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Place")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__id => {
if !fields.insert(__FieldTag::__id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for id",
));
}
result.id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__display_name => {
if !fields.insert(__FieldTag::__display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for display_name",
));
}
result.display_name = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__types => {
if !fields.insert(__FieldTag::__types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for types",
));
}
result.types = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__primary_type => {
if !fields.insert(__FieldTag::__primary_type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for primary_type",
));
}
result.primary_type = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__primary_type_display_name => {
if !fields.insert(__FieldTag::__primary_type_display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for primary_type_display_name",
));
}
result.primary_type_display_name = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__google_maps_type_label => {
if !fields.insert(__FieldTag::__google_maps_type_label) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for google_maps_type_label",
));
}
result.google_maps_type_label = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__national_phone_number => {
if !fields.insert(__FieldTag::__national_phone_number) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for national_phone_number",
));
}
result.national_phone_number = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__international_phone_number => {
if !fields.insert(__FieldTag::__international_phone_number) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for international_phone_number",
));
}
result.international_phone_number = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__formatted_address => {
if !fields.insert(__FieldTag::__formatted_address) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for formatted_address",
));
}
result.formatted_address = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__short_formatted_address => {
if !fields.insert(__FieldTag::__short_formatted_address) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for short_formatted_address",
));
}
result.short_formatted_address = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__postal_address => {
if !fields.insert(__FieldTag::__postal_address) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for postal_address",
));
}
result.postal_address = map.next_value::<std::option::Option<google_cloud_type::model::PostalAddress>>()?
;
}
__FieldTag::__address_components => {
if !fields.insert(__FieldTag::__address_components) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for address_components",
));
}
result.address_components = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::place::AddressComponent>,
>>()?
.unwrap_or_default();
}
__FieldTag::__plus_code => {
if !fields.insert(__FieldTag::__plus_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for plus_code",
));
}
result.plus_code = map
.next_value::<std::option::Option<crate::model::place::PlusCode>>(
)?;
}
__FieldTag::__location => {
if !fields.insert(__FieldTag::__location) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for location",
));
}
result.location = map.next_value::<std::option::Option<google_cloud_type::model::LatLng>>()?
;
}
__FieldTag::__viewport => {
if !fields.insert(__FieldTag::__viewport) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for viewport",
));
}
result.viewport = map.next_value::<std::option::Option<google_geo_type::model::Viewport>>()?
;
}
__FieldTag::__rating => {
if !fields.insert(__FieldTag::__rating) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rating",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.rating = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__google_maps_uri => {
if !fields.insert(__FieldTag::__google_maps_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for google_maps_uri",
));
}
result.google_maps_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__website_uri => {
if !fields.insert(__FieldTag::__website_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for website_uri",
));
}
result.website_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__reviews => {
if !fields.insert(__FieldTag::__reviews) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reviews",
));
}
result.reviews = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Review>>>()?.unwrap_or_default();
}
__FieldTag::__regular_opening_hours => {
if !fields.insert(__FieldTag::__regular_opening_hours) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for regular_opening_hours",
));
}
result.regular_opening_hours = map.next_value::<std::option::Option<crate::model::place::OpeningHours>>()?
;
}
__FieldTag::__utc_offset_minutes => {
if !fields.insert(__FieldTag::__utc_offset_minutes) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for utc_offset_minutes",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.utc_offset_minutes = map.next_value::<__With>()?.0;
}
__FieldTag::__time_zone => {
if !fields.insert(__FieldTag::__time_zone) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for time_zone",
));
}
result.time_zone = map.next_value::<std::option::Option<google_cloud_type::model::TimeZone>>()?
;
}
__FieldTag::__photos => {
if !fields.insert(__FieldTag::__photos) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for photos",
));
}
result.photos = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Photo>>>()?.unwrap_or_default();
}
__FieldTag::__adr_format_address => {
if !fields.insert(__FieldTag::__adr_format_address) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for adr_format_address",
));
}
result.adr_format_address = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__business_status => {
if !fields.insert(__FieldTag::__business_status) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for business_status",
));
}
result.business_status = map.next_value::<std::option::Option<crate::model::place::BusinessStatus>>()?.unwrap_or_default();
}
__FieldTag::__opening_date => {
if !fields.insert(__FieldTag::__opening_date) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for opening_date",
));
}
result.opening_date = map
.next_value::<std::option::Option<google_cloud_type::model::Date>>(
)?;
}
__FieldTag::__price_level => {
if !fields.insert(__FieldTag::__price_level) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for price_level",
));
}
result.price_level = map
.next_value::<std::option::Option<crate::model::PriceLevel>>()?
.unwrap_or_default();
}
__FieldTag::__attributions => {
if !fields.insert(__FieldTag::__attributions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for attributions",
));
}
result.attributions = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::place::Attribution>,
>>()?
.unwrap_or_default();
}
__FieldTag::__user_rating_count => {
if !fields.insert(__FieldTag::__user_rating_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for user_rating_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.user_rating_count = map.next_value::<__With>()?.0;
}
__FieldTag::__icon_mask_base_uri => {
if !fields.insert(__FieldTag::__icon_mask_base_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for icon_mask_base_uri",
));
}
result.icon_mask_base_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__icon_background_color => {
if !fields.insert(__FieldTag::__icon_background_color) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for icon_background_color",
));
}
result.icon_background_color = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__takeout => {
if !fields.insert(__FieldTag::__takeout) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for takeout",
));
}
result.takeout = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__delivery => {
if !fields.insert(__FieldTag::__delivery) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for delivery",
));
}
result.delivery = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__dine_in => {
if !fields.insert(__FieldTag::__dine_in) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for dine_in",
));
}
result.dine_in = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__curbside_pickup => {
if !fields.insert(__FieldTag::__curbside_pickup) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for curbside_pickup",
));
}
result.curbside_pickup =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__reservable => {
if !fields.insert(__FieldTag::__reservable) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reservable",
));
}
result.reservable = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_breakfast => {
if !fields.insert(__FieldTag::__serves_breakfast) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_breakfast",
));
}
result.serves_breakfast =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_lunch => {
if !fields.insert(__FieldTag::__serves_lunch) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_lunch",
));
}
result.serves_lunch = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_dinner => {
if !fields.insert(__FieldTag::__serves_dinner) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_dinner",
));
}
result.serves_dinner = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_beer => {
if !fields.insert(__FieldTag::__serves_beer) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_beer",
));
}
result.serves_beer = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_wine => {
if !fields.insert(__FieldTag::__serves_wine) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_wine",
));
}
result.serves_wine = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_brunch => {
if !fields.insert(__FieldTag::__serves_brunch) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_brunch",
));
}
result.serves_brunch = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_vegetarian_food => {
if !fields.insert(__FieldTag::__serves_vegetarian_food) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_vegetarian_food",
));
}
result.serves_vegetarian_food =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__current_opening_hours => {
if !fields.insert(__FieldTag::__current_opening_hours) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for current_opening_hours",
));
}
result.current_opening_hours = map.next_value::<std::option::Option<crate::model::place::OpeningHours>>()?
;
}
__FieldTag::__current_secondary_opening_hours => {
if !fields.insert(__FieldTag::__current_secondary_opening_hours) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for current_secondary_opening_hours",
));
}
result.current_secondary_opening_hours = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::place::OpeningHours>,
>>()?
.unwrap_or_default();
}
__FieldTag::__regular_secondary_opening_hours => {
if !fields.insert(__FieldTag::__regular_secondary_opening_hours) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for regular_secondary_opening_hours",
));
}
result.regular_secondary_opening_hours = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::place::OpeningHours>,
>>()?
.unwrap_or_default();
}
__FieldTag::__editorial_summary => {
if !fields.insert(__FieldTag::__editorial_summary) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for editorial_summary",
));
}
result.editorial_summary = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__outdoor_seating => {
if !fields.insert(__FieldTag::__outdoor_seating) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for outdoor_seating",
));
}
result.outdoor_seating =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__live_music => {
if !fields.insert(__FieldTag::__live_music) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for live_music",
));
}
result.live_music = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__menu_for_children => {
if !fields.insert(__FieldTag::__menu_for_children) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for menu_for_children",
));
}
result.menu_for_children =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_cocktails => {
if !fields.insert(__FieldTag::__serves_cocktails) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_cocktails",
));
}
result.serves_cocktails =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_dessert => {
if !fields.insert(__FieldTag::__serves_dessert) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_dessert",
));
}
result.serves_dessert =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__serves_coffee => {
if !fields.insert(__FieldTag::__serves_coffee) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for serves_coffee",
));
}
result.serves_coffee = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__good_for_children => {
if !fields.insert(__FieldTag::__good_for_children) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for good_for_children",
));
}
result.good_for_children =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__allows_dogs => {
if !fields.insert(__FieldTag::__allows_dogs) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for allows_dogs",
));
}
result.allows_dogs = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__restroom => {
if !fields.insert(__FieldTag::__restroom) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for restroom",
));
}
result.restroom = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__good_for_groups => {
if !fields.insert(__FieldTag::__good_for_groups) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for good_for_groups",
));
}
result.good_for_groups =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__good_for_watching_sports => {
if !fields.insert(__FieldTag::__good_for_watching_sports) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for good_for_watching_sports",
));
}
result.good_for_watching_sports =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__payment_options => {
if !fields.insert(__FieldTag::__payment_options) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for payment_options",
));
}
result.payment_options = map.next_value::<std::option::Option<crate::model::place::PaymentOptions>>()?
;
}
__FieldTag::__parking_options => {
if !fields.insert(__FieldTag::__parking_options) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parking_options",
));
}
result.parking_options = map.next_value::<std::option::Option<crate::model::place::ParkingOptions>>()?
;
}
__FieldTag::__sub_destinations => {
if !fields.insert(__FieldTag::__sub_destinations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sub_destinations",
));
}
result.sub_destinations = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::place::SubDestination>,
>>()?
.unwrap_or_default();
}
__FieldTag::__accessibility_options => {
if !fields.insert(__FieldTag::__accessibility_options) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for accessibility_options",
));
}
result.accessibility_options = map.next_value::<std::option::Option<crate::model::place::AccessibilityOptions>>()?
;
}
__FieldTag::__fuel_options => {
if !fields.insert(__FieldTag::__fuel_options) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for fuel_options",
));
}
result.fuel_options =
map.next_value::<std::option::Option<crate::model::FuelOptions>>()?;
}
__FieldTag::__ev_charge_options => {
if !fields.insert(__FieldTag::__ev_charge_options) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for ev_charge_options",
));
}
result.ev_charge_options = map
.next_value::<std::option::Option<crate::model::EVChargeOptions>>(
)?;
}
__FieldTag::__generative_summary => {
if !fields.insert(__FieldTag::__generative_summary) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for generative_summary",
));
}
result.generative_summary = map.next_value::<std::option::Option<crate::model::place::GenerativeSummary>>()?
;
}
__FieldTag::__containing_places => {
if !fields.insert(__FieldTag::__containing_places) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for containing_places",
));
}
result.containing_places = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::place::ContainingPlace>,
>>()?
.unwrap_or_default();
}
__FieldTag::__pure_service_area_business => {
if !fields.insert(__FieldTag::__pure_service_area_business) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pure_service_area_business",
));
}
result.pure_service_area_business =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__address_descriptor => {
if !fields.insert(__FieldTag::__address_descriptor) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for address_descriptor",
));
}
result.address_descriptor = map
.next_value::<std::option::Option<crate::model::AddressDescriptor>>(
)?;
}
__FieldTag::__google_maps_links => {
if !fields.insert(__FieldTag::__google_maps_links) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for google_maps_links",
));
}
result.google_maps_links = map.next_value::<std::option::Option<crate::model::place::GoogleMapsLinks>>()?
;
}
__FieldTag::__price_range => {
if !fields.insert(__FieldTag::__price_range) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for price_range",
));
}
result.price_range =
map.next_value::<std::option::Option<crate::model::PriceRange>>()?;
}
__FieldTag::__review_summary => {
if !fields.insert(__FieldTag::__review_summary) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for review_summary",
));
}
result.review_summary = map.next_value::<std::option::Option<crate::model::place::ReviewSummary>>()?
;
}
__FieldTag::__ev_charge_amenity_summary => {
if !fields.insert(__FieldTag::__ev_charge_amenity_summary) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for ev_charge_amenity_summary",
));
}
result.ev_charge_amenity_summary =
map.next_value::<std::option::Option<
crate::model::place::EvChargeAmenitySummary,
>>()?;
}
__FieldTag::__neighborhood_summary => {
if !fields.insert(__FieldTag::__neighborhood_summary) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for neighborhood_summary",
));
}
result.neighborhood_summary = map.next_value::<std::option::Option<crate::model::place::NeighborhoodSummary>>()?
;
}
__FieldTag::__consumer_alert => {
if !fields.insert(__FieldTag::__consumer_alert) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for consumer_alert",
));
}
result.consumer_alert = map.next_value::<std::option::Option<crate::model::place::ConsumerAlert>>()?
;
}
__FieldTag::__moved_place => {
if !fields.insert(__FieldTag::__moved_place) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for moved_place",
));
}
result.moved_place = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__moved_place_id => {
if !fields.insert(__FieldTag::__moved_place_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for moved_place_id",
));
}
result.moved_place_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__transit_station => {
if !fields.insert(__FieldTag::__transit_station) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for transit_station",
));
}
result.transit_station = map
.next_value::<std::option::Option<crate::model::TransitStation>>(
)?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::AddressComponent {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__long_text,
__short_text,
__types,
__language_code,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AddressComponent")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"longText" => Ok(__FieldTag::__long_text),
"long_text" => Ok(__FieldTag::__long_text),
"shortText" => Ok(__FieldTag::__short_text),
"short_text" => Ok(__FieldTag::__short_text),
"types" => Ok(__FieldTag::__types),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::AddressComponent;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AddressComponent")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__long_text => {
if !fields.insert(__FieldTag::__long_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for long_text",
));
}
result.long_text = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__short_text => {
if !fields.insert(__FieldTag::__short_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for short_text",
));
}
result.short_text = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__types => {
if !fields.insert(__FieldTag::__types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for types",
));
}
result.types = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__language_code => {
if !fields.insert(__FieldTag::__language_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_code",
));
}
result.language_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::PlusCode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__global_code,
__compound_code,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for PlusCode")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"globalCode" => Ok(__FieldTag::__global_code),
"global_code" => Ok(__FieldTag::__global_code),
"compoundCode" => Ok(__FieldTag::__compound_code),
"compound_code" => Ok(__FieldTag::__compound_code),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::PlusCode;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct PlusCode")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__global_code => {
if !fields.insert(__FieldTag::__global_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for global_code",
));
}
result.global_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__compound_code => {
if !fields.insert(__FieldTag::__compound_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for compound_code",
));
}
result.compound_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::OpeningHours {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__open_now,
__periods,
__weekday_descriptions,
__secondary_hours_type,
__special_days,
__next_open_time,
__next_close_time,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for OpeningHours")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"openNow" => Ok(__FieldTag::__open_now),
"open_now" => Ok(__FieldTag::__open_now),
"periods" => Ok(__FieldTag::__periods),
"weekdayDescriptions" => Ok(__FieldTag::__weekday_descriptions),
"weekday_descriptions" => Ok(__FieldTag::__weekday_descriptions),
"secondaryHoursType" => Ok(__FieldTag::__secondary_hours_type),
"secondary_hours_type" => Ok(__FieldTag::__secondary_hours_type),
"specialDays" => Ok(__FieldTag::__special_days),
"special_days" => Ok(__FieldTag::__special_days),
"nextOpenTime" => Ok(__FieldTag::__next_open_time),
"next_open_time" => Ok(__FieldTag::__next_open_time),
"nextCloseTime" => Ok(__FieldTag::__next_close_time),
"next_close_time" => Ok(__FieldTag::__next_close_time),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::OpeningHours;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct OpeningHours")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__open_now => {
if !fields.insert(__FieldTag::__open_now) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for open_now",
));
}
result.open_now = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__periods => {
if !fields.insert(__FieldTag::__periods) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for periods",
));
}
result.periods = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::place::opening_hours::Period>,
>>()?
.unwrap_or_default();
}
__FieldTag::__weekday_descriptions => {
if !fields.insert(__FieldTag::__weekday_descriptions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for weekday_descriptions",
));
}
result.weekday_descriptions = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__secondary_hours_type => {
if !fields.insert(__FieldTag::__secondary_hours_type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for secondary_hours_type",
));
}
result.secondary_hours_type = map
.next_value::<std::option::Option<
crate::model::place::opening_hours::SecondaryHoursType,
>>()?
.unwrap_or_default();
}
__FieldTag::__special_days => {
if !fields.insert(__FieldTag::__special_days) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for special_days",
));
}
result.special_days = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::place::opening_hours::SpecialDay>,
>>()?
.unwrap_or_default();
}
__FieldTag::__next_open_time => {
if !fields.insert(__FieldTag::__next_open_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for next_open_time",
));
}
result.next_open_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__next_close_time => {
if !fields.insert(__FieldTag::__next_close_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for next_close_time",
));
}
result.next_close_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::opening_hours::Period {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__open,
__close,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Period")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"open" => Ok(__FieldTag::__open),
"close" => Ok(__FieldTag::__close),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::opening_hours::Period;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Period")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__open => {
if !fields.insert(__FieldTag::__open) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for open",
));
}
result.open = map.next_value::<std::option::Option<
crate::model::place::opening_hours::period::Point,
>>()?;
}
__FieldTag::__close => {
if !fields.insert(__FieldTag::__close) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for close",
));
}
result.close = map.next_value::<std::option::Option<
crate::model::place::opening_hours::period::Point,
>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::opening_hours::period::Point {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__day,
__hour,
__minute,
__date,
__truncated,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Point")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"day" => Ok(__FieldTag::__day),
"hour" => Ok(__FieldTag::__hour),
"minute" => Ok(__FieldTag::__minute),
"date" => Ok(__FieldTag::__date),
"truncated" => Ok(__FieldTag::__truncated),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::opening_hours::period::Point;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Point")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__day => {
if !fields.insert(__FieldTag::__day) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for day",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.day = map.next_value::<__With>()?.0;
}
__FieldTag::__hour => {
if !fields.insert(__FieldTag::__hour) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for hour",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.hour = map.next_value::<__With>()?.0;
}
__FieldTag::__minute => {
if !fields.insert(__FieldTag::__minute) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for minute",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.minute = map.next_value::<__With>()?.0;
}
__FieldTag::__date => {
if !fields.insert(__FieldTag::__date) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for date",
));
}
result.date = map
.next_value::<std::option::Option<google_cloud_type::model::Date>>(
)?;
}
__FieldTag::__truncated => {
if !fields.insert(__FieldTag::__truncated) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for truncated",
));
}
result.truncated = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::opening_hours::SpecialDay {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__date,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SpecialDay")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"date" => Ok(__FieldTag::__date),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::opening_hours::SpecialDay;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SpecialDay")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__date => {
if !fields.insert(__FieldTag::__date) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for date",
));
}
result.date = map
.next_value::<std::option::Option<google_cloud_type::model::Date>>(
)?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::Attribution {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__provider,
__provider_uri,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Attribution")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"provider" => Ok(__FieldTag::__provider),
"providerUri" => Ok(__FieldTag::__provider_uri),
"provider_uri" => Ok(__FieldTag::__provider_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::Attribution;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Attribution")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__provider => {
if !fields.insert(__FieldTag::__provider) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for provider",
));
}
result.provider = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__provider_uri => {
if !fields.insert(__FieldTag::__provider_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for provider_uri",
));
}
result.provider_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::PaymentOptions {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__accepts_credit_cards,
__accepts_debit_cards,
__accepts_cash_only,
__accepts_nfc,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for PaymentOptions")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"acceptsCreditCards" => Ok(__FieldTag::__accepts_credit_cards),
"accepts_credit_cards" => Ok(__FieldTag::__accepts_credit_cards),
"acceptsDebitCards" => Ok(__FieldTag::__accepts_debit_cards),
"accepts_debit_cards" => Ok(__FieldTag::__accepts_debit_cards),
"acceptsCashOnly" => Ok(__FieldTag::__accepts_cash_only),
"accepts_cash_only" => Ok(__FieldTag::__accepts_cash_only),
"acceptsNfc" => Ok(__FieldTag::__accepts_nfc),
"accepts_nfc" => Ok(__FieldTag::__accepts_nfc),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::PaymentOptions;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct PaymentOptions")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__accepts_credit_cards => {
if !fields.insert(__FieldTag::__accepts_credit_cards) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for accepts_credit_cards",
));
}
result.accepts_credit_cards =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__accepts_debit_cards => {
if !fields.insert(__FieldTag::__accepts_debit_cards) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for accepts_debit_cards",
));
}
result.accepts_debit_cards =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__accepts_cash_only => {
if !fields.insert(__FieldTag::__accepts_cash_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for accepts_cash_only",
));
}
result.accepts_cash_only =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__accepts_nfc => {
if !fields.insert(__FieldTag::__accepts_nfc) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for accepts_nfc",
));
}
result.accepts_nfc = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::ParkingOptions {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__free_parking_lot,
__paid_parking_lot,
__free_street_parking,
__paid_street_parking,
__valet_parking,
__free_garage_parking,
__paid_garage_parking,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ParkingOptions")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"freeParkingLot" => Ok(__FieldTag::__free_parking_lot),
"free_parking_lot" => Ok(__FieldTag::__free_parking_lot),
"paidParkingLot" => Ok(__FieldTag::__paid_parking_lot),
"paid_parking_lot" => Ok(__FieldTag::__paid_parking_lot),
"freeStreetParking" => Ok(__FieldTag::__free_street_parking),
"free_street_parking" => Ok(__FieldTag::__free_street_parking),
"paidStreetParking" => Ok(__FieldTag::__paid_street_parking),
"paid_street_parking" => Ok(__FieldTag::__paid_street_parking),
"valetParking" => Ok(__FieldTag::__valet_parking),
"valet_parking" => Ok(__FieldTag::__valet_parking),
"freeGarageParking" => Ok(__FieldTag::__free_garage_parking),
"free_garage_parking" => Ok(__FieldTag::__free_garage_parking),
"paidGarageParking" => Ok(__FieldTag::__paid_garage_parking),
"paid_garage_parking" => Ok(__FieldTag::__paid_garage_parking),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::ParkingOptions;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ParkingOptions")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__free_parking_lot => {
if !fields.insert(__FieldTag::__free_parking_lot) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for free_parking_lot",
));
}
result.free_parking_lot =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__paid_parking_lot => {
if !fields.insert(__FieldTag::__paid_parking_lot) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for paid_parking_lot",
));
}
result.paid_parking_lot =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__free_street_parking => {
if !fields.insert(__FieldTag::__free_street_parking) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for free_street_parking",
));
}
result.free_street_parking =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__paid_street_parking => {
if !fields.insert(__FieldTag::__paid_street_parking) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for paid_street_parking",
));
}
result.paid_street_parking =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__valet_parking => {
if !fields.insert(__FieldTag::__valet_parking) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for valet_parking",
));
}
result.valet_parking = map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__free_garage_parking => {
if !fields.insert(__FieldTag::__free_garage_parking) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for free_garage_parking",
));
}
result.free_garage_parking =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__paid_garage_parking => {
if !fields.insert(__FieldTag::__paid_garage_parking) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for paid_garage_parking",
));
}
result.paid_garage_parking =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::SubDestination {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__id,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SubDestination")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"id" => Ok(__FieldTag::__id),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::SubDestination;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SubDestination")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__id => {
if !fields.insert(__FieldTag::__id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for id",
));
}
result.id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::AccessibilityOptions {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__wheelchair_accessible_parking,
__wheelchair_accessible_entrance,
__wheelchair_accessible_restroom,
__wheelchair_accessible_seating,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AccessibilityOptions")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"wheelchairAccessibleParking" => {
Ok(__FieldTag::__wheelchair_accessible_parking)
}
"wheelchair_accessible_parking" => {
Ok(__FieldTag::__wheelchair_accessible_parking)
}
"wheelchairAccessibleEntrance" => {
Ok(__FieldTag::__wheelchair_accessible_entrance)
}
"wheelchair_accessible_entrance" => {
Ok(__FieldTag::__wheelchair_accessible_entrance)
}
"wheelchairAccessibleRestroom" => {
Ok(__FieldTag::__wheelchair_accessible_restroom)
}
"wheelchair_accessible_restroom" => {
Ok(__FieldTag::__wheelchair_accessible_restroom)
}
"wheelchairAccessibleSeating" => {
Ok(__FieldTag::__wheelchair_accessible_seating)
}
"wheelchair_accessible_seating" => {
Ok(__FieldTag::__wheelchair_accessible_seating)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::AccessibilityOptions;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AccessibilityOptions")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__wheelchair_accessible_parking => {
if !fields.insert(__FieldTag::__wheelchair_accessible_parking) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for wheelchair_accessible_parking",
));
}
result.wheelchair_accessible_parking =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__wheelchair_accessible_entrance => {
if !fields.insert(__FieldTag::__wheelchair_accessible_entrance) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for wheelchair_accessible_entrance",
));
}
result.wheelchair_accessible_entrance =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__wheelchair_accessible_restroom => {
if !fields.insert(__FieldTag::__wheelchair_accessible_restroom) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for wheelchair_accessible_restroom",
));
}
result.wheelchair_accessible_restroom =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::__wheelchair_accessible_seating => {
if !fields.insert(__FieldTag::__wheelchair_accessible_seating) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for wheelchair_accessible_seating",
));
}
result.wheelchair_accessible_seating =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::GenerativeSummary {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__overview,
__overview_flag_content_uri,
__disclosure_text,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for GenerativeSummary")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"overview" => Ok(__FieldTag::__overview),
"overviewFlagContentUri" => Ok(__FieldTag::__overview_flag_content_uri),
"overview_flag_content_uri" => {
Ok(__FieldTag::__overview_flag_content_uri)
}
"disclosureText" => Ok(__FieldTag::__disclosure_text),
"disclosure_text" => Ok(__FieldTag::__disclosure_text),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::GenerativeSummary;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GenerativeSummary")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__overview => {
if !fields.insert(__FieldTag::__overview) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for overview",
));
}
result.overview = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__overview_flag_content_uri => {
if !fields.insert(__FieldTag::__overview_flag_content_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for overview_flag_content_uri",
));
}
result.overview_flag_content_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__disclosure_text => {
if !fields.insert(__FieldTag::__disclosure_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for disclosure_text",
));
}
result.disclosure_text = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::ContainingPlace {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__id,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ContainingPlace")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"id" => Ok(__FieldTag::__id),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::ContainingPlace;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ContainingPlace")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__id => {
if !fields.insert(__FieldTag::__id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for id",
));
}
result.id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::GoogleMapsLinks {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__directions_uri,
__place_uri,
__write_a_review_uri,
__reviews_uri,
__photos_uri,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for GoogleMapsLinks")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"directionsUri" => Ok(__FieldTag::__directions_uri),
"directions_uri" => Ok(__FieldTag::__directions_uri),
"placeUri" => Ok(__FieldTag::__place_uri),
"place_uri" => Ok(__FieldTag::__place_uri),
"writeAReviewUri" => Ok(__FieldTag::__write_a_review_uri),
"write_a_review_uri" => Ok(__FieldTag::__write_a_review_uri),
"reviewsUri" => Ok(__FieldTag::__reviews_uri),
"reviews_uri" => Ok(__FieldTag::__reviews_uri),
"photosUri" => Ok(__FieldTag::__photos_uri),
"photos_uri" => Ok(__FieldTag::__photos_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::GoogleMapsLinks;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GoogleMapsLinks")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__directions_uri => {
if !fields.insert(__FieldTag::__directions_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for directions_uri",
));
}
result.directions_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__place_uri => {
if !fields.insert(__FieldTag::__place_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for place_uri",
));
}
result.place_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__write_a_review_uri => {
if !fields.insert(__FieldTag::__write_a_review_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for write_a_review_uri",
));
}
result.write_a_review_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__reviews_uri => {
if !fields.insert(__FieldTag::__reviews_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reviews_uri",
));
}
result.reviews_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__photos_uri => {
if !fields.insert(__FieldTag::__photos_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for photos_uri",
));
}
result.photos_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::ReviewSummary {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__text,
__flag_content_uri,
__disclosure_text,
__reviews_uri,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ReviewSummary")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"text" => Ok(__FieldTag::__text),
"flagContentUri" => Ok(__FieldTag::__flag_content_uri),
"flag_content_uri" => Ok(__FieldTag::__flag_content_uri),
"disclosureText" => Ok(__FieldTag::__disclosure_text),
"disclosure_text" => Ok(__FieldTag::__disclosure_text),
"reviewsUri" => Ok(__FieldTag::__reviews_uri),
"reviews_uri" => Ok(__FieldTag::__reviews_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::ReviewSummary;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ReviewSummary")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__text => {
if !fields.insert(__FieldTag::__text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text",
));
}
result.text = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__flag_content_uri => {
if !fields.insert(__FieldTag::__flag_content_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for flag_content_uri",
));
}
result.flag_content_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__disclosure_text => {
if !fields.insert(__FieldTag::__disclosure_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for disclosure_text",
));
}
result.disclosure_text = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__reviews_uri => {
if !fields.insert(__FieldTag::__reviews_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reviews_uri",
));
}
result.reviews_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::EvChargeAmenitySummary {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__overview,
__coffee,
__restaurant,
__store,
__flag_content_uri,
__disclosure_text,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for EvChargeAmenitySummary")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"overview" => Ok(__FieldTag::__overview),
"coffee" => Ok(__FieldTag::__coffee),
"restaurant" => Ok(__FieldTag::__restaurant),
"store" => Ok(__FieldTag::__store),
"flagContentUri" => Ok(__FieldTag::__flag_content_uri),
"flag_content_uri" => Ok(__FieldTag::__flag_content_uri),
"disclosureText" => Ok(__FieldTag::__disclosure_text),
"disclosure_text" => Ok(__FieldTag::__disclosure_text),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::EvChargeAmenitySummary;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct EvChargeAmenitySummary")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__overview => {
if !fields.insert(__FieldTag::__overview) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for overview",
));
}
result.overview = map
.next_value::<std::option::Option<crate::model::ContentBlock>>()?;
}
__FieldTag::__coffee => {
if !fields.insert(__FieldTag::__coffee) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for coffee",
));
}
result.coffee = map
.next_value::<std::option::Option<crate::model::ContentBlock>>()?;
}
__FieldTag::__restaurant => {
if !fields.insert(__FieldTag::__restaurant) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for restaurant",
));
}
result.restaurant = map
.next_value::<std::option::Option<crate::model::ContentBlock>>()?;
}
__FieldTag::__store => {
if !fields.insert(__FieldTag::__store) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for store",
));
}
result.store = map
.next_value::<std::option::Option<crate::model::ContentBlock>>()?;
}
__FieldTag::__flag_content_uri => {
if !fields.insert(__FieldTag::__flag_content_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for flag_content_uri",
));
}
result.flag_content_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__disclosure_text => {
if !fields.insert(__FieldTag::__disclosure_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for disclosure_text",
));
}
result.disclosure_text = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::NeighborhoodSummary {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__overview,
__description,
__flag_content_uri,
__disclosure_text,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for NeighborhoodSummary")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"overview" => Ok(__FieldTag::__overview),
"description" => Ok(__FieldTag::__description),
"flagContentUri" => Ok(__FieldTag::__flag_content_uri),
"flag_content_uri" => Ok(__FieldTag::__flag_content_uri),
"disclosureText" => Ok(__FieldTag::__disclosure_text),
"disclosure_text" => Ok(__FieldTag::__disclosure_text),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::NeighborhoodSummary;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct NeighborhoodSummary")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__overview => {
if !fields.insert(__FieldTag::__overview) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for overview",
));
}
result.overview = map
.next_value::<std::option::Option<crate::model::ContentBlock>>()?;
}
__FieldTag::__description => {
if !fields.insert(__FieldTag::__description) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for description",
));
}
result.description = map
.next_value::<std::option::Option<crate::model::ContentBlock>>()?;
}
__FieldTag::__flag_content_uri => {
if !fields.insert(__FieldTag::__flag_content_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for flag_content_uri",
));
}
result.flag_content_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__disclosure_text => {
if !fields.insert(__FieldTag::__disclosure_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for disclosure_text",
));
}
result.disclosure_text = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::ConsumerAlert {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__overview,
__details,
__language_code,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ConsumerAlert")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"overview" => Ok(__FieldTag::__overview),
"details" => Ok(__FieldTag::__details),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::ConsumerAlert;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ConsumerAlert")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__overview => {
if !fields.insert(__FieldTag::__overview) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for overview",
));
}
result.overview = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__details => {
if !fields.insert(__FieldTag::__details) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for details",
));
}
result.details =
map.next_value::<std::option::Option<
crate::model::place::consumer_alert::Details,
>>()?;
}
__FieldTag::__language_code => {
if !fields.insert(__FieldTag::__language_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_code",
));
}
result.language_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::consumer_alert::Details {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__title,
__description,
__about_link,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Details")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"title" => Ok(__FieldTag::__title),
"description" => Ok(__FieldTag::__description),
"aboutLink" => Ok(__FieldTag::__about_link),
"about_link" => Ok(__FieldTag::__about_link),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::consumer_alert::Details;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Details")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__title => {
if !fields.insert(__FieldTag::__title) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for title",
));
}
result.title = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__description => {
if !fields.insert(__FieldTag::__description) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for description",
));
}
result.description = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__about_link => {
if !fields.insert(__FieldTag::__about_link) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for about_link",
));
}
result.about_link = map.next_value::<std::option::Option<
crate::model::place::consumer_alert::details::Link,
>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::place::consumer_alert::details::Link {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__title,
__uri,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Link")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"title" => Ok(__FieldTag::__title),
"uri" => Ok(__FieldTag::__uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::place::consumer_alert::details::Link;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Link")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__title => {
if !fields.insert(__FieldTag::__title) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for title",
));
}
result.title = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__uri => {
if !fields.insert(__FieldTag::__uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for uri",
));
}
result.uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::RoutingParameters {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__origin,
__travel_mode,
__route_modifiers,
__routing_preference,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for RoutingParameters")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"origin" => Ok(__FieldTag::__origin),
"travelMode" => Ok(__FieldTag::__travel_mode),
"travel_mode" => Ok(__FieldTag::__travel_mode),
"routeModifiers" => Ok(__FieldTag::__route_modifiers),
"route_modifiers" => Ok(__FieldTag::__route_modifiers),
"routingPreference" => Ok(__FieldTag::__routing_preference),
"routing_preference" => Ok(__FieldTag::__routing_preference),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RoutingParameters;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RoutingParameters")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__origin => {
if !fields.insert(__FieldTag::__origin) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for origin",
));
}
result.origin = map.next_value::<std::option::Option<google_cloud_type::model::LatLng>>()?
;
}
__FieldTag::__travel_mode => {
if !fields.insert(__FieldTag::__travel_mode) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for travel_mode",
));
}
result.travel_mode = map
.next_value::<std::option::Option<crate::model::TravelMode>>()?
.unwrap_or_default();
}
__FieldTag::__route_modifiers => {
if !fields.insert(__FieldTag::__route_modifiers) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for route_modifiers",
));
}
result.route_modifiers = map
.next_value::<std::option::Option<crate::model::RouteModifiers>>(
)?;
}
__FieldTag::__routing_preference => {
if !fields.insert(__FieldTag::__routing_preference) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for routing_preference",
));
}
result.routing_preference = map
.next_value::<std::option::Option<crate::model::RoutingPreference>>(
)?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::SearchNearbyRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__language_code,
__region_code,
__included_types,
__excluded_types,
__included_primary_types,
__excluded_primary_types,
__max_result_count,
__location_restriction,
__rank_preference,
__routing_parameters,
__include_future_opening_businesses,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SearchNearbyRequest")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
"regionCode" => Ok(__FieldTag::__region_code),
"region_code" => Ok(__FieldTag::__region_code),
"includedTypes" => Ok(__FieldTag::__included_types),
"included_types" => Ok(__FieldTag::__included_types),
"excludedTypes" => Ok(__FieldTag::__excluded_types),
"excluded_types" => Ok(__FieldTag::__excluded_types),
"includedPrimaryTypes" => Ok(__FieldTag::__included_primary_types),
"included_primary_types" => Ok(__FieldTag::__included_primary_types),
"excludedPrimaryTypes" => Ok(__FieldTag::__excluded_primary_types),
"excluded_primary_types" => Ok(__FieldTag::__excluded_primary_types),
"maxResultCount" => Ok(__FieldTag::__max_result_count),
"max_result_count" => Ok(__FieldTag::__max_result_count),
"locationRestriction" => Ok(__FieldTag::__location_restriction),
"location_restriction" => Ok(__FieldTag::__location_restriction),
"rankPreference" => Ok(__FieldTag::__rank_preference),
"rank_preference" => Ok(__FieldTag::__rank_preference),
"routingParameters" => Ok(__FieldTag::__routing_parameters),
"routing_parameters" => Ok(__FieldTag::__routing_parameters),
"includeFutureOpeningBusinesses" => {
Ok(__FieldTag::__include_future_opening_businesses)
}
"include_future_opening_businesses" => {
Ok(__FieldTag::__include_future_opening_businesses)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SearchNearbyRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SearchNearbyRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__language_code => {
if !fields.insert(__FieldTag::__language_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_code",
));
}
result.language_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__region_code => {
if !fields.insert(__FieldTag::__region_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for region_code",
));
}
result.region_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__included_types => {
if !fields.insert(__FieldTag::__included_types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for included_types",
));
}
result.included_types = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__excluded_types => {
if !fields.insert(__FieldTag::__excluded_types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for excluded_types",
));
}
result.excluded_types = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__included_primary_types => {
if !fields.insert(__FieldTag::__included_primary_types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for included_primary_types",
));
}
result.included_primary_types = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__excluded_primary_types => {
if !fields.insert(__FieldTag::__excluded_primary_types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for excluded_primary_types",
));
}
result.excluded_primary_types = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__max_result_count => {
if !fields.insert(__FieldTag::__max_result_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_result_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.max_result_count =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__location_restriction => {
if !fields.insert(__FieldTag::__location_restriction) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for location_restriction",
));
}
result.location_restriction = map.next_value::<std::option::Option<
crate::model::search_nearby_request::LocationRestriction,
>>()?;
}
__FieldTag::__rank_preference => {
if !fields.insert(__FieldTag::__rank_preference) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rank_preference",
));
}
result.rank_preference = map
.next_value::<std::option::Option<
crate::model::search_nearby_request::RankPreference,
>>()?
.unwrap_or_default();
}
__FieldTag::__routing_parameters => {
if !fields.insert(__FieldTag::__routing_parameters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for routing_parameters",
));
}
result.routing_parameters = map
.next_value::<std::option::Option<crate::model::RoutingParameters>>(
)?;
}
__FieldTag::__include_future_opening_businesses => {
if !fields.insert(__FieldTag::__include_future_opening_businesses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for include_future_opening_businesses",
));
}
result.include_future_opening_businesses = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::search_nearby_request::LocationRestriction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__circle,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for LocationRestriction")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"circle" => Ok(__FieldTag::__circle),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::search_nearby_request::LocationRestriction;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LocationRestriction")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__circle => {
if !fields.insert(__FieldTag::__circle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for circle",
));
}
if result.r#type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `r#type`, a oneof with full ID .google.maps.places.v1.SearchNearbyRequest.LocationRestriction.circle, latest field was circle",
));
}
result.r#type = std::option::Option::Some(
crate::model::search_nearby_request::location_restriction::Type::Circle(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::Circle>>>()?.unwrap_or_default()
),
);
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::SearchNearbyResponse {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__places,
__routing_summaries,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SearchNearbyResponse")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"places" => Ok(__FieldTag::__places),
"routingSummaries" => Ok(__FieldTag::__routing_summaries),
"routing_summaries" => Ok(__FieldTag::__routing_summaries),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SearchNearbyResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SearchNearbyResponse")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__places => {
if !fields.insert(__FieldTag::__places) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for places",
));
}
result.places = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Place>>>()?.unwrap_or_default();
}
__FieldTag::__routing_summaries => {
if !fields.insert(__FieldTag::__routing_summaries) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for routing_summaries",
));
}
result.routing_summaries =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::RoutingSummary>,
>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::SearchTextRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__text_query,
__language_code,
__region_code,
__rank_preference,
__included_type,
__open_now,
__min_rating,
__max_result_count,
__price_levels,
__strict_type_filtering,
__location_bias,
__location_restriction,
__ev_options,
__routing_parameters,
__search_along_route_parameters,
__include_pure_service_area_businesses,
__include_future_opening_businesses,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SearchTextRequest")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"textQuery" => Ok(__FieldTag::__text_query),
"text_query" => Ok(__FieldTag::__text_query),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
"regionCode" => Ok(__FieldTag::__region_code),
"region_code" => Ok(__FieldTag::__region_code),
"rankPreference" => Ok(__FieldTag::__rank_preference),
"rank_preference" => Ok(__FieldTag::__rank_preference),
"includedType" => Ok(__FieldTag::__included_type),
"included_type" => Ok(__FieldTag::__included_type),
"openNow" => Ok(__FieldTag::__open_now),
"open_now" => Ok(__FieldTag::__open_now),
"minRating" => Ok(__FieldTag::__min_rating),
"min_rating" => Ok(__FieldTag::__min_rating),
"maxResultCount" => Ok(__FieldTag::__max_result_count),
"max_result_count" => Ok(__FieldTag::__max_result_count),
"priceLevels" => Ok(__FieldTag::__price_levels),
"price_levels" => Ok(__FieldTag::__price_levels),
"strictTypeFiltering" => Ok(__FieldTag::__strict_type_filtering),
"strict_type_filtering" => Ok(__FieldTag::__strict_type_filtering),
"locationBias" => Ok(__FieldTag::__location_bias),
"location_bias" => Ok(__FieldTag::__location_bias),
"locationRestriction" => Ok(__FieldTag::__location_restriction),
"location_restriction" => Ok(__FieldTag::__location_restriction),
"evOptions" => Ok(__FieldTag::__ev_options),
"ev_options" => Ok(__FieldTag::__ev_options),
"routingParameters" => Ok(__FieldTag::__routing_parameters),
"routing_parameters" => Ok(__FieldTag::__routing_parameters),
"searchAlongRouteParameters" => {
Ok(__FieldTag::__search_along_route_parameters)
}
"search_along_route_parameters" => {
Ok(__FieldTag::__search_along_route_parameters)
}
"includePureServiceAreaBusinesses" => {
Ok(__FieldTag::__include_pure_service_area_businesses)
}
"include_pure_service_area_businesses" => {
Ok(__FieldTag::__include_pure_service_area_businesses)
}
"includeFutureOpeningBusinesses" => {
Ok(__FieldTag::__include_future_opening_businesses)
}
"include_future_opening_businesses" => {
Ok(__FieldTag::__include_future_opening_businesses)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SearchTextRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SearchTextRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__text_query => {
if !fields.insert(__FieldTag::__text_query) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text_query",
));
}
result.text_query = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__language_code => {
if !fields.insert(__FieldTag::__language_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_code",
));
}
result.language_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__region_code => {
if !fields.insert(__FieldTag::__region_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for region_code",
));
}
result.region_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__rank_preference => {
if !fields.insert(__FieldTag::__rank_preference) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rank_preference",
));
}
result.rank_preference = map
.next_value::<std::option::Option<
crate::model::search_text_request::RankPreference,
>>()?
.unwrap_or_default();
}
__FieldTag::__included_type => {
if !fields.insert(__FieldTag::__included_type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for included_type",
));
}
result.included_type = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__open_now => {
if !fields.insert(__FieldTag::__open_now) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for open_now",
));
}
result.open_now = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__min_rating => {
if !fields.insert(__FieldTag::__min_rating) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for min_rating",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.min_rating = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_result_count => {
if !fields.insert(__FieldTag::__max_result_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_result_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.max_result_count =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__price_levels => {
if !fields.insert(__FieldTag::__price_levels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for price_levels",
));
}
result.price_levels = map.next_value::<std::option::Option<std::vec::Vec<crate::model::PriceLevel>>>()?.unwrap_or_default();
}
__FieldTag::__strict_type_filtering => {
if !fields.insert(__FieldTag::__strict_type_filtering) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for strict_type_filtering",
));
}
result.strict_type_filtering = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__location_bias => {
if !fields.insert(__FieldTag::__location_bias) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for location_bias",
));
}
result.location_bias = map.next_value::<std::option::Option<
crate::model::search_text_request::LocationBias,
>>()?;
}
__FieldTag::__location_restriction => {
if !fields.insert(__FieldTag::__location_restriction) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for location_restriction",
));
}
result.location_restriction = map.next_value::<std::option::Option<
crate::model::search_text_request::LocationRestriction,
>>()?;
}
__FieldTag::__ev_options => {
if !fields.insert(__FieldTag::__ev_options) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for ev_options",
));
}
result.ev_options =
map.next_value::<std::option::Option<
crate::model::search_text_request::EVOptions,
>>()?;
}
__FieldTag::__routing_parameters => {
if !fields.insert(__FieldTag::__routing_parameters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for routing_parameters",
));
}
result.routing_parameters = map
.next_value::<std::option::Option<crate::model::RoutingParameters>>(
)?;
}
__FieldTag::__search_along_route_parameters => {
if !fields.insert(__FieldTag::__search_along_route_parameters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for search_along_route_parameters",
));
}
result.search_along_route_parameters = map
.next_value::<std::option::Option<
crate::model::search_text_request::SearchAlongRouteParameters,
>>()?;
}
__FieldTag::__include_pure_service_area_businesses => {
if !fields.insert(__FieldTag::__include_pure_service_area_businesses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for include_pure_service_area_businesses",
));
}
result.include_pure_service_area_businesses = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__include_future_opening_businesses => {
if !fields.insert(__FieldTag::__include_future_opening_businesses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for include_future_opening_businesses",
));
}
result.include_future_opening_businesses = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::search_text_request::LocationBias {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__rectangle,
__circle,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for LocationBias")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"rectangle" => Ok(__FieldTag::__rectangle),
"circle" => Ok(__FieldTag::__circle),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::search_text_request::LocationBias;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LocationBias")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__rectangle => {
if !fields.insert(__FieldTag::__rectangle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rectangle",
));
}
if result.r#type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `r#type`, a oneof with full ID .google.maps.places.v1.SearchTextRequest.LocationBias.rectangle, latest field was rectangle",
));
}
result.r#type = std::option::Option::Some(
crate::model::search_text_request::location_bias::Type::Rectangle(
map.next_value::<std::option::Option<
std::boxed::Box<google_geo_type::model::Viewport>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__circle => {
if !fields.insert(__FieldTag::__circle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for circle",
));
}
if result.r#type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `r#type`, a oneof with full ID .google.maps.places.v1.SearchTextRequest.LocationBias.circle, latest field was circle",
));
}
result.r#type =
std::option::Option::Some(
crate::model::search_text_request::location_bias::Type::Circle(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::Circle>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::search_text_request::LocationRestriction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__rectangle,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for LocationRestriction")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"rectangle" => Ok(__FieldTag::__rectangle),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::search_text_request::LocationRestriction;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LocationRestriction")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__rectangle => {
if !fields.insert(__FieldTag::__rectangle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rectangle",
));
}
if result.r#type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `r#type`, a oneof with full ID .google.maps.places.v1.SearchTextRequest.LocationRestriction.rectangle, latest field was rectangle",
));
}
result.r#type = std::option::Option::Some(
crate::model::search_text_request::location_restriction::Type::Rectangle(
map.next_value::<std::option::Option<std::boxed::Box<google_geo_type::model::Viewport>>>()?.unwrap_or_default()
),
);
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::search_text_request::EVOptions {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__minimum_charging_rate_kw,
__connector_types,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for EVOptions")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"minimumChargingRateKw" => Ok(__FieldTag::__minimum_charging_rate_kw),
"minimum_charging_rate_kw" => {
Ok(__FieldTag::__minimum_charging_rate_kw)
}
"connectorTypes" => Ok(__FieldTag::__connector_types),
"connector_types" => Ok(__FieldTag::__connector_types),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::search_text_request::EVOptions;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct EVOptions")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__minimum_charging_rate_kw => {
if !fields.insert(__FieldTag::__minimum_charging_rate_kw) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for minimum_charging_rate_kw",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.minimum_charging_rate_kw =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__connector_types => {
if !fields.insert(__FieldTag::__connector_types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for connector_types",
));
}
result.connector_types =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::EVConnectorType>,
>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::search_text_request::SearchAlongRouteParameters {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__polyline,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SearchAlongRouteParameters")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"polyline" => Ok(__FieldTag::__polyline),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::search_text_request::SearchAlongRouteParameters;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SearchAlongRouteParameters")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__polyline => {
if !fields.insert(__FieldTag::__polyline) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for polyline",
));
}
result.polyline =
map.next_value::<std::option::Option<crate::model::Polyline>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::SearchTextResponse {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__places,
__routing_summaries,
__contextual_contents,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SearchTextResponse")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"places" => Ok(__FieldTag::__places),
"routingSummaries" => Ok(__FieldTag::__routing_summaries),
"routing_summaries" => Ok(__FieldTag::__routing_summaries),
"contextualContents" => Ok(__FieldTag::__contextual_contents),
"contextual_contents" => Ok(__FieldTag::__contextual_contents),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SearchTextResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SearchTextResponse")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__places => {
if !fields.insert(__FieldTag::__places) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for places",
));
}
result.places = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Place>>>()?.unwrap_or_default();
}
__FieldTag::__routing_summaries => {
if !fields.insert(__FieldTag::__routing_summaries) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for routing_summaries",
));
}
result.routing_summaries =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::RoutingSummary>,
>>()?
.unwrap_or_default();
}
__FieldTag::__contextual_contents => {
if !fields.insert(__FieldTag::__contextual_contents) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for contextual_contents",
));
}
result.contextual_contents =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::ContextualContent>,
>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::GetPhotoMediaRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__max_width_px,
__max_height_px,
__skip_http_redirect,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for GetPhotoMediaRequest")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"maxWidthPx" => Ok(__FieldTag::__max_width_px),
"max_width_px" => Ok(__FieldTag::__max_width_px),
"maxHeightPx" => Ok(__FieldTag::__max_height_px),
"max_height_px" => Ok(__FieldTag::__max_height_px),
"skipHttpRedirect" => Ok(__FieldTag::__skip_http_redirect),
"skip_http_redirect" => Ok(__FieldTag::__skip_http_redirect),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::GetPhotoMediaRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetPhotoMediaRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__max_width_px => {
if !fields.insert(__FieldTag::__max_width_px) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_width_px",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.max_width_px = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_height_px => {
if !fields.insert(__FieldTag::__max_height_px) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_height_px",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.max_height_px =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__skip_http_redirect => {
if !fields.insert(__FieldTag::__skip_http_redirect) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for skip_http_redirect",
));
}
result.skip_http_redirect = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::PhotoMedia {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__photo_uri,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for PhotoMedia")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"photoUri" => Ok(__FieldTag::__photo_uri),
"photo_uri" => Ok(__FieldTag::__photo_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::PhotoMedia;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct PhotoMedia")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__photo_uri => {
if !fields.insert(__FieldTag::__photo_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for photo_uri",
));
}
result.photo_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::GetPlaceRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__language_code,
__region_code,
__session_token,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for GetPlaceRequest")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
"regionCode" => Ok(__FieldTag::__region_code),
"region_code" => Ok(__FieldTag::__region_code),
"sessionToken" => Ok(__FieldTag::__session_token),
"session_token" => Ok(__FieldTag::__session_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::GetPlaceRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetPlaceRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__language_code => {
if !fields.insert(__FieldTag::__language_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_code",
));
}
result.language_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__region_code => {
if !fields.insert(__FieldTag::__region_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for region_code",
));
}
result.region_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__session_token => {
if !fields.insert(__FieldTag::__session_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for session_token",
));
}
result.session_token = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::AutocompletePlacesRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__input,
__location_bias,
__location_restriction,
__included_primary_types,
__included_region_codes,
__language_code,
__region_code,
__origin,
__input_offset,
__include_query_predictions,
__session_token,
__include_pure_service_area_businesses,
__include_future_opening_businesses,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AutocompletePlacesRequest")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"input" => Ok(__FieldTag::__input),
"locationBias" => Ok(__FieldTag::__location_bias),
"location_bias" => Ok(__FieldTag::__location_bias),
"locationRestriction" => Ok(__FieldTag::__location_restriction),
"location_restriction" => Ok(__FieldTag::__location_restriction),
"includedPrimaryTypes" => Ok(__FieldTag::__included_primary_types),
"included_primary_types" => Ok(__FieldTag::__included_primary_types),
"includedRegionCodes" => Ok(__FieldTag::__included_region_codes),
"included_region_codes" => Ok(__FieldTag::__included_region_codes),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
"regionCode" => Ok(__FieldTag::__region_code),
"region_code" => Ok(__FieldTag::__region_code),
"origin" => Ok(__FieldTag::__origin),
"inputOffset" => Ok(__FieldTag::__input_offset),
"input_offset" => Ok(__FieldTag::__input_offset),
"includeQueryPredictions" => {
Ok(__FieldTag::__include_query_predictions)
}
"include_query_predictions" => {
Ok(__FieldTag::__include_query_predictions)
}
"sessionToken" => Ok(__FieldTag::__session_token),
"session_token" => Ok(__FieldTag::__session_token),
"includePureServiceAreaBusinesses" => {
Ok(__FieldTag::__include_pure_service_area_businesses)
}
"include_pure_service_area_businesses" => {
Ok(__FieldTag::__include_pure_service_area_businesses)
}
"includeFutureOpeningBusinesses" => {
Ok(__FieldTag::__include_future_opening_businesses)
}
"include_future_opening_businesses" => {
Ok(__FieldTag::__include_future_opening_businesses)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AutocompletePlacesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AutocompletePlacesRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__input => {
if !fields.insert(__FieldTag::__input) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input",
));
}
result.input = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__location_bias => {
if !fields.insert(__FieldTag::__location_bias) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for location_bias",
));
}
result.location_bias = map.next_value::<std::option::Option<
crate::model::autocomplete_places_request::LocationBias,
>>()?;
}
__FieldTag::__location_restriction => {
if !fields.insert(__FieldTag::__location_restriction) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for location_restriction",
));
}
result.location_restriction = map.next_value::<std::option::Option<
crate::model::autocomplete_places_request::LocationRestriction,
>>()?;
}
__FieldTag::__included_primary_types => {
if !fields.insert(__FieldTag::__included_primary_types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for included_primary_types",
));
}
result.included_primary_types = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__included_region_codes => {
if !fields.insert(__FieldTag::__included_region_codes) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for included_region_codes",
));
}
result.included_region_codes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__language_code => {
if !fields.insert(__FieldTag::__language_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_code",
));
}
result.language_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__region_code => {
if !fields.insert(__FieldTag::__region_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for region_code",
));
}
result.region_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__origin => {
if !fields.insert(__FieldTag::__origin) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for origin",
));
}
result.origin = map.next_value::<std::option::Option<google_cloud_type::model::LatLng>>()?
;
}
__FieldTag::__input_offset => {
if !fields.insert(__FieldTag::__input_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_offset",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.input_offset = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__include_query_predictions => {
if !fields.insert(__FieldTag::__include_query_predictions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for include_query_predictions",
));
}
result.include_query_predictions = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__session_token => {
if !fields.insert(__FieldTag::__session_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for session_token",
));
}
result.session_token = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__include_pure_service_area_businesses => {
if !fields.insert(__FieldTag::__include_pure_service_area_businesses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for include_pure_service_area_businesses",
));
}
result.include_pure_service_area_businesses = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__include_future_opening_businesses => {
if !fields.insert(__FieldTag::__include_future_opening_businesses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for include_future_opening_businesses",
));
}
result.include_future_opening_businesses = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::autocomplete_places_request::LocationBias {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__rectangle,
__circle,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for LocationBias")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"rectangle" => Ok(__FieldTag::__rectangle),
"circle" => Ok(__FieldTag::__circle),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::autocomplete_places_request::LocationBias;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LocationBias")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__rectangle => {
if !fields.insert(__FieldTag::__rectangle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rectangle",
));
}
if result.r#type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `r#type`, a oneof with full ID .google.maps.places.v1.AutocompletePlacesRequest.LocationBias.rectangle, latest field was rectangle",
));
}
result.r#type = std::option::Option::Some(
crate::model::autocomplete_places_request::location_bias::Type::Rectangle(
map.next_value::<std::option::Option<std::boxed::Box<google_geo_type::model::Viewport>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__circle => {
if !fields.insert(__FieldTag::__circle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for circle",
));
}
if result.r#type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `r#type`, a oneof with full ID .google.maps.places.v1.AutocompletePlacesRequest.LocationBias.circle, latest field was circle",
));
}
result.r#type = std::option::Option::Some(
crate::model::autocomplete_places_request::location_bias::Type::Circle(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::Circle>>>()?.unwrap_or_default()
),
);
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::autocomplete_places_request::LocationRestriction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__rectangle,
__circle,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for LocationRestriction")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"rectangle" => Ok(__FieldTag::__rectangle),
"circle" => Ok(__FieldTag::__circle),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::autocomplete_places_request::LocationRestriction;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LocationRestriction")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__rectangle => {
if !fields.insert(__FieldTag::__rectangle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rectangle",
));
}
if result.r#type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `r#type`, a oneof with full ID .google.maps.places.v1.AutocompletePlacesRequest.LocationRestriction.rectangle, latest field was rectangle",
));
}
result.r#type = std::option::Option::Some(
crate::model::autocomplete_places_request::location_restriction::Type::Rectangle(
map.next_value::<std::option::Option<std::boxed::Box<google_geo_type::model::Viewport>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__circle => {
if !fields.insert(__FieldTag::__circle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for circle",
));
}
if result.r#type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `r#type`, a oneof with full ID .google.maps.places.v1.AutocompletePlacesRequest.LocationRestriction.circle, latest field was circle",
));
}
result.r#type = std::option::Option::Some(
crate::model::autocomplete_places_request::location_restriction::Type::Circle(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::Circle>>>()?.unwrap_or_default()
),
);
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::AutocompletePlacesResponse {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__suggestions,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AutocompletePlacesResponse")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"suggestions" => Ok(__FieldTag::__suggestions),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AutocompletePlacesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AutocompletePlacesResponse")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__suggestions => {
if !fields.insert(__FieldTag::__suggestions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for suggestions",
));
}
result.suggestions = map
.next_value::<std::option::Option<
std::vec::Vec<
crate::model::autocomplete_places_response::Suggestion,
>,
>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::autocomplete_places_response::Suggestion {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__place_prediction,
__query_prediction,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Suggestion")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"placePrediction" => Ok(__FieldTag::__place_prediction),
"place_prediction" => Ok(__FieldTag::__place_prediction),
"queryPrediction" => Ok(__FieldTag::__query_prediction),
"query_prediction" => Ok(__FieldTag::__query_prediction),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::autocomplete_places_response::Suggestion;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Suggestion")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__place_prediction => {
if !fields.insert(__FieldTag::__place_prediction) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for place_prediction",
));
}
if result.kind.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `kind`, a oneof with full ID .google.maps.places.v1.AutocompletePlacesResponse.Suggestion.place_prediction, latest field was placePrediction",
));
}
result.kind = std::option::Option::Some(
crate::model::autocomplete_places_response::suggestion::Kind::PlacePrediction(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::autocomplete_places_response::suggestion::PlacePrediction>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__query_prediction => {
if !fields.insert(__FieldTag::__query_prediction) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for query_prediction",
));
}
if result.kind.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `kind`, a oneof with full ID .google.maps.places.v1.AutocompletePlacesResponse.Suggestion.query_prediction, latest field was queryPrediction",
));
}
result.kind = std::option::Option::Some(
crate::model::autocomplete_places_response::suggestion::Kind::QueryPrediction(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::autocomplete_places_response::suggestion::QueryPrediction>>>()?.unwrap_or_default()
),
);
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de>
for super::autocomplete_places_response::suggestion::StringRange
{
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__start_offset,
__end_offset,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for StringRange")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"startOffset" => Ok(__FieldTag::__start_offset),
"start_offset" => Ok(__FieldTag::__start_offset),
"endOffset" => Ok(__FieldTag::__end_offset),
"end_offset" => Ok(__FieldTag::__end_offset),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::autocomplete_places_response::suggestion::StringRange;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct StringRange")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__start_offset => {
if !fields.insert(__FieldTag::__start_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_offset",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.start_offset = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__end_offset => {
if !fields.insert(__FieldTag::__end_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for end_offset",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.end_offset = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de>
for super::autocomplete_places_response::suggestion::FormattableText
{
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__text,
__matches,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for FormattableText")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"text" => Ok(__FieldTag::__text),
"matches" => Ok(__FieldTag::__matches),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::autocomplete_places_response::suggestion::FormattableText;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct FormattableText")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__text => {
if !fields.insert(__FieldTag::__text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text",
));
}
result.text = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__matches => {
if !fields.insert(__FieldTag::__matches) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for matches",
));
}
result.matches = map.next_value::<std::option::Option<std::vec::Vec<crate::model::autocomplete_places_response::suggestion::StringRange>>>()?.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de>
for super::autocomplete_places_response::suggestion::StructuredFormat
{
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__main_text,
__secondary_text,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for StructuredFormat")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"mainText" => Ok(__FieldTag::__main_text),
"main_text" => Ok(__FieldTag::__main_text),
"secondaryText" => Ok(__FieldTag::__secondary_text),
"secondary_text" => Ok(__FieldTag::__secondary_text),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::autocomplete_places_response::suggestion::StructuredFormat;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct StructuredFormat")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__main_text => {
if !fields.insert(__FieldTag::__main_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for main_text",
));
}
result.main_text = map.next_value::<std::option::Option<crate::model::autocomplete_places_response::suggestion::FormattableText>>()?
;
}
__FieldTag::__secondary_text => {
if !fields.insert(__FieldTag::__secondary_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for secondary_text",
));
}
result.secondary_text = map.next_value::<std::option::Option<crate::model::autocomplete_places_response::suggestion::FormattableText>>()?
;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de>
for super::autocomplete_places_response::suggestion::PlacePrediction
{
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__place,
__place_id,
__text,
__structured_format,
__types,
__distance_meters,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for PlacePrediction")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"place" => Ok(__FieldTag::__place),
"placeId" => Ok(__FieldTag::__place_id),
"place_id" => Ok(__FieldTag::__place_id),
"text" => Ok(__FieldTag::__text),
"structuredFormat" => Ok(__FieldTag::__structured_format),
"structured_format" => Ok(__FieldTag::__structured_format),
"types" => Ok(__FieldTag::__types),
"distanceMeters" => Ok(__FieldTag::__distance_meters),
"distance_meters" => Ok(__FieldTag::__distance_meters),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::autocomplete_places_response::suggestion::PlacePrediction;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct PlacePrediction")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__place => {
if !fields.insert(__FieldTag::__place) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for place",
));
}
result.place = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__place_id => {
if !fields.insert(__FieldTag::__place_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for place_id",
));
}
result.place_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__text => {
if !fields.insert(__FieldTag::__text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text",
));
}
result.text = map.next_value::<std::option::Option<crate::model::autocomplete_places_response::suggestion::FormattableText>>()?
;
}
__FieldTag::__structured_format => {
if !fields.insert(__FieldTag::__structured_format) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for structured_format",
));
}
result.structured_format = map.next_value::<std::option::Option<crate::model::autocomplete_places_response::suggestion::StructuredFormat>>()?
;
}
__FieldTag::__types => {
if !fields.insert(__FieldTag::__types) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for types",
));
}
result.types = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__distance_meters => {
if !fields.insert(__FieldTag::__distance_meters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for distance_meters",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.distance_meters =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de>
for super::autocomplete_places_response::suggestion::QueryPrediction
{
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__text,
__structured_format,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for QueryPrediction")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"text" => Ok(__FieldTag::__text),
"structuredFormat" => Ok(__FieldTag::__structured_format),
"structured_format" => Ok(__FieldTag::__structured_format),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::autocomplete_places_response::suggestion::QueryPrediction;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct QueryPrediction")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__text => {
if !fields.insert(__FieldTag::__text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text",
));
}
result.text = map.next_value::<std::option::Option<crate::model::autocomplete_places_response::suggestion::FormattableText>>()?
;
}
__FieldTag::__structured_format => {
if !fields.insert(__FieldTag::__structured_format) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for structured_format",
));
}
result.structured_format = map.next_value::<std::option::Option<crate::model::autocomplete_places_response::suggestion::StructuredFormat>>()?
;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::Polyline {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__encoded_polyline,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Polyline")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"encodedPolyline" => Ok(__FieldTag::__encoded_polyline),
"encoded_polyline" => Ok(__FieldTag::__encoded_polyline),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Polyline;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Polyline")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__encoded_polyline => {
if !fields.insert(__FieldTag::__encoded_polyline) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for encoded_polyline",
));
}
if result.polyline_type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `polyline_type`, a oneof with full ID .google.maps.places.v1.Polyline.encoded_polyline, latest field was encodedPolyline",
));
}
result.polyline_type = std::option::Option::Some(
crate::model::polyline::PolylineType::EncodedPolyline(
map.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::PriceRange {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__start_price,
__end_price,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for PriceRange")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"startPrice" => Ok(__FieldTag::__start_price),
"start_price" => Ok(__FieldTag::__start_price),
"endPrice" => Ok(__FieldTag::__end_price),
"end_price" => Ok(__FieldTag::__end_price),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::PriceRange;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct PriceRange")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__start_price => {
if !fields.insert(__FieldTag::__start_price) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_price",
));
}
result.start_price = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__end_price => {
if !fields.insert(__FieldTag::__end_price) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for end_price",
));
}
result.end_price = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::References {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__reviews,
__places,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for References")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"reviews" => Ok(__FieldTag::__reviews),
"places" => Ok(__FieldTag::__places),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::References;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct References")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__reviews => {
if !fields.insert(__FieldTag::__reviews) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reviews",
));
}
result.reviews = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Review>>>()?.unwrap_or_default();
}
__FieldTag::__places => {
if !fields.insert(__FieldTag::__places) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for places",
));
}
result.places = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::Review {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__name,
__relative_publish_time_description,
__text,
__original_text,
__rating,
__author_attribution,
__publish_time,
__flag_content_uri,
__google_maps_uri,
__visit_date,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Review")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"name" => Ok(__FieldTag::__name),
"relativePublishTimeDescription" => {
Ok(__FieldTag::__relative_publish_time_description)
}
"relative_publish_time_description" => {
Ok(__FieldTag::__relative_publish_time_description)
}
"text" => Ok(__FieldTag::__text),
"originalText" => Ok(__FieldTag::__original_text),
"original_text" => Ok(__FieldTag::__original_text),
"rating" => Ok(__FieldTag::__rating),
"authorAttribution" => Ok(__FieldTag::__author_attribution),
"author_attribution" => Ok(__FieldTag::__author_attribution),
"publishTime" => Ok(__FieldTag::__publish_time),
"publish_time" => Ok(__FieldTag::__publish_time),
"flagContentUri" => Ok(__FieldTag::__flag_content_uri),
"flag_content_uri" => Ok(__FieldTag::__flag_content_uri),
"googleMapsUri" => Ok(__FieldTag::__google_maps_uri),
"google_maps_uri" => Ok(__FieldTag::__google_maps_uri),
"visitDate" => Ok(__FieldTag::__visit_date),
"visit_date" => Ok(__FieldTag::__visit_date),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Review;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Review")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__name => {
if !fields.insert(__FieldTag::__name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name",
));
}
result.name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__relative_publish_time_description => {
if !fields.insert(__FieldTag::__relative_publish_time_description) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for relative_publish_time_description",
));
}
result.relative_publish_time_description = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__text => {
if !fields.insert(__FieldTag::__text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text",
));
}
result.text = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__original_text => {
if !fields.insert(__FieldTag::__original_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for original_text",
));
}
result.original_text = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__rating => {
if !fields.insert(__FieldTag::__rating) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rating",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.rating = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__author_attribution => {
if !fields.insert(__FieldTag::__author_attribution) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for author_attribution",
));
}
result.author_attribution = map
.next_value::<std::option::Option<crate::model::AuthorAttribution>>(
)?;
}
__FieldTag::__publish_time => {
if !fields.insert(__FieldTag::__publish_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for publish_time",
));
}
result.publish_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__flag_content_uri => {
if !fields.insert(__FieldTag::__flag_content_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for flag_content_uri",
));
}
result.flag_content_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__google_maps_uri => {
if !fields.insert(__FieldTag::__google_maps_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for google_maps_uri",
));
}
result.google_maps_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__visit_date => {
if !fields.insert(__FieldTag::__visit_date) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for visit_date",
));
}
result.visit_date = map
.next_value::<std::option::Option<google_cloud_type::model::Date>>(
)?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::RouteModifiers {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__avoid_tolls,
__avoid_highways,
__avoid_ferries,
__avoid_indoor,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for RouteModifiers")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"avoidTolls" => Ok(__FieldTag::__avoid_tolls),
"avoid_tolls" => Ok(__FieldTag::__avoid_tolls),
"avoidHighways" => Ok(__FieldTag::__avoid_highways),
"avoid_highways" => Ok(__FieldTag::__avoid_highways),
"avoidFerries" => Ok(__FieldTag::__avoid_ferries),
"avoid_ferries" => Ok(__FieldTag::__avoid_ferries),
"avoidIndoor" => Ok(__FieldTag::__avoid_indoor),
"avoid_indoor" => Ok(__FieldTag::__avoid_indoor),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RouteModifiers;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RouteModifiers")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__avoid_tolls => {
if !fields.insert(__FieldTag::__avoid_tolls) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for avoid_tolls",
));
}
result.avoid_tolls = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__avoid_highways => {
if !fields.insert(__FieldTag::__avoid_highways) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for avoid_highways",
));
}
result.avoid_highways = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__avoid_ferries => {
if !fields.insert(__FieldTag::__avoid_ferries) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for avoid_ferries",
));
}
result.avoid_ferries = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__avoid_indoor => {
if !fields.insert(__FieldTag::__avoid_indoor) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for avoid_indoor",
));
}
result.avoid_indoor = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::RoutingSummary {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__legs,
__directions_uri,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for RoutingSummary")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"legs" => Ok(__FieldTag::__legs),
"directionsUri" => Ok(__FieldTag::__directions_uri),
"directions_uri" => Ok(__FieldTag::__directions_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RoutingSummary;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RoutingSummary")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__legs => {
if !fields.insert(__FieldTag::__legs) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for legs",
));
}
result.legs = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::routing_summary::Leg>,
>>()?
.unwrap_or_default();
}
__FieldTag::__directions_uri => {
if !fields.insert(__FieldTag::__directions_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for directions_uri",
));
}
result.directions_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::routing_summary::Leg {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__duration,
__distance_meters,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Leg")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"duration" => Ok(__FieldTag::__duration),
"distanceMeters" => Ok(__FieldTag::__distance_meters),
"distance_meters" => Ok(__FieldTag::__distance_meters),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::routing_summary::Leg;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Leg")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__duration => {
if !fields.insert(__FieldTag::__duration) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for duration",
));
}
result.duration =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__distance_meters => {
if !fields.insert(__FieldTag::__distance_meters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for distance_meters",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.distance_meters =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::TransitStation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__display_name,
__agencies,
__stops,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for TransitStation")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"agencies" => Ok(__FieldTag::__agencies),
"stops" => Ok(__FieldTag::__stops),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TransitStation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TransitStation")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__display_name => {
if !fields.insert(__FieldTag::__display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for display_name",
));
}
result.display_name = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__agencies => {
if !fields.insert(__FieldTag::__agencies) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for agencies",
));
}
result.agencies = map.next_value::<std::option::Option<std::vec::Vec<crate::model::TransitAgency>>>()?.unwrap_or_default();
}
__FieldTag::__stops => {
if !fields.insert(__FieldTag::__stops) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for stops",
));
}
result.stops = map.next_value::<std::option::Option<std::vec::Vec<crate::model::TransitStop>>>()?.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::TransitAgency {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__display_name,
__url,
__fare_url,
__icon,
__lines,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for TransitAgency")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"url" => Ok(__FieldTag::__url),
"fareUrl" => Ok(__FieldTag::__fare_url),
"fare_url" => Ok(__FieldTag::__fare_url),
"icon" => Ok(__FieldTag::__icon),
"lines" => Ok(__FieldTag::__lines),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TransitAgency;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TransitAgency")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__display_name => {
if !fields.insert(__FieldTag::__display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for display_name",
));
}
result.display_name = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__url => {
if !fields.insert(__FieldTag::__url) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for url",
));
}
result.url = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__fare_url => {
if !fields.insert(__FieldTag::__fare_url) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for fare_url",
));
}
result.fare_url = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__icon => {
if !fields.insert(__FieldTag::__icon) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for icon",
));
}
result.icon =
map.next_value::<std::option::Option<crate::model::TransitIcon>>()?;
}
__FieldTag::__lines => {
if !fields.insert(__FieldTag::__lines) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for lines",
));
}
result.lines = map.next_value::<std::option::Option<std::vec::Vec<crate::model::TransitLine>>>()?.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::TransitLine {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__id,
__vehicle_type,
__display_name,
__short_display_name,
__text_color,
__background_color,
__url,
__icon,
__vehicle_icon,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for TransitLine")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"id" => Ok(__FieldTag::__id),
"vehicleType" => Ok(__FieldTag::__vehicle_type),
"vehicle_type" => Ok(__FieldTag::__vehicle_type),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"shortDisplayName" => Ok(__FieldTag::__short_display_name),
"short_display_name" => Ok(__FieldTag::__short_display_name),
"textColor" => Ok(__FieldTag::__text_color),
"text_color" => Ok(__FieldTag::__text_color),
"backgroundColor" => Ok(__FieldTag::__background_color),
"background_color" => Ok(__FieldTag::__background_color),
"url" => Ok(__FieldTag::__url),
"icon" => Ok(__FieldTag::__icon),
"vehicleIcon" => Ok(__FieldTag::__vehicle_icon),
"vehicle_icon" => Ok(__FieldTag::__vehicle_icon),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TransitLine;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TransitLine")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__id => {
if !fields.insert(__FieldTag::__id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for id",
));
}
result.id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__vehicle_type => {
if !fields.insert(__FieldTag::__vehicle_type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vehicle_type",
));
}
result.vehicle_type = map.next_value::<std::option::Option<crate::model::transit_line::VehicleType>>()?.unwrap_or_default();
}
__FieldTag::__display_name => {
if !fields.insert(__FieldTag::__display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for display_name",
));
}
result.display_name = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__short_display_name => {
if !fields.insert(__FieldTag::__short_display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for short_display_name",
));
}
result.short_display_name = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__text_color => {
if !fields.insert(__FieldTag::__text_color) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text_color",
));
}
result.text_color = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__background_color => {
if !fields.insert(__FieldTag::__background_color) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for background_color",
));
}
result.background_color = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__url => {
if !fields.insert(__FieldTag::__url) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for url",
));
}
result.url = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__icon => {
if !fields.insert(__FieldTag::__icon) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for icon",
));
}
result.icon =
map.next_value::<std::option::Option<crate::model::TransitIcon>>()?;
}
__FieldTag::__vehicle_icon => {
if !fields.insert(__FieldTag::__vehicle_icon) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vehicle_icon",
));
}
result.vehicle_icon =
map.next_value::<std::option::Option<crate::model::TransitIcon>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::TransitStop {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__id,
__display_name,
__platform_code,
__signage_text,
__stop_code,
__location,
__wheelchair_accessible_entrance,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for TransitStop")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"id" => Ok(__FieldTag::__id),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"platformCode" => Ok(__FieldTag::__platform_code),
"platform_code" => Ok(__FieldTag::__platform_code),
"signageText" => Ok(__FieldTag::__signage_text),
"signage_text" => Ok(__FieldTag::__signage_text),
"stopCode" => Ok(__FieldTag::__stop_code),
"stop_code" => Ok(__FieldTag::__stop_code),
"location" => Ok(__FieldTag::__location),
"wheelchairAccessibleEntrance" => {
Ok(__FieldTag::__wheelchair_accessible_entrance)
}
"wheelchair_accessible_entrance" => {
Ok(__FieldTag::__wheelchair_accessible_entrance)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TransitStop;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TransitStop")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__id => {
if !fields.insert(__FieldTag::__id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for id",
));
}
result.id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__display_name => {
if !fields.insert(__FieldTag::__display_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for display_name",
));
}
result.display_name = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__platform_code => {
if !fields.insert(__FieldTag::__platform_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for platform_code",
));
}
result.platform_code = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__signage_text => {
if !fields.insert(__FieldTag::__signage_text) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for signage_text",
));
}
result.signage_text = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__stop_code => {
if !fields.insert(__FieldTag::__stop_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for stop_code",
));
}
result.stop_code = map.next_value::<std::option::Option<google_cloud_type::model::LocalizedText>>()?
;
}
__FieldTag::__location => {
if !fields.insert(__FieldTag::__location) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for location",
));
}
result.location = map.next_value::<std::option::Option<google_cloud_type::model::LatLng>>()?
;
}
__FieldTag::__wheelchair_accessible_entrance => {
if !fields.insert(__FieldTag::__wheelchair_accessible_entrance) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for wheelchair_accessible_entrance",
));
}
result.wheelchair_accessible_entrance =
map.next_value::<std::option::Option<bool>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::TransitIcon {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__url,
__name_included,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for TransitIcon")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"url" => Ok(__FieldTag::__url),
"nameIncluded" => Ok(__FieldTag::__name_included),
"name_included" => Ok(__FieldTag::__name_included),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TransitIcon;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TransitIcon")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__url => {
if !fields.insert(__FieldTag::__url) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for url",
));
}
result.url = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__name_included => {
if !fields.insert(__FieldTag::__name_included) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for name_included",
));
}
result.name_included = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}