#[allow(unused_imports)]
use super::*;
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::ImageClassificationPredictionParams {
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 {
__confidence_threshold,
__max_predictions,
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 ImageClassificationPredictionParams")
}
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 {
"confidenceThreshold" => Ok(__FieldTag::__confidence_threshold),
"confidence_threshold" => Ok(__FieldTag::__confidence_threshold),
"maxPredictions" => Ok(__FieldTag::__max_predictions),
"max_predictions" => Ok(__FieldTag::__max_predictions),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImageClassificationPredictionParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImageClassificationPredictionParams")
}
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::__confidence_threshold => {
if !fields.insert(__FieldTag::__confidence_threshold) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence_threshold",
));
}
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_threshold =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_predictions => {
if !fields.insert(__FieldTag::__max_predictions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_predictions",
));
}
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_predictions =
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::ImageObjectDetectionPredictionParams {
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 {
__confidence_threshold,
__max_predictions,
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 ImageObjectDetectionPredictionParams")
}
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 {
"confidenceThreshold" => Ok(__FieldTag::__confidence_threshold),
"confidence_threshold" => Ok(__FieldTag::__confidence_threshold),
"maxPredictions" => Ok(__FieldTag::__max_predictions),
"max_predictions" => Ok(__FieldTag::__max_predictions),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImageObjectDetectionPredictionParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImageObjectDetectionPredictionParams")
}
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::__confidence_threshold => {
if !fields.insert(__FieldTag::__confidence_threshold) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence_threshold",
));
}
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_threshold =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_predictions => {
if !fields.insert(__FieldTag::__max_predictions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_predictions",
));
}
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_predictions =
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::ImageSegmentationPredictionParams {
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 {
__confidence_threshold,
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 ImageSegmentationPredictionParams")
}
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 {
"confidenceThreshold" => Ok(__FieldTag::__confidence_threshold),
"confidence_threshold" => Ok(__FieldTag::__confidence_threshold),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ImageSegmentationPredictionParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ImageSegmentationPredictionParams")
}
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::__confidence_threshold => {
if !fields.insert(__FieldTag::__confidence_threshold) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence_threshold",
));
}
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_threshold =
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::VideoActionRecognitionPredictionParams {
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 {
__confidence_threshold,
__max_predictions,
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 VideoActionRecognitionPredictionParams")
}
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 {
"confidenceThreshold" => Ok(__FieldTag::__confidence_threshold),
"confidence_threshold" => Ok(__FieldTag::__confidence_threshold),
"maxPredictions" => Ok(__FieldTag::__max_predictions),
"max_predictions" => Ok(__FieldTag::__max_predictions),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::VideoActionRecognitionPredictionParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct VideoActionRecognitionPredictionParams")
}
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::__confidence_threshold => {
if !fields.insert(__FieldTag::__confidence_threshold) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence_threshold",
));
}
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_threshold =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_predictions => {
if !fields.insert(__FieldTag::__max_predictions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_predictions",
));
}
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_predictions =
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::VideoClassificationPredictionParams {
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 {
__confidence_threshold,
__max_predictions,
__segment_classification,
__shot_classification,
__one_sec_interval_classification,
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 VideoClassificationPredictionParams")
}
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 {
"confidenceThreshold" => Ok(__FieldTag::__confidence_threshold),
"confidence_threshold" => Ok(__FieldTag::__confidence_threshold),
"maxPredictions" => Ok(__FieldTag::__max_predictions),
"max_predictions" => Ok(__FieldTag::__max_predictions),
"segmentClassification" => Ok(__FieldTag::__segment_classification),
"segment_classification" => Ok(__FieldTag::__segment_classification),
"shotClassification" => Ok(__FieldTag::__shot_classification),
"shot_classification" => Ok(__FieldTag::__shot_classification),
"oneSecIntervalClassification" => {
Ok(__FieldTag::__one_sec_interval_classification)
}
"one_sec_interval_classification" => {
Ok(__FieldTag::__one_sec_interval_classification)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::VideoClassificationPredictionParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct VideoClassificationPredictionParams")
}
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::__confidence_threshold => {
if !fields.insert(__FieldTag::__confidence_threshold) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence_threshold",
));
}
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_threshold =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_predictions => {
if !fields.insert(__FieldTag::__max_predictions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_predictions",
));
}
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_predictions =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__segment_classification => {
if !fields.insert(__FieldTag::__segment_classification) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for segment_classification",
));
}
result.segment_classification = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__shot_classification => {
if !fields.insert(__FieldTag::__shot_classification) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for shot_classification",
));
}
result.shot_classification = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__one_sec_interval_classification => {
if !fields.insert(__FieldTag::__one_sec_interval_classification) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for one_sec_interval_classification",
));
}
result.one_sec_interval_classification = 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::VideoObjectTrackingPredictionParams {
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 {
__confidence_threshold,
__max_predictions,
__min_bounding_box_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 VideoObjectTrackingPredictionParams")
}
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 {
"confidenceThreshold" => Ok(__FieldTag::__confidence_threshold),
"confidence_threshold" => Ok(__FieldTag::__confidence_threshold),
"maxPredictions" => Ok(__FieldTag::__max_predictions),
"max_predictions" => Ok(__FieldTag::__max_predictions),
"minBoundingBoxSize" => Ok(__FieldTag::__min_bounding_box_size),
"min_bounding_box_size" => Ok(__FieldTag::__min_bounding_box_size),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::VideoObjectTrackingPredictionParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct VideoObjectTrackingPredictionParams")
}
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::__confidence_threshold => {
if !fields.insert(__FieldTag::__confidence_threshold) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence_threshold",
));
}
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_threshold =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_predictions => {
if !fields.insert(__FieldTag::__max_predictions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_predictions",
));
}
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_predictions =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__min_bounding_box_size => {
if !fields.insert(__FieldTag::__min_bounding_box_size) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for min_bounding_box_size",
));
}
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.min_bounding_box_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)
}
}