#[allow(unused_imports)]
use super::*;
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::Job {
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,
__input_uri,
__output_uri,
__template_id,
__config,
__state,
__create_time,
__start_time,
__end_time,
__ttl_after_completion_days,
__labels,
__error,
__mode,
__batch_mode_priority,
__optimization,
__fill_content_gaps,
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 Job")
}
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),
"inputUri" => Ok(__FieldTag::__input_uri),
"input_uri" => Ok(__FieldTag::__input_uri),
"outputUri" => Ok(__FieldTag::__output_uri),
"output_uri" => Ok(__FieldTag::__output_uri),
"templateId" => Ok(__FieldTag::__template_id),
"template_id" => Ok(__FieldTag::__template_id),
"config" => Ok(__FieldTag::__config),
"state" => Ok(__FieldTag::__state),
"createTime" => Ok(__FieldTag::__create_time),
"create_time" => Ok(__FieldTag::__create_time),
"startTime" => Ok(__FieldTag::__start_time),
"start_time" => Ok(__FieldTag::__start_time),
"endTime" => Ok(__FieldTag::__end_time),
"end_time" => Ok(__FieldTag::__end_time),
"ttlAfterCompletionDays" => Ok(__FieldTag::__ttl_after_completion_days),
"ttl_after_completion_days" => {
Ok(__FieldTag::__ttl_after_completion_days)
}
"labels" => Ok(__FieldTag::__labels),
"error" => Ok(__FieldTag::__error),
"mode" => Ok(__FieldTag::__mode),
"batchModePriority" => Ok(__FieldTag::__batch_mode_priority),
"batch_mode_priority" => Ok(__FieldTag::__batch_mode_priority),
"optimization" => Ok(__FieldTag::__optimization),
"fillContentGaps" => Ok(__FieldTag::__fill_content_gaps),
"fill_content_gaps" => Ok(__FieldTag::__fill_content_gaps),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Job;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Job")
}
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::__input_uri => {
if !fields.insert(__FieldTag::__input_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_uri",
));
}
result.input_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__output_uri => {
if !fields.insert(__FieldTag::__output_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for output_uri",
));
}
result.output_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__template_id => {
if !fields.insert(__FieldTag::__template_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for template_id",
));
}
if result.job_config.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `job_config`, a oneof with full ID .google.cloud.video.transcoder.v1.Job.template_id, latest field was templateId",
));
}
result.job_config = std::option::Option::Some(
crate::model::job::JobConfig::TemplateId(
map.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__config => {
if !fields.insert(__FieldTag::__config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for config",
));
}
if result.job_config.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `job_config`, a oneof with full ID .google.cloud.video.transcoder.v1.Job.config, latest field was config",
));
}
result.job_config =
std::option::Option::Some(crate::model::job::JobConfig::Config(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::JobConfig>,
>>()?
.unwrap_or_default(),
));
}
__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::job::ProcessingState>>()?.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::__start_time => {
if !fields.insert(__FieldTag::__start_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_time",
));
}
result.start_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::__ttl_after_completion_days => {
if !fields.insert(__FieldTag::__ttl_after_completion_days) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for ttl_after_completion_days",
));
}
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.ttl_after_completion_days =
map.next_value::<__With>()?.0.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::__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::__mode => {
if !fields.insert(__FieldTag::__mode) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mode",
));
}
result.mode = map.next_value::<std::option::Option<crate::model::job::ProcessingMode>>()?.unwrap_or_default();
}
__FieldTag::__batch_mode_priority => {
if !fields.insert(__FieldTag::__batch_mode_priority) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for batch_mode_priority",
));
}
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_mode_priority =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__optimization => {
if !fields.insert(__FieldTag::__optimization) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for optimization",
));
}
result.optimization = map.next_value::<std::option::Option<crate::model::job::OptimizationStrategy>>()?.unwrap_or_default();
}
__FieldTag::__fill_content_gaps => {
if !fields.insert(__FieldTag::__fill_content_gaps) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for fill_content_gaps",
));
}
result.fill_content_gaps = 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::JobTemplate {
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,
__config,
__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 JobTemplate")
}
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),
"config" => Ok(__FieldTag::__config),
"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::JobTemplate;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct JobTemplate")
}
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::__config => {
if !fields.insert(__FieldTag::__config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for config",
));
}
result.config =
map.next_value::<std::option::Option<crate::model::JobConfig>>()?;
}
__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::JobConfig {
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 {
__inputs,
__edit_list,
__elementary_streams,
__mux_streams,
__manifests,
__output,
__ad_breaks,
__pubsub_destination,
__sprite_sheets,
__overlays,
__encryptions,
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 JobConfig")
}
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 {
"inputs" => Ok(__FieldTag::__inputs),
"editList" => Ok(__FieldTag::__edit_list),
"edit_list" => Ok(__FieldTag::__edit_list),
"elementaryStreams" => Ok(__FieldTag::__elementary_streams),
"elementary_streams" => Ok(__FieldTag::__elementary_streams),
"muxStreams" => Ok(__FieldTag::__mux_streams),
"mux_streams" => Ok(__FieldTag::__mux_streams),
"manifests" => Ok(__FieldTag::__manifests),
"output" => Ok(__FieldTag::__output),
"adBreaks" => Ok(__FieldTag::__ad_breaks),
"ad_breaks" => Ok(__FieldTag::__ad_breaks),
"pubsubDestination" => Ok(__FieldTag::__pubsub_destination),
"pubsub_destination" => Ok(__FieldTag::__pubsub_destination),
"spriteSheets" => Ok(__FieldTag::__sprite_sheets),
"sprite_sheets" => Ok(__FieldTag::__sprite_sheets),
"overlays" => Ok(__FieldTag::__overlays),
"encryptions" => Ok(__FieldTag::__encryptions),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::JobConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct JobConfig")
}
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::__inputs => {
if !fields.insert(__FieldTag::__inputs) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for inputs",
));
}
result.inputs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Input>>>()?.unwrap_or_default();
}
__FieldTag::__edit_list => {
if !fields.insert(__FieldTag::__edit_list) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for edit_list",
));
}
result.edit_list = map.next_value::<std::option::Option<std::vec::Vec<crate::model::EditAtom>>>()?.unwrap_or_default();
}
__FieldTag::__elementary_streams => {
if !fields.insert(__FieldTag::__elementary_streams) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for elementary_streams",
));
}
result.elementary_streams =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::ElementaryStream>,
>>()?
.unwrap_or_default();
}
__FieldTag::__mux_streams => {
if !fields.insert(__FieldTag::__mux_streams) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mux_streams",
));
}
result.mux_streams = map.next_value::<std::option::Option<std::vec::Vec<crate::model::MuxStream>>>()?.unwrap_or_default();
}
__FieldTag::__manifests => {
if !fields.insert(__FieldTag::__manifests) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for manifests",
));
}
result.manifests = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Manifest>>>()?.unwrap_or_default();
}
__FieldTag::__output => {
if !fields.insert(__FieldTag::__output) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for output",
));
}
result.output =
map.next_value::<std::option::Option<crate::model::Output>>()?;
}
__FieldTag::__ad_breaks => {
if !fields.insert(__FieldTag::__ad_breaks) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for ad_breaks",
));
}
result.ad_breaks = map.next_value::<std::option::Option<std::vec::Vec<crate::model::AdBreak>>>()?.unwrap_or_default();
}
__FieldTag::__pubsub_destination => {
if !fields.insert(__FieldTag::__pubsub_destination) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pubsub_destination",
));
}
result.pubsub_destination = map
.next_value::<std::option::Option<crate::model::PubsubDestination>>(
)?;
}
__FieldTag::__sprite_sheets => {
if !fields.insert(__FieldTag::__sprite_sheets) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sprite_sheets",
));
}
result.sprite_sheets = map.next_value::<std::option::Option<std::vec::Vec<crate::model::SpriteSheet>>>()?.unwrap_or_default();
}
__FieldTag::__overlays => {
if !fields.insert(__FieldTag::__overlays) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for overlays",
));
}
result.overlays = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Overlay>>>()?.unwrap_or_default();
}
__FieldTag::__encryptions => {
if !fields.insert(__FieldTag::__encryptions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for encryptions",
));
}
result.encryptions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Encryption>>>()?.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::Input {
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,
__uri,
__preprocessing_config,
__attributes,
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 Input")
}
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),
"uri" => Ok(__FieldTag::__uri),
"preprocessingConfig" => Ok(__FieldTag::__preprocessing_config),
"preprocessing_config" => Ok(__FieldTag::__preprocessing_config),
"attributes" => Ok(__FieldTag::__attributes),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Input;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Input")
}
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::__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::__preprocessing_config => {
if !fields.insert(__FieldTag::__preprocessing_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for preprocessing_config",
));
}
result.preprocessing_config = map.next_value::<std::option::Option<crate::model::PreprocessingConfig>>()?
;
}
__FieldTag::__attributes => {
if !fields.insert(__FieldTag::__attributes) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for attributes",
));
}
result.attributes = map
.next_value::<std::option::Option<crate::model::InputAttributes>>(
)?;
}
__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::Output {
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 Output")
}
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::Output;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Output")
}
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::EditAtom {
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,
__inputs,
__end_time_offset,
__start_time_offset,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for EditAtom")
}
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),
"inputs" => Ok(__FieldTag::__inputs),
"endTimeOffset" => Ok(__FieldTag::__end_time_offset),
"end_time_offset" => Ok(__FieldTag::__end_time_offset),
"startTimeOffset" => Ok(__FieldTag::__start_time_offset),
"start_time_offset" => Ok(__FieldTag::__start_time_offset),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::EditAtom;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct EditAtom")
}
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::__inputs => {
if !fields.insert(__FieldTag::__inputs) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for inputs",
));
}
result.inputs = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__end_time_offset => {
if !fields.insert(__FieldTag::__end_time_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for end_time_offset",
));
}
result.end_time_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__start_time_offset => {
if !fields.insert(__FieldTag::__start_time_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_time_offset",
));
}
result.start_time_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__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::AdBreak {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__start_time_offset,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AdBreak")
}
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 {
"startTimeOffset" => Ok(__FieldTag::__start_time_offset),
"start_time_offset" => Ok(__FieldTag::__start_time_offset),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AdBreak;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AdBreak")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__start_time_offset => {
if !fields.insert(__FieldTag::__start_time_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_time_offset",
));
}
result.start_time_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__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::ElementaryStream {
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,
__video_stream,
__audio_stream,
__text_stream,
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 ElementaryStream")
}
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),
"videoStream" => Ok(__FieldTag::__video_stream),
"video_stream" => Ok(__FieldTag::__video_stream),
"audioStream" => Ok(__FieldTag::__audio_stream),
"audio_stream" => Ok(__FieldTag::__audio_stream),
"textStream" => Ok(__FieldTag::__text_stream),
"text_stream" => Ok(__FieldTag::__text_stream),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ElementaryStream;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ElementaryStream")
}
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::__video_stream => {
if !fields.insert(__FieldTag::__video_stream) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for video_stream",
));
}
if result.elementary_stream.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `elementary_stream`, a oneof with full ID .google.cloud.video.transcoder.v1.ElementaryStream.video_stream, latest field was videoStream",
));
}
result.elementary_stream = std::option::Option::Some(
crate::model::elementary_stream::ElementaryStream::VideoStream(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::VideoStream>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__audio_stream => {
if !fields.insert(__FieldTag::__audio_stream) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for audio_stream",
));
}
if result.elementary_stream.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `elementary_stream`, a oneof with full ID .google.cloud.video.transcoder.v1.ElementaryStream.audio_stream, latest field was audioStream",
));
}
result.elementary_stream = std::option::Option::Some(
crate::model::elementary_stream::ElementaryStream::AudioStream(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::AudioStream>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__text_stream => {
if !fields.insert(__FieldTag::__text_stream) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for text_stream",
));
}
if result.elementary_stream.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `elementary_stream`, a oneof with full ID .google.cloud.video.transcoder.v1.ElementaryStream.text_stream, latest field was textStream",
));
}
result.elementary_stream = std::option::Option::Some(
crate::model::elementary_stream::ElementaryStream::TextStream(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::TextStream>,
>>()?
.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::MuxStream {
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,
__file_name,
__container,
__elementary_streams,
__segment_settings,
__encryption_id,
__fmp4,
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 MuxStream")
}
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),
"fileName" => Ok(__FieldTag::__file_name),
"file_name" => Ok(__FieldTag::__file_name),
"container" => Ok(__FieldTag::__container),
"elementaryStreams" => Ok(__FieldTag::__elementary_streams),
"elementary_streams" => Ok(__FieldTag::__elementary_streams),
"segmentSettings" => Ok(__FieldTag::__segment_settings),
"segment_settings" => Ok(__FieldTag::__segment_settings),
"encryptionId" => Ok(__FieldTag::__encryption_id),
"encryption_id" => Ok(__FieldTag::__encryption_id),
"fmp4" => Ok(__FieldTag::__fmp4),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::MuxStream;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct MuxStream")
}
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::__file_name => {
if !fields.insert(__FieldTag::__file_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for file_name",
));
}
result.file_name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__container => {
if !fields.insert(__FieldTag::__container) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for container",
));
}
result.container = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__elementary_streams => {
if !fields.insert(__FieldTag::__elementary_streams) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for elementary_streams",
));
}
result.elementary_streams = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__segment_settings => {
if !fields.insert(__FieldTag::__segment_settings) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for segment_settings",
));
}
result.segment_settings = map
.next_value::<std::option::Option<crate::model::SegmentSettings>>(
)?;
}
__FieldTag::__encryption_id => {
if !fields.insert(__FieldTag::__encryption_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for encryption_id",
));
}
result.encryption_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__fmp4 => {
if !fields.insert(__FieldTag::__fmp4) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for fmp4",
));
}
if result.container_config.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `container_config`, a oneof with full ID .google.cloud.video.transcoder.v1.MuxStream.fmp4, latest field was fmp4",
));
}
result.container_config = std::option::Option::Some(
crate::model::mux_stream::ContainerConfig::Fmp4(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::mux_stream::Fmp4Config>,
>>()?
.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::mux_stream::Fmp4Config {
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 {
__codec_tag,
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 Fmp4Config")
}
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 {
"codecTag" => Ok(__FieldTag::__codec_tag),
"codec_tag" => Ok(__FieldTag::__codec_tag),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::mux_stream::Fmp4Config;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Fmp4Config")
}
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::__codec_tag => {
if !fields.insert(__FieldTag::__codec_tag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for codec_tag",
));
}
result.codec_tag = 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::Manifest {
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 {
__file_name,
__type,
__mux_streams,
__dash,
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 Manifest")
}
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 {
"fileName" => Ok(__FieldTag::__file_name),
"file_name" => Ok(__FieldTag::__file_name),
"type" => Ok(__FieldTag::__type),
"muxStreams" => Ok(__FieldTag::__mux_streams),
"mux_streams" => Ok(__FieldTag::__mux_streams),
"dash" => Ok(__FieldTag::__dash),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Manifest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Manifest")
}
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::__file_name => {
if !fields.insert(__FieldTag::__file_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for file_name",
));
}
result.file_name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__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::manifest::ManifestType>>()?.unwrap_or_default();
}
__FieldTag::__mux_streams => {
if !fields.insert(__FieldTag::__mux_streams) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mux_streams",
));
}
result.mux_streams = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__dash => {
if !fields.insert(__FieldTag::__dash) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for dash",
));
}
if result.manifest_config.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `manifest_config`, a oneof with full ID .google.cloud.video.transcoder.v1.Manifest.dash, latest field was dash",
));
}
result.manifest_config = std::option::Option::Some(
crate::model::manifest::ManifestConfig::Dash(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::manifest::DashConfig>,
>>()?
.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::manifest::DashConfig {
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 {
__segment_reference_scheme,
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 DashConfig")
}
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 {
"segmentReferenceScheme" => Ok(__FieldTag::__segment_reference_scheme),
"segment_reference_scheme" => {
Ok(__FieldTag::__segment_reference_scheme)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::manifest::DashConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DashConfig")
}
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::__segment_reference_scheme => {
if !fields.insert(__FieldTag::__segment_reference_scheme) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for segment_reference_scheme",
));
}
result.segment_reference_scheme = map
.next_value::<std::option::Option<
crate::model::manifest::dash_config::SegmentReferenceScheme,
>>()?
.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::PubsubDestination {
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 {
__topic,
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 PubsubDestination")
}
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 {
"topic" => Ok(__FieldTag::__topic),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::PubsubDestination;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct PubsubDestination")
}
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::__topic => {
if !fields.insert(__FieldTag::__topic) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for topic",
));
}
result.topic = 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::SpriteSheet {
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 {
__format,
__file_prefix,
__sprite_width_pixels,
__sprite_height_pixels,
__column_count,
__row_count,
__start_time_offset,
__end_time_offset,
__total_count,
__interval,
__quality,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SpriteSheet")
}
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 {
"format" => Ok(__FieldTag::__format),
"filePrefix" => Ok(__FieldTag::__file_prefix),
"file_prefix" => Ok(__FieldTag::__file_prefix),
"spriteWidthPixels" => Ok(__FieldTag::__sprite_width_pixels),
"sprite_width_pixels" => Ok(__FieldTag::__sprite_width_pixels),
"spriteHeightPixels" => Ok(__FieldTag::__sprite_height_pixels),
"sprite_height_pixels" => Ok(__FieldTag::__sprite_height_pixels),
"columnCount" => Ok(__FieldTag::__column_count),
"column_count" => Ok(__FieldTag::__column_count),
"rowCount" => Ok(__FieldTag::__row_count),
"row_count" => Ok(__FieldTag::__row_count),
"startTimeOffset" => Ok(__FieldTag::__start_time_offset),
"start_time_offset" => Ok(__FieldTag::__start_time_offset),
"endTimeOffset" => Ok(__FieldTag::__end_time_offset),
"end_time_offset" => Ok(__FieldTag::__end_time_offset),
"totalCount" => Ok(__FieldTag::__total_count),
"total_count" => Ok(__FieldTag::__total_count),
"interval" => Ok(__FieldTag::__interval),
"quality" => Ok(__FieldTag::__quality),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SpriteSheet;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SpriteSheet")
}
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::__format => {
if !fields.insert(__FieldTag::__format) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for format",
));
}
result.format = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__file_prefix => {
if !fields.insert(__FieldTag::__file_prefix) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for file_prefix",
));
}
result.file_prefix = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__sprite_width_pixels => {
if !fields.insert(__FieldTag::__sprite_width_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sprite_width_pixels",
));
}
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.sprite_width_pixels =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__sprite_height_pixels => {
if !fields.insert(__FieldTag::__sprite_height_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sprite_height_pixels",
));
}
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.sprite_height_pixels =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__column_count => {
if !fields.insert(__FieldTag::__column_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for column_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.column_count = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__row_count => {
if !fields.insert(__FieldTag::__row_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for row_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.row_count = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__start_time_offset => {
if !fields.insert(__FieldTag::__start_time_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_time_offset",
));
}
result.start_time_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__end_time_offset => {
if !fields.insert(__FieldTag::__end_time_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for end_time_offset",
));
}
result.end_time_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__total_count => {
if !fields.insert(__FieldTag::__total_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for total_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
if result.extraction_strategy.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `extraction_strategy`, a oneof with full ID .google.cloud.video.transcoder.v1.SpriteSheet.total_count, latest field was totalCount",
));
}
result.extraction_strategy = std::option::Option::Some(
crate::model::sprite_sheet::ExtractionStrategy::TotalCount(
map.next_value::<__With>()?.0.unwrap_or_default(),
),
);
}
__FieldTag::__interval => {
if !fields.insert(__FieldTag::__interval) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for interval",
));
}
if result.extraction_strategy.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `extraction_strategy`, a oneof with full ID .google.cloud.video.transcoder.v1.SpriteSheet.interval, latest field was interval",
));
}
result.extraction_strategy = std::option::Option::Some(
crate::model::sprite_sheet::ExtractionStrategy::Interval(
map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__quality => {
if !fields.insert(__FieldTag::__quality) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for quality",
));
}
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.quality = 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::Overlay {
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,
__animations,
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 Overlay")
}
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),
"animations" => Ok(__FieldTag::__animations),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Overlay;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Overlay")
}
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::overlay::Image>>(
)?;
}
__FieldTag::__animations => {
if !fields.insert(__FieldTag::__animations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for animations",
));
}
result.animations = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::overlay::Animation>,
>>()?
.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::overlay::NormalizedCoordinate {
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 NormalizedCoordinate")
}
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::overlay::NormalizedCoordinate;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct NormalizedCoordinate")
}
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<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.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<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.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::overlay::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 {
__uri,
__resolution,
__alpha,
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 {
"uri" => Ok(__FieldTag::__uri),
"resolution" => Ok(__FieldTag::__resolution),
"alpha" => Ok(__FieldTag::__alpha),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::overlay::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::__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::__resolution => {
if !fields.insert(__FieldTag::__resolution) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for resolution",
));
}
result.resolution =
map.next_value::<std::option::Option<
crate::model::overlay::NormalizedCoordinate,
>>()?;
}
__FieldTag::__alpha => {
if !fields.insert(__FieldTag::__alpha) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for alpha",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.alpha = 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::overlay::AnimationStatic {
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 {
__xy,
__start_time_offset,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AnimationStatic")
}
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 {
"xy" => Ok(__FieldTag::__xy),
"startTimeOffset" => Ok(__FieldTag::__start_time_offset),
"start_time_offset" => Ok(__FieldTag::__start_time_offset),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::overlay::AnimationStatic;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AnimationStatic")
}
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::__xy => {
if !fields.insert(__FieldTag::__xy) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for xy",
));
}
result.xy =
map.next_value::<std::option::Option<
crate::model::overlay::NormalizedCoordinate,
>>()?;
}
__FieldTag::__start_time_offset => {
if !fields.insert(__FieldTag::__start_time_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_time_offset",
));
}
result.start_time_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__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::overlay::AnimationFade {
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 {
__fade_type,
__xy,
__start_time_offset,
__end_time_offset,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AnimationFade")
}
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 {
"fadeType" => Ok(__FieldTag::__fade_type),
"fade_type" => Ok(__FieldTag::__fade_type),
"xy" => Ok(__FieldTag::__xy),
"startTimeOffset" => Ok(__FieldTag::__start_time_offset),
"start_time_offset" => Ok(__FieldTag::__start_time_offset),
"endTimeOffset" => Ok(__FieldTag::__end_time_offset),
"end_time_offset" => Ok(__FieldTag::__end_time_offset),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::overlay::AnimationFade;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AnimationFade")
}
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::__fade_type => {
if !fields.insert(__FieldTag::__fade_type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for fade_type",
));
}
result.fade_type = map
.next_value::<std::option::Option<crate::model::overlay::FadeType>>(
)?
.unwrap_or_default();
}
__FieldTag::__xy => {
if !fields.insert(__FieldTag::__xy) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for xy",
));
}
result.xy =
map.next_value::<std::option::Option<
crate::model::overlay::NormalizedCoordinate,
>>()?;
}
__FieldTag::__start_time_offset => {
if !fields.insert(__FieldTag::__start_time_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_time_offset",
));
}
result.start_time_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__end_time_offset => {
if !fields.insert(__FieldTag::__end_time_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for end_time_offset",
));
}
result.end_time_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__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::overlay::AnimationEnd {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__start_time_offset,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AnimationEnd")
}
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 {
"startTimeOffset" => Ok(__FieldTag::__start_time_offset),
"start_time_offset" => Ok(__FieldTag::__start_time_offset),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::overlay::AnimationEnd;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AnimationEnd")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__start_time_offset => {
if !fields.insert(__FieldTag::__start_time_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_time_offset",
));
}
result.start_time_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__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::overlay::Animation {
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 {
__animation_static,
__animation_fade,
__animation_end,
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 Animation")
}
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 {
"animationStatic" => Ok(__FieldTag::__animation_static),
"animation_static" => Ok(__FieldTag::__animation_static),
"animationFade" => Ok(__FieldTag::__animation_fade),
"animation_fade" => Ok(__FieldTag::__animation_fade),
"animationEnd" => Ok(__FieldTag::__animation_end),
"animation_end" => Ok(__FieldTag::__animation_end),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::overlay::Animation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Animation")
}
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::__animation_static => {
if !fields.insert(__FieldTag::__animation_static) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for animation_static",
));
}
if result.animation_type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `animation_type`, a oneof with full ID .google.cloud.video.transcoder.v1.Overlay.Animation.animation_static, latest field was animationStatic",
));
}
result.animation_type = std::option::Option::Some(
crate::model::overlay::animation::AnimationType::AnimationStatic(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::overlay::AnimationStatic>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__animation_fade => {
if !fields.insert(__FieldTag::__animation_fade) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for animation_fade",
));
}
if result.animation_type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `animation_type`, a oneof with full ID .google.cloud.video.transcoder.v1.Overlay.Animation.animation_fade, latest field was animationFade",
));
}
result.animation_type = std::option::Option::Some(
crate::model::overlay::animation::AnimationType::AnimationFade(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::overlay::AnimationFade>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__animation_end => {
if !fields.insert(__FieldTag::__animation_end) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for animation_end",
));
}
if result.animation_type.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `animation_type`, a oneof with full ID .google.cloud.video.transcoder.v1.Overlay.Animation.animation_end, latest field was animationEnd",
));
}
result.animation_type = std::option::Option::Some(
crate::model::overlay::animation::AnimationType::AnimationEnd(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::overlay::AnimationEnd>,
>>()?
.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::PreprocessingConfig {
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,
__denoise,
__deblock,
__audio,
__crop,
__pad,
__deinterlace,
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 PreprocessingConfig")
}
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),
"denoise" => Ok(__FieldTag::__denoise),
"deblock" => Ok(__FieldTag::__deblock),
"audio" => Ok(__FieldTag::__audio),
"crop" => Ok(__FieldTag::__crop),
"pad" => Ok(__FieldTag::__pad),
"deinterlace" => Ok(__FieldTag::__deinterlace),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::PreprocessingConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct PreprocessingConfig")
}
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<crate::model::preprocessing_config::Color>>()?
;
}
__FieldTag::__denoise => {
if !fields.insert(__FieldTag::__denoise) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for denoise",
));
}
result.denoise =
map.next_value::<std::option::Option<
crate::model::preprocessing_config::Denoise,
>>()?;
}
__FieldTag::__deblock => {
if !fields.insert(__FieldTag::__deblock) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for deblock",
));
}
result.deblock =
map.next_value::<std::option::Option<
crate::model::preprocessing_config::Deblock,
>>()?;
}
__FieldTag::__audio => {
if !fields.insert(__FieldTag::__audio) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for audio",
));
}
result.audio = map.next_value::<std::option::Option<crate::model::preprocessing_config::Audio>>()?
;
}
__FieldTag::__crop => {
if !fields.insert(__FieldTag::__crop) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for crop",
));
}
result.crop = map.next_value::<std::option::Option<crate::model::preprocessing_config::Crop>>()?
;
}
__FieldTag::__pad => {
if !fields.insert(__FieldTag::__pad) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pad",
));
}
result.pad = map.next_value::<std::option::Option<crate::model::preprocessing_config::Pad>>()?
;
}
__FieldTag::__deinterlace => {
if !fields.insert(__FieldTag::__deinterlace) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for deinterlace",
));
}
result.deinterlace = map.next_value::<std::option::Option<
crate::model::preprocessing_config::Deinterlace,
>>()?;
}
__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::preprocessing_config::Color {
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 {
__saturation,
__contrast,
__brightness,
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 Color")
}
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 {
"saturation" => Ok(__FieldTag::__saturation),
"contrast" => Ok(__FieldTag::__contrast),
"brightness" => Ok(__FieldTag::__brightness),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::preprocessing_config::Color;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Color")
}
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::__saturation => {
if !fields.insert(__FieldTag::__saturation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for saturation",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.saturation = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__contrast => {
if !fields.insert(__FieldTag::__contrast) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for contrast",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.contrast = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__brightness => {
if !fields.insert(__FieldTag::__brightness) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for brightness",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.brightness = 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::preprocessing_config::Denoise {
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 {
__strength,
__tune,
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 Denoise")
}
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 {
"strength" => Ok(__FieldTag::__strength),
"tune" => Ok(__FieldTag::__tune),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::preprocessing_config::Denoise;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Denoise")
}
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::__strength => {
if !fields.insert(__FieldTag::__strength) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for strength",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.strength = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__tune => {
if !fields.insert(__FieldTag::__tune) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for tune",
));
}
result.tune = 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::preprocessing_config::Deblock {
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 {
__strength,
__enabled,
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 Deblock")
}
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 {
"strength" => Ok(__FieldTag::__strength),
"enabled" => Ok(__FieldTag::__enabled),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::preprocessing_config::Deblock;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Deblock")
}
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::__strength => {
if !fields.insert(__FieldTag::__strength) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for strength",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.strength = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__enabled => {
if !fields.insert(__FieldTag::__enabled) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enabled",
));
}
result.enabled = 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::preprocessing_config::Audio {
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 {
__lufs,
__high_boost,
__low_boost,
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 Audio")
}
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 {
"lufs" => Ok(__FieldTag::__lufs),
"highBoost" => Ok(__FieldTag::__high_boost),
"high_boost" => Ok(__FieldTag::__high_boost),
"lowBoost" => Ok(__FieldTag::__low_boost),
"low_boost" => Ok(__FieldTag::__low_boost),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::preprocessing_config::Audio;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Audio")
}
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::__lufs => {
if !fields.insert(__FieldTag::__lufs) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for lufs",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.lufs = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__high_boost => {
if !fields.insert(__FieldTag::__high_boost) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for high_boost",
));
}
result.high_boost = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__low_boost => {
if !fields.insert(__FieldTag::__low_boost) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for low_boost",
));
}
result.low_boost = 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::preprocessing_config::Crop {
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 {
__top_pixels,
__bottom_pixels,
__left_pixels,
__right_pixels,
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 Crop")
}
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 {
"topPixels" => Ok(__FieldTag::__top_pixels),
"top_pixels" => Ok(__FieldTag::__top_pixels),
"bottomPixels" => Ok(__FieldTag::__bottom_pixels),
"bottom_pixels" => Ok(__FieldTag::__bottom_pixels),
"leftPixels" => Ok(__FieldTag::__left_pixels),
"left_pixels" => Ok(__FieldTag::__left_pixels),
"rightPixels" => Ok(__FieldTag::__right_pixels),
"right_pixels" => Ok(__FieldTag::__right_pixels),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::preprocessing_config::Crop;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Crop")
}
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::__top_pixels => {
if !fields.insert(__FieldTag::__top_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for top_pixels",
));
}
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.top_pixels = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__bottom_pixels => {
if !fields.insert(__FieldTag::__bottom_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bottom_pixels",
));
}
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.bottom_pixels =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__left_pixels => {
if !fields.insert(__FieldTag::__left_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for left_pixels",
));
}
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.left_pixels = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__right_pixels => {
if !fields.insert(__FieldTag::__right_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for right_pixels",
));
}
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.right_pixels = 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::preprocessing_config::Pad {
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 {
__top_pixels,
__bottom_pixels,
__left_pixels,
__right_pixels,
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 Pad")
}
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 {
"topPixels" => Ok(__FieldTag::__top_pixels),
"top_pixels" => Ok(__FieldTag::__top_pixels),
"bottomPixels" => Ok(__FieldTag::__bottom_pixels),
"bottom_pixels" => Ok(__FieldTag::__bottom_pixels),
"leftPixels" => Ok(__FieldTag::__left_pixels),
"left_pixels" => Ok(__FieldTag::__left_pixels),
"rightPixels" => Ok(__FieldTag::__right_pixels),
"right_pixels" => Ok(__FieldTag::__right_pixels),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::preprocessing_config::Pad;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Pad")
}
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::__top_pixels => {
if !fields.insert(__FieldTag::__top_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for top_pixels",
));
}
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.top_pixels = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__bottom_pixels => {
if !fields.insert(__FieldTag::__bottom_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bottom_pixels",
));
}
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.bottom_pixels =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__left_pixels => {
if !fields.insert(__FieldTag::__left_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for left_pixels",
));
}
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.left_pixels = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__right_pixels => {
if !fields.insert(__FieldTag::__right_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for right_pixels",
));
}
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.right_pixels = 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::preprocessing_config::Deinterlace {
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 {
__yadif,
__bwdif,
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 Deinterlace")
}
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 {
"yadif" => Ok(__FieldTag::__yadif),
"bwdif" => Ok(__FieldTag::__bwdif),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::preprocessing_config::Deinterlace;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Deinterlace")
}
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::__yadif => {
if !fields.insert(__FieldTag::__yadif) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for yadif",
));
}
if result.deinterlacing_filter.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `deinterlacing_filter`, a oneof with full ID .google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.yadif, latest field was yadif",
));
}
result.deinterlacing_filter = std::option::Option::Some(
crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__bwdif => {
if !fields.insert(__FieldTag::__bwdif) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bwdif",
));
}
if result.deinterlacing_filter.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `deinterlacing_filter`, a oneof with full ID .google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.bwdif, latest field was bwdif",
));
}
result.deinterlacing_filter = std::option::Option::Some(
crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>>>()?.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::preprocessing_config::deinterlace::YadifConfig {
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 {
__mode,
__disable_spatial_interlacing,
__parity,
__deinterlace_all_frames,
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 YadifConfig")
}
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 {
"mode" => Ok(__FieldTag::__mode),
"disableSpatialInterlacing" => {
Ok(__FieldTag::__disable_spatial_interlacing)
}
"disable_spatial_interlacing" => {
Ok(__FieldTag::__disable_spatial_interlacing)
}
"parity" => Ok(__FieldTag::__parity),
"deinterlaceAllFrames" => Ok(__FieldTag::__deinterlace_all_frames),
"deinterlace_all_frames" => Ok(__FieldTag::__deinterlace_all_frames),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::preprocessing_config::deinterlace::YadifConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct YadifConfig")
}
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::__mode => {
if !fields.insert(__FieldTag::__mode) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mode",
));
}
result.mode = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__disable_spatial_interlacing => {
if !fields.insert(__FieldTag::__disable_spatial_interlacing) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for disable_spatial_interlacing",
));
}
result.disable_spatial_interlacing = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__parity => {
if !fields.insert(__FieldTag::__parity) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parity",
));
}
result.parity = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__deinterlace_all_frames => {
if !fields.insert(__FieldTag::__deinterlace_all_frames) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for deinterlace_all_frames",
));
}
result.deinterlace_all_frames = 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::preprocessing_config::deinterlace::BwdifConfig {
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 {
__mode,
__parity,
__deinterlace_all_frames,
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 BwdifConfig")
}
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 {
"mode" => Ok(__FieldTag::__mode),
"parity" => Ok(__FieldTag::__parity),
"deinterlaceAllFrames" => Ok(__FieldTag::__deinterlace_all_frames),
"deinterlace_all_frames" => Ok(__FieldTag::__deinterlace_all_frames),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::preprocessing_config::deinterlace::BwdifConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BwdifConfig")
}
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::__mode => {
if !fields.insert(__FieldTag::__mode) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mode",
));
}
result.mode = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__parity => {
if !fields.insert(__FieldTag::__parity) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parity",
));
}
result.parity = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__deinterlace_all_frames => {
if !fields.insert(__FieldTag::__deinterlace_all_frames) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for deinterlace_all_frames",
));
}
result.deinterlace_all_frames = 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::TrackDefinition {
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_track,
__languages,
__detect_languages,
__detected_languages,
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 TrackDefinition")
}
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 {
"inputTrack" => Ok(__FieldTag::__input_track),
"input_track" => Ok(__FieldTag::__input_track),
"languages" => Ok(__FieldTag::__languages),
"detectLanguages" => Ok(__FieldTag::__detect_languages),
"detect_languages" => Ok(__FieldTag::__detect_languages),
"detectedLanguages" => Ok(__FieldTag::__detected_languages),
"detected_languages" => Ok(__FieldTag::__detected_languages),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TrackDefinition;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TrackDefinition")
}
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_track => {
if !fields.insert(__FieldTag::__input_track) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_track",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.input_track = map.next_value::<__With>()?.0;
}
__FieldTag::__languages => {
if !fields.insert(__FieldTag::__languages) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for languages",
));
}
result.languages = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__detect_languages => {
if !fields.insert(__FieldTag::__detect_languages) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for detect_languages",
));
}
result.detect_languages = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__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<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::InputAttributes {
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 {
__track_definitions,
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 InputAttributes")
}
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 {
"trackDefinitions" => Ok(__FieldTag::__track_definitions),
"track_definitions" => Ok(__FieldTag::__track_definitions),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::InputAttributes;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct InputAttributes")
}
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::__track_definitions => {
if !fields.insert(__FieldTag::__track_definitions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for track_definitions",
));
}
result.track_definitions =
map.next_value::<std::option::Option<
std::vec::Vec<crate::model::TrackDefinition>,
>>()?
.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::VideoStream {
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 {
__h264,
__h265,
__vp9,
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 VideoStream")
}
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 {
"h264" => Ok(__FieldTag::__h264),
"h265" => Ok(__FieldTag::__h265),
"vp9" => Ok(__FieldTag::__vp9),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::VideoStream;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct VideoStream")
}
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::__h264 => {
if !fields.insert(__FieldTag::__h264) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for h264",
));
}
if result.codec_settings.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `codec_settings`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.h264, latest field was h264",
));
}
result.codec_settings = std::option::Option::Some(
crate::model::video_stream::CodecSettings::H264(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::video_stream::H264CodecSettings,
>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__h265 => {
if !fields.insert(__FieldTag::__h265) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for h265",
));
}
if result.codec_settings.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `codec_settings`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.h265, latest field was h265",
));
}
result.codec_settings = std::option::Option::Some(
crate::model::video_stream::CodecSettings::H265(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::video_stream::H265CodecSettings,
>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__vp9 => {
if !fields.insert(__FieldTag::__vp9) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vp9",
));
}
if result.codec_settings.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `codec_settings`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.vp9, latest field was vp9",
));
}
result.codec_settings = std::option::Option::Some(
crate::model::video_stream::CodecSettings::Vp9(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::video_stream::Vp9CodecSettings,
>,
>>()?
.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::video_stream::H264ColorFormatSDR {
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 {
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 H264ColorFormatSDR")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::H264ColorFormatSDR;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct H264ColorFormatSDR")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::video_stream::H264ColorFormatHLG {
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 {
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 H264ColorFormatHLG")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::H264ColorFormatHLG;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct H264ColorFormatHLG")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::video_stream::H264CodecSettings {
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 {
__width_pixels,
__height_pixels,
__frame_rate,
__frame_rate_conversion_strategy,
__bitrate_bps,
__pixel_format,
__rate_control_mode,
__crf_level,
__allow_open_gop,
__gop_frame_count,
__gop_duration,
__enable_two_pass,
__vbv_size_bits,
__vbv_fullness_bits,
__entropy_coder,
__b_pyramid,
__b_frame_count,
__aq_strength,
__profile,
__tune,
__preset,
__sdr,
__hlg,
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 H264CodecSettings")
}
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 {
"widthPixels" => Ok(__FieldTag::__width_pixels),
"width_pixels" => Ok(__FieldTag::__width_pixels),
"heightPixels" => Ok(__FieldTag::__height_pixels),
"height_pixels" => Ok(__FieldTag::__height_pixels),
"frameRate" => Ok(__FieldTag::__frame_rate),
"frame_rate" => Ok(__FieldTag::__frame_rate),
"frameRateConversionStrategy" => {
Ok(__FieldTag::__frame_rate_conversion_strategy)
}
"frame_rate_conversion_strategy" => {
Ok(__FieldTag::__frame_rate_conversion_strategy)
}
"bitrateBps" => Ok(__FieldTag::__bitrate_bps),
"bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
"pixelFormat" => Ok(__FieldTag::__pixel_format),
"pixel_format" => Ok(__FieldTag::__pixel_format),
"rateControlMode" => Ok(__FieldTag::__rate_control_mode),
"rate_control_mode" => Ok(__FieldTag::__rate_control_mode),
"crfLevel" => Ok(__FieldTag::__crf_level),
"crf_level" => Ok(__FieldTag::__crf_level),
"allowOpenGop" => Ok(__FieldTag::__allow_open_gop),
"allow_open_gop" => Ok(__FieldTag::__allow_open_gop),
"gopFrameCount" => Ok(__FieldTag::__gop_frame_count),
"gop_frame_count" => Ok(__FieldTag::__gop_frame_count),
"gopDuration" => Ok(__FieldTag::__gop_duration),
"gop_duration" => Ok(__FieldTag::__gop_duration),
"enableTwoPass" => Ok(__FieldTag::__enable_two_pass),
"enable_two_pass" => Ok(__FieldTag::__enable_two_pass),
"vbvSizeBits" => Ok(__FieldTag::__vbv_size_bits),
"vbv_size_bits" => Ok(__FieldTag::__vbv_size_bits),
"vbvFullnessBits" => Ok(__FieldTag::__vbv_fullness_bits),
"vbv_fullness_bits" => Ok(__FieldTag::__vbv_fullness_bits),
"entropyCoder" => Ok(__FieldTag::__entropy_coder),
"entropy_coder" => Ok(__FieldTag::__entropy_coder),
"bPyramid" => Ok(__FieldTag::__b_pyramid),
"b_pyramid" => Ok(__FieldTag::__b_pyramid),
"bFrameCount" => Ok(__FieldTag::__b_frame_count),
"b_frame_count" => Ok(__FieldTag::__b_frame_count),
"aqStrength" => Ok(__FieldTag::__aq_strength),
"aq_strength" => Ok(__FieldTag::__aq_strength),
"profile" => Ok(__FieldTag::__profile),
"tune" => Ok(__FieldTag::__tune),
"preset" => Ok(__FieldTag::__preset),
"sdr" => Ok(__FieldTag::__sdr),
"hlg" => Ok(__FieldTag::__hlg),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::H264CodecSettings;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct H264CodecSettings")
}
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::__width_pixels => {
if !fields.insert(__FieldTag::__width_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for width_pixels",
));
}
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_pixels = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__height_pixels => {
if !fields.insert(__FieldTag::__height_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for height_pixels",
));
}
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_pixels =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__frame_rate => {
if !fields.insert(__FieldTag::__frame_rate) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for frame_rate",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.frame_rate = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__frame_rate_conversion_strategy => {
if !fields.insert(__FieldTag::__frame_rate_conversion_strategy) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for frame_rate_conversion_strategy",
));
}
result.frame_rate_conversion_strategy = map
.next_value::<std::option::Option<
crate::model::video_stream::FrameRateConversionStrategy,
>>()?
.unwrap_or_default();
}
__FieldTag::__bitrate_bps => {
if !fields.insert(__FieldTag::__bitrate_bps) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bitrate_bps",
));
}
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.bitrate_bps = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__pixel_format => {
if !fields.insert(__FieldTag::__pixel_format) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pixel_format",
));
}
result.pixel_format = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__rate_control_mode => {
if !fields.insert(__FieldTag::__rate_control_mode) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rate_control_mode",
));
}
result.rate_control_mode = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__crf_level => {
if !fields.insert(__FieldTag::__crf_level) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for crf_level",
));
}
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.crf_level = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__allow_open_gop => {
if !fields.insert(__FieldTag::__allow_open_gop) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for allow_open_gop",
));
}
result.allow_open_gop = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__gop_frame_count => {
if !fields.insert(__FieldTag::__gop_frame_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gop_frame_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
if result.gop_mode.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count, latest field was gopFrameCount",
));
}
result.gop_mode = std::option::Option::Some(
crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(
map.next_value::<__With>()?.0.unwrap_or_default()
),
);
}
__FieldTag::__gop_duration => {
if !fields.insert(__FieldTag::__gop_duration) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gop_duration",
));
}
if result.gop_mode.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_duration, latest field was gopDuration",
));
}
result.gop_mode = std::option::Option::Some(
crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(
map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__enable_two_pass => {
if !fields.insert(__FieldTag::__enable_two_pass) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enable_two_pass",
));
}
result.enable_two_pass = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__vbv_size_bits => {
if !fields.insert(__FieldTag::__vbv_size_bits) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vbv_size_bits",
));
}
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.vbv_size_bits =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__vbv_fullness_bits => {
if !fields.insert(__FieldTag::__vbv_fullness_bits) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vbv_fullness_bits",
));
}
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.vbv_fullness_bits =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__entropy_coder => {
if !fields.insert(__FieldTag::__entropy_coder) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for entropy_coder",
));
}
result.entropy_coder = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__b_pyramid => {
if !fields.insert(__FieldTag::__b_pyramid) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for b_pyramid",
));
}
result.b_pyramid = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__b_frame_count => {
if !fields.insert(__FieldTag::__b_frame_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for b_frame_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.b_frame_count =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__aq_strength => {
if !fields.insert(__FieldTag::__aq_strength) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for aq_strength",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.aq_strength = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__profile => {
if !fields.insert(__FieldTag::__profile) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for profile",
));
}
result.profile = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__tune => {
if !fields.insert(__FieldTag::__tune) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for tune",
));
}
result.tune = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__preset => {
if !fields.insert(__FieldTag::__preset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for preset",
));
}
result.preset = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__sdr => {
if !fields.insert(__FieldTag::__sdr) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sdr",
));
}
if result.color_format.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.sdr, latest field was sdr",
));
}
result.color_format = std::option::Option::Some(
crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::video_stream::H264ColorFormatSDR,
>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__hlg => {
if !fields.insert(__FieldTag::__hlg) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for hlg",
));
}
if result.color_format.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.hlg, latest field was hlg",
));
}
result.color_format = std::option::Option::Some(
crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::video_stream::H264ColorFormatHLG,
>,
>>()?
.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::video_stream::H265ColorFormatSDR {
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 {
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 H265ColorFormatSDR")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::H265ColorFormatSDR;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct H265ColorFormatSDR")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::video_stream::H265ColorFormatHLG {
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 {
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 H265ColorFormatHLG")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::H265ColorFormatHLG;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct H265ColorFormatHLG")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::video_stream::H265ColorFormatHDR10 {
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 {
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 H265ColorFormatHDR10")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::H265ColorFormatHDR10;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct H265ColorFormatHDR10")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::video_stream::H265CodecSettings {
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 {
__width_pixels,
__height_pixels,
__frame_rate,
__frame_rate_conversion_strategy,
__bitrate_bps,
__pixel_format,
__rate_control_mode,
__crf_level,
__allow_open_gop,
__gop_frame_count,
__gop_duration,
__enable_two_pass,
__vbv_size_bits,
__vbv_fullness_bits,
__b_pyramid,
__b_frame_count,
__aq_strength,
__profile,
__tune,
__preset,
__sdr,
__hlg,
__hdr10,
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 H265CodecSettings")
}
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 {
"widthPixels" => Ok(__FieldTag::__width_pixels),
"width_pixels" => Ok(__FieldTag::__width_pixels),
"heightPixels" => Ok(__FieldTag::__height_pixels),
"height_pixels" => Ok(__FieldTag::__height_pixels),
"frameRate" => Ok(__FieldTag::__frame_rate),
"frame_rate" => Ok(__FieldTag::__frame_rate),
"frameRateConversionStrategy" => {
Ok(__FieldTag::__frame_rate_conversion_strategy)
}
"frame_rate_conversion_strategy" => {
Ok(__FieldTag::__frame_rate_conversion_strategy)
}
"bitrateBps" => Ok(__FieldTag::__bitrate_bps),
"bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
"pixelFormat" => Ok(__FieldTag::__pixel_format),
"pixel_format" => Ok(__FieldTag::__pixel_format),
"rateControlMode" => Ok(__FieldTag::__rate_control_mode),
"rate_control_mode" => Ok(__FieldTag::__rate_control_mode),
"crfLevel" => Ok(__FieldTag::__crf_level),
"crf_level" => Ok(__FieldTag::__crf_level),
"allowOpenGop" => Ok(__FieldTag::__allow_open_gop),
"allow_open_gop" => Ok(__FieldTag::__allow_open_gop),
"gopFrameCount" => Ok(__FieldTag::__gop_frame_count),
"gop_frame_count" => Ok(__FieldTag::__gop_frame_count),
"gopDuration" => Ok(__FieldTag::__gop_duration),
"gop_duration" => Ok(__FieldTag::__gop_duration),
"enableTwoPass" => Ok(__FieldTag::__enable_two_pass),
"enable_two_pass" => Ok(__FieldTag::__enable_two_pass),
"vbvSizeBits" => Ok(__FieldTag::__vbv_size_bits),
"vbv_size_bits" => Ok(__FieldTag::__vbv_size_bits),
"vbvFullnessBits" => Ok(__FieldTag::__vbv_fullness_bits),
"vbv_fullness_bits" => Ok(__FieldTag::__vbv_fullness_bits),
"bPyramid" => Ok(__FieldTag::__b_pyramid),
"b_pyramid" => Ok(__FieldTag::__b_pyramid),
"bFrameCount" => Ok(__FieldTag::__b_frame_count),
"b_frame_count" => Ok(__FieldTag::__b_frame_count),
"aqStrength" => Ok(__FieldTag::__aq_strength),
"aq_strength" => Ok(__FieldTag::__aq_strength),
"profile" => Ok(__FieldTag::__profile),
"tune" => Ok(__FieldTag::__tune),
"preset" => Ok(__FieldTag::__preset),
"sdr" => Ok(__FieldTag::__sdr),
"hlg" => Ok(__FieldTag::__hlg),
"hdr10" => Ok(__FieldTag::__hdr10),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::H265CodecSettings;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct H265CodecSettings")
}
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::__width_pixels => {
if !fields.insert(__FieldTag::__width_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for width_pixels",
));
}
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_pixels = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__height_pixels => {
if !fields.insert(__FieldTag::__height_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for height_pixels",
));
}
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_pixels =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__frame_rate => {
if !fields.insert(__FieldTag::__frame_rate) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for frame_rate",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.frame_rate = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__frame_rate_conversion_strategy => {
if !fields.insert(__FieldTag::__frame_rate_conversion_strategy) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for frame_rate_conversion_strategy",
));
}
result.frame_rate_conversion_strategy = map
.next_value::<std::option::Option<
crate::model::video_stream::FrameRateConversionStrategy,
>>()?
.unwrap_or_default();
}
__FieldTag::__bitrate_bps => {
if !fields.insert(__FieldTag::__bitrate_bps) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bitrate_bps",
));
}
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.bitrate_bps = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__pixel_format => {
if !fields.insert(__FieldTag::__pixel_format) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pixel_format",
));
}
result.pixel_format = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__rate_control_mode => {
if !fields.insert(__FieldTag::__rate_control_mode) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rate_control_mode",
));
}
result.rate_control_mode = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__crf_level => {
if !fields.insert(__FieldTag::__crf_level) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for crf_level",
));
}
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.crf_level = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__allow_open_gop => {
if !fields.insert(__FieldTag::__allow_open_gop) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for allow_open_gop",
));
}
result.allow_open_gop = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__gop_frame_count => {
if !fields.insert(__FieldTag::__gop_frame_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gop_frame_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
if result.gop_mode.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count, latest field was gopFrameCount",
));
}
result.gop_mode = std::option::Option::Some(
crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(
map.next_value::<__With>()?.0.unwrap_or_default()
),
);
}
__FieldTag::__gop_duration => {
if !fields.insert(__FieldTag::__gop_duration) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gop_duration",
));
}
if result.gop_mode.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_duration, latest field was gopDuration",
));
}
result.gop_mode = std::option::Option::Some(
crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(
map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__enable_two_pass => {
if !fields.insert(__FieldTag::__enable_two_pass) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enable_two_pass",
));
}
result.enable_two_pass = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__vbv_size_bits => {
if !fields.insert(__FieldTag::__vbv_size_bits) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vbv_size_bits",
));
}
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.vbv_size_bits =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__vbv_fullness_bits => {
if !fields.insert(__FieldTag::__vbv_fullness_bits) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vbv_fullness_bits",
));
}
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.vbv_fullness_bits =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__b_pyramid => {
if !fields.insert(__FieldTag::__b_pyramid) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for b_pyramid",
));
}
result.b_pyramid = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__b_frame_count => {
if !fields.insert(__FieldTag::__b_frame_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for b_frame_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.b_frame_count =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__aq_strength => {
if !fields.insert(__FieldTag::__aq_strength) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for aq_strength",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.aq_strength = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__profile => {
if !fields.insert(__FieldTag::__profile) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for profile",
));
}
result.profile = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__tune => {
if !fields.insert(__FieldTag::__tune) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for tune",
));
}
result.tune = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__preset => {
if !fields.insert(__FieldTag::__preset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for preset",
));
}
result.preset = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__sdr => {
if !fields.insert(__FieldTag::__sdr) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sdr",
));
}
if result.color_format.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.sdr, latest field was sdr",
));
}
result.color_format = std::option::Option::Some(
crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::video_stream::H265ColorFormatSDR,
>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__hlg => {
if !fields.insert(__FieldTag::__hlg) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for hlg",
));
}
if result.color_format.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.hlg, latest field was hlg",
));
}
result.color_format = std::option::Option::Some(
crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::video_stream::H265ColorFormatHLG,
>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__hdr10 => {
if !fields.insert(__FieldTag::__hdr10) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for hdr10",
));
}
if result.color_format.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.hdr10, latest field was hdr10",
));
}
result.color_format = std::option::Option::Some(
crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>>()?.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::video_stream::Vp9ColorFormatSDR {
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 {
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 Vp9ColorFormatSDR")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::Vp9ColorFormatSDR;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Vp9ColorFormatSDR")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::video_stream::Vp9ColorFormatHLG {
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 {
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 Vp9ColorFormatHLG")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::Vp9ColorFormatHLG;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Vp9ColorFormatHLG")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::video_stream::Vp9CodecSettings {
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 {
__width_pixels,
__height_pixels,
__frame_rate,
__frame_rate_conversion_strategy,
__bitrate_bps,
__pixel_format,
__rate_control_mode,
__crf_level,
__gop_frame_count,
__gop_duration,
__profile,
__sdr,
__hlg,
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 Vp9CodecSettings")
}
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 {
"widthPixels" => Ok(__FieldTag::__width_pixels),
"width_pixels" => Ok(__FieldTag::__width_pixels),
"heightPixels" => Ok(__FieldTag::__height_pixels),
"height_pixels" => Ok(__FieldTag::__height_pixels),
"frameRate" => Ok(__FieldTag::__frame_rate),
"frame_rate" => Ok(__FieldTag::__frame_rate),
"frameRateConversionStrategy" => {
Ok(__FieldTag::__frame_rate_conversion_strategy)
}
"frame_rate_conversion_strategy" => {
Ok(__FieldTag::__frame_rate_conversion_strategy)
}
"bitrateBps" => Ok(__FieldTag::__bitrate_bps),
"bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
"pixelFormat" => Ok(__FieldTag::__pixel_format),
"pixel_format" => Ok(__FieldTag::__pixel_format),
"rateControlMode" => Ok(__FieldTag::__rate_control_mode),
"rate_control_mode" => Ok(__FieldTag::__rate_control_mode),
"crfLevel" => Ok(__FieldTag::__crf_level),
"crf_level" => Ok(__FieldTag::__crf_level),
"gopFrameCount" => Ok(__FieldTag::__gop_frame_count),
"gop_frame_count" => Ok(__FieldTag::__gop_frame_count),
"gopDuration" => Ok(__FieldTag::__gop_duration),
"gop_duration" => Ok(__FieldTag::__gop_duration),
"profile" => Ok(__FieldTag::__profile),
"sdr" => Ok(__FieldTag::__sdr),
"hlg" => Ok(__FieldTag::__hlg),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::video_stream::Vp9CodecSettings;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Vp9CodecSettings")
}
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::__width_pixels => {
if !fields.insert(__FieldTag::__width_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for width_pixels",
));
}
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_pixels = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__height_pixels => {
if !fields.insert(__FieldTag::__height_pixels) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for height_pixels",
));
}
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_pixels =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__frame_rate => {
if !fields.insert(__FieldTag::__frame_rate) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for frame_rate",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.frame_rate = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__frame_rate_conversion_strategy => {
if !fields.insert(__FieldTag::__frame_rate_conversion_strategy) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for frame_rate_conversion_strategy",
));
}
result.frame_rate_conversion_strategy = map
.next_value::<std::option::Option<
crate::model::video_stream::FrameRateConversionStrategy,
>>()?
.unwrap_or_default();
}
__FieldTag::__bitrate_bps => {
if !fields.insert(__FieldTag::__bitrate_bps) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bitrate_bps",
));
}
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.bitrate_bps = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__pixel_format => {
if !fields.insert(__FieldTag::__pixel_format) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for pixel_format",
));
}
result.pixel_format = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__rate_control_mode => {
if !fields.insert(__FieldTag::__rate_control_mode) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for rate_control_mode",
));
}
result.rate_control_mode = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__crf_level => {
if !fields.insert(__FieldTag::__crf_level) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for crf_level",
));
}
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.crf_level = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__gop_frame_count => {
if !fields.insert(__FieldTag::__gop_frame_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gop_frame_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
if result.gop_mode.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.gop_frame_count, latest field was gopFrameCount",
));
}
result.gop_mode = std::option::Option::Some(
crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(
map.next_value::<__With>()?.0.unwrap_or_default()
),
);
}
__FieldTag::__gop_duration => {
if !fields.insert(__FieldTag::__gop_duration) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gop_duration",
));
}
if result.gop_mode.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.gop_duration, latest field was gopDuration",
));
}
result.gop_mode = std::option::Option::Some(
crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(
map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__profile => {
if !fields.insert(__FieldTag::__profile) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for profile",
));
}
result.profile = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__sdr => {
if !fields.insert(__FieldTag::__sdr) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sdr",
));
}
if result.color_format.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.sdr, latest field was sdr",
));
}
result.color_format = std::option::Option::Some(
crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::video_stream::Vp9ColorFormatSDR,
>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__hlg => {
if !fields.insert(__FieldTag::__hlg) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for hlg",
));
}
if result.color_format.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.hlg, latest field was hlg",
));
}
result.color_format = std::option::Option::Some(
crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::video_stream::Vp9ColorFormatHLG,
>,
>>()?
.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::AudioStream {
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 {
__codec,
__bitrate_bps,
__channel_count,
__channel_layout,
__mapping,
__sample_rate_hertz,
__language_code,
__display_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 AudioStream")
}
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 {
"codec" => Ok(__FieldTag::__codec),
"bitrateBps" => Ok(__FieldTag::__bitrate_bps),
"bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
"channelCount" => Ok(__FieldTag::__channel_count),
"channel_count" => Ok(__FieldTag::__channel_count),
"channelLayout" => Ok(__FieldTag::__channel_layout),
"channel_layout" => Ok(__FieldTag::__channel_layout),
"mapping" => Ok(__FieldTag::__mapping),
"sampleRateHertz" => Ok(__FieldTag::__sample_rate_hertz),
"sample_rate_hertz" => Ok(__FieldTag::__sample_rate_hertz),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AudioStream;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AudioStream")
}
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::__codec => {
if !fields.insert(__FieldTag::__codec) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for codec",
));
}
result.codec = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__bitrate_bps => {
if !fields.insert(__FieldTag::__bitrate_bps) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for bitrate_bps",
));
}
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.bitrate_bps = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__channel_count => {
if !fields.insert(__FieldTag::__channel_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for channel_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.channel_count =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__channel_layout => {
if !fields.insert(__FieldTag::__channel_layout) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for channel_layout",
));
}
result.channel_layout = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__mapping => {
if !fields.insert(__FieldTag::__mapping) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mapping",
));
}
result.mapping = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::audio_stream::AudioMapping>,
>>()?
.unwrap_or_default();
}
__FieldTag::__sample_rate_hertz => {
if !fields.insert(__FieldTag::__sample_rate_hertz) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sample_rate_hertz",
));
}
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.sample_rate_hertz =
map.next_value::<__With>()?.0.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::__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::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::audio_stream::AudioMapping {
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 {
__atom_key,
__input_key,
__input_track,
__input_channel,
__output_channel,
__gain_db,
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 AudioMapping")
}
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 {
"atomKey" => Ok(__FieldTag::__atom_key),
"atom_key" => Ok(__FieldTag::__atom_key),
"inputKey" => Ok(__FieldTag::__input_key),
"input_key" => Ok(__FieldTag::__input_key),
"inputTrack" => Ok(__FieldTag::__input_track),
"input_track" => Ok(__FieldTag::__input_track),
"inputChannel" => Ok(__FieldTag::__input_channel),
"input_channel" => Ok(__FieldTag::__input_channel),
"outputChannel" => Ok(__FieldTag::__output_channel),
"output_channel" => Ok(__FieldTag::__output_channel),
"gainDb" => Ok(__FieldTag::__gain_db),
"gain_db" => Ok(__FieldTag::__gain_db),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::audio_stream::AudioMapping;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AudioMapping")
}
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::__atom_key => {
if !fields.insert(__FieldTag::__atom_key) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for atom_key",
));
}
result.atom_key = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__input_key => {
if !fields.insert(__FieldTag::__input_key) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_key",
));
}
result.input_key = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__input_track => {
if !fields.insert(__FieldTag::__input_track) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_track",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.input_track = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__input_channel => {
if !fields.insert(__FieldTag::__input_channel) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_channel",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.input_channel =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__output_channel => {
if !fields.insert(__FieldTag::__output_channel) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for output_channel",
));
}
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.output_channel =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__gain_db => {
if !fields.insert(__FieldTag::__gain_db) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gain_db",
));
}
struct __With(std::option::Option<f64>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
}
}
result.gain_db = 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::TextStream {
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 {
__codec,
__language_code,
__mapping,
__display_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 TextStream")
}
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 {
"codec" => Ok(__FieldTag::__codec),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
"mapping" => Ok(__FieldTag::__mapping),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TextStream;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TextStream")
}
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::__codec => {
if !fields.insert(__FieldTag::__codec) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for codec",
));
}
result.codec = 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::__mapping => {
if !fields.insert(__FieldTag::__mapping) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mapping",
));
}
result.mapping = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::text_stream::TextMapping>,
>>()?
.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::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_stream::TextMapping {
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 {
__atom_key,
__input_key,
__input_track,
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 TextMapping")
}
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 {
"atomKey" => Ok(__FieldTag::__atom_key),
"atom_key" => Ok(__FieldTag::__atom_key),
"inputKey" => Ok(__FieldTag::__input_key),
"input_key" => Ok(__FieldTag::__input_key),
"inputTrack" => Ok(__FieldTag::__input_track),
"input_track" => Ok(__FieldTag::__input_track),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::text_stream::TextMapping;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TextMapping")
}
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::__atom_key => {
if !fields.insert(__FieldTag::__atom_key) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for atom_key",
));
}
result.atom_key = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__input_key => {
if !fields.insert(__FieldTag::__input_key) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_key",
));
}
result.input_key = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__input_track => {
if !fields.insert(__FieldTag::__input_track) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for input_track",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.input_track = 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::SegmentSettings {
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 {
__segment_duration,
__individual_segments,
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 SegmentSettings")
}
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 {
"segmentDuration" => Ok(__FieldTag::__segment_duration),
"segment_duration" => Ok(__FieldTag::__segment_duration),
"individualSegments" => Ok(__FieldTag::__individual_segments),
"individual_segments" => Ok(__FieldTag::__individual_segments),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SegmentSettings;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SegmentSettings")
}
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::__segment_duration => {
if !fields.insert(__FieldTag::__segment_duration) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for segment_duration",
));
}
result.segment_duration =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__individual_segments => {
if !fields.insert(__FieldTag::__individual_segments) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for individual_segments",
));
}
result.individual_segments = 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::Encryption {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__id,
__aes_128,
__sample_aes,
__mpeg_cenc,
__secret_manager_key_source,
__drm_systems,
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 Encryption")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"id" => Ok(__FieldTag::__id),
"aes128" => Ok(__FieldTag::__aes_128),
"aes_128" => Ok(__FieldTag::__aes_128),
"sampleAes" => Ok(__FieldTag::__sample_aes),
"sample_aes" => Ok(__FieldTag::__sample_aes),
"mpegCenc" => Ok(__FieldTag::__mpeg_cenc),
"mpeg_cenc" => Ok(__FieldTag::__mpeg_cenc),
"secretManagerKeySource" => Ok(__FieldTag::__secret_manager_key_source),
"secret_manager_key_source" => {
Ok(__FieldTag::__secret_manager_key_source)
}
"drmSystems" => Ok(__FieldTag::__drm_systems),
"drm_systems" => Ok(__FieldTag::__drm_systems),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Encryption;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Encryption")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__id => {
if !fields.insert(__FieldTag::__id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for id",
));
}
result.id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__aes_128 => {
if !fields.insert(__FieldTag::__aes_128) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for aes_128",
));
}
if result.encryption_mode.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `encryption_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.aes_128, latest field was aes128",
));
}
result.encryption_mode = std::option::Option::Some(
crate::model::encryption::EncryptionMode::Aes128(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::encryption::Aes128Encryption>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__sample_aes => {
if !fields.insert(__FieldTag::__sample_aes) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for sample_aes",
));
}
if result.encryption_mode.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `encryption_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.sample_aes, latest field was sampleAes",
));
}
result.encryption_mode = std::option::Option::Some(
crate::model::encryption::EncryptionMode::SampleAes(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::encryption::SampleAesEncryption,
>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__mpeg_cenc => {
if !fields.insert(__FieldTag::__mpeg_cenc) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for mpeg_cenc",
));
}
if result.encryption_mode.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `encryption_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.mpeg_cenc, latest field was mpegCenc",
));
}
result.encryption_mode = std::option::Option::Some(
crate::model::encryption::EncryptionMode::MpegCenc(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::encryption::MpegCommonEncryption,
>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__secret_manager_key_source => {
if !fields.insert(__FieldTag::__secret_manager_key_source) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for secret_manager_key_source",
));
}
if result.secret_source.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `secret_source`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.secret_manager_key_source, latest field was secretManagerKeySource",
));
}
result.secret_source = std::option::Option::Some(
crate::model::encryption::SecretSource::SecretManagerKeySource(
map.next_value::<std::option::Option<
std::boxed::Box<
crate::model::encryption::SecretManagerSource,
>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__drm_systems => {
if !fields.insert(__FieldTag::__drm_systems) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for drm_systems",
));
}
result.drm_systems = map.next_value::<std::option::Option<crate::model::encryption::DrmSystems>>()?
;
}
__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::encryption::Aes128Encryption {
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 {
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 Aes128Encryption")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::encryption::Aes128Encryption;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Aes128Encryption")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::encryption::SampleAesEncryption {
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 {
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 SampleAesEncryption")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::encryption::SampleAesEncryption;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SampleAesEncryption")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::encryption::MpegCommonEncryption {
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 {
__scheme,
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 MpegCommonEncryption")
}
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 {
"scheme" => Ok(__FieldTag::__scheme),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::encryption::MpegCommonEncryption;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct MpegCommonEncryption")
}
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::__scheme => {
if !fields.insert(__FieldTag::__scheme) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for scheme",
));
}
result.scheme = 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::encryption::SecretManagerSource {
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 {
__secret_version,
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 SecretManagerSource")
}
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 {
"secretVersion" => Ok(__FieldTag::__secret_version),
"secret_version" => Ok(__FieldTag::__secret_version),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::encryption::SecretManagerSource;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SecretManagerSource")
}
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::__secret_version => {
if !fields.insert(__FieldTag::__secret_version) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for secret_version",
));
}
result.secret_version = 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::encryption::Widevine {
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 {
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 Widevine")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::encryption::Widevine;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Widevine")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::encryption::Fairplay {
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 {
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 Fairplay")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::encryption::Fairplay;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Fairplay")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::encryption::Playready {
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 {
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 Playready")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::encryption::Playready;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Playready")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::encryption::Clearkey {
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 {
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 Clearkey")
}
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;
Ok(__FieldTag::Unknown(value.to_string()))
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::encryption::Clearkey;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Clearkey")
}
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 result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__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::encryption::DrmSystems {
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 {
__widevine,
__fairplay,
__playready,
__clearkey,
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 DrmSystems")
}
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 {
"widevine" => Ok(__FieldTag::__widevine),
"fairplay" => Ok(__FieldTag::__fairplay),
"playready" => Ok(__FieldTag::__playready),
"clearkey" => Ok(__FieldTag::__clearkey),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::encryption::DrmSystems;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DrmSystems")
}
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::__widevine => {
if !fields.insert(__FieldTag::__widevine) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for widevine",
));
}
result.widevine = map.next_value::<std::option::Option<crate::model::encryption::Widevine>>()?
;
}
__FieldTag::__fairplay => {
if !fields.insert(__FieldTag::__fairplay) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for fairplay",
));
}
result.fairplay = map.next_value::<std::option::Option<crate::model::encryption::Fairplay>>()?
;
}
__FieldTag::__playready => {
if !fields.insert(__FieldTag::__playready) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for playready",
));
}
result.playready = map.next_value::<std::option::Option<crate::model::encryption::Playready>>()?
;
}
__FieldTag::__clearkey => {
if !fields.insert(__FieldTag::__clearkey) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for clearkey",
));
}
result.clearkey = map.next_value::<std::option::Option<crate::model::encryption::Clearkey>>()?
;
}
__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::CreateJobRequest {
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,
__job,
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 CreateJobRequest")
}
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),
"job" => Ok(__FieldTag::__job),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CreateJobRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CreateJobRequest")
}
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::__job => {
if !fields.insert(__FieldTag::__job) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for job",
));
}
result.job =
map.next_value::<std::option::Option<crate::model::Job>>()?;
}
__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::ListJobsRequest {
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,
__filter,
__order_by,
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 ListJobsRequest")
}
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),
"filter" => Ok(__FieldTag::__filter),
"orderBy" => Ok(__FieldTag::__order_by),
"order_by" => Ok(__FieldTag::__order_by),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListJobsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListJobsRequest")
}
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::__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::__order_by => {
if !fields.insert(__FieldTag::__order_by) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for order_by",
));
}
result.order_by = 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::GetJobRequest {
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 GetJobRequest")
}
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::GetJobRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetJobRequest")
}
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::DeleteJobRequest {
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,
__allow_missing,
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 DeleteJobRequest")
}
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),
"allowMissing" => Ok(__FieldTag::__allow_missing),
"allow_missing" => Ok(__FieldTag::__allow_missing),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DeleteJobRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DeleteJobRequest")
}
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::__allow_missing => {
if !fields.insert(__FieldTag::__allow_missing) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for allow_missing",
));
}
result.allow_missing = 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::ListJobsResponse {
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 {
__jobs,
__next_page_token,
__unreachable,
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 ListJobsResponse")
}
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 {
"jobs" => Ok(__FieldTag::__jobs),
"nextPageToken" => Ok(__FieldTag::__next_page_token),
"next_page_token" => Ok(__FieldTag::__next_page_token),
"unreachable" => Ok(__FieldTag::__unreachable),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListJobsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListJobsResponse")
}
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::__jobs => {
if !fields.insert(__FieldTag::__jobs) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for jobs",
));
}
result.jobs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Job>>>()?.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::__unreachable => {
if !fields.insert(__FieldTag::__unreachable) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for unreachable",
));
}
result.unreachable = 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::CreateJobTemplateRequest {
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,
__job_template,
__job_template_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 CreateJobTemplateRequest")
}
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),
"jobTemplate" => Ok(__FieldTag::__job_template),
"job_template" => Ok(__FieldTag::__job_template),
"jobTemplateId" => Ok(__FieldTag::__job_template_id),
"job_template_id" => Ok(__FieldTag::__job_template_id),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CreateJobTemplateRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CreateJobTemplateRequest")
}
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::__job_template => {
if !fields.insert(__FieldTag::__job_template) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for job_template",
));
}
result.job_template =
map.next_value::<std::option::Option<crate::model::JobTemplate>>()?;
}
__FieldTag::__job_template_id => {
if !fields.insert(__FieldTag::__job_template_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for job_template_id",
));
}
result.job_template_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::ListJobTemplatesRequest {
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,
__filter,
__order_by,
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 ListJobTemplatesRequest")
}
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),
"filter" => Ok(__FieldTag::__filter),
"orderBy" => Ok(__FieldTag::__order_by),
"order_by" => Ok(__FieldTag::__order_by),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListJobTemplatesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListJobTemplatesRequest")
}
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::__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::__order_by => {
if !fields.insert(__FieldTag::__order_by) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for order_by",
));
}
result.order_by = 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::GetJobTemplateRequest {
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 GetJobTemplateRequest")
}
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::GetJobTemplateRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetJobTemplateRequest")
}
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::DeleteJobTemplateRequest {
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,
__allow_missing,
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 DeleteJobTemplateRequest")
}
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),
"allowMissing" => Ok(__FieldTag::__allow_missing),
"allow_missing" => Ok(__FieldTag::__allow_missing),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DeleteJobTemplateRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DeleteJobTemplateRequest")
}
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::__allow_missing => {
if !fields.insert(__FieldTag::__allow_missing) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for allow_missing",
));
}
result.allow_missing = 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::ListJobTemplatesResponse {
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 {
__job_templates,
__next_page_token,
__unreachable,
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 ListJobTemplatesResponse")
}
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 {
"jobTemplates" => Ok(__FieldTag::__job_templates),
"job_templates" => Ok(__FieldTag::__job_templates),
"nextPageToken" => Ok(__FieldTag::__next_page_token),
"next_page_token" => Ok(__FieldTag::__next_page_token),
"unreachable" => Ok(__FieldTag::__unreachable),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListJobTemplatesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListJobTemplatesResponse")
}
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::__job_templates => {
if !fields.insert(__FieldTag::__job_templates) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for job_templates",
));
}
result.job_templates = map.next_value::<std::option::Option<std::vec::Vec<crate::model::JobTemplate>>>()?.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::__unreachable => {
if !fields.insert(__FieldTag::__unreachable) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for unreachable",
));
}
result.unreachable = 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)
}
}