#[allow(unused_imports)]
use super::*;
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::Vertex {
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 {
__x,
__y,
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 Vertex")
}
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 {
"x" => Ok(__FieldTag::__x),
"y" => Ok(__FieldTag::__y),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Vertex;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Vertex")
}
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::__x => {
if !fields.insert(__FieldTag::__x) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for x",
));
}
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.x = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__y => {
if !fields.insert(__FieldTag::__y) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for y",
));
}
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.y = 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::NormalizedVertex {
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 {
__x,
__y,
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 NormalizedVertex")
}
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 {
"x" => Ok(__FieldTag::__x),
"y" => Ok(__FieldTag::__y),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::NormalizedVertex;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct NormalizedVertex")
}
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::__x => {
if !fields.insert(__FieldTag::__x) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for x",
));
}
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.x = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__y => {
if !fields.insert(__FieldTag::__y) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for y",
));
}
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.y = 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::BoundingPoly {
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 {
__vertices,
__normalized_vertices,
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 BoundingPoly")
}
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 {
"vertices" => Ok(__FieldTag::__vertices),
"normalizedVertices" => Ok(__FieldTag::__normalized_vertices),
"normalized_vertices" => Ok(__FieldTag::__normalized_vertices),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BoundingPoly;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BoundingPoly")
}
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::__vertices => {
if !fields.insert(__FieldTag::__vertices) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vertices",
));
}
result.vertices = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Vertex>>>()?.unwrap_or_default();
}
__FieldTag::__normalized_vertices => {
if !fields.insert(__FieldTag::__normalized_vertices) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for normalized_vertices",
));
}
result.normalized_vertices =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::NormalizedVertex>,
>>()?
.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::Position {
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 {
__x,
__y,
__z,
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 Position")
}
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 {
"x" => Ok(__FieldTag::__x),
"y" => Ok(__FieldTag::__y),
"z" => Ok(__FieldTag::__z),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Position;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Position")
}
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::__x => {
if !fields.insert(__FieldTag::__x) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for x",
));
}
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.x = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__y => {
if !fields.insert(__FieldTag::__y) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for y",
));
}
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.y = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__z => {
if !fields.insert(__FieldTag::__z) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for z",
));
}
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.z = 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::Feature {
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_results,
__model,
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 Feature")
}
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),
"maxResults" => Ok(__FieldTag::__max_results),
"max_results" => Ok(__FieldTag::__max_results),
"model" => Ok(__FieldTag::__model),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Feature;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Feature")
}
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::feature::Type>>()?
.unwrap_or_default();
}
__FieldTag::__max_results => {
if !fields.insert(__FieldTag::__max_results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_results",
));
}
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_results = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__model => {
if !fields.insert(__FieldTag::__model) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for model",
));
}
result.model = 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::ImageSource {
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 {
__gcs_image_uri,
__image_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 ImageSource")
}
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 {
"gcsImageUri" => Ok(__FieldTag::__gcs_image_uri),
"gcs_image_uri" => Ok(__FieldTag::__gcs_image_uri),
"imageUri" => Ok(__FieldTag::__image_uri),
"image_uri" => Ok(__FieldTag::__image_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImageSource;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImageSource")
}
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::__gcs_image_uri => {
if !fields.insert(__FieldTag::__gcs_image_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gcs_image_uri",
));
}
result.gcs_image_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__image_uri => {
if !fields.insert(__FieldTag::__image_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for image_uri",
));
}
result.image_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::Image {
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,
__source,
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 Image")
}
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),
"source" => Ok(__FieldTag::__source),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Image;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Image")
}
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",
));
}
struct __With(std::option::Option<::bytes::Bytes>);
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<serde_with::base64::Base64> >::deserialize(deserializer).map(__With)
}
}
result.content = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__source => {
if !fields.insert(__FieldTag::__source) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for source",
));
}
result.source =
map.next_value::<std::option::Option<crate::model::ImageSource>>()?;
}
__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::FaceAnnotation {
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 {
__bounding_poly,
__fd_bounding_poly,
__landmarks,
__roll_angle,
__pan_angle,
__tilt_angle,
__detection_confidence,
__landmarking_confidence,
__joy_likelihood,
__sorrow_likelihood,
__anger_likelihood,
__surprise_likelihood,
__under_exposed_likelihood,
__blurred_likelihood,
__headwear_likelihood,
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 FaceAnnotation")
}
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 {
"boundingPoly" => Ok(__FieldTag::__bounding_poly),
"bounding_poly" => Ok(__FieldTag::__bounding_poly),
"fdBoundingPoly" => Ok(__FieldTag::__fd_bounding_poly),
"fd_bounding_poly" => Ok(__FieldTag::__fd_bounding_poly),
"landmarks" => Ok(__FieldTag::__landmarks),
"rollAngle" => Ok(__FieldTag::__roll_angle),
"roll_angle" => Ok(__FieldTag::__roll_angle),
"panAngle" => Ok(__FieldTag::__pan_angle),
"pan_angle" => Ok(__FieldTag::__pan_angle),
"tiltAngle" => Ok(__FieldTag::__tilt_angle),
"tilt_angle" => Ok(__FieldTag::__tilt_angle),
"detectionConfidence" => Ok(__FieldTag::__detection_confidence),
"detection_confidence" => Ok(__FieldTag::__detection_confidence),
"landmarkingConfidence" => Ok(__FieldTag::__landmarking_confidence),
"landmarking_confidence" => Ok(__FieldTag::__landmarking_confidence),
"joyLikelihood" => Ok(__FieldTag::__joy_likelihood),
"joy_likelihood" => Ok(__FieldTag::__joy_likelihood),
"sorrowLikelihood" => Ok(__FieldTag::__sorrow_likelihood),
"sorrow_likelihood" => Ok(__FieldTag::__sorrow_likelihood),
"angerLikelihood" => Ok(__FieldTag::__anger_likelihood),
"anger_likelihood" => Ok(__FieldTag::__anger_likelihood),
"surpriseLikelihood" => Ok(__FieldTag::__surprise_likelihood),
"surprise_likelihood" => Ok(__FieldTag::__surprise_likelihood),
"underExposedLikelihood" => Ok(__FieldTag::__under_exposed_likelihood),
"under_exposed_likelihood" => {
Ok(__FieldTag::__under_exposed_likelihood)
}
"blurredLikelihood" => Ok(__FieldTag::__blurred_likelihood),
"blurred_likelihood" => Ok(__FieldTag::__blurred_likelihood),
"headwearLikelihood" => Ok(__FieldTag::__headwear_likelihood),
"headwear_likelihood" => Ok(__FieldTag::__headwear_likelihood),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::FaceAnnotation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct FaceAnnotation")
}
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::__bounding_poly => {
if !fields.insert(__FieldTag::__bounding_poly) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bounding_poly",
));
}
result.bounding_poly = map
.next_value::<std::option::Option<crate::model::BoundingPoly>>()?;
}
__FieldTag::__fd_bounding_poly => {
if !fields.insert(__FieldTag::__fd_bounding_poly) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for fd_bounding_poly",
));
}
result.fd_bounding_poly = map
.next_value::<std::option::Option<crate::model::BoundingPoly>>()?;
}
__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::face_annotation::Landmark>,
>>()?
.unwrap_or_default();
}
__FieldTag::__roll_angle => {
if !fields.insert(__FieldTag::__roll_angle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for roll_angle",
));
}
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.roll_angle = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__pan_angle => {
if !fields.insert(__FieldTag::__pan_angle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pan_angle",
));
}
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.pan_angle = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__tilt_angle => {
if !fields.insert(__FieldTag::__tilt_angle) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for tilt_angle",
));
}
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.tilt_angle = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__detection_confidence => {
if !fields.insert(__FieldTag::__detection_confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for detection_confidence",
));
}
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.detection_confidence =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__landmarking_confidence => {
if !fields.insert(__FieldTag::__landmarking_confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for landmarking_confidence",
));
}
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.landmarking_confidence =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__joy_likelihood => {
if !fields.insert(__FieldTag::__joy_likelihood) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for joy_likelihood",
));
}
result.joy_likelihood = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__sorrow_likelihood => {
if !fields.insert(__FieldTag::__sorrow_likelihood) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sorrow_likelihood",
));
}
result.sorrow_likelihood = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__anger_likelihood => {
if !fields.insert(__FieldTag::__anger_likelihood) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for anger_likelihood",
));
}
result.anger_likelihood = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__surprise_likelihood => {
if !fields.insert(__FieldTag::__surprise_likelihood) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for surprise_likelihood",
));
}
result.surprise_likelihood = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__under_exposed_likelihood => {
if !fields.insert(__FieldTag::__under_exposed_likelihood) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for under_exposed_likelihood",
));
}
result.under_exposed_likelihood = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__blurred_likelihood => {
if !fields.insert(__FieldTag::__blurred_likelihood) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for blurred_likelihood",
));
}
result.blurred_likelihood = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__headwear_likelihood => {
if !fields.insert(__FieldTag::__headwear_likelihood) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for headwear_likelihood",
));
}
result.headwear_likelihood = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.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::face_annotation::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 {
__type,
__position,
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 {
"type" => Ok(__FieldTag::__type),
"position" => Ok(__FieldTag::__position),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::face_annotation::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::__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::face_annotation::landmark::Type,
>>()?
.unwrap_or_default();
}
__FieldTag::__position => {
if !fields.insert(__FieldTag::__position) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for position",
));
}
result.position =
map.next_value::<std::option::Option<crate::model::Position>>()?;
}
__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::LocationInfo {
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 {
__lat_lng,
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 LocationInfo")
}
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 {
"latLng" => Ok(__FieldTag::__lat_lng),
"lat_lng" => Ok(__FieldTag::__lat_lng),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::LocationInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LocationInfo")
}
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::__lat_lng => {
if !fields.insert(__FieldTag::__lat_lng) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for lat_lng",
));
}
result.lat_lng = 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::Property {
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,
__value,
__uint64_value,
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 Property")
}
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),
"value" => Ok(__FieldTag::__value),
"uint64Value" => Ok(__FieldTag::__uint64_value),
"uint64_value" => Ok(__FieldTag::__uint64_value),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Property;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Property")
}
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::__value => {
if !fields.insert(__FieldTag::__value) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for value",
));
}
result.value = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__uint64_value => {
if !fields.insert(__FieldTag::__uint64_value) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for uint64_value",
));
}
struct __With(std::option::Option<u64>);
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::U64> >::deserialize(deserializer).map(__With)
}
}
result.uint64_value = 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::EntityAnnotation {
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 {
__mid,
__locale,
__description,
__score,
__confidence,
__topicality,
__bounding_poly,
__locations,
__properties,
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 EntityAnnotation")
}
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 {
"mid" => Ok(__FieldTag::__mid),
"locale" => Ok(__FieldTag::__locale),
"description" => Ok(__FieldTag::__description),
"score" => Ok(__FieldTag::__score),
"confidence" => Ok(__FieldTag::__confidence),
"topicality" => Ok(__FieldTag::__topicality),
"boundingPoly" => Ok(__FieldTag::__bounding_poly),
"bounding_poly" => Ok(__FieldTag::__bounding_poly),
"locations" => Ok(__FieldTag::__locations),
"properties" => Ok(__FieldTag::__properties),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::EntityAnnotation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct EntityAnnotation")
}
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::__mid => {
if !fields.insert(__FieldTag::__mid) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mid",
));
}
result.mid = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__locale => {
if !fields.insert(__FieldTag::__locale) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for locale",
));
}
result.locale = 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::__score => {
if !fields.insert(__FieldTag::__score) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for score",
));
}
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.score = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
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.confidence = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__topicality => {
if !fields.insert(__FieldTag::__topicality) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for topicality",
));
}
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.topicality = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__bounding_poly => {
if !fields.insert(__FieldTag::__bounding_poly) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bounding_poly",
));
}
result.bounding_poly = map
.next_value::<std::option::Option<crate::model::BoundingPoly>>()?;
}
__FieldTag::__locations => {
if !fields.insert(__FieldTag::__locations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for locations",
));
}
result.locations = map.next_value::<std::option::Option<std::vec::Vec<crate::model::LocationInfo>>>()?.unwrap_or_default();
}
__FieldTag::__properties => {
if !fields.insert(__FieldTag::__properties) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for properties",
));
}
result.properties = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Property>>>()?.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::LocalizedObjectAnnotation {
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 {
__mid,
__language_code,
__name,
__score,
__bounding_poly,
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 LocalizedObjectAnnotation")
}
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 {
"mid" => Ok(__FieldTag::__mid),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
"name" => Ok(__FieldTag::__name),
"score" => Ok(__FieldTag::__score),
"boundingPoly" => Ok(__FieldTag::__bounding_poly),
"bounding_poly" => Ok(__FieldTag::__bounding_poly),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::LocalizedObjectAnnotation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LocalizedObjectAnnotation")
}
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::__mid => {
if !fields.insert(__FieldTag::__mid) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mid",
));
}
result.mid = 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::__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::__score => {
if !fields.insert(__FieldTag::__score) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for score",
));
}
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.score = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__bounding_poly => {
if !fields.insert(__FieldTag::__bounding_poly) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bounding_poly",
));
}
result.bounding_poly = map
.next_value::<std::option::Option<crate::model::BoundingPoly>>()?;
}
__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::SafeSearchAnnotation {
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 {
__adult,
__spoof,
__medical,
__violence,
__racy,
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 SafeSearchAnnotation")
}
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 {
"adult" => Ok(__FieldTag::__adult),
"spoof" => Ok(__FieldTag::__spoof),
"medical" => Ok(__FieldTag::__medical),
"violence" => Ok(__FieldTag::__violence),
"racy" => Ok(__FieldTag::__racy),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SafeSearchAnnotation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SafeSearchAnnotation")
}
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::__adult => {
if !fields.insert(__FieldTag::__adult) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for adult",
));
}
result.adult = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__spoof => {
if !fields.insert(__FieldTag::__spoof) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for spoof",
));
}
result.spoof = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__medical => {
if !fields.insert(__FieldTag::__medical) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for medical",
));
}
result.medical = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__violence => {
if !fields.insert(__FieldTag::__violence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for violence",
));
}
result.violence = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.unwrap_or_default();
}
__FieldTag::__racy => {
if !fields.insert(__FieldTag::__racy) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for racy",
));
}
result.racy = map
.next_value::<std::option::Option<crate::model::Likelihood>>()?
.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::LatLongRect {
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 {
__min_lat_lng,
__max_lat_lng,
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 LatLongRect")
}
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 {
"minLatLng" => Ok(__FieldTag::__min_lat_lng),
"min_lat_lng" => Ok(__FieldTag::__min_lat_lng),
"maxLatLng" => Ok(__FieldTag::__max_lat_lng),
"max_lat_lng" => Ok(__FieldTag::__max_lat_lng),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::LatLongRect;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LatLongRect")
}
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::__min_lat_lng => {
if !fields.insert(__FieldTag::__min_lat_lng) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for min_lat_lng",
));
}
result.min_lat_lng = map.next_value::<std::option::Option<google_cloud_type::model::LatLng>>()?
;
}
__FieldTag::__max_lat_lng => {
if !fields.insert(__FieldTag::__max_lat_lng) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_lat_lng",
));
}
result.max_lat_lng = 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::ColorInfo {
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 {
__color,
__score,
__pixel_fraction,
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 ColorInfo")
}
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 {
"color" => Ok(__FieldTag::__color),
"score" => Ok(__FieldTag::__score),
"pixelFraction" => Ok(__FieldTag::__pixel_fraction),
"pixel_fraction" => Ok(__FieldTag::__pixel_fraction),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ColorInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ColorInfo")
}
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::__color => {
if !fields.insert(__FieldTag::__color) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for color",
));
}
result.color = map
.next_value::<std::option::Option<google_cloud_type::model::Color>>(
)?;
}
__FieldTag::__score => {
if !fields.insert(__FieldTag::__score) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for score",
));
}
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.score = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__pixel_fraction => {
if !fields.insert(__FieldTag::__pixel_fraction) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pixel_fraction",
));
}
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_fraction =
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::DominantColorsAnnotation {
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 {
__colors,
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 DominantColorsAnnotation")
}
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 {
"colors" => Ok(__FieldTag::__colors),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DominantColorsAnnotation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DominantColorsAnnotation")
}
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::__colors => {
if !fields.insert(__FieldTag::__colors) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for colors",
));
}
result.colors = map.next_value::<std::option::Option<std::vec::Vec<crate::model::ColorInfo>>>()?.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::ImageProperties {
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 {
__dominant_colors,
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 ImageProperties")
}
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 {
"dominantColors" => Ok(__FieldTag::__dominant_colors),
"dominant_colors" => Ok(__FieldTag::__dominant_colors),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImageProperties;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImageProperties")
}
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::__dominant_colors => {
if !fields.insert(__FieldTag::__dominant_colors) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for dominant_colors",
));
}
result.dominant_colors = map.next_value::<std::option::Option<crate::model::DominantColorsAnnotation>>()?
;
}
__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::CropHint {
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 {
__bounding_poly,
__confidence,
__importance_fraction,
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 CropHint")
}
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 {
"boundingPoly" => Ok(__FieldTag::__bounding_poly),
"bounding_poly" => Ok(__FieldTag::__bounding_poly),
"confidence" => Ok(__FieldTag::__confidence),
"importanceFraction" => Ok(__FieldTag::__importance_fraction),
"importance_fraction" => Ok(__FieldTag::__importance_fraction),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CropHint;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CropHint")
}
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::__bounding_poly => {
if !fields.insert(__FieldTag::__bounding_poly) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bounding_poly",
));
}
result.bounding_poly = map
.next_value::<std::option::Option<crate::model::BoundingPoly>>()?;
}
__FieldTag::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
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.confidence = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__importance_fraction => {
if !fields.insert(__FieldTag::__importance_fraction) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for importance_fraction",
));
}
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.importance_fraction =
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::CropHintsAnnotation {
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 {
__crop_hints,
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 CropHintsAnnotation")
}
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 {
"cropHints" => Ok(__FieldTag::__crop_hints),
"crop_hints" => Ok(__FieldTag::__crop_hints),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CropHintsAnnotation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CropHintsAnnotation")
}
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::__crop_hints => {
if !fields.insert(__FieldTag::__crop_hints) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for crop_hints",
));
}
result.crop_hints = map.next_value::<std::option::Option<std::vec::Vec<crate::model::CropHint>>>()?.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::CropHintsParams {
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 {
__aspect_ratios,
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 CropHintsParams")
}
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 {
"aspectRatios" => Ok(__FieldTag::__aspect_ratios),
"aspect_ratios" => Ok(__FieldTag::__aspect_ratios),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CropHintsParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CropHintsParams")
}
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::__aspect_ratios => {
if !fields.insert(__FieldTag::__aspect_ratios) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for aspect_ratios",
));
}
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.aspect_ratios =
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::WebDetectionParams {
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 {
__include_geo_results,
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 WebDetectionParams")
}
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 {
"includeGeoResults" => Ok(__FieldTag::__include_geo_results),
"include_geo_results" => Ok(__FieldTag::__include_geo_results),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::WebDetectionParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct WebDetectionParams")
}
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::__include_geo_results => {
if !fields.insert(__FieldTag::__include_geo_results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for include_geo_results",
));
}
result.include_geo_results = 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::TextDetectionParams {
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 {
__enable_text_detection_confidence_score,
__advanced_ocr_options,
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 TextDetectionParams")
}
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 {
"enableTextDetectionConfidenceScore" => {
Ok(__FieldTag::__enable_text_detection_confidence_score)
}
"enable_text_detection_confidence_score" => {
Ok(__FieldTag::__enable_text_detection_confidence_score)
}
"advancedOcrOptions" => Ok(__FieldTag::__advanced_ocr_options),
"advanced_ocr_options" => Ok(__FieldTag::__advanced_ocr_options),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TextDetectionParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TextDetectionParams")
}
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::__enable_text_detection_confidence_score => {
if !fields.insert(__FieldTag::__enable_text_detection_confidence_score)
{
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enable_text_detection_confidence_score",
));
}
result.enable_text_detection_confidence_score = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__advanced_ocr_options => {
if !fields.insert(__FieldTag::__advanced_ocr_options) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for advanced_ocr_options",
));
}
result.advanced_ocr_options = 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::ImageContext {
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 {
__lat_long_rect,
__language_hints,
__crop_hints_params,
__product_search_params,
__web_detection_params,
__text_detection_params,
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 ImageContext")
}
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 {
"latLongRect" => Ok(__FieldTag::__lat_long_rect),
"lat_long_rect" => Ok(__FieldTag::__lat_long_rect),
"languageHints" => Ok(__FieldTag::__language_hints),
"language_hints" => Ok(__FieldTag::__language_hints),
"cropHintsParams" => Ok(__FieldTag::__crop_hints_params),
"crop_hints_params" => Ok(__FieldTag::__crop_hints_params),
"productSearchParams" => Ok(__FieldTag::__product_search_params),
"product_search_params" => Ok(__FieldTag::__product_search_params),
"webDetectionParams" => Ok(__FieldTag::__web_detection_params),
"web_detection_params" => Ok(__FieldTag::__web_detection_params),
"textDetectionParams" => Ok(__FieldTag::__text_detection_params),
"text_detection_params" => Ok(__FieldTag::__text_detection_params),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImageContext;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImageContext")
}
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::__lat_long_rect => {
if !fields.insert(__FieldTag::__lat_long_rect) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for lat_long_rect",
));
}
result.lat_long_rect =
map.next_value::<std::option::Option<crate::model::LatLongRect>>()?;
}
__FieldTag::__language_hints => {
if !fields.insert(__FieldTag::__language_hints) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_hints",
));
}
result.language_hints = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__crop_hints_params => {
if !fields.insert(__FieldTag::__crop_hints_params) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for crop_hints_params",
));
}
result.crop_hints_params = map
.next_value::<std::option::Option<crate::model::CropHintsParams>>(
)?;
}
__FieldTag::__product_search_params => {
if !fields.insert(__FieldTag::__product_search_params) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_search_params",
));
}
result.product_search_params = map.next_value::<std::option::Option<crate::model::ProductSearchParams>>()?
;
}
__FieldTag::__web_detection_params => {
if !fields.insert(__FieldTag::__web_detection_params) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for web_detection_params",
));
}
result.web_detection_params = map.next_value::<std::option::Option<crate::model::WebDetectionParams>>()?
;
}
__FieldTag::__text_detection_params => {
if !fields.insert(__FieldTag::__text_detection_params) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text_detection_params",
));
}
result.text_detection_params = map.next_value::<std::option::Option<crate::model::TextDetectionParams>>()?
;
}
__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::AnnotateImageRequest {
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 {
__image,
__features,
__image_context,
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 AnnotateImageRequest")
}
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 {
"image" => Ok(__FieldTag::__image),
"features" => Ok(__FieldTag::__features),
"imageContext" => Ok(__FieldTag::__image_context),
"image_context" => Ok(__FieldTag::__image_context),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AnnotateImageRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AnnotateImageRequest")
}
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::__image => {
if !fields.insert(__FieldTag::__image) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for image",
));
}
result.image =
map.next_value::<std::option::Option<crate::model::Image>>()?;
}
__FieldTag::__features => {
if !fields.insert(__FieldTag::__features) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for features",
));
}
result.features = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Feature>>>()?.unwrap_or_default();
}
__FieldTag::__image_context => {
if !fields.insert(__FieldTag::__image_context) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for image_context",
));
}
result.image_context = map
.next_value::<std::option::Option<crate::model::ImageContext>>()?;
}
__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::ImageAnnotationContext {
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 {
__uri,
__page_number,
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 ImageAnnotationContext")
}
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 {
"uri" => Ok(__FieldTag::__uri),
"pageNumber" => Ok(__FieldTag::__page_number),
"page_number" => Ok(__FieldTag::__page_number),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImageAnnotationContext;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImageAnnotationContext")
}
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::__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::__page_number => {
if !fields.insert(__FieldTag::__page_number) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_number",
));
}
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.page_number = 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::AnnotateImageResponse {
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 {
__face_annotations,
__landmark_annotations,
__logo_annotations,
__label_annotations,
__localized_object_annotations,
__text_annotations,
__full_text_annotation,
__safe_search_annotation,
__image_properties_annotation,
__crop_hints_annotation,
__web_detection,
__product_search_results,
__error,
__context,
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 AnnotateImageResponse")
}
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 {
"faceAnnotations" => Ok(__FieldTag::__face_annotations),
"face_annotations" => Ok(__FieldTag::__face_annotations),
"landmarkAnnotations" => Ok(__FieldTag::__landmark_annotations),
"landmark_annotations" => Ok(__FieldTag::__landmark_annotations),
"logoAnnotations" => Ok(__FieldTag::__logo_annotations),
"logo_annotations" => Ok(__FieldTag::__logo_annotations),
"labelAnnotations" => Ok(__FieldTag::__label_annotations),
"label_annotations" => Ok(__FieldTag::__label_annotations),
"localizedObjectAnnotations" => {
Ok(__FieldTag::__localized_object_annotations)
}
"localized_object_annotations" => {
Ok(__FieldTag::__localized_object_annotations)
}
"textAnnotations" => Ok(__FieldTag::__text_annotations),
"text_annotations" => Ok(__FieldTag::__text_annotations),
"fullTextAnnotation" => Ok(__FieldTag::__full_text_annotation),
"full_text_annotation" => Ok(__FieldTag::__full_text_annotation),
"safeSearchAnnotation" => Ok(__FieldTag::__safe_search_annotation),
"safe_search_annotation" => Ok(__FieldTag::__safe_search_annotation),
"imagePropertiesAnnotation" => {
Ok(__FieldTag::__image_properties_annotation)
}
"image_properties_annotation" => {
Ok(__FieldTag::__image_properties_annotation)
}
"cropHintsAnnotation" => Ok(__FieldTag::__crop_hints_annotation),
"crop_hints_annotation" => Ok(__FieldTag::__crop_hints_annotation),
"webDetection" => Ok(__FieldTag::__web_detection),
"web_detection" => Ok(__FieldTag::__web_detection),
"productSearchResults" => Ok(__FieldTag::__product_search_results),
"product_search_results" => Ok(__FieldTag::__product_search_results),
"error" => Ok(__FieldTag::__error),
"context" => Ok(__FieldTag::__context),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AnnotateImageResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AnnotateImageResponse")
}
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::__face_annotations => {
if !fields.insert(__FieldTag::__face_annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for face_annotations",
));
}
result.face_annotations =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::FaceAnnotation>,
>>()?
.unwrap_or_default();
}
__FieldTag::__landmark_annotations => {
if !fields.insert(__FieldTag::__landmark_annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for landmark_annotations",
));
}
result.landmark_annotations =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::EntityAnnotation>,
>>()?
.unwrap_or_default();
}
__FieldTag::__logo_annotations => {
if !fields.insert(__FieldTag::__logo_annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for logo_annotations",
));
}
result.logo_annotations =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::EntityAnnotation>,
>>()?
.unwrap_or_default();
}
__FieldTag::__label_annotations => {
if !fields.insert(__FieldTag::__label_annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for label_annotations",
));
}
result.label_annotations =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::EntityAnnotation>,
>>()?
.unwrap_or_default();
}
__FieldTag::__localized_object_annotations => {
if !fields.insert(__FieldTag::__localized_object_annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for localized_object_annotations",
));
}
result.localized_object_annotations = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::LocalizedObjectAnnotation>,
>>()?
.unwrap_or_default();
}
__FieldTag::__text_annotations => {
if !fields.insert(__FieldTag::__text_annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text_annotations",
));
}
result.text_annotations =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::EntityAnnotation>,
>>()?
.unwrap_or_default();
}
__FieldTag::__full_text_annotation => {
if !fields.insert(__FieldTag::__full_text_annotation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for full_text_annotation",
));
}
result.full_text_annotation = map
.next_value::<std::option::Option<crate::model::TextAnnotation>>(
)?;
}
__FieldTag::__safe_search_annotation => {
if !fields.insert(__FieldTag::__safe_search_annotation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for safe_search_annotation",
));
}
result.safe_search_annotation = map.next_value::<std::option::Option<crate::model::SafeSearchAnnotation>>()?
;
}
__FieldTag::__image_properties_annotation => {
if !fields.insert(__FieldTag::__image_properties_annotation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for image_properties_annotation",
));
}
result.image_properties_annotation = map
.next_value::<std::option::Option<crate::model::ImageProperties>>(
)?;
}
__FieldTag::__crop_hints_annotation => {
if !fields.insert(__FieldTag::__crop_hints_annotation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for crop_hints_annotation",
));
}
result.crop_hints_annotation = map.next_value::<std::option::Option<crate::model::CropHintsAnnotation>>()?
;
}
__FieldTag::__web_detection => {
if !fields.insert(__FieldTag::__web_detection) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for web_detection",
));
}
result.web_detection = map
.next_value::<std::option::Option<crate::model::WebDetection>>()?;
}
__FieldTag::__product_search_results => {
if !fields.insert(__FieldTag::__product_search_results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_search_results",
));
}
result.product_search_results = map.next_value::<std::option::Option<crate::model::ProductSearchResults>>()?
;
}
__FieldTag::__error => {
if !fields.insert(__FieldTag::__error) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for error",
));
}
result.error = map
.next_value::<std::option::Option<google_cloud_rpc::model::Status>>(
)?;
}
__FieldTag::__context => {
if !fields.insert(__FieldTag::__context) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for context",
));
}
result.context = map.next_value::<std::option::Option<crate::model::ImageAnnotationContext>>()?
;
}
__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::BatchAnnotateImagesRequest {
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 {
__requests,
__parent,
__labels,
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 BatchAnnotateImagesRequest")
}
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 {
"requests" => Ok(__FieldTag::__requests),
"parent" => Ok(__FieldTag::__parent),
"labels" => Ok(__FieldTag::__labels),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchAnnotateImagesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchAnnotateImagesRequest")
}
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::__requests => {
if !fields.insert(__FieldTag::__requests) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for requests",
));
}
result.requests = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::AnnotateImageRequest>,
>>()?
.unwrap_or_default();
}
__FieldTag::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__labels => {
if !fields.insert(__FieldTag::__labels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for labels",
));
}
result.labels = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
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::BatchAnnotateImagesResponse {
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 {
__responses,
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 BatchAnnotateImagesResponse")
}
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 {
"responses" => Ok(__FieldTag::__responses),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchAnnotateImagesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchAnnotateImagesResponse")
}
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::__responses => {
if !fields.insert(__FieldTag::__responses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for responses",
));
}
result.responses = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::AnnotateImageResponse>,
>>()?
.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::AnnotateFileRequest {
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_config,
__features,
__image_context,
__pages,
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 AnnotateFileRequest")
}
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 {
"inputConfig" => Ok(__FieldTag::__input_config),
"input_config" => Ok(__FieldTag::__input_config),
"features" => Ok(__FieldTag::__features),
"imageContext" => Ok(__FieldTag::__image_context),
"image_context" => Ok(__FieldTag::__image_context),
"pages" => Ok(__FieldTag::__pages),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AnnotateFileRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AnnotateFileRequest")
}
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_config => {
if !fields.insert(__FieldTag::__input_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_config",
));
}
result.input_config =
map.next_value::<std::option::Option<crate::model::InputConfig>>()?;
}
__FieldTag::__features => {
if !fields.insert(__FieldTag::__features) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for features",
));
}
result.features = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Feature>>>()?.unwrap_or_default();
}
__FieldTag::__image_context => {
if !fields.insert(__FieldTag::__image_context) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for image_context",
));
}
result.image_context = map
.next_value::<std::option::Option<crate::model::ImageContext>>()?;
}
__FieldTag::__pages => {
if !fields.insert(__FieldTag::__pages) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pages",
));
}
struct __With(std::option::Option<std::vec::Vec<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<std::vec::Vec<wkt::internal::I32>>,
>::deserialize(deserializer)
.map(__With)
}
}
result.pages = 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::AnnotateFileResponse {
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_config,
__responses,
__total_pages,
__error,
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 AnnotateFileResponse")
}
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 {
"inputConfig" => Ok(__FieldTag::__input_config),
"input_config" => Ok(__FieldTag::__input_config),
"responses" => Ok(__FieldTag::__responses),
"totalPages" => Ok(__FieldTag::__total_pages),
"total_pages" => Ok(__FieldTag::__total_pages),
"error" => Ok(__FieldTag::__error),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AnnotateFileResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AnnotateFileResponse")
}
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_config => {
if !fields.insert(__FieldTag::__input_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_config",
));
}
result.input_config =
map.next_value::<std::option::Option<crate::model::InputConfig>>()?;
}
__FieldTag::__responses => {
if !fields.insert(__FieldTag::__responses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for responses",
));
}
result.responses = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::AnnotateImageResponse>,
>>()?
.unwrap_or_default();
}
__FieldTag::__total_pages => {
if !fields.insert(__FieldTag::__total_pages) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for total_pages",
));
}
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.total_pages = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__error => {
if !fields.insert(__FieldTag::__error) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for error",
));
}
result.error = map
.next_value::<std::option::Option<google_cloud_rpc::model::Status>>(
)?;
}
__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::BatchAnnotateFilesRequest {
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 {
__requests,
__parent,
__labels,
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 BatchAnnotateFilesRequest")
}
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 {
"requests" => Ok(__FieldTag::__requests),
"parent" => Ok(__FieldTag::__parent),
"labels" => Ok(__FieldTag::__labels),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchAnnotateFilesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchAnnotateFilesRequest")
}
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::__requests => {
if !fields.insert(__FieldTag::__requests) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for requests",
));
}
result.requests = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::AnnotateFileRequest>,
>>()?
.unwrap_or_default();
}
__FieldTag::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__labels => {
if !fields.insert(__FieldTag::__labels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for labels",
));
}
result.labels = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
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::BatchAnnotateFilesResponse {
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 {
__responses,
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 BatchAnnotateFilesResponse")
}
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 {
"responses" => Ok(__FieldTag::__responses),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchAnnotateFilesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchAnnotateFilesResponse")
}
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::__responses => {
if !fields.insert(__FieldTag::__responses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for responses",
));
}
result.responses = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::AnnotateFileResponse>,
>>()?
.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::AsyncAnnotateFileRequest {
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_config,
__features,
__image_context,
__output_config,
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 AsyncAnnotateFileRequest")
}
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 {
"inputConfig" => Ok(__FieldTag::__input_config),
"input_config" => Ok(__FieldTag::__input_config),
"features" => Ok(__FieldTag::__features),
"imageContext" => Ok(__FieldTag::__image_context),
"image_context" => Ok(__FieldTag::__image_context),
"outputConfig" => Ok(__FieldTag::__output_config),
"output_config" => Ok(__FieldTag::__output_config),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AsyncAnnotateFileRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AsyncAnnotateFileRequest")
}
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_config => {
if !fields.insert(__FieldTag::__input_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_config",
));
}
result.input_config =
map.next_value::<std::option::Option<crate::model::InputConfig>>()?;
}
__FieldTag::__features => {
if !fields.insert(__FieldTag::__features) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for features",
));
}
result.features = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Feature>>>()?.unwrap_or_default();
}
__FieldTag::__image_context => {
if !fields.insert(__FieldTag::__image_context) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for image_context",
));
}
result.image_context = map
.next_value::<std::option::Option<crate::model::ImageContext>>()?;
}
__FieldTag::__output_config => {
if !fields.insert(__FieldTag::__output_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for output_config",
));
}
result.output_config = map
.next_value::<std::option::Option<crate::model::OutputConfig>>()?;
}
__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::AsyncAnnotateFileResponse {
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 {
__output_config,
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 AsyncAnnotateFileResponse")
}
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 {
"outputConfig" => Ok(__FieldTag::__output_config),
"output_config" => Ok(__FieldTag::__output_config),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AsyncAnnotateFileResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AsyncAnnotateFileResponse")
}
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::__output_config => {
if !fields.insert(__FieldTag::__output_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for output_config",
));
}
result.output_config = map
.next_value::<std::option::Option<crate::model::OutputConfig>>()?;
}
__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::AsyncBatchAnnotateImagesRequest {
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 {
__requests,
__output_config,
__parent,
__labels,
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 AsyncBatchAnnotateImagesRequest")
}
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 {
"requests" => Ok(__FieldTag::__requests),
"outputConfig" => Ok(__FieldTag::__output_config),
"output_config" => Ok(__FieldTag::__output_config),
"parent" => Ok(__FieldTag::__parent),
"labels" => Ok(__FieldTag::__labels),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AsyncBatchAnnotateImagesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AsyncBatchAnnotateImagesRequest")
}
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::__requests => {
if !fields.insert(__FieldTag::__requests) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for requests",
));
}
result.requests = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::AnnotateImageRequest>,
>>()?
.unwrap_or_default();
}
__FieldTag::__output_config => {
if !fields.insert(__FieldTag::__output_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for output_config",
));
}
result.output_config = map
.next_value::<std::option::Option<crate::model::OutputConfig>>()?;
}
__FieldTag::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__labels => {
if !fields.insert(__FieldTag::__labels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for labels",
));
}
result.labels = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
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::AsyncBatchAnnotateImagesResponse {
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 {
__output_config,
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 AsyncBatchAnnotateImagesResponse")
}
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 {
"outputConfig" => Ok(__FieldTag::__output_config),
"output_config" => Ok(__FieldTag::__output_config),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AsyncBatchAnnotateImagesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AsyncBatchAnnotateImagesResponse")
}
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::__output_config => {
if !fields.insert(__FieldTag::__output_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for output_config",
));
}
result.output_config = map
.next_value::<std::option::Option<crate::model::OutputConfig>>()?;
}
__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::AsyncBatchAnnotateFilesRequest {
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 {
__requests,
__parent,
__labels,
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 AsyncBatchAnnotateFilesRequest")
}
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 {
"requests" => Ok(__FieldTag::__requests),
"parent" => Ok(__FieldTag::__parent),
"labels" => Ok(__FieldTag::__labels),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AsyncBatchAnnotateFilesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AsyncBatchAnnotateFilesRequest")
}
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::__requests => {
if !fields.insert(__FieldTag::__requests) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for requests",
));
}
result.requests = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::AsyncAnnotateFileRequest>,
>>()?
.unwrap_or_default();
}
__FieldTag::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__labels => {
if !fields.insert(__FieldTag::__labels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for labels",
));
}
result.labels = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
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::AsyncBatchAnnotateFilesResponse {
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 {
__responses,
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 AsyncBatchAnnotateFilesResponse")
}
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 {
"responses" => Ok(__FieldTag::__responses),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AsyncBatchAnnotateFilesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AsyncBatchAnnotateFilesResponse")
}
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::__responses => {
if !fields.insert(__FieldTag::__responses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for responses",
));
}
result.responses = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::AsyncAnnotateFileResponse>,
>>()?
.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::InputConfig {
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 {
__gcs_source,
__content,
__mime_type,
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 InputConfig")
}
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 {
"gcsSource" => Ok(__FieldTag::__gcs_source),
"gcs_source" => Ok(__FieldTag::__gcs_source),
"content" => Ok(__FieldTag::__content),
"mimeType" => Ok(__FieldTag::__mime_type),
"mime_type" => Ok(__FieldTag::__mime_type),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::InputConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct InputConfig")
}
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::__gcs_source => {
if !fields.insert(__FieldTag::__gcs_source) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gcs_source",
));
}
result.gcs_source =
map.next_value::<std::option::Option<crate::model::GcsSource>>()?;
}
__FieldTag::__content => {
if !fields.insert(__FieldTag::__content) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for content",
));
}
struct __With(std::option::Option<::bytes::Bytes>);
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<serde_with::base64::Base64> >::deserialize(deserializer).map(__With)
}
}
result.content = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__mime_type => {
if !fields.insert(__FieldTag::__mime_type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mime_type",
));
}
result.mime_type = 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::OutputConfig {
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 {
__gcs_destination,
__batch_size,
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 OutputConfig")
}
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 {
"gcsDestination" => Ok(__FieldTag::__gcs_destination),
"gcs_destination" => Ok(__FieldTag::__gcs_destination),
"batchSize" => Ok(__FieldTag::__batch_size),
"batch_size" => Ok(__FieldTag::__batch_size),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::OutputConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct OutputConfig")
}
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::__gcs_destination => {
if !fields.insert(__FieldTag::__gcs_destination) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gcs_destination",
));
}
result.gcs_destination = map
.next_value::<std::option::Option<crate::model::GcsDestination>>(
)?;
}
__FieldTag::__batch_size => {
if !fields.insert(__FieldTag::__batch_size) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for batch_size",
));
}
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.batch_size = 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::GcsSource {
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 {
__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 GcsSource")
}
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 {
"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::GcsSource;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GcsSource")
}
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::__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::GcsDestination {
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 {
__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 GcsDestination")
}
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 {
"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::GcsDestination;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GcsDestination")
}
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::__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::OperationMetadata {
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 {
__state,
__create_time,
__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 OperationMetadata")
}
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 {
"state" => Ok(__FieldTag::__state),
"createTime" => Ok(__FieldTag::__create_time),
"create_time" => Ok(__FieldTag::__create_time),
"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::OperationMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct OperationMetadata")
}
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::__state => {
if !fields.insert(__FieldTag::__state) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for state",
));
}
result.state = map.next_value::<std::option::Option<crate::model::operation_metadata::State>>()?.unwrap_or_default();
}
__FieldTag::__create_time => {
if !fields.insert(__FieldTag::__create_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for create_time",
));
}
result.create_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__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::ProductSearchParams {
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 {
__bounding_poly,
__product_set,
__product_categories,
__filter,
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 ProductSearchParams")
}
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 {
"boundingPoly" => Ok(__FieldTag::__bounding_poly),
"bounding_poly" => Ok(__FieldTag::__bounding_poly),
"productSet" => Ok(__FieldTag::__product_set),
"product_set" => Ok(__FieldTag::__product_set),
"productCategories" => Ok(__FieldTag::__product_categories),
"product_categories" => Ok(__FieldTag::__product_categories),
"filter" => Ok(__FieldTag::__filter),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ProductSearchParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ProductSearchParams")
}
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::__bounding_poly => {
if !fields.insert(__FieldTag::__bounding_poly) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bounding_poly",
));
}
result.bounding_poly = map
.next_value::<std::option::Option<crate::model::BoundingPoly>>()?;
}
__FieldTag::__product_set => {
if !fields.insert(__FieldTag::__product_set) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_set",
));
}
result.product_set = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__product_categories => {
if !fields.insert(__FieldTag::__product_categories) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_categories",
));
}
result.product_categories = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__filter => {
if !fields.insert(__FieldTag::__filter) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for filter",
));
}
result.filter = 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::ProductSearchResults {
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 {
__index_time,
__results,
__product_grouped_results,
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 ProductSearchResults")
}
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 {
"indexTime" => Ok(__FieldTag::__index_time),
"index_time" => Ok(__FieldTag::__index_time),
"results" => Ok(__FieldTag::__results),
"productGroupedResults" => Ok(__FieldTag::__product_grouped_results),
"product_grouped_results" => Ok(__FieldTag::__product_grouped_results),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ProductSearchResults;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ProductSearchResults")
}
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::__index_time => {
if !fields.insert(__FieldTag::__index_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for index_time",
));
}
result.index_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__results => {
if !fields.insert(__FieldTag::__results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for results",
));
}
result.results = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::product_search_results::Result>,
>>()?
.unwrap_or_default();
}
__FieldTag::__product_grouped_results => {
if !fields.insert(__FieldTag::__product_grouped_results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_grouped_results",
));
}
result.product_grouped_results = map
.next_value::<std::option::Option<
std::vec::Vec<
crate::model::product_search_results::GroupedResult,
>,
>>()?
.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::product_search_results::Result {
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 {
__product,
__score,
__image,
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 Result")
}
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 {
"product" => Ok(__FieldTag::__product),
"score" => Ok(__FieldTag::__score),
"image" => Ok(__FieldTag::__image),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::product_search_results::Result;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Result")
}
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::__product => {
if !fields.insert(__FieldTag::__product) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product",
));
}
result.product =
map.next_value::<std::option::Option<crate::model::Product>>()?;
}
__FieldTag::__score => {
if !fields.insert(__FieldTag::__score) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for score",
));
}
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.score = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__image => {
if !fields.insert(__FieldTag::__image) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for image",
));
}
result.image = 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::product_search_results::ObjectAnnotation {
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 {
__mid,
__language_code,
__name,
__score,
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 ObjectAnnotation")
}
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 {
"mid" => Ok(__FieldTag::__mid),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
"name" => Ok(__FieldTag::__name),
"score" => Ok(__FieldTag::__score),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::product_search_results::ObjectAnnotation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ObjectAnnotation")
}
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::__mid => {
if !fields.insert(__FieldTag::__mid) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mid",
));
}
result.mid = 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::__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::__score => {
if !fields.insert(__FieldTag::__score) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for score",
));
}
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.score = 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::product_search_results::GroupedResult {
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 {
__bounding_poly,
__results,
__object_annotations,
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 GroupedResult")
}
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 {
"boundingPoly" => Ok(__FieldTag::__bounding_poly),
"bounding_poly" => Ok(__FieldTag::__bounding_poly),
"results" => Ok(__FieldTag::__results),
"objectAnnotations" => Ok(__FieldTag::__object_annotations),
"object_annotations" => Ok(__FieldTag::__object_annotations),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::product_search_results::GroupedResult;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GroupedResult")
}
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::__bounding_poly => {
if !fields.insert(__FieldTag::__bounding_poly) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bounding_poly",
));
}
result.bounding_poly = map
.next_value::<std::option::Option<crate::model::BoundingPoly>>()?;
}
__FieldTag::__results => {
if !fields.insert(__FieldTag::__results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for results",
));
}
result.results = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::product_search_results::Result>,
>>()?
.unwrap_or_default();
}
__FieldTag::__object_annotations => {
if !fields.insert(__FieldTag::__object_annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for object_annotations",
));
}
result.object_annotations = map
.next_value::<std::option::Option<
std::vec::Vec<
crate::model::product_search_results::ObjectAnnotation,
>,
>>()?
.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::Product {
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,
__display_name,
__description,
__product_category,
__product_labels,
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 Product")
}
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),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"description" => Ok(__FieldTag::__description),
"productCategory" => Ok(__FieldTag::__product_category),
"product_category" => Ok(__FieldTag::__product_category),
"productLabels" => Ok(__FieldTag::__product_labels),
"product_labels" => Ok(__FieldTag::__product_labels),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Product;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Product")
}
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::__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::__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::__product_category => {
if !fields.insert(__FieldTag::__product_category) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_category",
));
}
result.product_category = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__product_labels => {
if !fields.insert(__FieldTag::__product_labels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_labels",
));
}
result.product_labels =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::product::KeyValue>,
>>()?
.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::product::KeyValue {
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 {
__key,
__value,
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 KeyValue")
}
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 {
"key" => Ok(__FieldTag::__key),
"value" => Ok(__FieldTag::__value),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::product::KeyValue;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct KeyValue")
}
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::__key => {
if !fields.insert(__FieldTag::__key) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for key",
));
}
result.key = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__value => {
if !fields.insert(__FieldTag::__value) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for value",
));
}
result.value = 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::ProductSet {
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,
__display_name,
__index_time,
__index_error,
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 ProductSet")
}
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),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"indexTime" => Ok(__FieldTag::__index_time),
"index_time" => Ok(__FieldTag::__index_time),
"indexError" => Ok(__FieldTag::__index_error),
"index_error" => Ok(__FieldTag::__index_error),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ProductSet;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ProductSet")
}
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::__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::__index_time => {
if !fields.insert(__FieldTag::__index_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for index_time",
));
}
result.index_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__index_error => {
if !fields.insert(__FieldTag::__index_error) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for index_error",
));
}
result.index_error = map
.next_value::<std::option::Option<google_cloud_rpc::model::Status>>(
)?;
}
__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::ReferenceImage {
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,
__uri,
__bounding_polys,
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 ReferenceImage")
}
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),
"uri" => Ok(__FieldTag::__uri),
"boundingPolys" => Ok(__FieldTag::__bounding_polys),
"bounding_polys" => Ok(__FieldTag::__bounding_polys),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ReferenceImage;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ReferenceImage")
}
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::__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::__bounding_polys => {
if !fields.insert(__FieldTag::__bounding_polys) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bounding_polys",
));
}
result.bounding_polys = map.next_value::<std::option::Option<std::vec::Vec<crate::model::BoundingPoly>>>()?.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::CreateProductRequest {
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 {
__parent,
__product,
__product_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 CreateProductRequest")
}
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 {
"parent" => Ok(__FieldTag::__parent),
"product" => Ok(__FieldTag::__product),
"productId" => Ok(__FieldTag::__product_id),
"product_id" => Ok(__FieldTag::__product_id),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CreateProductRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CreateProductRequest")
}
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::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__product => {
if !fields.insert(__FieldTag::__product) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product",
));
}
result.product =
map.next_value::<std::option::Option<crate::model::Product>>()?;
}
__FieldTag::__product_id => {
if !fields.insert(__FieldTag::__product_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_id",
));
}
result.product_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::ListProductsRequest {
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 {
__parent,
__page_size,
__page_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 ListProductsRequest")
}
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 {
"parent" => Ok(__FieldTag::__parent),
"pageSize" => Ok(__FieldTag::__page_size),
"page_size" => Ok(__FieldTag::__page_size),
"pageToken" => Ok(__FieldTag::__page_token),
"page_token" => Ok(__FieldTag::__page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListProductsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListProductsRequest")
}
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::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__page_size => {
if !fields.insert(__FieldTag::__page_size) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_size",
));
}
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.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__page_token => {
if !fields.insert(__FieldTag::__page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_token",
));
}
result.page_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::ListProductsResponse {
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 {
__products,
__next_page_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 ListProductsResponse")
}
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 {
"products" => Ok(__FieldTag::__products),
"nextPageToken" => Ok(__FieldTag::__next_page_token),
"next_page_token" => Ok(__FieldTag::__next_page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListProductsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListProductsResponse")
}
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::__products => {
if !fields.insert(__FieldTag::__products) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for products",
));
}
result.products = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Product>>>()?.unwrap_or_default();
}
__FieldTag::__next_page_token => {
if !fields.insert(__FieldTag::__next_page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for next_page_token",
));
}
result.next_page_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::GetProductRequest {
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,
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 GetProductRequest")
}
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),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::GetProductRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetProductRequest")
}
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::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::UpdateProductRequest {
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 {
__product,
__update_mask,
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 UpdateProductRequest")
}
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 {
"product" => Ok(__FieldTag::__product),
"updateMask" => Ok(__FieldTag::__update_mask),
"update_mask" => Ok(__FieldTag::__update_mask),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::UpdateProductRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct UpdateProductRequest")
}
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::__product => {
if !fields.insert(__FieldTag::__product) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product",
));
}
result.product =
map.next_value::<std::option::Option<crate::model::Product>>()?;
}
__FieldTag::__update_mask => {
if !fields.insert(__FieldTag::__update_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_mask",
));
}
result.update_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__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::DeleteProductRequest {
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,
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 DeleteProductRequest")
}
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),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DeleteProductRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DeleteProductRequest")
}
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::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::CreateProductSetRequest {
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 {
__parent,
__product_set,
__product_set_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 CreateProductSetRequest")
}
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 {
"parent" => Ok(__FieldTag::__parent),
"productSet" => Ok(__FieldTag::__product_set),
"product_set" => Ok(__FieldTag::__product_set),
"productSetId" => Ok(__FieldTag::__product_set_id),
"product_set_id" => Ok(__FieldTag::__product_set_id),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CreateProductSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CreateProductSetRequest")
}
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::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__product_set => {
if !fields.insert(__FieldTag::__product_set) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_set",
));
}
result.product_set =
map.next_value::<std::option::Option<crate::model::ProductSet>>()?;
}
__FieldTag::__product_set_id => {
if !fields.insert(__FieldTag::__product_set_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_set_id",
));
}
result.product_set_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::ListProductSetsRequest {
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 {
__parent,
__page_size,
__page_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 ListProductSetsRequest")
}
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 {
"parent" => Ok(__FieldTag::__parent),
"pageSize" => Ok(__FieldTag::__page_size),
"page_size" => Ok(__FieldTag::__page_size),
"pageToken" => Ok(__FieldTag::__page_token),
"page_token" => Ok(__FieldTag::__page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListProductSetsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListProductSetsRequest")
}
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::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__page_size => {
if !fields.insert(__FieldTag::__page_size) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_size",
));
}
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.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__page_token => {
if !fields.insert(__FieldTag::__page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_token",
));
}
result.page_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::ListProductSetsResponse {
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 {
__product_sets,
__next_page_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 ListProductSetsResponse")
}
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 {
"productSets" => Ok(__FieldTag::__product_sets),
"product_sets" => Ok(__FieldTag::__product_sets),
"nextPageToken" => Ok(__FieldTag::__next_page_token),
"next_page_token" => Ok(__FieldTag::__next_page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListProductSetsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListProductSetsResponse")
}
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::__product_sets => {
if !fields.insert(__FieldTag::__product_sets) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_sets",
));
}
result.product_sets = map.next_value::<std::option::Option<std::vec::Vec<crate::model::ProductSet>>>()?.unwrap_or_default();
}
__FieldTag::__next_page_token => {
if !fields.insert(__FieldTag::__next_page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for next_page_token",
));
}
result.next_page_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::GetProductSetRequest {
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,
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 GetProductSetRequest")
}
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),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::GetProductSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetProductSetRequest")
}
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::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::UpdateProductSetRequest {
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 {
__product_set,
__update_mask,
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 UpdateProductSetRequest")
}
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 {
"productSet" => Ok(__FieldTag::__product_set),
"product_set" => Ok(__FieldTag::__product_set),
"updateMask" => Ok(__FieldTag::__update_mask),
"update_mask" => Ok(__FieldTag::__update_mask),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::UpdateProductSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct UpdateProductSetRequest")
}
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::__product_set => {
if !fields.insert(__FieldTag::__product_set) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_set",
));
}
result.product_set =
map.next_value::<std::option::Option<crate::model::ProductSet>>()?;
}
__FieldTag::__update_mask => {
if !fields.insert(__FieldTag::__update_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_mask",
));
}
result.update_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__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::DeleteProductSetRequest {
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,
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 DeleteProductSetRequest")
}
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),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DeleteProductSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DeleteProductSetRequest")
}
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::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::CreateReferenceImageRequest {
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 {
__parent,
__reference_image,
__reference_image_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 CreateReferenceImageRequest")
}
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 {
"parent" => Ok(__FieldTag::__parent),
"referenceImage" => Ok(__FieldTag::__reference_image),
"reference_image" => Ok(__FieldTag::__reference_image),
"referenceImageId" => Ok(__FieldTag::__reference_image_id),
"reference_image_id" => Ok(__FieldTag::__reference_image_id),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CreateReferenceImageRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CreateReferenceImageRequest")
}
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::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__reference_image => {
if !fields.insert(__FieldTag::__reference_image) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reference_image",
));
}
result.reference_image = map
.next_value::<std::option::Option<crate::model::ReferenceImage>>(
)?;
}
__FieldTag::__reference_image_id => {
if !fields.insert(__FieldTag::__reference_image_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reference_image_id",
));
}
result.reference_image_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::ListReferenceImagesRequest {
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 {
__parent,
__page_size,
__page_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 ListReferenceImagesRequest")
}
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 {
"parent" => Ok(__FieldTag::__parent),
"pageSize" => Ok(__FieldTag::__page_size),
"page_size" => Ok(__FieldTag::__page_size),
"pageToken" => Ok(__FieldTag::__page_token),
"page_token" => Ok(__FieldTag::__page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListReferenceImagesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListReferenceImagesRequest")
}
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::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__page_size => {
if !fields.insert(__FieldTag::__page_size) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_size",
));
}
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.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__page_token => {
if !fields.insert(__FieldTag::__page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_token",
));
}
result.page_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::ListReferenceImagesResponse {
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 {
__reference_images,
__page_size,
__next_page_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 ListReferenceImagesResponse")
}
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 {
"referenceImages" => Ok(__FieldTag::__reference_images),
"reference_images" => Ok(__FieldTag::__reference_images),
"pageSize" => Ok(__FieldTag::__page_size),
"page_size" => Ok(__FieldTag::__page_size),
"nextPageToken" => Ok(__FieldTag::__next_page_token),
"next_page_token" => Ok(__FieldTag::__next_page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListReferenceImagesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListReferenceImagesResponse")
}
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::__reference_images => {
if !fields.insert(__FieldTag::__reference_images) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reference_images",
));
}
result.reference_images =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::ReferenceImage>,
>>()?
.unwrap_or_default();
}
__FieldTag::__page_size => {
if !fields.insert(__FieldTag::__page_size) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_size",
));
}
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.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__next_page_token => {
if !fields.insert(__FieldTag::__next_page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for next_page_token",
));
}
result.next_page_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::GetReferenceImageRequest {
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,
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 GetReferenceImageRequest")
}
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),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::GetReferenceImageRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetReferenceImageRequest")
}
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::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::DeleteReferenceImageRequest {
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,
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 DeleteReferenceImageRequest")
}
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),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DeleteReferenceImageRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DeleteReferenceImageRequest")
}
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::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::AddProductToProductSetRequest {
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,
__product,
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 AddProductToProductSetRequest")
}
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),
"product" => Ok(__FieldTag::__product),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AddProductToProductSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AddProductToProductSetRequest")
}
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::__product => {
if !fields.insert(__FieldTag::__product) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product",
));
}
result.product = 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::RemoveProductFromProductSetRequest {
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,
__product,
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 RemoveProductFromProductSetRequest")
}
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),
"product" => Ok(__FieldTag::__product),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RemoveProductFromProductSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RemoveProductFromProductSetRequest")
}
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::__product => {
if !fields.insert(__FieldTag::__product) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product",
));
}
result.product = 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::ListProductsInProductSetRequest {
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,
__page_size,
__page_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 ListProductsInProductSetRequest")
}
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),
"pageSize" => Ok(__FieldTag::__page_size),
"page_size" => Ok(__FieldTag::__page_size),
"pageToken" => Ok(__FieldTag::__page_token),
"page_token" => Ok(__FieldTag::__page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListProductsInProductSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListProductsInProductSetRequest")
}
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::__page_size => {
if !fields.insert(__FieldTag::__page_size) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_size",
));
}
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.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__page_token => {
if !fields.insert(__FieldTag::__page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_token",
));
}
result.page_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::ListProductsInProductSetResponse {
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 {
__products,
__next_page_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 ListProductsInProductSetResponse")
}
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 {
"products" => Ok(__FieldTag::__products),
"nextPageToken" => Ok(__FieldTag::__next_page_token),
"next_page_token" => Ok(__FieldTag::__next_page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListProductsInProductSetResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListProductsInProductSetResponse")
}
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::__products => {
if !fields.insert(__FieldTag::__products) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for products",
));
}
result.products = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Product>>>()?.unwrap_or_default();
}
__FieldTag::__next_page_token => {
if !fields.insert(__FieldTag::__next_page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for next_page_token",
));
}
result.next_page_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::ImportProductSetsGcsSource {
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 {
__csv_file_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 ImportProductSetsGcsSource")
}
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 {
"csvFileUri" => Ok(__FieldTag::__csv_file_uri),
"csv_file_uri" => Ok(__FieldTag::__csv_file_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImportProductSetsGcsSource;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImportProductSetsGcsSource")
}
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::__csv_file_uri => {
if !fields.insert(__FieldTag::__csv_file_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for csv_file_uri",
));
}
result.csv_file_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::ImportProductSetsInputConfig {
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 {
__gcs_source,
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 ImportProductSetsInputConfig")
}
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 {
"gcsSource" => Ok(__FieldTag::__gcs_source),
"gcs_source" => Ok(__FieldTag::__gcs_source),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImportProductSetsInputConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImportProductSetsInputConfig")
}
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::__gcs_source => {
if !fields.insert(__FieldTag::__gcs_source) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gcs_source",
));
}
if result.source.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `source`, a oneof with full ID .google.cloud.vision.v1.ImportProductSetsInputConfig.gcs_source, latest field was gcsSource",
));
}
result.source = std::option::Option::Some(
crate::model::import_product_sets_input_config::Source::GcsSource(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::ImportProductSetsGcsSource>,
>>()?
.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::ImportProductSetsRequest {
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 {
__parent,
__input_config,
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 ImportProductSetsRequest")
}
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 {
"parent" => Ok(__FieldTag::__parent),
"inputConfig" => Ok(__FieldTag::__input_config),
"input_config" => Ok(__FieldTag::__input_config),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImportProductSetsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImportProductSetsRequest")
}
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::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__input_config => {
if !fields.insert(__FieldTag::__input_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_config",
));
}
result.input_config = map.next_value::<std::option::Option<crate::model::ImportProductSetsInputConfig>>()?
;
}
__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::ImportProductSetsResponse {
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 {
__reference_images,
__statuses,
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 ImportProductSetsResponse")
}
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 {
"referenceImages" => Ok(__FieldTag::__reference_images),
"reference_images" => Ok(__FieldTag::__reference_images),
"statuses" => Ok(__FieldTag::__statuses),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImportProductSetsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImportProductSetsResponse")
}
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::__reference_images => {
if !fields.insert(__FieldTag::__reference_images) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reference_images",
));
}
result.reference_images =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::ReferenceImage>,
>>()?
.unwrap_or_default();
}
__FieldTag::__statuses => {
if !fields.insert(__FieldTag::__statuses) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for statuses",
));
}
result.statuses =
map.next_value::<std::option::Option<
std::vec::Vec<google_cloud_rpc::model::Status>,
>>()?
.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::BatchOperationMetadata {
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 {
__state,
__submit_time,
__end_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 BatchOperationMetadata")
}
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 {
"state" => Ok(__FieldTag::__state),
"submitTime" => Ok(__FieldTag::__submit_time),
"submit_time" => Ok(__FieldTag::__submit_time),
"endTime" => Ok(__FieldTag::__end_time),
"end_time" => Ok(__FieldTag::__end_time),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchOperationMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchOperationMetadata")
}
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::__state => {
if !fields.insert(__FieldTag::__state) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for state",
));
}
result.state =
map.next_value::<std::option::Option<
crate::model::batch_operation_metadata::State,
>>()?
.unwrap_or_default();
}
__FieldTag::__submit_time => {
if !fields.insert(__FieldTag::__submit_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for submit_time",
));
}
result.submit_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__end_time => {
if !fields.insert(__FieldTag::__end_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for end_time",
));
}
result.end_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::ProductSetPurgeConfig {
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 {
__product_set_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 ProductSetPurgeConfig")
}
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 {
"productSetId" => Ok(__FieldTag::__product_set_id),
"product_set_id" => Ok(__FieldTag::__product_set_id),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ProductSetPurgeConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ProductSetPurgeConfig")
}
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::__product_set_id => {
if !fields.insert(__FieldTag::__product_set_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_set_id",
));
}
result.product_set_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::PurgeProductsRequest {
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 {
__product_set_purge_config,
__delete_orphan_products,
__parent,
__force,
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 PurgeProductsRequest")
}
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 {
"productSetPurgeConfig" => Ok(__FieldTag::__product_set_purge_config),
"product_set_purge_config" => {
Ok(__FieldTag::__product_set_purge_config)
}
"deleteOrphanProducts" => Ok(__FieldTag::__delete_orphan_products),
"delete_orphan_products" => Ok(__FieldTag::__delete_orphan_products),
"parent" => Ok(__FieldTag::__parent),
"force" => Ok(__FieldTag::__force),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::PurgeProductsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct PurgeProductsRequest")
}
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::__product_set_purge_config => {
if !fields.insert(__FieldTag::__product_set_purge_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for product_set_purge_config",
));
}
if result.target.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `target`, a oneof with full ID .google.cloud.vision.v1.PurgeProductsRequest.product_set_purge_config, latest field was productSetPurgeConfig",
));
}
result.target = std::option::Option::Some(
crate::model::purge_products_request::Target::ProductSetPurgeConfig(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::ProductSetPurgeConfig>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__delete_orphan_products => {
if !fields.insert(__FieldTag::__delete_orphan_products) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for delete_orphan_products",
));
}
if result.target.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `target`, a oneof with full ID .google.cloud.vision.v1.PurgeProductsRequest.delete_orphan_products, latest field was deleteOrphanProducts",
));
}
result.target = std::option::Option::Some(
crate::model::purge_products_request::Target::DeleteOrphanProducts(
map.next_value::<std::option::Option<bool>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__force => {
if !fields.insert(__FieldTag::__force) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for force",
));
}
result.force = 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::TextAnnotation {
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 {
__pages,
__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 TextAnnotation")
}
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 {
"pages" => Ok(__FieldTag::__pages),
"text" => Ok(__FieldTag::__text),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TextAnnotation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TextAnnotation")
}
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::__pages => {
if !fields.insert(__FieldTag::__pages) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pages",
));
}
result.pages = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Page>>>()?.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<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::text_annotation::DetectedLanguage {
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,
__confidence,
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 DetectedLanguage")
}
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),
"confidence" => Ok(__FieldTag::__confidence),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::text_annotation::DetectedLanguage;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DetectedLanguage")
}
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::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
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.confidence = 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::text_annotation::DetectedBreak {
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,
__is_prefix,
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 DetectedBreak")
}
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),
"isPrefix" => Ok(__FieldTag::__is_prefix),
"is_prefix" => Ok(__FieldTag::__is_prefix),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::text_annotation::DetectedBreak;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DetectedBreak")
}
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::text_annotation::detected_break::BreakType,
>>()?
.unwrap_or_default();
}
__FieldTag::__is_prefix => {
if !fields.insert(__FieldTag::__is_prefix) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for is_prefix",
));
}
result.is_prefix = 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::text_annotation::TextProperty {
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 {
__detected_languages,
__detected_break,
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 TextProperty")
}
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 {
"detectedLanguages" => Ok(__FieldTag::__detected_languages),
"detected_languages" => Ok(__FieldTag::__detected_languages),
"detectedBreak" => Ok(__FieldTag::__detected_break),
"detected_break" => Ok(__FieldTag::__detected_break),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::text_annotation::TextProperty;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TextProperty")
}
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::__detected_languages => {
if !fields.insert(__FieldTag::__detected_languages) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for detected_languages",
));
}
result.detected_languages = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::text_annotation::DetectedLanguage>,
>>()?
.unwrap_or_default();
}
__FieldTag::__detected_break => {
if !fields.insert(__FieldTag::__detected_break) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for detected_break",
));
}
result.detected_break =
map.next_value::<std::option::Option<
crate::model::text_annotation::DetectedBreak,
>>()?;
}
__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::Page {
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 {
__property,
__width,
__height,
__blocks,
__confidence,
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 Page")
}
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 {
"property" => Ok(__FieldTag::__property),
"width" => Ok(__FieldTag::__width),
"height" => Ok(__FieldTag::__height),
"blocks" => Ok(__FieldTag::__blocks),
"confidence" => Ok(__FieldTag::__confidence),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Page;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Page")
}
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::__property => {
if !fields.insert(__FieldTag::__property) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for property",
));
}
result.property =
map.next_value::<std::option::Option<
crate::model::text_annotation::TextProperty,
>>()?;
}
__FieldTag::__width => {
if !fields.insert(__FieldTag::__width) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for width",
));
}
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 = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__height => {
if !fields.insert(__FieldTag::__height) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for height",
));
}
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 = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__blocks => {
if !fields.insert(__FieldTag::__blocks) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for blocks",
));
}
result.blocks = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Block>>>()?.unwrap_or_default();
}
__FieldTag::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
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.confidence = 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::Block {
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 {
__property,
__bounding_box,
__paragraphs,
__block_type,
__confidence,
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 Block")
}
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 {
"property" => Ok(__FieldTag::__property),
"boundingBox" => Ok(__FieldTag::__bounding_box),
"bounding_box" => Ok(__FieldTag::__bounding_box),
"paragraphs" => Ok(__FieldTag::__paragraphs),
"blockType" => Ok(__FieldTag::__block_type),
"block_type" => Ok(__FieldTag::__block_type),
"confidence" => Ok(__FieldTag::__confidence),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Block;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Block")
}
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::__property => {
if !fields.insert(__FieldTag::__property) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for property",
));
}
result.property =
map.next_value::<std::option::Option<
crate::model::text_annotation::TextProperty,
>>()?;
}
__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::BoundingPoly>>()?;
}
__FieldTag::__paragraphs => {
if !fields.insert(__FieldTag::__paragraphs) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for paragraphs",
));
}
result.paragraphs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Paragraph>>>()?.unwrap_or_default();
}
__FieldTag::__block_type => {
if !fields.insert(__FieldTag::__block_type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for block_type",
));
}
result.block_type = map
.next_value::<std::option::Option<crate::model::block::BlockType>>(
)?
.unwrap_or_default();
}
__FieldTag::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
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.confidence = 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::Paragraph {
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 {
__property,
__bounding_box,
__words,
__confidence,
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 Paragraph")
}
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 {
"property" => Ok(__FieldTag::__property),
"boundingBox" => Ok(__FieldTag::__bounding_box),
"bounding_box" => Ok(__FieldTag::__bounding_box),
"words" => Ok(__FieldTag::__words),
"confidence" => Ok(__FieldTag::__confidence),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Paragraph;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Paragraph")
}
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::__property => {
if !fields.insert(__FieldTag::__property) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for property",
));
}
result.property =
map.next_value::<std::option::Option<
crate::model::text_annotation::TextProperty,
>>()?;
}
__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::BoundingPoly>>()?;
}
__FieldTag::__words => {
if !fields.insert(__FieldTag::__words) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for words",
));
}
result.words = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Word>>>()?.unwrap_or_default();
}
__FieldTag::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
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.confidence = 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::Word {
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 {
__property,
__bounding_box,
__symbols,
__confidence,
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 Word")
}
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 {
"property" => Ok(__FieldTag::__property),
"boundingBox" => Ok(__FieldTag::__bounding_box),
"bounding_box" => Ok(__FieldTag::__bounding_box),
"symbols" => Ok(__FieldTag::__symbols),
"confidence" => Ok(__FieldTag::__confidence),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Word;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Word")
}
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::__property => {
if !fields.insert(__FieldTag::__property) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for property",
));
}
result.property =
map.next_value::<std::option::Option<
crate::model::text_annotation::TextProperty,
>>()?;
}
__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::BoundingPoly>>()?;
}
__FieldTag::__symbols => {
if !fields.insert(__FieldTag::__symbols) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for symbols",
));
}
result.symbols = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Symbol>>>()?.unwrap_or_default();
}
__FieldTag::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
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.confidence = 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::Symbol {
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 {
__property,
__bounding_box,
__text,
__confidence,
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 Symbol")
}
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 {
"property" => Ok(__FieldTag::__property),
"boundingBox" => Ok(__FieldTag::__bounding_box),
"bounding_box" => Ok(__FieldTag::__bounding_box),
"text" => Ok(__FieldTag::__text),
"confidence" => Ok(__FieldTag::__confidence),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Symbol;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Symbol")
}
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::__property => {
if !fields.insert(__FieldTag::__property) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for property",
));
}
result.property =
map.next_value::<std::option::Option<
crate::model::text_annotation::TextProperty,
>>()?;
}
__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::BoundingPoly>>()?;
}
__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::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
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.confidence = 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::WebDetection {
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 {
__web_entities,
__full_matching_images,
__partial_matching_images,
__pages_with_matching_images,
__visually_similar_images,
__best_guess_labels,
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 WebDetection")
}
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 {
"webEntities" => Ok(__FieldTag::__web_entities),
"web_entities" => Ok(__FieldTag::__web_entities),
"fullMatchingImages" => Ok(__FieldTag::__full_matching_images),
"full_matching_images" => Ok(__FieldTag::__full_matching_images),
"partialMatchingImages" => Ok(__FieldTag::__partial_matching_images),
"partial_matching_images" => Ok(__FieldTag::__partial_matching_images),
"pagesWithMatchingImages" => {
Ok(__FieldTag::__pages_with_matching_images)
}
"pages_with_matching_images" => {
Ok(__FieldTag::__pages_with_matching_images)
}
"visuallySimilarImages" => Ok(__FieldTag::__visually_similar_images),
"visually_similar_images" => Ok(__FieldTag::__visually_similar_images),
"bestGuessLabels" => Ok(__FieldTag::__best_guess_labels),
"best_guess_labels" => Ok(__FieldTag::__best_guess_labels),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::WebDetection;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct WebDetection")
}
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::__web_entities => {
if !fields.insert(__FieldTag::__web_entities) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for web_entities",
));
}
result.web_entities = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::web_detection::WebEntity>,
>>()?
.unwrap_or_default();
}
__FieldTag::__full_matching_images => {
if !fields.insert(__FieldTag::__full_matching_images) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for full_matching_images",
));
}
result.full_matching_images = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::web_detection::WebImage>,
>>()?
.unwrap_or_default();
}
__FieldTag::__partial_matching_images => {
if !fields.insert(__FieldTag::__partial_matching_images) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for partial_matching_images",
));
}
result.partial_matching_images = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::web_detection::WebImage>,
>>()?
.unwrap_or_default();
}
__FieldTag::__pages_with_matching_images => {
if !fields.insert(__FieldTag::__pages_with_matching_images) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pages_with_matching_images",
));
}
result.pages_with_matching_images = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::web_detection::WebPage>,
>>()?
.unwrap_or_default();
}
__FieldTag::__visually_similar_images => {
if !fields.insert(__FieldTag::__visually_similar_images) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for visually_similar_images",
));
}
result.visually_similar_images = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::web_detection::WebImage>,
>>()?
.unwrap_or_default();
}
__FieldTag::__best_guess_labels => {
if !fields.insert(__FieldTag::__best_guess_labels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for best_guess_labels",
));
}
result.best_guess_labels = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::web_detection::WebLabel>,
>>()?
.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::web_detection::WebEntity {
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 {
__entity_id,
__score,
__description,
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 WebEntity")
}
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 {
"entityId" => Ok(__FieldTag::__entity_id),
"entity_id" => Ok(__FieldTag::__entity_id),
"score" => Ok(__FieldTag::__score),
"description" => Ok(__FieldTag::__description),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::web_detection::WebEntity;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct WebEntity")
}
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::__entity_id => {
if !fields.insert(__FieldTag::__entity_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for entity_id",
));
}
result.entity_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__score => {
if !fields.insert(__FieldTag::__score) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for score",
));
}
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.score = map.next_value::<__With>()?.0.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::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::web_detection::WebImage {
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,
__score,
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 WebImage")
}
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),
"score" => Ok(__FieldTag::__score),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::web_detection::WebImage;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct WebImage")
}
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::__score => {
if !fields.insert(__FieldTag::__score) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for score",
));
}
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.score = 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::web_detection::WebPage {
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,
__score,
__page_title,
__full_matching_images,
__partial_matching_images,
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 WebPage")
}
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),
"score" => Ok(__FieldTag::__score),
"pageTitle" => Ok(__FieldTag::__page_title),
"page_title" => Ok(__FieldTag::__page_title),
"fullMatchingImages" => Ok(__FieldTag::__full_matching_images),
"full_matching_images" => Ok(__FieldTag::__full_matching_images),
"partialMatchingImages" => Ok(__FieldTag::__partial_matching_images),
"partial_matching_images" => Ok(__FieldTag::__partial_matching_images),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::web_detection::WebPage;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct WebPage")
}
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::__score => {
if !fields.insert(__FieldTag::__score) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for score",
));
}
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.score = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__page_title => {
if !fields.insert(__FieldTag::__page_title) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for page_title",
));
}
result.page_title = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__full_matching_images => {
if !fields.insert(__FieldTag::__full_matching_images) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for full_matching_images",
));
}
result.full_matching_images = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::web_detection::WebImage>,
>>()?
.unwrap_or_default();
}
__FieldTag::__partial_matching_images => {
if !fields.insert(__FieldTag::__partial_matching_images) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for partial_matching_images",
));
}
result.partial_matching_images = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::web_detection::WebImage>,
>>()?
.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::web_detection::WebLabel {
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 {
__label,
__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 WebLabel")
}
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 {
"label" => Ok(__FieldTag::__label),
"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::web_detection::WebLabel;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct WebLabel")
}
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::__label => {
if !fields.insert(__FieldTag::__label) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for label",
));
}
result.label = 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::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)
}
}