#[allow(unused_imports)]
use super::*;
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::FindClosestBuildingInsightsRequest {
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 {
__location,
__required_quality,
__exact_quality_required,
__experiments,
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 FindClosestBuildingInsightsRequest")
}
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 {
"location" => Ok(__FieldTag::__location),
"requiredQuality" => Ok(__FieldTag::__required_quality),
"required_quality" => Ok(__FieldTag::__required_quality),
"exactQualityRequired" => Ok(__FieldTag::__exact_quality_required),
"exact_quality_required" => Ok(__FieldTag::__exact_quality_required),
"experiments" => Ok(__FieldTag::__experiments),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::FindClosestBuildingInsightsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct FindClosestBuildingInsightsRequest")
}
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::__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::__required_quality => {
if !fields.insert(__FieldTag::__required_quality) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for required_quality",
));
}
result.required_quality = map
.next_value::<std::option::Option<crate::model::ImageryQuality>>()?
.unwrap_or_default();
}
__FieldTag::__exact_quality_required => {
if !fields.insert(__FieldTag::__exact_quality_required) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for exact_quality_required",
));
}
result.exact_quality_required = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__experiments => {
if !fields.insert(__FieldTag::__experiments) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for experiments",
));
}
result.experiments = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Experiment>>>()?.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::LatLngBox {
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 {
__sw,
__ne,
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 LatLngBox")
}
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 {
"sw" => Ok(__FieldTag::__sw),
"ne" => Ok(__FieldTag::__ne),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::LatLngBox;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LatLngBox")
}
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::__sw => {
if !fields.insert(__FieldTag::__sw) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sw",
));
}
result.sw = map.next_value::<std::option::Option<google_cloud_type::model::LatLng>>()?
;
}
__FieldTag::__ne => {
if !fields.insert(__FieldTag::__ne) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for ne",
));
}
result.ne = map.next_value::<std::option::Option<google_cloud_type::model::LatLng>>()?
;
}
__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::BuildingInsights {
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,
__center,
__bounding_box,
__imagery_date,
__imagery_processed_date,
__postal_code,
__administrative_area,
__statistical_area,
__region_code,
__solar_potential,
__imagery_quality,
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 BuildingInsights")
}
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),
"center" => Ok(__FieldTag::__center),
"boundingBox" => Ok(__FieldTag::__bounding_box),
"bounding_box" => Ok(__FieldTag::__bounding_box),
"imageryDate" => Ok(__FieldTag::__imagery_date),
"imagery_date" => Ok(__FieldTag::__imagery_date),
"imageryProcessedDate" => Ok(__FieldTag::__imagery_processed_date),
"imagery_processed_date" => Ok(__FieldTag::__imagery_processed_date),
"postalCode" => Ok(__FieldTag::__postal_code),
"postal_code" => Ok(__FieldTag::__postal_code),
"administrativeArea" => Ok(__FieldTag::__administrative_area),
"administrative_area" => Ok(__FieldTag::__administrative_area),
"statisticalArea" => Ok(__FieldTag::__statistical_area),
"statistical_area" => Ok(__FieldTag::__statistical_area),
"regionCode" => Ok(__FieldTag::__region_code),
"region_code" => Ok(__FieldTag::__region_code),
"solarPotential" => Ok(__FieldTag::__solar_potential),
"solar_potential" => Ok(__FieldTag::__solar_potential),
"imageryQuality" => Ok(__FieldTag::__imagery_quality),
"imagery_quality" => Ok(__FieldTag::__imagery_quality),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BuildingInsights;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BuildingInsights")
}
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::__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::__bounding_box => {
if !fields.insert(__FieldTag::__bounding_box) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bounding_box",
));
}
result.bounding_box =
map.next_value::<std::option::Option<crate::model::LatLngBox>>()?;
}
__FieldTag::__imagery_date => {
if !fields.insert(__FieldTag::__imagery_date) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for imagery_date",
));
}
result.imagery_date = map
.next_value::<std::option::Option<google_cloud_type::model::Date>>(
)?;
}
__FieldTag::__imagery_processed_date => {
if !fields.insert(__FieldTag::__imagery_processed_date) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for imagery_processed_date",
));
}
result.imagery_processed_date = map
.next_value::<std::option::Option<google_cloud_type::model::Date>>(
)?;
}
__FieldTag::__postal_code => {
if !fields.insert(__FieldTag::__postal_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for postal_code",
));
}
result.postal_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__administrative_area => {
if !fields.insert(__FieldTag::__administrative_area) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for administrative_area",
));
}
result.administrative_area = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__statistical_area => {
if !fields.insert(__FieldTag::__statistical_area) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for statistical_area",
));
}
result.statistical_area = 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::__solar_potential => {
if !fields.insert(__FieldTag::__solar_potential) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for solar_potential",
));
}
result.solar_potential = map
.next_value::<std::option::Option<crate::model::SolarPotential>>(
)?;
}
__FieldTag::__imagery_quality => {
if !fields.insert(__FieldTag::__imagery_quality) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for imagery_quality",
));
}
result.imagery_quality = map
.next_value::<std::option::Option<crate::model::ImageryQuality>>()?
.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::SolarPotential {
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 {
__max_array_panels_count,
__panel_capacity_watts,
__panel_height_meters,
__panel_width_meters,
__panel_lifetime_years,
__max_array_area_meters2,
__max_sunshine_hours_per_year,
__carbon_offset_factor_kg_per_mwh,
__whole_roof_stats,
__building_stats,
__roof_segment_stats,
__solar_panels,
__solar_panel_configs,
__financial_analyses,
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 SolarPotential")
}
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 {
"maxArrayPanelsCount" => Ok(__FieldTag::__max_array_panels_count),
"max_array_panels_count" => Ok(__FieldTag::__max_array_panels_count),
"panelCapacityWatts" => Ok(__FieldTag::__panel_capacity_watts),
"panel_capacity_watts" => Ok(__FieldTag::__panel_capacity_watts),
"panelHeightMeters" => Ok(__FieldTag::__panel_height_meters),
"panel_height_meters" => Ok(__FieldTag::__panel_height_meters),
"panelWidthMeters" => Ok(__FieldTag::__panel_width_meters),
"panel_width_meters" => Ok(__FieldTag::__panel_width_meters),
"panelLifetimeYears" => Ok(__FieldTag::__panel_lifetime_years),
"panel_lifetime_years" => Ok(__FieldTag::__panel_lifetime_years),
"maxArrayAreaMeters2" => Ok(__FieldTag::__max_array_area_meters2),
"max_array_area_meters2" => Ok(__FieldTag::__max_array_area_meters2),
"maxSunshineHoursPerYear" => {
Ok(__FieldTag::__max_sunshine_hours_per_year)
}
"max_sunshine_hours_per_year" => {
Ok(__FieldTag::__max_sunshine_hours_per_year)
}
"carbonOffsetFactorKgPerMwh" => {
Ok(__FieldTag::__carbon_offset_factor_kg_per_mwh)
}
"carbon_offset_factor_kg_per_mwh" => {
Ok(__FieldTag::__carbon_offset_factor_kg_per_mwh)
}
"wholeRoofStats" => Ok(__FieldTag::__whole_roof_stats),
"whole_roof_stats" => Ok(__FieldTag::__whole_roof_stats),
"buildingStats" => Ok(__FieldTag::__building_stats),
"building_stats" => Ok(__FieldTag::__building_stats),
"roofSegmentStats" => Ok(__FieldTag::__roof_segment_stats),
"roof_segment_stats" => Ok(__FieldTag::__roof_segment_stats),
"solarPanels" => Ok(__FieldTag::__solar_panels),
"solar_panels" => Ok(__FieldTag::__solar_panels),
"solarPanelConfigs" => Ok(__FieldTag::__solar_panel_configs),
"solar_panel_configs" => Ok(__FieldTag::__solar_panel_configs),
"financialAnalyses" => Ok(__FieldTag::__financial_analyses),
"financial_analyses" => Ok(__FieldTag::__financial_analyses),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SolarPotential;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SolarPotential")
}
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::__max_array_panels_count => {
if !fields.insert(__FieldTag::__max_array_panels_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_array_panels_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_array_panels_count =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__panel_capacity_watts => {
if !fields.insert(__FieldTag::__panel_capacity_watts) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for panel_capacity_watts",
));
}
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.panel_capacity_watts =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__panel_height_meters => {
if !fields.insert(__FieldTag::__panel_height_meters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for panel_height_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.panel_height_meters =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__panel_width_meters => {
if !fields.insert(__FieldTag::__panel_width_meters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for panel_width_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.panel_width_meters =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__panel_lifetime_years => {
if !fields.insert(__FieldTag::__panel_lifetime_years) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for panel_lifetime_years",
));
}
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.panel_lifetime_years =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_array_area_meters2 => {
if !fields.insert(__FieldTag::__max_array_area_meters2) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_array_area_meters2",
));
}
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.max_array_area_meters2 =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_sunshine_hours_per_year => {
if !fields.insert(__FieldTag::__max_sunshine_hours_per_year) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_sunshine_hours_per_year",
));
}
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.max_sunshine_hours_per_year =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__carbon_offset_factor_kg_per_mwh => {
if !fields.insert(__FieldTag::__carbon_offset_factor_kg_per_mwh) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for carbon_offset_factor_kg_per_mwh",
));
}
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.carbon_offset_factor_kg_per_mwh =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__whole_roof_stats => {
if !fields.insert(__FieldTag::__whole_roof_stats) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for whole_roof_stats",
));
}
result.whole_roof_stats = map.next_value::<std::option::Option<crate::model::SizeAndSunshineStats>>()?
;
}
__FieldTag::__building_stats => {
if !fields.insert(__FieldTag::__building_stats) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for building_stats",
));
}
result.building_stats = map.next_value::<std::option::Option<crate::model::SizeAndSunshineStats>>()?
;
}
__FieldTag::__roof_segment_stats => {
if !fields.insert(__FieldTag::__roof_segment_stats) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for roof_segment_stats",
));
}
result.roof_segment_stats = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::RoofSegmentSizeAndSunshineStats>,
>>()?
.unwrap_or_default();
}
__FieldTag::__solar_panels => {
if !fields.insert(__FieldTag::__solar_panels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for solar_panels",
));
}
result.solar_panels = map.next_value::<std::option::Option<std::vec::Vec<crate::model::SolarPanel>>>()?.unwrap_or_default();
}
__FieldTag::__solar_panel_configs => {
if !fields.insert(__FieldTag::__solar_panel_configs) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for solar_panel_configs",
));
}
result.solar_panel_configs =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::SolarPanelConfig>,
>>()?
.unwrap_or_default();
}
__FieldTag::__financial_analyses => {
if !fields.insert(__FieldTag::__financial_analyses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for financial_analyses",
));
}
result.financial_analyses =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::FinancialAnalysis>,
>>()?
.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::RoofSegmentSizeAndSunshineStats {
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 {
__pitch_degrees,
__azimuth_degrees,
__stats,
__center,
__bounding_box,
__plane_height_at_center_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 RoofSegmentSizeAndSunshineStats")
}
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 {
"pitchDegrees" => Ok(__FieldTag::__pitch_degrees),
"pitch_degrees" => Ok(__FieldTag::__pitch_degrees),
"azimuthDegrees" => Ok(__FieldTag::__azimuth_degrees),
"azimuth_degrees" => Ok(__FieldTag::__azimuth_degrees),
"stats" => Ok(__FieldTag::__stats),
"center" => Ok(__FieldTag::__center),
"boundingBox" => Ok(__FieldTag::__bounding_box),
"bounding_box" => Ok(__FieldTag::__bounding_box),
"planeHeightAtCenterMeters" => {
Ok(__FieldTag::__plane_height_at_center_meters)
}
"plane_height_at_center_meters" => {
Ok(__FieldTag::__plane_height_at_center_meters)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RoofSegmentSizeAndSunshineStats;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RoofSegmentSizeAndSunshineStats")
}
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::__pitch_degrees => {
if !fields.insert(__FieldTag::__pitch_degrees) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pitch_degrees",
));
}
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.pitch_degrees = map.next_value::<__With>()?.0;
}
__FieldTag::__azimuth_degrees => {
if !fields.insert(__FieldTag::__azimuth_degrees) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for azimuth_degrees",
));
}
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.azimuth_degrees = map.next_value::<__With>()?.0;
}
__FieldTag::__stats => {
if !fields.insert(__FieldTag::__stats) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for stats",
));
}
result.stats = map.next_value::<std::option::Option<crate::model::SizeAndSunshineStats>>()?
;
}
__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::__bounding_box => {
if !fields.insert(__FieldTag::__bounding_box) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bounding_box",
));
}
result.bounding_box =
map.next_value::<std::option::Option<crate::model::LatLngBox>>()?;
}
__FieldTag::__plane_height_at_center_meters => {
if !fields.insert(__FieldTag::__plane_height_at_center_meters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for plane_height_at_center_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.plane_height_at_center_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::SizeAndSunshineStats {
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 {
__area_meters2,
__sunshine_quantiles,
__ground_area_meters2,
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 SizeAndSunshineStats")
}
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 {
"areaMeters2" => Ok(__FieldTag::__area_meters2),
"area_meters2" => Ok(__FieldTag::__area_meters2),
"sunshineQuantiles" => Ok(__FieldTag::__sunshine_quantiles),
"sunshine_quantiles" => Ok(__FieldTag::__sunshine_quantiles),
"groundAreaMeters2" => Ok(__FieldTag::__ground_area_meters2),
"ground_area_meters2" => Ok(__FieldTag::__ground_area_meters2),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SizeAndSunshineStats;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SizeAndSunshineStats")
}
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::__area_meters2 => {
if !fields.insert(__FieldTag::__area_meters2) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for area_meters2",
));
}
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.area_meters2 = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__sunshine_quantiles => {
if !fields.insert(__FieldTag::__sunshine_quantiles) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sunshine_quantiles",
));
}
struct __With(std::option::Option<std::vec::Vec<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<std::vec::Vec<wkt::internal::F32>>,
>::deserialize(deserializer)
.map(__With)
}
}
result.sunshine_quantiles =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__ground_area_meters2 => {
if !fields.insert(__FieldTag::__ground_area_meters2) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for ground_area_meters2",
));
}
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.ground_area_meters2 =
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::SolarPanel {
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,
__orientation,
__yearly_energy_dc_kwh,
__segment_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 SolarPanel")
}
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),
"orientation" => Ok(__FieldTag::__orientation),
"yearlyEnergyDcKwh" => Ok(__FieldTag::__yearly_energy_dc_kwh),
"yearly_energy_dc_kwh" => Ok(__FieldTag::__yearly_energy_dc_kwh),
"segmentIndex" => Ok(__FieldTag::__segment_index),
"segment_index" => Ok(__FieldTag::__segment_index),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SolarPanel;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SolarPanel")
}
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::__orientation => {
if !fields.insert(__FieldTag::__orientation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for orientation",
));
}
result.orientation = map.next_value::<std::option::Option<crate::model::SolarPanelOrientation>>()?.unwrap_or_default();
}
__FieldTag::__yearly_energy_dc_kwh => {
if !fields.insert(__FieldTag::__yearly_energy_dc_kwh) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for yearly_energy_dc_kwh",
));
}
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.yearly_energy_dc_kwh =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__segment_index => {
if !fields.insert(__FieldTag::__segment_index) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for segment_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.segment_index = 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::SolarPanelConfig {
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 {
__panels_count,
__yearly_energy_dc_kwh,
__roof_segment_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 SolarPanelConfig")
}
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 {
"panelsCount" => Ok(__FieldTag::__panels_count),
"panels_count" => Ok(__FieldTag::__panels_count),
"yearlyEnergyDcKwh" => Ok(__FieldTag::__yearly_energy_dc_kwh),
"yearly_energy_dc_kwh" => Ok(__FieldTag::__yearly_energy_dc_kwh),
"roofSegmentSummaries" => Ok(__FieldTag::__roof_segment_summaries),
"roof_segment_summaries" => Ok(__FieldTag::__roof_segment_summaries),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SolarPanelConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SolarPanelConfig")
}
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::__panels_count => {
if !fields.insert(__FieldTag::__panels_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for panels_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.panels_count = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__yearly_energy_dc_kwh => {
if !fields.insert(__FieldTag::__yearly_energy_dc_kwh) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for yearly_energy_dc_kwh",
));
}
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.yearly_energy_dc_kwh =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__roof_segment_summaries => {
if !fields.insert(__FieldTag::__roof_segment_summaries) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for roof_segment_summaries",
));
}
result.roof_segment_summaries = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::RoofSegmentSummary>,
>>()?
.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::RoofSegmentSummary {
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 {
__pitch_degrees,
__azimuth_degrees,
__panels_count,
__yearly_energy_dc_kwh,
__segment_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 RoofSegmentSummary")
}
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 {
"pitchDegrees" => Ok(__FieldTag::__pitch_degrees),
"pitch_degrees" => Ok(__FieldTag::__pitch_degrees),
"azimuthDegrees" => Ok(__FieldTag::__azimuth_degrees),
"azimuth_degrees" => Ok(__FieldTag::__azimuth_degrees),
"panelsCount" => Ok(__FieldTag::__panels_count),
"panels_count" => Ok(__FieldTag::__panels_count),
"yearlyEnergyDcKwh" => Ok(__FieldTag::__yearly_energy_dc_kwh),
"yearly_energy_dc_kwh" => Ok(__FieldTag::__yearly_energy_dc_kwh),
"segmentIndex" => Ok(__FieldTag::__segment_index),
"segment_index" => Ok(__FieldTag::__segment_index),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RoofSegmentSummary;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RoofSegmentSummary")
}
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::__pitch_degrees => {
if !fields.insert(__FieldTag::__pitch_degrees) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pitch_degrees",
));
}
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.pitch_degrees = map.next_value::<__With>()?.0;
}
__FieldTag::__azimuth_degrees => {
if !fields.insert(__FieldTag::__azimuth_degrees) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for azimuth_degrees",
));
}
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.azimuth_degrees = map.next_value::<__With>()?.0;
}
__FieldTag::__panels_count => {
if !fields.insert(__FieldTag::__panels_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for panels_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.panels_count = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__yearly_energy_dc_kwh => {
if !fields.insert(__FieldTag::__yearly_energy_dc_kwh) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for yearly_energy_dc_kwh",
));
}
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.yearly_energy_dc_kwh =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__segment_index => {
if !fields.insert(__FieldTag::__segment_index) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for segment_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.segment_index = 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::FinancialAnalysis {
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 {
__monthly_bill,
__default_bill,
__average_kwh_per_month,
__panel_config_index,
__financial_details,
__leasing_savings,
__cash_purchase_savings,
__financed_purchase_savings,
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 FinancialAnalysis")
}
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 {
"monthlyBill" => Ok(__FieldTag::__monthly_bill),
"monthly_bill" => Ok(__FieldTag::__monthly_bill),
"defaultBill" => Ok(__FieldTag::__default_bill),
"default_bill" => Ok(__FieldTag::__default_bill),
"averageKwhPerMonth" => Ok(__FieldTag::__average_kwh_per_month),
"average_kwh_per_month" => Ok(__FieldTag::__average_kwh_per_month),
"panelConfigIndex" => Ok(__FieldTag::__panel_config_index),
"panel_config_index" => Ok(__FieldTag::__panel_config_index),
"financialDetails" => Ok(__FieldTag::__financial_details),
"financial_details" => Ok(__FieldTag::__financial_details),
"leasingSavings" => Ok(__FieldTag::__leasing_savings),
"leasing_savings" => Ok(__FieldTag::__leasing_savings),
"cashPurchaseSavings" => Ok(__FieldTag::__cash_purchase_savings),
"cash_purchase_savings" => Ok(__FieldTag::__cash_purchase_savings),
"financedPurchaseSavings" => {
Ok(__FieldTag::__financed_purchase_savings)
}
"financed_purchase_savings" => {
Ok(__FieldTag::__financed_purchase_savings)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::FinancialAnalysis;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct FinancialAnalysis")
}
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::__monthly_bill => {
if !fields.insert(__FieldTag::__monthly_bill) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for monthly_bill",
));
}
result.monthly_bill = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__default_bill => {
if !fields.insert(__FieldTag::__default_bill) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for default_bill",
));
}
result.default_bill = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__average_kwh_per_month => {
if !fields.insert(__FieldTag::__average_kwh_per_month) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for average_kwh_per_month",
));
}
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.average_kwh_per_month =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__panel_config_index => {
if !fields.insert(__FieldTag::__panel_config_index) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for panel_config_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.panel_config_index = map.next_value::<__With>()?.0;
}
__FieldTag::__financial_details => {
if !fields.insert(__FieldTag::__financial_details) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for financial_details",
));
}
result.financial_details = map
.next_value::<std::option::Option<crate::model::FinancialDetails>>(
)?;
}
__FieldTag::__leasing_savings => {
if !fields.insert(__FieldTag::__leasing_savings) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for leasing_savings",
));
}
result.leasing_savings = map
.next_value::<std::option::Option<crate::model::LeasingSavings>>(
)?;
}
__FieldTag::__cash_purchase_savings => {
if !fields.insert(__FieldTag::__cash_purchase_savings) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for cash_purchase_savings",
));
}
result.cash_purchase_savings = map.next_value::<std::option::Option<crate::model::CashPurchaseSavings>>()?
;
}
__FieldTag::__financed_purchase_savings => {
if !fields.insert(__FieldTag::__financed_purchase_savings) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for financed_purchase_savings",
));
}
result.financed_purchase_savings = map.next_value::<std::option::Option<crate::model::FinancedPurchaseSavings>>()?
;
}
__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::FinancialDetails {
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 {
__initial_ac_kwh_per_year,
__remaining_lifetime_utility_bill,
__federal_incentive,
__state_incentive,
__utility_incentive,
__lifetime_srec_total,
__cost_of_electricity_without_solar,
__net_metering_allowed,
__solar_percentage,
__percentage_exported_to_grid,
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 FinancialDetails")
}
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 {
"initialAcKwhPerYear" => Ok(__FieldTag::__initial_ac_kwh_per_year),
"initial_ac_kwh_per_year" => Ok(__FieldTag::__initial_ac_kwh_per_year),
"remainingLifetimeUtilityBill" => {
Ok(__FieldTag::__remaining_lifetime_utility_bill)
}
"remaining_lifetime_utility_bill" => {
Ok(__FieldTag::__remaining_lifetime_utility_bill)
}
"federalIncentive" => Ok(__FieldTag::__federal_incentive),
"federal_incentive" => Ok(__FieldTag::__federal_incentive),
"stateIncentive" => Ok(__FieldTag::__state_incentive),
"state_incentive" => Ok(__FieldTag::__state_incentive),
"utilityIncentive" => Ok(__FieldTag::__utility_incentive),
"utility_incentive" => Ok(__FieldTag::__utility_incentive),
"lifetimeSrecTotal" => Ok(__FieldTag::__lifetime_srec_total),
"lifetime_srec_total" => Ok(__FieldTag::__lifetime_srec_total),
"costOfElectricityWithoutSolar" => {
Ok(__FieldTag::__cost_of_electricity_without_solar)
}
"cost_of_electricity_without_solar" => {
Ok(__FieldTag::__cost_of_electricity_without_solar)
}
"netMeteringAllowed" => Ok(__FieldTag::__net_metering_allowed),
"net_metering_allowed" => Ok(__FieldTag::__net_metering_allowed),
"solarPercentage" => Ok(__FieldTag::__solar_percentage),
"solar_percentage" => Ok(__FieldTag::__solar_percentage),
"percentageExportedToGrid" => {
Ok(__FieldTag::__percentage_exported_to_grid)
}
"percentage_exported_to_grid" => {
Ok(__FieldTag::__percentage_exported_to_grid)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::FinancialDetails;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct FinancialDetails")
}
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::__initial_ac_kwh_per_year => {
if !fields.insert(__FieldTag::__initial_ac_kwh_per_year) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for initial_ac_kwh_per_year",
));
}
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.initial_ac_kwh_per_year =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__remaining_lifetime_utility_bill => {
if !fields.insert(__FieldTag::__remaining_lifetime_utility_bill) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for remaining_lifetime_utility_bill",
));
}
result.remaining_lifetime_utility_bill = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__federal_incentive => {
if !fields.insert(__FieldTag::__federal_incentive) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for federal_incentive",
));
}
result.federal_incentive = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__state_incentive => {
if !fields.insert(__FieldTag::__state_incentive) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for state_incentive",
));
}
result.state_incentive = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__utility_incentive => {
if !fields.insert(__FieldTag::__utility_incentive) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for utility_incentive",
));
}
result.utility_incentive = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__lifetime_srec_total => {
if !fields.insert(__FieldTag::__lifetime_srec_total) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for lifetime_srec_total",
));
}
result.lifetime_srec_total = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__cost_of_electricity_without_solar => {
if !fields.insert(__FieldTag::__cost_of_electricity_without_solar) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for cost_of_electricity_without_solar",
));
}
result.cost_of_electricity_without_solar = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__net_metering_allowed => {
if !fields.insert(__FieldTag::__net_metering_allowed) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for net_metering_allowed",
));
}
result.net_metering_allowed = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__solar_percentage => {
if !fields.insert(__FieldTag::__solar_percentage) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for solar_percentage",
));
}
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.solar_percentage = map.next_value::<__With>()?.0;
}
__FieldTag::__percentage_exported_to_grid => {
if !fields.insert(__FieldTag::__percentage_exported_to_grid) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for percentage_exported_to_grid",
));
}
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.percentage_exported_to_grid = 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::SavingsOverTime {
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 {
__savings_year1,
__savings_year20,
__present_value_of_savings_year20,
__savings_lifetime,
__present_value_of_savings_lifetime,
__financially_viable,
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 SavingsOverTime")
}
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 {
"savingsYear1" => Ok(__FieldTag::__savings_year1),
"savings_year1" => Ok(__FieldTag::__savings_year1),
"savingsYear20" => Ok(__FieldTag::__savings_year20),
"savings_year20" => Ok(__FieldTag::__savings_year20),
"presentValueOfSavingsYear20" => {
Ok(__FieldTag::__present_value_of_savings_year20)
}
"present_value_of_savings_year20" => {
Ok(__FieldTag::__present_value_of_savings_year20)
}
"savingsLifetime" => Ok(__FieldTag::__savings_lifetime),
"savings_lifetime" => Ok(__FieldTag::__savings_lifetime),
"presentValueOfSavingsLifetime" => {
Ok(__FieldTag::__present_value_of_savings_lifetime)
}
"present_value_of_savings_lifetime" => {
Ok(__FieldTag::__present_value_of_savings_lifetime)
}
"financiallyViable" => Ok(__FieldTag::__financially_viable),
"financially_viable" => Ok(__FieldTag::__financially_viable),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SavingsOverTime;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SavingsOverTime")
}
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::__savings_year1 => {
if !fields.insert(__FieldTag::__savings_year1) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for savings_year1",
));
}
result.savings_year1 = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__savings_year20 => {
if !fields.insert(__FieldTag::__savings_year20) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for savings_year20",
));
}
result.savings_year20 = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__present_value_of_savings_year20 => {
if !fields.insert(__FieldTag::__present_value_of_savings_year20) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for present_value_of_savings_year20",
));
}
result.present_value_of_savings_year20 = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__savings_lifetime => {
if !fields.insert(__FieldTag::__savings_lifetime) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for savings_lifetime",
));
}
result.savings_lifetime = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__present_value_of_savings_lifetime => {
if !fields.insert(__FieldTag::__present_value_of_savings_lifetime) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for present_value_of_savings_lifetime",
));
}
result.present_value_of_savings_lifetime = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__financially_viable => {
if !fields.insert(__FieldTag::__financially_viable) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for financially_viable",
));
}
result.financially_viable = 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::LeasingSavings {
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 {
__leases_allowed,
__leases_supported,
__annual_leasing_cost,
__savings,
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 LeasingSavings")
}
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 {
"leasesAllowed" => Ok(__FieldTag::__leases_allowed),
"leases_allowed" => Ok(__FieldTag::__leases_allowed),
"leasesSupported" => Ok(__FieldTag::__leases_supported),
"leases_supported" => Ok(__FieldTag::__leases_supported),
"annualLeasingCost" => Ok(__FieldTag::__annual_leasing_cost),
"annual_leasing_cost" => Ok(__FieldTag::__annual_leasing_cost),
"savings" => Ok(__FieldTag::__savings),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::LeasingSavings;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LeasingSavings")
}
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::__leases_allowed => {
if !fields.insert(__FieldTag::__leases_allowed) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for leases_allowed",
));
}
result.leases_allowed = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__leases_supported => {
if !fields.insert(__FieldTag::__leases_supported) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for leases_supported",
));
}
result.leases_supported = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__annual_leasing_cost => {
if !fields.insert(__FieldTag::__annual_leasing_cost) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for annual_leasing_cost",
));
}
result.annual_leasing_cost = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__savings => {
if !fields.insert(__FieldTag::__savings) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for savings",
));
}
result.savings = map
.next_value::<std::option::Option<crate::model::SavingsOverTime>>(
)?;
}
__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::CashPurchaseSavings {
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 {
__out_of_pocket_cost,
__upfront_cost,
__rebate_value,
__payback_years,
__savings,
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 CashPurchaseSavings")
}
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 {
"outOfPocketCost" => Ok(__FieldTag::__out_of_pocket_cost),
"out_of_pocket_cost" => Ok(__FieldTag::__out_of_pocket_cost),
"upfrontCost" => Ok(__FieldTag::__upfront_cost),
"upfront_cost" => Ok(__FieldTag::__upfront_cost),
"rebateValue" => Ok(__FieldTag::__rebate_value),
"rebate_value" => Ok(__FieldTag::__rebate_value),
"paybackYears" => Ok(__FieldTag::__payback_years),
"payback_years" => Ok(__FieldTag::__payback_years),
"savings" => Ok(__FieldTag::__savings),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CashPurchaseSavings;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CashPurchaseSavings")
}
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::__out_of_pocket_cost => {
if !fields.insert(__FieldTag::__out_of_pocket_cost) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for out_of_pocket_cost",
));
}
result.out_of_pocket_cost = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__upfront_cost => {
if !fields.insert(__FieldTag::__upfront_cost) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for upfront_cost",
));
}
result.upfront_cost = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__rebate_value => {
if !fields.insert(__FieldTag::__rebate_value) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rebate_value",
));
}
result.rebate_value = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__payback_years => {
if !fields.insert(__FieldTag::__payback_years) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for payback_years",
));
}
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.payback_years = map.next_value::<__With>()?.0;
}
__FieldTag::__savings => {
if !fields.insert(__FieldTag::__savings) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for savings",
));
}
result.savings = map
.next_value::<std::option::Option<crate::model::SavingsOverTime>>(
)?;
}
__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::FinancedPurchaseSavings {
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 {
__annual_loan_payment,
__rebate_value,
__loan_interest_rate,
__savings,
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 FinancedPurchaseSavings")
}
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 {
"annualLoanPayment" => Ok(__FieldTag::__annual_loan_payment),
"annual_loan_payment" => Ok(__FieldTag::__annual_loan_payment),
"rebateValue" => Ok(__FieldTag::__rebate_value),
"rebate_value" => Ok(__FieldTag::__rebate_value),
"loanInterestRate" => Ok(__FieldTag::__loan_interest_rate),
"loan_interest_rate" => Ok(__FieldTag::__loan_interest_rate),
"savings" => Ok(__FieldTag::__savings),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::FinancedPurchaseSavings;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct FinancedPurchaseSavings")
}
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::__annual_loan_payment => {
if !fields.insert(__FieldTag::__annual_loan_payment) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for annual_loan_payment",
));
}
result.annual_loan_payment = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__rebate_value => {
if !fields.insert(__FieldTag::__rebate_value) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rebate_value",
));
}
result.rebate_value = map
.next_value::<std::option::Option<google_cloud_type::model::Money>>(
)?;
}
__FieldTag::__loan_interest_rate => {
if !fields.insert(__FieldTag::__loan_interest_rate) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for loan_interest_rate",
));
}
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.loan_interest_rate =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__savings => {
if !fields.insert(__FieldTag::__savings) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for savings",
));
}
result.savings = map
.next_value::<std::option::Option<crate::model::SavingsOverTime>>(
)?;
}
__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::GetDataLayersRequest {
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 {
__location,
__radius_meters,
__view,
__required_quality,
__pixel_size_meters,
__exact_quality_required,
__experiments,
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 GetDataLayersRequest")
}
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 {
"location" => Ok(__FieldTag::__location),
"radiusMeters" => Ok(__FieldTag::__radius_meters),
"radius_meters" => Ok(__FieldTag::__radius_meters),
"view" => Ok(__FieldTag::__view),
"requiredQuality" => Ok(__FieldTag::__required_quality),
"required_quality" => Ok(__FieldTag::__required_quality),
"pixelSizeMeters" => Ok(__FieldTag::__pixel_size_meters),
"pixel_size_meters" => Ok(__FieldTag::__pixel_size_meters),
"exactQualityRequired" => Ok(__FieldTag::__exact_quality_required),
"exact_quality_required" => Ok(__FieldTag::__exact_quality_required),
"experiments" => Ok(__FieldTag::__experiments),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::GetDataLayersRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetDataLayersRequest")
}
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::__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::__radius_meters => {
if !fields.insert(__FieldTag::__radius_meters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for radius_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.radius_meters =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__view => {
if !fields.insert(__FieldTag::__view) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for view",
));
}
result.view = map
.next_value::<std::option::Option<crate::model::DataLayerView>>()?
.unwrap_or_default();
}
__FieldTag::__required_quality => {
if !fields.insert(__FieldTag::__required_quality) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for required_quality",
));
}
result.required_quality = map
.next_value::<std::option::Option<crate::model::ImageryQuality>>()?
.unwrap_or_default();
}
__FieldTag::__pixel_size_meters => {
if !fields.insert(__FieldTag::__pixel_size_meters) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pixel_size_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.pixel_size_meters =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__exact_quality_required => {
if !fields.insert(__FieldTag::__exact_quality_required) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for exact_quality_required",
));
}
result.exact_quality_required = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__experiments => {
if !fields.insert(__FieldTag::__experiments) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for experiments",
));
}
result.experiments = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Experiment>>>()?.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::DataLayers {
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 {
__imagery_date,
__imagery_processed_date,
__dsm_url,
__rgb_url,
__mask_url,
__annual_flux_url,
__monthly_flux_url,
__hourly_shade_urls,
__imagery_quality,
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 DataLayers")
}
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 {
"imageryDate" => Ok(__FieldTag::__imagery_date),
"imagery_date" => Ok(__FieldTag::__imagery_date),
"imageryProcessedDate" => Ok(__FieldTag::__imagery_processed_date),
"imagery_processed_date" => Ok(__FieldTag::__imagery_processed_date),
"dsmUrl" => Ok(__FieldTag::__dsm_url),
"dsm_url" => Ok(__FieldTag::__dsm_url),
"rgbUrl" => Ok(__FieldTag::__rgb_url),
"rgb_url" => Ok(__FieldTag::__rgb_url),
"maskUrl" => Ok(__FieldTag::__mask_url),
"mask_url" => Ok(__FieldTag::__mask_url),
"annualFluxUrl" => Ok(__FieldTag::__annual_flux_url),
"annual_flux_url" => Ok(__FieldTag::__annual_flux_url),
"monthlyFluxUrl" => Ok(__FieldTag::__monthly_flux_url),
"monthly_flux_url" => Ok(__FieldTag::__monthly_flux_url),
"hourlyShadeUrls" => Ok(__FieldTag::__hourly_shade_urls),
"hourly_shade_urls" => Ok(__FieldTag::__hourly_shade_urls),
"imageryQuality" => Ok(__FieldTag::__imagery_quality),
"imagery_quality" => Ok(__FieldTag::__imagery_quality),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DataLayers;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DataLayers")
}
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::__imagery_date => {
if !fields.insert(__FieldTag::__imagery_date) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for imagery_date",
));
}
result.imagery_date = map
.next_value::<std::option::Option<google_cloud_type::model::Date>>(
)?;
}
__FieldTag::__imagery_processed_date => {
if !fields.insert(__FieldTag::__imagery_processed_date) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for imagery_processed_date",
));
}
result.imagery_processed_date = map
.next_value::<std::option::Option<google_cloud_type::model::Date>>(
)?;
}
__FieldTag::__dsm_url => {
if !fields.insert(__FieldTag::__dsm_url) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for dsm_url",
));
}
result.dsm_url = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__rgb_url => {
if !fields.insert(__FieldTag::__rgb_url) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rgb_url",
));
}
result.rgb_url = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__mask_url => {
if !fields.insert(__FieldTag::__mask_url) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mask_url",
));
}
result.mask_url = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__annual_flux_url => {
if !fields.insert(__FieldTag::__annual_flux_url) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for annual_flux_url",
));
}
result.annual_flux_url = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__monthly_flux_url => {
if !fields.insert(__FieldTag::__monthly_flux_url) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for monthly_flux_url",
));
}
result.monthly_flux_url = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__hourly_shade_urls => {
if !fields.insert(__FieldTag::__hourly_shade_urls) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for hourly_shade_urls",
));
}
result.hourly_shade_urls = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__imagery_quality => {
if !fields.insert(__FieldTag::__imagery_quality) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for imagery_quality",
));
}
result.imagery_quality = map
.next_value::<std::option::Option<crate::model::ImageryQuality>>()?
.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::GetGeoTiffRequest {
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,
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 GetGeoTiffRequest")
}
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),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::GetGeoTiffRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetGeoTiffRequest")
}
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::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)
}
}