#[allow(unused_imports)]
use super::*;
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::CreateRecognizerRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__recognizer,
__validate_only,
__recognizer_id,
__parent,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for CreateRecognizerRequest")
}
fn visit_str<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 {
"recognizer" => Ok(__FieldTag::__recognizer),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
"recognizerId" => Ok(__FieldTag::__recognizer_id),
"recognizer_id" => Ok(__FieldTag::__recognizer_id),
"parent" => Ok(__FieldTag::__parent),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CreateRecognizerRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CreateRecognizerRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__recognizer => {
if !fields.insert(__FieldTag::__recognizer) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for recognizer",
));
}
result.recognizer =
map.next_value::<std::option::Option<crate::model::Recognizer>>()?;
}
__FieldTag::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__recognizer_id => {
if !fields.insert(__FieldTag::__recognizer_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for recognizer_id",
));
}
result.recognizer_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::OperationMetadata {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__create_time,
__update_time,
__resource,
__method,
__kms_key_name,
__kms_key_version_name,
__batch_recognize_request,
__create_recognizer_request,
__update_recognizer_request,
__delete_recognizer_request,
__undelete_recognizer_request,
__create_custom_class_request,
__update_custom_class_request,
__delete_custom_class_request,
__undelete_custom_class_request,
__create_phrase_set_request,
__update_phrase_set_request,
__delete_phrase_set_request,
__undelete_phrase_set_request,
__update_config_request,
__progress_percent,
__batch_recognize_metadata,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for OperationMetadata")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"createTime" => Ok(__FieldTag::__create_time),
"create_time" => Ok(__FieldTag::__create_time),
"updateTime" => Ok(__FieldTag::__update_time),
"update_time" => Ok(__FieldTag::__update_time),
"resource" => Ok(__FieldTag::__resource),
"method" => Ok(__FieldTag::__method),
"kmsKeyName" => Ok(__FieldTag::__kms_key_name),
"kms_key_name" => Ok(__FieldTag::__kms_key_name),
"kmsKeyVersionName" => Ok(__FieldTag::__kms_key_version_name),
"kms_key_version_name" => Ok(__FieldTag::__kms_key_version_name),
"batchRecognizeRequest" => Ok(__FieldTag::__batch_recognize_request),
"batch_recognize_request" => Ok(__FieldTag::__batch_recognize_request),
"createRecognizerRequest" => {
Ok(__FieldTag::__create_recognizer_request)
}
"create_recognizer_request" => {
Ok(__FieldTag::__create_recognizer_request)
}
"updateRecognizerRequest" => {
Ok(__FieldTag::__update_recognizer_request)
}
"update_recognizer_request" => {
Ok(__FieldTag::__update_recognizer_request)
}
"deleteRecognizerRequest" => {
Ok(__FieldTag::__delete_recognizer_request)
}
"delete_recognizer_request" => {
Ok(__FieldTag::__delete_recognizer_request)
}
"undeleteRecognizerRequest" => {
Ok(__FieldTag::__undelete_recognizer_request)
}
"undelete_recognizer_request" => {
Ok(__FieldTag::__undelete_recognizer_request)
}
"createCustomClassRequest" => {
Ok(__FieldTag::__create_custom_class_request)
}
"create_custom_class_request" => {
Ok(__FieldTag::__create_custom_class_request)
}
"updateCustomClassRequest" => {
Ok(__FieldTag::__update_custom_class_request)
}
"update_custom_class_request" => {
Ok(__FieldTag::__update_custom_class_request)
}
"deleteCustomClassRequest" => {
Ok(__FieldTag::__delete_custom_class_request)
}
"delete_custom_class_request" => {
Ok(__FieldTag::__delete_custom_class_request)
}
"undeleteCustomClassRequest" => {
Ok(__FieldTag::__undelete_custom_class_request)
}
"undelete_custom_class_request" => {
Ok(__FieldTag::__undelete_custom_class_request)
}
"createPhraseSetRequest" => Ok(__FieldTag::__create_phrase_set_request),
"create_phrase_set_request" => {
Ok(__FieldTag::__create_phrase_set_request)
}
"updatePhraseSetRequest" => Ok(__FieldTag::__update_phrase_set_request),
"update_phrase_set_request" => {
Ok(__FieldTag::__update_phrase_set_request)
}
"deletePhraseSetRequest" => Ok(__FieldTag::__delete_phrase_set_request),
"delete_phrase_set_request" => {
Ok(__FieldTag::__delete_phrase_set_request)
}
"undeletePhraseSetRequest" => {
Ok(__FieldTag::__undelete_phrase_set_request)
}
"undelete_phrase_set_request" => {
Ok(__FieldTag::__undelete_phrase_set_request)
}
"updateConfigRequest" => Ok(__FieldTag::__update_config_request),
"update_config_request" => Ok(__FieldTag::__update_config_request),
"progressPercent" => Ok(__FieldTag::__progress_percent),
"progress_percent" => Ok(__FieldTag::__progress_percent),
"batchRecognizeMetadata" => Ok(__FieldTag::__batch_recognize_metadata),
"batch_recognize_metadata" => {
Ok(__FieldTag::__batch_recognize_metadata)
}
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::OperationMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct OperationMetadata")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__create_time => {
if !fields.insert(__FieldTag::__create_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for create_time",
));
}
result.create_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__update_time => {
if !fields.insert(__FieldTag::__update_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_time",
));
}
result.update_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__resource => {
if !fields.insert(__FieldTag::__resource) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for resource",
));
}
result.resource = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__method => {
if !fields.insert(__FieldTag::__method) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for method",
));
}
result.method = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__kms_key_name => {
if !fields.insert(__FieldTag::__kms_key_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for kms_key_name",
));
}
result.kms_key_name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__kms_key_version_name => {
if !fields.insert(__FieldTag::__kms_key_version_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for kms_key_version_name",
));
}
result.kms_key_version_name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__batch_recognize_request => {
if !fields.insert(__FieldTag::__batch_recognize_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for batch_recognize_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.batch_recognize_request, latest field was batchRecognizeRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::BatchRecognizeRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::BatchRecognizeRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__create_recognizer_request => {
if !fields.insert(__FieldTag::__create_recognizer_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for create_recognizer_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.create_recognizer_request, latest field was createRecognizerRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::CreateRecognizerRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::CreateRecognizerRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__update_recognizer_request => {
if !fields.insert(__FieldTag::__update_recognizer_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_recognizer_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.update_recognizer_request, latest field was updateRecognizerRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::UpdateRecognizerRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::UpdateRecognizerRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__delete_recognizer_request => {
if !fields.insert(__FieldTag::__delete_recognizer_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for delete_recognizer_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.delete_recognizer_request, latest field was deleteRecognizerRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::DeleteRecognizerRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::DeleteRecognizerRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__undelete_recognizer_request => {
if !fields.insert(__FieldTag::__undelete_recognizer_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for undelete_recognizer_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.undelete_recognizer_request, latest field was undeleteRecognizerRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::UndeleteRecognizerRequest(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::UndeleteRecognizerRequest>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__create_custom_class_request => {
if !fields.insert(__FieldTag::__create_custom_class_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for create_custom_class_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.create_custom_class_request, latest field was createCustomClassRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::CreateCustomClassRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::CreateCustomClassRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__update_custom_class_request => {
if !fields.insert(__FieldTag::__update_custom_class_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_custom_class_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.update_custom_class_request, latest field was updateCustomClassRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::UpdateCustomClassRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::UpdateCustomClassRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__delete_custom_class_request => {
if !fields.insert(__FieldTag::__delete_custom_class_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for delete_custom_class_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.delete_custom_class_request, latest field was deleteCustomClassRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::DeleteCustomClassRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::DeleteCustomClassRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__undelete_custom_class_request => {
if !fields.insert(__FieldTag::__undelete_custom_class_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for undelete_custom_class_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.undelete_custom_class_request, latest field was undeleteCustomClassRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::UndeleteCustomClassRequest(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::UndeleteCustomClassRequest>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__create_phrase_set_request => {
if !fields.insert(__FieldTag::__create_phrase_set_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for create_phrase_set_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.create_phrase_set_request, latest field was createPhraseSetRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::CreatePhraseSetRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::CreatePhraseSetRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__update_phrase_set_request => {
if !fields.insert(__FieldTag::__update_phrase_set_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_phrase_set_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.update_phrase_set_request, latest field was updatePhraseSetRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::UpdatePhraseSetRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::UpdatePhraseSetRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__delete_phrase_set_request => {
if !fields.insert(__FieldTag::__delete_phrase_set_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for delete_phrase_set_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.delete_phrase_set_request, latest field was deletePhraseSetRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::DeletePhraseSetRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::DeletePhraseSetRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__undelete_phrase_set_request => {
if !fields.insert(__FieldTag::__undelete_phrase_set_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for undelete_phrase_set_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.undelete_phrase_set_request, latest field was undeletePhraseSetRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::UndeletePhraseSetRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::UndeletePhraseSetRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__update_config_request => {
if !fields.insert(__FieldTag::__update_config_request) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_config_request",
));
}
if result.request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `request`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.update_config_request, latest field was updateConfigRequest",
));
}
result.request = std::option::Option::Some(
crate::model::operation_metadata::Request::UpdateConfigRequest(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::UpdateConfigRequest>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__progress_percent => {
if !fields.insert(__FieldTag::__progress_percent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for progress_percent",
));
}
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.progress_percent =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__batch_recognize_metadata => {
if !fields.insert(__FieldTag::__batch_recognize_metadata) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for batch_recognize_metadata",
));
}
if result.metadata.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `metadata`, a oneof with full ID .google.cloud.speech.v2.OperationMetadata.batch_recognize_metadata, latest field was batchRecognizeMetadata",
));
}
result.metadata = std::option::Option::Some(
crate::model::operation_metadata::Metadata::BatchRecognizeMetadata(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::BatchRecognizeMetadata>,
>>()?
.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::ListRecognizersRequest {
fn deserialize<D>(deserializer: D) -> 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,
__show_deleted,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ListRecognizersRequest")
}
fn visit_str<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),
"showDeleted" => Ok(__FieldTag::__show_deleted),
"show_deleted" => Ok(__FieldTag::__show_deleted),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListRecognizersRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListRecognizersRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__show_deleted => {
if !fields.insert(__FieldTag::__show_deleted) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for show_deleted",
));
}
result.show_deleted = 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::ListRecognizersResponse {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__recognizers,
__next_page_token,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ListRecognizersResponse")
}
fn visit_str<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 {
"recognizers" => Ok(__FieldTag::__recognizers),
"nextPageToken" => Ok(__FieldTag::__next_page_token),
"next_page_token" => Ok(__FieldTag::__next_page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListRecognizersResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListRecognizersResponse")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__recognizers => {
if !fields.insert(__FieldTag::__recognizers) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for recognizers",
));
}
result.recognizers = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Recognizer>>>()?.unwrap_or_default();
}
__FieldTag::__next_page_token => {
if !fields.insert(__FieldTag::__next_page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for next_page_token",
));
}
result.next_page_token = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::GetRecognizerRequest {
fn deserialize<D>(deserializer: D) -> 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 GetRecognizerRequest")
}
fn visit_str<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::GetRecognizerRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetRecognizerRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::UpdateRecognizerRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__recognizer,
__update_mask,
__validate_only,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for UpdateRecognizerRequest")
}
fn visit_str<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 {
"recognizer" => Ok(__FieldTag::__recognizer),
"updateMask" => Ok(__FieldTag::__update_mask),
"update_mask" => Ok(__FieldTag::__update_mask),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::UpdateRecognizerRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct UpdateRecognizerRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__recognizer => {
if !fields.insert(__FieldTag::__recognizer) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for recognizer",
));
}
result.recognizer =
map.next_value::<std::option::Option<crate::model::Recognizer>>()?;
}
__FieldTag::__update_mask => {
if !fields.insert(__FieldTag::__update_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_mask",
));
}
result.update_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__FieldTag::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = 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::DeleteRecognizerRequest {
fn deserialize<D>(deserializer: D) -> 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,
__validate_only,
__allow_missing,
__etag,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for DeleteRecognizerRequest")
}
fn visit_str<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),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
"allowMissing" => Ok(__FieldTag::__allow_missing),
"allow_missing" => Ok(__FieldTag::__allow_missing),
"etag" => Ok(__FieldTag::__etag),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DeleteRecognizerRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DeleteRecognizerRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = map
.next_value::<std::option::Option<bool>>()?
.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::__etag => {
if !fields.insert(__FieldTag::__etag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for etag",
));
}
result.etag = 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::UndeleteRecognizerRequest {
fn deserialize<D>(deserializer: D) -> 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,
__validate_only,
__etag,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for UndeleteRecognizerRequest")
}
fn visit_str<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),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
"etag" => Ok(__FieldTag::__etag),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::UndeleteRecognizerRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct UndeleteRecognizerRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__etag => {
if !fields.insert(__FieldTag::__etag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for etag",
));
}
result.etag = 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::Recognizer {
fn deserialize<D>(deserializer: D) -> 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,
__uid,
__display_name,
__model,
__language_codes,
__default_recognition_config,
__annotations,
__state,
__create_time,
__update_time,
__delete_time,
__expire_time,
__etag,
__reconciling,
__kms_key_name,
__kms_key_version_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 Recognizer")
}
fn visit_str<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),
"uid" => Ok(__FieldTag::__uid),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"model" => Ok(__FieldTag::__model),
"languageCodes" => Ok(__FieldTag::__language_codes),
"language_codes" => Ok(__FieldTag::__language_codes),
"defaultRecognitionConfig" => {
Ok(__FieldTag::__default_recognition_config)
}
"default_recognition_config" => {
Ok(__FieldTag::__default_recognition_config)
}
"annotations" => Ok(__FieldTag::__annotations),
"state" => Ok(__FieldTag::__state),
"createTime" => Ok(__FieldTag::__create_time),
"create_time" => Ok(__FieldTag::__create_time),
"updateTime" => Ok(__FieldTag::__update_time),
"update_time" => Ok(__FieldTag::__update_time),
"deleteTime" => Ok(__FieldTag::__delete_time),
"delete_time" => Ok(__FieldTag::__delete_time),
"expireTime" => Ok(__FieldTag::__expire_time),
"expire_time" => Ok(__FieldTag::__expire_time),
"etag" => Ok(__FieldTag::__etag),
"reconciling" => Ok(__FieldTag::__reconciling),
"kmsKeyName" => Ok(__FieldTag::__kms_key_name),
"kms_key_name" => Ok(__FieldTag::__kms_key_name),
"kmsKeyVersionName" => Ok(__FieldTag::__kms_key_version_name),
"kms_key_version_name" => Ok(__FieldTag::__kms_key_version_name),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Recognizer;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Recognizer")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__uid => {
if !fields.insert(__FieldTag::__uid) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for uid",
));
}
result.uid = 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::__model => {
if !fields.insert(__FieldTag::__model) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for model",
));
}
result.model = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__language_codes => {
if !fields.insert(__FieldTag::__language_codes) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_codes",
));
}
result.language_codes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__default_recognition_config => {
if !fields.insert(__FieldTag::__default_recognition_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for default_recognition_config",
));
}
result.default_recognition_config = map
.next_value::<std::option::Option<crate::model::RecognitionConfig>>(
)?;
}
__FieldTag::__annotations => {
if !fields.insert(__FieldTag::__annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for annotations",
));
}
result.annotations = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
std::string::String,
>,
>>()?
.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::recognizer::State>>(
)?
.unwrap_or_default();
}
__FieldTag::__create_time => {
if !fields.insert(__FieldTag::__create_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for create_time",
));
}
result.create_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__update_time => {
if !fields.insert(__FieldTag::__update_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_time",
));
}
result.update_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__delete_time => {
if !fields.insert(__FieldTag::__delete_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for delete_time",
));
}
result.delete_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__expire_time => {
if !fields.insert(__FieldTag::__expire_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for expire_time",
));
}
result.expire_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__etag => {
if !fields.insert(__FieldTag::__etag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for etag",
));
}
result.etag = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__reconciling => {
if !fields.insert(__FieldTag::__reconciling) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reconciling",
));
}
result.reconciling = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__kms_key_name => {
if !fields.insert(__FieldTag::__kms_key_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for kms_key_name",
));
}
result.kms_key_name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__kms_key_version_name => {
if !fields.insert(__FieldTag::__kms_key_version_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for kms_key_version_name",
));
}
result.kms_key_version_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::AutoDetectDecodingConfig {
fn deserialize<D>(deserializer: D) -> 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 AutoDetectDecodingConfig")
}
fn visit_str<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::AutoDetectDecodingConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AutoDetectDecodingConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::ExplicitDecodingConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__encoding,
__sample_rate_hertz,
__audio_channel_count,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ExplicitDecodingConfig")
}
fn visit_str<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 {
"encoding" => Ok(__FieldTag::__encoding),
"sampleRateHertz" => Ok(__FieldTag::__sample_rate_hertz),
"sample_rate_hertz" => Ok(__FieldTag::__sample_rate_hertz),
"audioChannelCount" => Ok(__FieldTag::__audio_channel_count),
"audio_channel_count" => Ok(__FieldTag::__audio_channel_count),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ExplicitDecodingConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ExplicitDecodingConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__encoding => {
if !fields.insert(__FieldTag::__encoding) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for encoding",
));
}
result.encoding = map
.next_value::<std::option::Option<
crate::model::explicit_decoding_config::AudioEncoding,
>>()?
.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::__audio_channel_count => {
if !fields.insert(__FieldTag::__audio_channel_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for audio_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.audio_channel_count =
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::SpeakerDiarizationConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__min_speaker_count,
__max_speaker_count,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SpeakerDiarizationConfig")
}
fn visit_str<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 {
"minSpeakerCount" => Ok(__FieldTag::__min_speaker_count),
"min_speaker_count" => Ok(__FieldTag::__min_speaker_count),
"maxSpeakerCount" => Ok(__FieldTag::__max_speaker_count),
"max_speaker_count" => Ok(__FieldTag::__max_speaker_count),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SpeakerDiarizationConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SpeakerDiarizationConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__min_speaker_count => {
if !fields.insert(__FieldTag::__min_speaker_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for min_speaker_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.min_speaker_count =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__max_speaker_count => {
if !fields.insert(__FieldTag::__max_speaker_count) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_speaker_count",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.max_speaker_count =
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::CustomPromptConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__custom_prompt,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for CustomPromptConfig")
}
fn visit_str<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 {
"customPrompt" => Ok(__FieldTag::__custom_prompt),
"custom_prompt" => Ok(__FieldTag::__custom_prompt),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CustomPromptConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CustomPromptConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__custom_prompt => {
if !fields.insert(__FieldTag::__custom_prompt) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for custom_prompt",
));
}
result.custom_prompt = 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::RecognitionFeatures {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__profanity_filter,
__enable_word_time_offsets,
__enable_word_confidence,
__enable_automatic_punctuation,
__enable_spoken_punctuation,
__enable_spoken_emojis,
__multi_channel_mode,
__diarization_config,
__max_alternatives,
__custom_prompt_config,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for RecognitionFeatures")
}
fn visit_str<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 {
"profanityFilter" => Ok(__FieldTag::__profanity_filter),
"profanity_filter" => Ok(__FieldTag::__profanity_filter),
"enableWordTimeOffsets" => Ok(__FieldTag::__enable_word_time_offsets),
"enable_word_time_offsets" => {
Ok(__FieldTag::__enable_word_time_offsets)
}
"enableWordConfidence" => Ok(__FieldTag::__enable_word_confidence),
"enable_word_confidence" => Ok(__FieldTag::__enable_word_confidence),
"enableAutomaticPunctuation" => {
Ok(__FieldTag::__enable_automatic_punctuation)
}
"enable_automatic_punctuation" => {
Ok(__FieldTag::__enable_automatic_punctuation)
}
"enableSpokenPunctuation" => {
Ok(__FieldTag::__enable_spoken_punctuation)
}
"enable_spoken_punctuation" => {
Ok(__FieldTag::__enable_spoken_punctuation)
}
"enableSpokenEmojis" => Ok(__FieldTag::__enable_spoken_emojis),
"enable_spoken_emojis" => Ok(__FieldTag::__enable_spoken_emojis),
"multiChannelMode" => Ok(__FieldTag::__multi_channel_mode),
"multi_channel_mode" => Ok(__FieldTag::__multi_channel_mode),
"diarizationConfig" => Ok(__FieldTag::__diarization_config),
"diarization_config" => Ok(__FieldTag::__diarization_config),
"maxAlternatives" => Ok(__FieldTag::__max_alternatives),
"max_alternatives" => Ok(__FieldTag::__max_alternatives),
"customPromptConfig" => Ok(__FieldTag::__custom_prompt_config),
"custom_prompt_config" => Ok(__FieldTag::__custom_prompt_config),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RecognitionFeatures;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RecognitionFeatures")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__profanity_filter => {
if !fields.insert(__FieldTag::__profanity_filter) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for profanity_filter",
));
}
result.profanity_filter = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__enable_word_time_offsets => {
if !fields.insert(__FieldTag::__enable_word_time_offsets) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enable_word_time_offsets",
));
}
result.enable_word_time_offsets = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__enable_word_confidence => {
if !fields.insert(__FieldTag::__enable_word_confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enable_word_confidence",
));
}
result.enable_word_confidence = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__enable_automatic_punctuation => {
if !fields.insert(__FieldTag::__enable_automatic_punctuation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enable_automatic_punctuation",
));
}
result.enable_automatic_punctuation = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__enable_spoken_punctuation => {
if !fields.insert(__FieldTag::__enable_spoken_punctuation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enable_spoken_punctuation",
));
}
result.enable_spoken_punctuation = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__enable_spoken_emojis => {
if !fields.insert(__FieldTag::__enable_spoken_emojis) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enable_spoken_emojis",
));
}
result.enable_spoken_emojis = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__multi_channel_mode => {
if !fields.insert(__FieldTag::__multi_channel_mode) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for multi_channel_mode",
));
}
result.multi_channel_mode = map
.next_value::<std::option::Option<
crate::model::recognition_features::MultiChannelMode,
>>()?
.unwrap_or_default();
}
__FieldTag::__diarization_config => {
if !fields.insert(__FieldTag::__diarization_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for diarization_config",
));
}
result.diarization_config = map.next_value::<std::option::Option<crate::model::SpeakerDiarizationConfig>>()?
;
}
__FieldTag::__max_alternatives => {
if !fields.insert(__FieldTag::__max_alternatives) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for max_alternatives",
));
}
struct __With(std::option::Option<i32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
}
}
result.max_alternatives =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__custom_prompt_config => {
if !fields.insert(__FieldTag::__custom_prompt_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for custom_prompt_config",
));
}
result.custom_prompt_config = map.next_value::<std::option::Option<crate::model::CustomPromptConfig>>()?
;
}
__FieldTag::Unknown(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::TranscriptNormalization {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__entries,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for TranscriptNormalization")
}
fn visit_str<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 {
"entries" => Ok(__FieldTag::__entries),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TranscriptNormalization;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TranscriptNormalization")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__entries => {
if !fields.insert(__FieldTag::__entries) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for entries",
));
}
result.entries = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::transcript_normalization::Entry>,
>>()?
.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::transcript_normalization::Entry {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__search,
__replace,
__case_sensitive,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Entry")
}
fn visit_str<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 {
"search" => Ok(__FieldTag::__search),
"replace" => Ok(__FieldTag::__replace),
"caseSensitive" => Ok(__FieldTag::__case_sensitive),
"case_sensitive" => Ok(__FieldTag::__case_sensitive),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::transcript_normalization::Entry;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Entry")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__search => {
if !fields.insert(__FieldTag::__search) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for search",
));
}
result.search = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__replace => {
if !fields.insert(__FieldTag::__replace) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for replace",
));
}
result.replace = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__case_sensitive => {
if !fields.insert(__FieldTag::__case_sensitive) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for case_sensitive",
));
}
result.case_sensitive = 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::TranslationConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__target_language,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for TranslationConfig")
}
fn visit_str<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 {
"targetLanguage" => Ok(__FieldTag::__target_language),
"target_language" => Ok(__FieldTag::__target_language),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::TranslationConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct TranslationConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__target_language => {
if !fields.insert(__FieldTag::__target_language) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for target_language",
));
}
result.target_language = 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::SpeechAdaptation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__phrase_sets,
__custom_classes,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SpeechAdaptation")
}
fn visit_str<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 {
"phraseSets" => Ok(__FieldTag::__phrase_sets),
"phrase_sets" => Ok(__FieldTag::__phrase_sets),
"customClasses" => Ok(__FieldTag::__custom_classes),
"custom_classes" => Ok(__FieldTag::__custom_classes),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SpeechAdaptation;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SpeechAdaptation")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__phrase_sets => {
if !fields.insert(__FieldTag::__phrase_sets) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for phrase_sets",
));
}
result.phrase_sets = map
.next_value::<std::option::Option<
std::vec::Vec<
crate::model::speech_adaptation::AdaptationPhraseSet,
>,
>>()?
.unwrap_or_default();
}
__FieldTag::__custom_classes => {
if !fields.insert(__FieldTag::__custom_classes) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for custom_classes",
));
}
result.custom_classes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::CustomClass>>>()?.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::speech_adaptation::AdaptationPhraseSet {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__phrase_set,
__inline_phrase_set,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AdaptationPhraseSet")
}
fn visit_str<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 {
"phraseSet" => Ok(__FieldTag::__phrase_set),
"phrase_set" => Ok(__FieldTag::__phrase_set),
"inlinePhraseSet" => Ok(__FieldTag::__inline_phrase_set),
"inline_phrase_set" => Ok(__FieldTag::__inline_phrase_set),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::speech_adaptation::AdaptationPhraseSet;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AdaptationPhraseSet")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__phrase_set => {
if !fields.insert(__FieldTag::__phrase_set) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for phrase_set",
));
}
if result.value.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `value`, a oneof with full ID .google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.phrase_set, latest field was phraseSet",
));
}
result.value = std::option::Option::Some(
crate::model::speech_adaptation::adaptation_phrase_set::Value::PhraseSet(
map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
),
);
}
__FieldTag::__inline_phrase_set => {
if !fields.insert(__FieldTag::__inline_phrase_set) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for inline_phrase_set",
));
}
if result.value.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `value`, a oneof with full ID .google.cloud.speech.v2.SpeechAdaptation.AdaptationPhraseSet.inline_phrase_set, latest field was inlinePhraseSet",
));
}
result.value = std::option::Option::Some(
crate::model::speech_adaptation::adaptation_phrase_set::Value::InlinePhraseSet(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::PhraseSet>>>()?.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::DenoiserConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__denoise_audio,
__snr_threshold,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for DenoiserConfig")
}
fn visit_str<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 {
"denoiseAudio" => Ok(__FieldTag::__denoise_audio),
"denoise_audio" => Ok(__FieldTag::__denoise_audio),
"snrThreshold" => Ok(__FieldTag::__snr_threshold),
"snr_threshold" => Ok(__FieldTag::__snr_threshold),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DenoiserConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DenoiserConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__denoise_audio => {
if !fields.insert(__FieldTag::__denoise_audio) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for denoise_audio",
));
}
result.denoise_audio = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__snr_threshold => {
if !fields.insert(__FieldTag::__snr_threshold) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for snr_threshold",
));
}
struct __With(std::option::Option<f32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F32> >::deserialize(deserializer).map(__With)
}
}
result.snr_threshold =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::RecognitionConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__auto_decoding_config,
__explicit_decoding_config,
__model,
__language_codes,
__features,
__adaptation,
__transcript_normalization,
__translation_config,
__denoiser_config,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for RecognitionConfig")
}
fn visit_str<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 {
"autoDecodingConfig" => Ok(__FieldTag::__auto_decoding_config),
"auto_decoding_config" => Ok(__FieldTag::__auto_decoding_config),
"explicitDecodingConfig" => Ok(__FieldTag::__explicit_decoding_config),
"explicit_decoding_config" => {
Ok(__FieldTag::__explicit_decoding_config)
}
"model" => Ok(__FieldTag::__model),
"languageCodes" => Ok(__FieldTag::__language_codes),
"language_codes" => Ok(__FieldTag::__language_codes),
"features" => Ok(__FieldTag::__features),
"adaptation" => Ok(__FieldTag::__adaptation),
"transcriptNormalization" => Ok(__FieldTag::__transcript_normalization),
"transcript_normalization" => {
Ok(__FieldTag::__transcript_normalization)
}
"translationConfig" => Ok(__FieldTag::__translation_config),
"translation_config" => Ok(__FieldTag::__translation_config),
"denoiserConfig" => Ok(__FieldTag::__denoiser_config),
"denoiser_config" => Ok(__FieldTag::__denoiser_config),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RecognitionConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RecognitionConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__auto_decoding_config => {
if !fields.insert(__FieldTag::__auto_decoding_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for auto_decoding_config",
));
}
if result.decoding_config.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `decoding_config`, a oneof with full ID .google.cloud.speech.v2.RecognitionConfig.auto_decoding_config, latest field was autoDecodingConfig",
));
}
result.decoding_config = std::option::Option::Some(
crate::model::recognition_config::DecodingConfig::AutoDecodingConfig(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::AutoDetectDecodingConfig>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__explicit_decoding_config => {
if !fields.insert(__FieldTag::__explicit_decoding_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for explicit_decoding_config",
));
}
if result.decoding_config.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `decoding_config`, a oneof with full ID .google.cloud.speech.v2.RecognitionConfig.explicit_decoding_config, latest field was explicitDecodingConfig",
));
}
result.decoding_config = std::option::Option::Some(
crate::model::recognition_config::DecodingConfig::ExplicitDecodingConfig(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::ExplicitDecodingConfig>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__model => {
if !fields.insert(__FieldTag::__model) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for model",
));
}
result.model = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__language_codes => {
if !fields.insert(__FieldTag::__language_codes) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_codes",
));
}
result.language_codes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
}
__FieldTag::__features => {
if !fields.insert(__FieldTag::__features) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for features",
));
}
result.features = map.next_value::<std::option::Option<crate::model::RecognitionFeatures>>()?
;
}
__FieldTag::__adaptation => {
if !fields.insert(__FieldTag::__adaptation) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for adaptation",
));
}
result.adaptation = map
.next_value::<std::option::Option<crate::model::SpeechAdaptation>>(
)?;
}
__FieldTag::__transcript_normalization => {
if !fields.insert(__FieldTag::__transcript_normalization) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for transcript_normalization",
));
}
result.transcript_normalization = map.next_value::<std::option::Option<crate::model::TranscriptNormalization>>()?
;
}
__FieldTag::__translation_config => {
if !fields.insert(__FieldTag::__translation_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for translation_config",
));
}
result.translation_config = map
.next_value::<std::option::Option<crate::model::TranslationConfig>>(
)?;
}
__FieldTag::__denoiser_config => {
if !fields.insert(__FieldTag::__denoiser_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for denoiser_config",
));
}
result.denoiser_config = map
.next_value::<std::option::Option<crate::model::DenoiserConfig>>(
)?;
}
__FieldTag::Unknown(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::RecognizeRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__recognizer,
__config,
__config_mask,
__content,
__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 RecognizeRequest")
}
fn visit_str<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 {
"recognizer" => Ok(__FieldTag::__recognizer),
"config" => Ok(__FieldTag::__config),
"configMask" => Ok(__FieldTag::__config_mask),
"config_mask" => Ok(__FieldTag::__config_mask),
"content" => Ok(__FieldTag::__content),
"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::RecognizeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RecognizeRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__recognizer => {
if !fields.insert(__FieldTag::__recognizer) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for recognizer",
));
}
result.recognizer = 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::RecognitionConfig>>(
)?;
}
__FieldTag::__config_mask => {
if !fields.insert(__FieldTag::__config_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for config_mask",
));
}
result.config_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__FieldTag::__content => {
if !fields.insert(__FieldTag::__content) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for content",
));
}
struct __With(std::option::Option<::bytes::Bytes>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<serde_with::base64::Base64> >::deserialize(deserializer).map(__With)
}
}
if result.audio_source.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `audio_source`, a oneof with full ID .google.cloud.speech.v2.RecognizeRequest.content, latest field was content",
));
}
result.audio_source = std::option::Option::Some(
crate::model::recognize_request::AudioSource::Content(
map.next_value::<__With>()?.0.unwrap_or_default(),
),
);
}
__FieldTag::__uri => {
if !fields.insert(__FieldTag::__uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for uri",
));
}
if result.audio_source.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `audio_source`, a oneof with full ID .google.cloud.speech.v2.RecognizeRequest.uri, latest field was uri",
));
}
result.audio_source = std::option::Option::Some(
crate::model::recognize_request::AudioSource::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::RecognitionResponseMetadata {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__request_id,
__total_billed_duration,
__prompt,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for RecognitionResponseMetadata")
}
fn visit_str<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 {
"requestId" => Ok(__FieldTag::__request_id),
"request_id" => Ok(__FieldTag::__request_id),
"totalBilledDuration" => Ok(__FieldTag::__total_billed_duration),
"total_billed_duration" => Ok(__FieldTag::__total_billed_duration),
"prompt" => Ok(__FieldTag::__prompt),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RecognitionResponseMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RecognitionResponseMetadata")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__request_id => {
if !fields.insert(__FieldTag::__request_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for request_id",
));
}
result.request_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__total_billed_duration => {
if !fields.insert(__FieldTag::__total_billed_duration) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for total_billed_duration",
));
}
result.total_billed_duration =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__prompt => {
if !fields.insert(__FieldTag::__prompt) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for prompt",
));
}
result.prompt =
map.next_value::<std::option::Option<std::string::String>>()?;
}
__FieldTag::Unknown(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::SpeechRecognitionAlternative {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__transcript,
__confidence,
__words,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SpeechRecognitionAlternative")
}
fn visit_str<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 {
"transcript" => Ok(__FieldTag::__transcript),
"confidence" => Ok(__FieldTag::__confidence),
"words" => Ok(__FieldTag::__words),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SpeechRecognitionAlternative;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SpeechRecognitionAlternative")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__transcript => {
if !fields.insert(__FieldTag::__transcript) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for transcript",
));
}
result.transcript = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
struct __With(std::option::Option<f32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F32> >::deserialize(deserializer).map(__With)
}
}
result.confidence = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__words => {
if !fields.insert(__FieldTag::__words) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for words",
));
}
result.words = map.next_value::<std::option::Option<std::vec::Vec<crate::model::WordInfo>>>()?.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::WordInfo {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__start_offset,
__end_offset,
__word,
__confidence,
__speaker_label,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for WordInfo")
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
use std::result::Result::Ok;
use std::string::ToString;
match value {
"startOffset" => Ok(__FieldTag::__start_offset),
"start_offset" => Ok(__FieldTag::__start_offset),
"endOffset" => Ok(__FieldTag::__end_offset),
"end_offset" => Ok(__FieldTag::__end_offset),
"word" => Ok(__FieldTag::__word),
"confidence" => Ok(__FieldTag::__confidence),
"speakerLabel" => Ok(__FieldTag::__speaker_label),
"speaker_label" => Ok(__FieldTag::__speaker_label),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::WordInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct WordInfo")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__start_offset => {
if !fields.insert(__FieldTag::__start_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for start_offset",
));
}
result.start_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__end_offset => {
if !fields.insert(__FieldTag::__end_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for end_offset",
));
}
result.end_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__word => {
if !fields.insert(__FieldTag::__word) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for word",
));
}
result.word = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__confidence => {
if !fields.insert(__FieldTag::__confidence) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for confidence",
));
}
struct __With(std::option::Option<f32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F32> >::deserialize(deserializer).map(__With)
}
}
result.confidence = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__speaker_label => {
if !fields.insert(__FieldTag::__speaker_label) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for speaker_label",
));
}
result.speaker_label = 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::SpeechRecognitionResult {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__alternatives,
__channel_tag,
__result_end_offset,
__language_code,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for SpeechRecognitionResult")
}
fn visit_str<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 {
"alternatives" => Ok(__FieldTag::__alternatives),
"channelTag" => Ok(__FieldTag::__channel_tag),
"channel_tag" => Ok(__FieldTag::__channel_tag),
"resultEndOffset" => Ok(__FieldTag::__result_end_offset),
"result_end_offset" => Ok(__FieldTag::__result_end_offset),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::SpeechRecognitionResult;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SpeechRecognitionResult")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__alternatives => {
if !fields.insert(__FieldTag::__alternatives) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for alternatives",
));
}
result.alternatives = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::SpeechRecognitionAlternative>,
>>()?
.unwrap_or_default();
}
__FieldTag::__channel_tag => {
if !fields.insert(__FieldTag::__channel_tag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for channel_tag",
));
}
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_tag = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__result_end_offset => {
if !fields.insert(__FieldTag::__result_end_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for result_end_offset",
));
}
result.result_end_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__language_code => {
if !fields.insert(__FieldTag::__language_code) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for language_code",
));
}
result.language_code = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::RecognizeResponse {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__results,
__metadata,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for RecognizeResponse")
}
fn visit_str<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 {
"results" => Ok(__FieldTag::__results),
"metadata" => Ok(__FieldTag::__metadata),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RecognizeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RecognizeResponse")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__results => {
if !fields.insert(__FieldTag::__results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for results",
));
}
result.results = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::SpeechRecognitionResult>,
>>()?
.unwrap_or_default();
}
__FieldTag::__metadata => {
if !fields.insert(__FieldTag::__metadata) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for metadata",
));
}
result.metadata = map.next_value::<std::option::Option<crate::model::RecognitionResponseMetadata>>()?
;
}
__FieldTag::Unknown(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::StreamingRecognitionFeatures {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__enable_voice_activity_events,
__interim_results,
__voice_activity_timeout,
__endpointing_sensitivity,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for StreamingRecognitionFeatures")
}
fn visit_str<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 {
"enableVoiceActivityEvents" => {
Ok(__FieldTag::__enable_voice_activity_events)
}
"enable_voice_activity_events" => {
Ok(__FieldTag::__enable_voice_activity_events)
}
"interimResults" => Ok(__FieldTag::__interim_results),
"interim_results" => Ok(__FieldTag::__interim_results),
"voiceActivityTimeout" => Ok(__FieldTag::__voice_activity_timeout),
"voice_activity_timeout" => Ok(__FieldTag::__voice_activity_timeout),
"endpointingSensitivity" => Ok(__FieldTag::__endpointing_sensitivity),
"endpointing_sensitivity" => Ok(__FieldTag::__endpointing_sensitivity),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::StreamingRecognitionFeatures;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct StreamingRecognitionFeatures")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__enable_voice_activity_events => {
if !fields.insert(__FieldTag::__enable_voice_activity_events) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for enable_voice_activity_events",
));
}
result.enable_voice_activity_events = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__interim_results => {
if !fields.insert(__FieldTag::__interim_results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for interim_results",
));
}
result.interim_results = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__voice_activity_timeout => {
if !fields.insert(__FieldTag::__voice_activity_timeout) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for voice_activity_timeout",
));
}
result.voice_activity_timeout = map.next_value::<std::option::Option<
crate::model::streaming_recognition_features::VoiceActivityTimeout,
>>()?;
}
__FieldTag::__endpointing_sensitivity => {
if !fields.insert(__FieldTag::__endpointing_sensitivity) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for endpointing_sensitivity",
));
}
result.endpointing_sensitivity = map.next_value::<std::option::Option<crate::model::streaming_recognition_features::EndpointingSensitivity>>()?.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::streaming_recognition_features::VoiceActivityTimeout
{
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__speech_start_timeout,
__speech_end_timeout,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for VoiceActivityTimeout")
}
fn visit_str<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 {
"speechStartTimeout" => Ok(__FieldTag::__speech_start_timeout),
"speech_start_timeout" => Ok(__FieldTag::__speech_start_timeout),
"speechEndTimeout" => Ok(__FieldTag::__speech_end_timeout),
"speech_end_timeout" => Ok(__FieldTag::__speech_end_timeout),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::streaming_recognition_features::VoiceActivityTimeout;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct VoiceActivityTimeout")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__speech_start_timeout => {
if !fields.insert(__FieldTag::__speech_start_timeout) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for speech_start_timeout",
));
}
result.speech_start_timeout =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__speech_end_timeout => {
if !fields.insert(__FieldTag::__speech_end_timeout) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for speech_end_timeout",
));
}
result.speech_end_timeout =
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::StreamingRecognitionConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__config,
__config_mask,
__streaming_features,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for StreamingRecognitionConfig")
}
fn visit_str<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 {
"config" => Ok(__FieldTag::__config),
"configMask" => Ok(__FieldTag::__config_mask),
"config_mask" => Ok(__FieldTag::__config_mask),
"streamingFeatures" => Ok(__FieldTag::__streaming_features),
"streaming_features" => Ok(__FieldTag::__streaming_features),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::StreamingRecognitionConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct StreamingRecognitionConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__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::RecognitionConfig>>(
)?;
}
__FieldTag::__config_mask => {
if !fields.insert(__FieldTag::__config_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for config_mask",
));
}
result.config_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__FieldTag::__streaming_features => {
if !fields.insert(__FieldTag::__streaming_features) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for streaming_features",
));
}
result.streaming_features = map.next_value::<std::option::Option<crate::model::StreamingRecognitionFeatures>>()?
;
}
__FieldTag::Unknown(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::StreamingRecognizeRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__recognizer,
__streaming_config,
__audio,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for StreamingRecognizeRequest")
}
fn visit_str<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 {
"recognizer" => Ok(__FieldTag::__recognizer),
"streamingConfig" => Ok(__FieldTag::__streaming_config),
"streaming_config" => Ok(__FieldTag::__streaming_config),
"audio" => Ok(__FieldTag::__audio),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::StreamingRecognizeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct StreamingRecognizeRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__recognizer => {
if !fields.insert(__FieldTag::__recognizer) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for recognizer",
));
}
result.recognizer = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__streaming_config => {
if !fields.insert(__FieldTag::__streaming_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for streaming_config",
));
}
if result.streaming_request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `streaming_request`, a oneof with full ID .google.cloud.speech.v2.StreamingRecognizeRequest.streaming_config, latest field was streamingConfig",
));
}
result.streaming_request = std::option::Option::Some(
crate::model::streaming_recognize_request::StreamingRequest::StreamingConfig(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::StreamingRecognitionConfig>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__audio => {
if !fields.insert(__FieldTag::__audio) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for audio",
));
}
struct __With(std::option::Option<::bytes::Bytes>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<serde_with::base64::Base64> >::deserialize(deserializer).map(__With)
}
}
if result.streaming_request.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `streaming_request`, a oneof with full ID .google.cloud.speech.v2.StreamingRecognizeRequest.audio, latest field was audio",
));
}
result.streaming_request = std::option::Option::Some(
crate::model::streaming_recognize_request::StreamingRequest::Audio(
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::BatchRecognizeRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__recognizer,
__config,
__config_mask,
__files,
__recognition_output_config,
__processing_strategy,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for BatchRecognizeRequest")
}
fn visit_str<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 {
"recognizer" => Ok(__FieldTag::__recognizer),
"config" => Ok(__FieldTag::__config),
"configMask" => Ok(__FieldTag::__config_mask),
"config_mask" => Ok(__FieldTag::__config_mask),
"files" => Ok(__FieldTag::__files),
"recognitionOutputConfig" => {
Ok(__FieldTag::__recognition_output_config)
}
"recognition_output_config" => {
Ok(__FieldTag::__recognition_output_config)
}
"processingStrategy" => Ok(__FieldTag::__processing_strategy),
"processing_strategy" => Ok(__FieldTag::__processing_strategy),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchRecognizeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchRecognizeRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__recognizer => {
if !fields.insert(__FieldTag::__recognizer) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for recognizer",
));
}
result.recognizer = 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::RecognitionConfig>>(
)?;
}
__FieldTag::__config_mask => {
if !fields.insert(__FieldTag::__config_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for config_mask",
));
}
result.config_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__FieldTag::__files => {
if !fields.insert(__FieldTag::__files) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for files",
));
}
result.files = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::BatchRecognizeFileMetadata>,
>>()?
.unwrap_or_default();
}
__FieldTag::__recognition_output_config => {
if !fields.insert(__FieldTag::__recognition_output_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for recognition_output_config",
));
}
result.recognition_output_config = map.next_value::<std::option::Option<crate::model::RecognitionOutputConfig>>()?
;
}
__FieldTag::__processing_strategy => {
if !fields.insert(__FieldTag::__processing_strategy) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for processing_strategy",
));
}
result.processing_strategy = map
.next_value::<std::option::Option<
crate::model::batch_recognize_request::ProcessingStrategy,
>>()?
.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::GcsOutputConfig {
fn deserialize<D>(deserializer: D) -> 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 GcsOutputConfig")
}
fn visit_str<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::GcsOutputConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GcsOutputConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::InlineOutputConfig {
fn deserialize<D>(deserializer: D) -> 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 InlineOutputConfig")
}
fn visit_str<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::InlineOutputConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct InlineOutputConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::NativeOutputFileFormatConfig {
fn deserialize<D>(deserializer: D) -> 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 NativeOutputFileFormatConfig")
}
fn visit_str<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::NativeOutputFileFormatConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct NativeOutputFileFormatConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::VttOutputFileFormatConfig {
fn deserialize<D>(deserializer: D) -> 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 VttOutputFileFormatConfig")
}
fn visit_str<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::VttOutputFileFormatConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct VttOutputFileFormatConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::SrtOutputFileFormatConfig {
fn deserialize<D>(deserializer: D) -> 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 SrtOutputFileFormatConfig")
}
fn visit_str<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::SrtOutputFileFormatConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct SrtOutputFileFormatConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::OutputFormatConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__native,
__vtt,
__srt,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for OutputFormatConfig")
}
fn visit_str<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 {
"native" => Ok(__FieldTag::__native),
"vtt" => Ok(__FieldTag::__vtt),
"srt" => Ok(__FieldTag::__srt),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::OutputFormatConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct OutputFormatConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__native => {
if !fields.insert(__FieldTag::__native) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for native",
));
}
result.native = map.next_value::<std::option::Option<crate::model::NativeOutputFileFormatConfig>>()?
;
}
__FieldTag::__vtt => {
if !fields.insert(__FieldTag::__vtt) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vtt",
));
}
result.vtt = map.next_value::<std::option::Option<crate::model::VttOutputFileFormatConfig>>()?
;
}
__FieldTag::__srt => {
if !fields.insert(__FieldTag::__srt) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for srt",
));
}
result.srt = map.next_value::<std::option::Option<crate::model::SrtOutputFileFormatConfig>>()?
;
}
__FieldTag::Unknown(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::RecognitionOutputConfig {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__gcs_output_config,
__inline_response_config,
__output_format_config,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for RecognitionOutputConfig")
}
fn visit_str<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 {
"gcsOutputConfig" => Ok(__FieldTag::__gcs_output_config),
"gcs_output_config" => Ok(__FieldTag::__gcs_output_config),
"inlineResponseConfig" => Ok(__FieldTag::__inline_response_config),
"inline_response_config" => Ok(__FieldTag::__inline_response_config),
"outputFormatConfig" => Ok(__FieldTag::__output_format_config),
"output_format_config" => Ok(__FieldTag::__output_format_config),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::RecognitionOutputConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct RecognitionOutputConfig")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
#[allow(unused_imports)]
use serde::de::Error;
use std::option::Option::Some;
let mut fields = std::collections::HashSet::new();
let mut result = Self::Value::new();
while let Some(tag) = map.next_key::<__FieldTag>()? {
#[allow(clippy::match_single_binding)]
match tag {
__FieldTag::__gcs_output_config => {
if !fields.insert(__FieldTag::__gcs_output_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for gcs_output_config",
));
}
if result.output.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `output`, a oneof with full ID .google.cloud.speech.v2.RecognitionOutputConfig.gcs_output_config, latest field was gcsOutputConfig",
));
}
result.output = std::option::Option::Some(
crate::model::recognition_output_config::Output::GcsOutputConfig(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::GcsOutputConfig>,
>>()?
.unwrap_or_default(),
),
);
}
__FieldTag::__inline_response_config => {
if !fields.insert(__FieldTag::__inline_response_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for inline_response_config",
));
}
if result.output.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `output`, a oneof with full ID .google.cloud.speech.v2.RecognitionOutputConfig.inline_response_config, latest field was inlineResponseConfig",
));
}
result.output = std::option::Option::Some(
crate::model::recognition_output_config::Output::InlineResponseConfig(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::InlineOutputConfig>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__output_format_config => {
if !fields.insert(__FieldTag::__output_format_config) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for output_format_config",
));
}
result.output_format_config = map.next_value::<std::option::Option<crate::model::OutputFormatConfig>>()?
;
}
__FieldTag::Unknown(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::BatchRecognizeResponse {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__results,
__total_billed_duration,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for BatchRecognizeResponse")
}
fn visit_str<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 {
"results" => Ok(__FieldTag::__results),
"totalBilledDuration" => Ok(__FieldTag::__total_billed_duration),
"total_billed_duration" => Ok(__FieldTag::__total_billed_duration),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchRecognizeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchRecognizeResponse")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__results => {
if !fields.insert(__FieldTag::__results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for results",
));
}
result.results = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
crate::model::BatchRecognizeFileResult,
>,
>>()?
.unwrap_or_default();
}
__FieldTag::__total_billed_duration => {
if !fields.insert(__FieldTag::__total_billed_duration) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for total_billed_duration",
));
}
result.total_billed_duration =
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::BatchRecognizeResults {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__results,
__metadata,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for BatchRecognizeResults")
}
fn visit_str<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 {
"results" => Ok(__FieldTag::__results),
"metadata" => Ok(__FieldTag::__metadata),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchRecognizeResults;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchRecognizeResults")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__results => {
if !fields.insert(__FieldTag::__results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for results",
));
}
result.results = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::SpeechRecognitionResult>,
>>()?
.unwrap_or_default();
}
__FieldTag::__metadata => {
if !fields.insert(__FieldTag::__metadata) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for metadata",
));
}
result.metadata = map.next_value::<std::option::Option<crate::model::RecognitionResponseMetadata>>()?
;
}
__FieldTag::Unknown(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::CloudStorageResult {
fn deserialize<D>(deserializer: D) -> 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,
__vtt_format_uri,
__srt_format_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 CloudStorageResult")
}
fn visit_str<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),
"vttFormatUri" => Ok(__FieldTag::__vtt_format_uri),
"vtt_format_uri" => Ok(__FieldTag::__vtt_format_uri),
"srtFormatUri" => Ok(__FieldTag::__srt_format_uri),
"srt_format_uri" => Ok(__FieldTag::__srt_format_uri),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CloudStorageResult;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CloudStorageResult")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__vtt_format_uri => {
if !fields.insert(__FieldTag::__vtt_format_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vtt_format_uri",
));
}
result.vtt_format_uri = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__srt_format_uri => {
if !fields.insert(__FieldTag::__srt_format_uri) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for srt_format_uri",
));
}
result.srt_format_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::InlineResult {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__transcript,
__vtt_captions,
__srt_captions,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for InlineResult")
}
fn visit_str<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 {
"transcript" => Ok(__FieldTag::__transcript),
"vttCaptions" => Ok(__FieldTag::__vtt_captions),
"vtt_captions" => Ok(__FieldTag::__vtt_captions),
"srtCaptions" => Ok(__FieldTag::__srt_captions),
"srt_captions" => Ok(__FieldTag::__srt_captions),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::InlineResult;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct InlineResult")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__transcript => {
if !fields.insert(__FieldTag::__transcript) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for transcript",
));
}
result.transcript = map.next_value::<std::option::Option<crate::model::BatchRecognizeResults>>()?
;
}
__FieldTag::__vtt_captions => {
if !fields.insert(__FieldTag::__vtt_captions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for vtt_captions",
));
}
result.vtt_captions = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__srt_captions => {
if !fields.insert(__FieldTag::__srt_captions) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for srt_captions",
));
}
result.srt_captions = 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::BatchRecognizeFileResult {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__error,
__metadata,
__cloud_storage_result,
__inline_result,
__uri,
__transcript,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for BatchRecognizeFileResult")
}
fn visit_str<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 {
"error" => Ok(__FieldTag::__error),
"metadata" => Ok(__FieldTag::__metadata),
"cloudStorageResult" => Ok(__FieldTag::__cloud_storage_result),
"cloud_storage_result" => Ok(__FieldTag::__cloud_storage_result),
"inlineResult" => Ok(__FieldTag::__inline_result),
"inline_result" => Ok(__FieldTag::__inline_result),
"uri" => Ok(__FieldTag::__uri),
"transcript" => Ok(__FieldTag::__transcript),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchRecognizeFileResult;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchRecognizeFileResult")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__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::__metadata => {
if !fields.insert(__FieldTag::__metadata) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for metadata",
));
}
result.metadata = map.next_value::<std::option::Option<crate::model::RecognitionResponseMetadata>>()?
;
}
__FieldTag::__cloud_storage_result => {
if !fields.insert(__FieldTag::__cloud_storage_result) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for cloud_storage_result",
));
}
if result.result.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `result`, a oneof with full ID .google.cloud.speech.v2.BatchRecognizeFileResult.cloud_storage_result, latest field was cloudStorageResult",
));
}
result.result = std::option::Option::Some(
crate::model::batch_recognize_file_result::Result::CloudStorageResult(
map.next_value::<std::option::Option<std::boxed::Box<crate::model::CloudStorageResult>>>()?.unwrap_or_default()
),
);
}
__FieldTag::__inline_result => {
if !fields.insert(__FieldTag::__inline_result) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for inline_result",
));
}
if result.result.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `result`, a oneof with full ID .google.cloud.speech.v2.BatchRecognizeFileResult.inline_result, latest field was inlineResult",
));
}
result.result = std::option::Option::Some(
crate::model::batch_recognize_file_result::Result::InlineResult(
map.next_value::<std::option::Option<
std::boxed::Box<crate::model::InlineResult>,
>>()?
.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::__transcript => {
if !fields.insert(__FieldTag::__transcript) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for transcript",
));
}
result.transcript = map.next_value::<std::option::Option<crate::model::BatchRecognizeResults>>()?
;
}
__FieldTag::Unknown(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::BatchRecognizeTranscriptionMetadata {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__progress_percent,
__error,
__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 BatchRecognizeTranscriptionMetadata")
}
fn visit_str<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 {
"progressPercent" => Ok(__FieldTag::__progress_percent),
"progress_percent" => Ok(__FieldTag::__progress_percent),
"error" => Ok(__FieldTag::__error),
"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::BatchRecognizeTranscriptionMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchRecognizeTranscriptionMetadata")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__progress_percent => {
if !fields.insert(__FieldTag::__progress_percent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for progress_percent",
));
}
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.progress_percent =
map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__error => {
if !fields.insert(__FieldTag::__error) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for error",
));
}
result.error = map
.next_value::<std::option::Option<google_cloud_rpc::model::Status>>(
)?;
}
__FieldTag::__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::BatchRecognizeMetadata {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__transcription_metadata,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for BatchRecognizeMetadata")
}
fn visit_str<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 {
"transcriptionMetadata" => Ok(__FieldTag::__transcription_metadata),
"transcription_metadata" => Ok(__FieldTag::__transcription_metadata),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchRecognizeMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchRecognizeMetadata")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__transcription_metadata => {
if !fields.insert(__FieldTag::__transcription_metadata) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for transcription_metadata",
));
}
result.transcription_metadata = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
crate::model::BatchRecognizeTranscriptionMetadata,
>,
>>()?
.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::BatchRecognizeFileMetadata {
fn deserialize<D>(deserializer: D) -> 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,
__config,
__config_mask,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for BatchRecognizeFileMetadata")
}
fn visit_str<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),
"config" => Ok(__FieldTag::__config),
"configMask" => Ok(__FieldTag::__config_mask),
"config_mask" => Ok(__FieldTag::__config_mask),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::BatchRecognizeFileMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct BatchRecognizeFileMetadata")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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",
));
}
if result.audio_source.is_some() {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for `audio_source`, a oneof with full ID .google.cloud.speech.v2.BatchRecognizeFileMetadata.uri, latest field was uri",
));
}
result.audio_source = std::option::Option::Some(
crate::model::batch_recognize_file_metadata::AudioSource::Uri(
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::RecognitionConfig>>(
)?;
}
__FieldTag::__config_mask => {
if !fields.insert(__FieldTag::__config_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for config_mask",
));
}
result.config_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::StreamingRecognitionResult {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__alternatives,
__is_final,
__stability,
__result_end_offset,
__channel_tag,
__language_code,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for StreamingRecognitionResult")
}
fn visit_str<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 {
"alternatives" => Ok(__FieldTag::__alternatives),
"isFinal" => Ok(__FieldTag::__is_final),
"is_final" => Ok(__FieldTag::__is_final),
"stability" => Ok(__FieldTag::__stability),
"resultEndOffset" => Ok(__FieldTag::__result_end_offset),
"result_end_offset" => Ok(__FieldTag::__result_end_offset),
"channelTag" => Ok(__FieldTag::__channel_tag),
"channel_tag" => Ok(__FieldTag::__channel_tag),
"languageCode" => Ok(__FieldTag::__language_code),
"language_code" => Ok(__FieldTag::__language_code),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::StreamingRecognitionResult;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct StreamingRecognitionResult")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__alternatives => {
if !fields.insert(__FieldTag::__alternatives) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for alternatives",
));
}
result.alternatives = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::SpeechRecognitionAlternative>,
>>()?
.unwrap_or_default();
}
__FieldTag::__is_final => {
if !fields.insert(__FieldTag::__is_final) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for is_final",
));
}
result.is_final = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__stability => {
if !fields.insert(__FieldTag::__stability) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for stability",
));
}
struct __With(std::option::Option<f32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F32> >::deserialize(deserializer).map(__With)
}
}
result.stability = map.next_value::<__With>()?.0.unwrap_or_default();
}
__FieldTag::__result_end_offset => {
if !fields.insert(__FieldTag::__result_end_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for result_end_offset",
));
}
result.result_end_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__channel_tag => {
if !fields.insert(__FieldTag::__channel_tag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for channel_tag",
));
}
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_tag = 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::Unknown(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::StreamingRecognizeResponse {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__results,
__speech_event_type,
__speech_event_offset,
__metadata,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for StreamingRecognizeResponse")
}
fn visit_str<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 {
"results" => Ok(__FieldTag::__results),
"speechEventType" => Ok(__FieldTag::__speech_event_type),
"speech_event_type" => Ok(__FieldTag::__speech_event_type),
"speechEventOffset" => Ok(__FieldTag::__speech_event_offset),
"speech_event_offset" => Ok(__FieldTag::__speech_event_offset),
"metadata" => Ok(__FieldTag::__metadata),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::StreamingRecognizeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct StreamingRecognizeResponse")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__results => {
if !fields.insert(__FieldTag::__results) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for results",
));
}
result.results = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::StreamingRecognitionResult>,
>>()?
.unwrap_or_default();
}
__FieldTag::__speech_event_type => {
if !fields.insert(__FieldTag::__speech_event_type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for speech_event_type",
));
}
result.speech_event_type = map
.next_value::<std::option::Option<
crate::model::streaming_recognize_response::SpeechEventType,
>>()?
.unwrap_or_default();
}
__FieldTag::__speech_event_offset => {
if !fields.insert(__FieldTag::__speech_event_offset) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for speech_event_offset",
));
}
result.speech_event_offset =
map.next_value::<std::option::Option<wkt::Duration>>()?;
}
__FieldTag::__metadata => {
if !fields.insert(__FieldTag::__metadata) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for metadata",
));
}
result.metadata = map.next_value::<std::option::Option<crate::model::RecognitionResponseMetadata>>()?
;
}
__FieldTag::Unknown(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::Config {
fn deserialize<D>(deserializer: D) -> 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,
__kms_key_name,
__update_time,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for Config")
}
fn visit_str<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),
"kmsKeyName" => Ok(__FieldTag::__kms_key_name),
"kms_key_name" => Ok(__FieldTag::__kms_key_name),
"updateTime" => Ok(__FieldTag::__update_time),
"update_time" => Ok(__FieldTag::__update_time),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::Config;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Config")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__kms_key_name => {
if !fields.insert(__FieldTag::__kms_key_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for kms_key_name",
));
}
result.kms_key_name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__update_time => {
if !fields.insert(__FieldTag::__update_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_time",
));
}
result.update_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::GetConfigRequest {
fn deserialize<D>(deserializer: D) -> 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 GetConfigRequest")
}
fn visit_str<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::GetConfigRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetConfigRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::UpdateConfigRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__config,
__update_mask,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for UpdateConfigRequest")
}
fn visit_str<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 {
"config" => Ok(__FieldTag::__config),
"updateMask" => Ok(__FieldTag::__update_mask),
"update_mask" => Ok(__FieldTag::__update_mask),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::UpdateConfigRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct UpdateConfigRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__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::Config>>()?;
}
__FieldTag::__update_mask => {
if !fields.insert(__FieldTag::__update_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_mask",
));
}
result.update_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::CustomClass {
fn deserialize<D>(deserializer: D) -> 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,
__uid,
__display_name,
__items,
__state,
__create_time,
__update_time,
__delete_time,
__expire_time,
__annotations,
__etag,
__reconciling,
__kms_key_name,
__kms_key_version_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 CustomClass")
}
fn visit_str<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),
"uid" => Ok(__FieldTag::__uid),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"items" => Ok(__FieldTag::__items),
"state" => Ok(__FieldTag::__state),
"createTime" => Ok(__FieldTag::__create_time),
"create_time" => Ok(__FieldTag::__create_time),
"updateTime" => Ok(__FieldTag::__update_time),
"update_time" => Ok(__FieldTag::__update_time),
"deleteTime" => Ok(__FieldTag::__delete_time),
"delete_time" => Ok(__FieldTag::__delete_time),
"expireTime" => Ok(__FieldTag::__expire_time),
"expire_time" => Ok(__FieldTag::__expire_time),
"annotations" => Ok(__FieldTag::__annotations),
"etag" => Ok(__FieldTag::__etag),
"reconciling" => Ok(__FieldTag::__reconciling),
"kmsKeyName" => Ok(__FieldTag::__kms_key_name),
"kms_key_name" => Ok(__FieldTag::__kms_key_name),
"kmsKeyVersionName" => Ok(__FieldTag::__kms_key_version_name),
"kms_key_version_name" => Ok(__FieldTag::__kms_key_version_name),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CustomClass;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CustomClass")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__uid => {
if !fields.insert(__FieldTag::__uid) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for uid",
));
}
result.uid = 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::__items => {
if !fields.insert(__FieldTag::__items) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for items",
));
}
result.items = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::custom_class::ClassItem>,
>>()?
.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::custom_class::State>>()?.unwrap_or_default();
}
__FieldTag::__create_time => {
if !fields.insert(__FieldTag::__create_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for create_time",
));
}
result.create_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__update_time => {
if !fields.insert(__FieldTag::__update_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_time",
));
}
result.update_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__delete_time => {
if !fields.insert(__FieldTag::__delete_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for delete_time",
));
}
result.delete_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__expire_time => {
if !fields.insert(__FieldTag::__expire_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for expire_time",
));
}
result.expire_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__annotations => {
if !fields.insert(__FieldTag::__annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for annotations",
));
}
result.annotations = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
std::string::String,
>,
>>()?
.unwrap_or_default();
}
__FieldTag::__etag => {
if !fields.insert(__FieldTag::__etag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for etag",
));
}
result.etag = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__reconciling => {
if !fields.insert(__FieldTag::__reconciling) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reconciling",
));
}
result.reconciling = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__kms_key_name => {
if !fields.insert(__FieldTag::__kms_key_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for kms_key_name",
));
}
result.kms_key_name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__kms_key_version_name => {
if !fields.insert(__FieldTag::__kms_key_version_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for kms_key_version_name",
));
}
result.kms_key_version_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::custom_class::ClassItem {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__value,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ClassItem")
}
fn visit_str<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 {
"value" => Ok(__FieldTag::__value),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::custom_class::ClassItem;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ClassItem")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__value => {
if !fields.insert(__FieldTag::__value) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for value",
));
}
result.value = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::PhraseSet {
fn deserialize<D>(deserializer: D) -> 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,
__uid,
__phrases,
__boost,
__display_name,
__state,
__create_time,
__update_time,
__delete_time,
__expire_time,
__annotations,
__etag,
__reconciling,
__kms_key_name,
__kms_key_version_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 PhraseSet")
}
fn visit_str<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),
"uid" => Ok(__FieldTag::__uid),
"phrases" => Ok(__FieldTag::__phrases),
"boost" => Ok(__FieldTag::__boost),
"displayName" => Ok(__FieldTag::__display_name),
"display_name" => Ok(__FieldTag::__display_name),
"state" => Ok(__FieldTag::__state),
"createTime" => Ok(__FieldTag::__create_time),
"create_time" => Ok(__FieldTag::__create_time),
"updateTime" => Ok(__FieldTag::__update_time),
"update_time" => Ok(__FieldTag::__update_time),
"deleteTime" => Ok(__FieldTag::__delete_time),
"delete_time" => Ok(__FieldTag::__delete_time),
"expireTime" => Ok(__FieldTag::__expire_time),
"expire_time" => Ok(__FieldTag::__expire_time),
"annotations" => Ok(__FieldTag::__annotations),
"etag" => Ok(__FieldTag::__etag),
"reconciling" => Ok(__FieldTag::__reconciling),
"kmsKeyName" => Ok(__FieldTag::__kms_key_name),
"kms_key_name" => Ok(__FieldTag::__kms_key_name),
"kmsKeyVersionName" => Ok(__FieldTag::__kms_key_version_name),
"kms_key_version_name" => Ok(__FieldTag::__kms_key_version_name),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::PhraseSet;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct PhraseSet")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__uid => {
if !fields.insert(__FieldTag::__uid) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for uid",
));
}
result.uid = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__phrases => {
if !fields.insert(__FieldTag::__phrases) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for phrases",
));
}
result.phrases = map
.next_value::<std::option::Option<
std::vec::Vec<crate::model::phrase_set::Phrase>,
>>()?
.unwrap_or_default();
}
__FieldTag::__boost => {
if !fields.insert(__FieldTag::__boost) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for boost",
));
}
struct __With(std::option::Option<f32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F32> >::deserialize(deserializer).map(__With)
}
}
result.boost = map.next_value::<__With>()?.0.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::__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::phrase_set::State>>(
)?
.unwrap_or_default();
}
__FieldTag::__create_time => {
if !fields.insert(__FieldTag::__create_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for create_time",
));
}
result.create_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__update_time => {
if !fields.insert(__FieldTag::__update_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_time",
));
}
result.update_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__delete_time => {
if !fields.insert(__FieldTag::__delete_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for delete_time",
));
}
result.delete_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__expire_time => {
if !fields.insert(__FieldTag::__expire_time) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for expire_time",
));
}
result.expire_time =
map.next_value::<std::option::Option<wkt::Timestamp>>()?;
}
__FieldTag::__annotations => {
if !fields.insert(__FieldTag::__annotations) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for annotations",
));
}
result.annotations = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
std::string::String,
>,
>>()?
.unwrap_or_default();
}
__FieldTag::__etag => {
if !fields.insert(__FieldTag::__etag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for etag",
));
}
result.etag = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__reconciling => {
if !fields.insert(__FieldTag::__reconciling) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for reconciling",
));
}
result.reconciling = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__kms_key_name => {
if !fields.insert(__FieldTag::__kms_key_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for kms_key_name",
));
}
result.kms_key_name = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__kms_key_version_name => {
if !fields.insert(__FieldTag::__kms_key_version_name) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for kms_key_version_name",
));
}
result.kms_key_version_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::phrase_set::Phrase {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__value,
__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 Phrase")
}
fn visit_str<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 {
"value" => Ok(__FieldTag::__value),
"boost" => Ok(__FieldTag::__boost),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::phrase_set::Phrase;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct Phrase")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__value => {
if !fields.insert(__FieldTag::__value) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for value",
));
}
result.value = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__boost => {
if !fields.insert(__FieldTag::__boost) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for boost",
));
}
struct __With(std::option::Option<f32>);
impl<'de> serde::de::Deserialize<'de> for __With {
fn deserialize<D>(
deserializer: D,
) -> std::result::Result<Self, D::Error>
where
D: serde::de::Deserializer<'de>,
{
serde_with::As::< std::option::Option<wkt::internal::F32> >::deserialize(deserializer).map(__With)
}
}
result.boost = 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::CreateCustomClassRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__custom_class,
__validate_only,
__custom_class_id,
__parent,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for CreateCustomClassRequest")
}
fn visit_str<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 {
"customClass" => Ok(__FieldTag::__custom_class),
"custom_class" => Ok(__FieldTag::__custom_class),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
"customClassId" => Ok(__FieldTag::__custom_class_id),
"custom_class_id" => Ok(__FieldTag::__custom_class_id),
"parent" => Ok(__FieldTag::__parent),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CreateCustomClassRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CreateCustomClassRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__custom_class => {
if !fields.insert(__FieldTag::__custom_class) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for custom_class",
));
}
result.custom_class =
map.next_value::<std::option::Option<crate::model::CustomClass>>()?;
}
__FieldTag::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__custom_class_id => {
if !fields.insert(__FieldTag::__custom_class_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for custom_class_id",
));
}
result.custom_class_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(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::ListCustomClassesRequest {
fn deserialize<D>(deserializer: D) -> 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,
__show_deleted,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ListCustomClassesRequest")
}
fn visit_str<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),
"showDeleted" => Ok(__FieldTag::__show_deleted),
"show_deleted" => Ok(__FieldTag::__show_deleted),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListCustomClassesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListCustomClassesRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__show_deleted => {
if !fields.insert(__FieldTag::__show_deleted) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for show_deleted",
));
}
result.show_deleted = 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::ListCustomClassesResponse {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__custom_classes,
__next_page_token,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ListCustomClassesResponse")
}
fn visit_str<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 {
"customClasses" => Ok(__FieldTag::__custom_classes),
"custom_classes" => Ok(__FieldTag::__custom_classes),
"nextPageToken" => Ok(__FieldTag::__next_page_token),
"next_page_token" => Ok(__FieldTag::__next_page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListCustomClassesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListCustomClassesResponse")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__custom_classes => {
if !fields.insert(__FieldTag::__custom_classes) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for custom_classes",
));
}
result.custom_classes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::CustomClass>>>()?.unwrap_or_default();
}
__FieldTag::__next_page_token => {
if !fields.insert(__FieldTag::__next_page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for next_page_token",
));
}
result.next_page_token = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::GetCustomClassRequest {
fn deserialize<D>(deserializer: D) -> 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 GetCustomClassRequest")
}
fn visit_str<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::GetCustomClassRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetCustomClassRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::UpdateCustomClassRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__custom_class,
__update_mask,
__validate_only,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for UpdateCustomClassRequest")
}
fn visit_str<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 {
"customClass" => Ok(__FieldTag::__custom_class),
"custom_class" => Ok(__FieldTag::__custom_class),
"updateMask" => Ok(__FieldTag::__update_mask),
"update_mask" => Ok(__FieldTag::__update_mask),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::UpdateCustomClassRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct UpdateCustomClassRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__custom_class => {
if !fields.insert(__FieldTag::__custom_class) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for custom_class",
));
}
result.custom_class =
map.next_value::<std::option::Option<crate::model::CustomClass>>()?;
}
__FieldTag::__update_mask => {
if !fields.insert(__FieldTag::__update_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_mask",
));
}
result.update_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__FieldTag::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = 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::DeleteCustomClassRequest {
fn deserialize<D>(deserializer: D) -> 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,
__validate_only,
__allow_missing,
__etag,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for DeleteCustomClassRequest")
}
fn visit_str<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),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
"allowMissing" => Ok(__FieldTag::__allow_missing),
"allow_missing" => Ok(__FieldTag::__allow_missing),
"etag" => Ok(__FieldTag::__etag),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DeleteCustomClassRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DeleteCustomClassRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = map
.next_value::<std::option::Option<bool>>()?
.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::__etag => {
if !fields.insert(__FieldTag::__etag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for etag",
));
}
result.etag = 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::UndeleteCustomClassRequest {
fn deserialize<D>(deserializer: D) -> 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,
__validate_only,
__etag,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for UndeleteCustomClassRequest")
}
fn visit_str<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),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
"etag" => Ok(__FieldTag::__etag),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::UndeleteCustomClassRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct UndeleteCustomClassRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__etag => {
if !fields.insert(__FieldTag::__etag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for etag",
));
}
result.etag = 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::CreatePhraseSetRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__phrase_set,
__validate_only,
__phrase_set_id,
__parent,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for CreatePhraseSetRequest")
}
fn visit_str<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 {
"phraseSet" => Ok(__FieldTag::__phrase_set),
"phrase_set" => Ok(__FieldTag::__phrase_set),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
"phraseSetId" => Ok(__FieldTag::__phrase_set_id),
"phrase_set_id" => Ok(__FieldTag::__phrase_set_id),
"parent" => Ok(__FieldTag::__parent),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::CreatePhraseSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct CreatePhraseSetRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__phrase_set => {
if !fields.insert(__FieldTag::__phrase_set) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for phrase_set",
));
}
result.phrase_set =
map.next_value::<std::option::Option<crate::model::PhraseSet>>()?;
}
__FieldTag::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__phrase_set_id => {
if !fields.insert(__FieldTag::__phrase_set_id) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for phrase_set_id",
));
}
result.phrase_set_id = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__parent => {
if !fields.insert(__FieldTag::__parent) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for parent",
));
}
result.parent = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(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::ListPhraseSetsRequest {
fn deserialize<D>(deserializer: D) -> 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,
__show_deleted,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ListPhraseSetsRequest")
}
fn visit_str<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),
"showDeleted" => Ok(__FieldTag::__show_deleted),
"show_deleted" => Ok(__FieldTag::__show_deleted),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListPhraseSetsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListPhraseSetsRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__show_deleted => {
if !fields.insert(__FieldTag::__show_deleted) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for show_deleted",
));
}
result.show_deleted = 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::ListPhraseSetsResponse {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__phrase_sets,
__next_page_token,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ListPhraseSetsResponse")
}
fn visit_str<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 {
"phraseSets" => Ok(__FieldTag::__phrase_sets),
"phrase_sets" => Ok(__FieldTag::__phrase_sets),
"nextPageToken" => Ok(__FieldTag::__next_page_token),
"next_page_token" => Ok(__FieldTag::__next_page_token),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ListPhraseSetsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ListPhraseSetsResponse")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__phrase_sets => {
if !fields.insert(__FieldTag::__phrase_sets) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for phrase_sets",
));
}
result.phrase_sets = map.next_value::<std::option::Option<std::vec::Vec<crate::model::PhraseSet>>>()?.unwrap_or_default();
}
__FieldTag::__next_page_token => {
if !fields.insert(__FieldTag::__next_page_token) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for next_page_token",
));
}
result.next_page_token = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}
#[doc(hidden)]
impl<'de> serde::de::Deserialize<'de> for super::GetPhraseSetRequest {
fn deserialize<D>(deserializer: D) -> 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 GetPhraseSetRequest")
}
fn visit_str<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::GetPhraseSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct GetPhraseSetRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::UpdatePhraseSetRequest {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__phrase_set,
__update_mask,
__validate_only,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for UpdatePhraseSetRequest")
}
fn visit_str<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 {
"phraseSet" => Ok(__FieldTag::__phrase_set),
"phrase_set" => Ok(__FieldTag::__phrase_set),
"updateMask" => Ok(__FieldTag::__update_mask),
"update_mask" => Ok(__FieldTag::__update_mask),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::UpdatePhraseSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct UpdatePhraseSetRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__phrase_set => {
if !fields.insert(__FieldTag::__phrase_set) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for phrase_set",
));
}
result.phrase_set =
map.next_value::<std::option::Option<crate::model::PhraseSet>>()?;
}
__FieldTag::__update_mask => {
if !fields.insert(__FieldTag::__update_mask) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for update_mask",
));
}
result.update_mask =
map.next_value::<std::option::Option<wkt::FieldMask>>()?;
}
__FieldTag::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = 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::DeletePhraseSetRequest {
fn deserialize<D>(deserializer: D) -> 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,
__validate_only,
__allow_missing,
__etag,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for DeletePhraseSetRequest")
}
fn visit_str<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),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
"allowMissing" => Ok(__FieldTag::__allow_missing),
"allow_missing" => Ok(__FieldTag::__allow_missing),
"etag" => Ok(__FieldTag::__etag),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::DeletePhraseSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct DeletePhraseSetRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = map
.next_value::<std::option::Option<bool>>()?
.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::__etag => {
if !fields.insert(__FieldTag::__etag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for etag",
));
}
result.etag = 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::UndeletePhraseSetRequest {
fn deserialize<D>(deserializer: D) -> 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,
__validate_only,
__etag,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for UndeletePhraseSetRequest")
}
fn visit_str<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),
"validateOnly" => Ok(__FieldTag::__validate_only),
"validate_only" => Ok(__FieldTag::__validate_only),
"etag" => Ok(__FieldTag::__etag),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::UndeletePhraseSetRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct UndeletePhraseSetRequest")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__validate_only => {
if !fields.insert(__FieldTag::__validate_only) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for validate_only",
));
}
result.validate_only = map
.next_value::<std::option::Option<bool>>()?
.unwrap_or_default();
}
__FieldTag::__etag => {
if !fields.insert(__FieldTag::__etag) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for etag",
));
}
result.etag = 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::ModelFeature {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__feature,
__release_state,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ModelFeature")
}
fn visit_str<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 {
"feature" => Ok(__FieldTag::__feature),
"releaseState" => Ok(__FieldTag::__release_state),
"release_state" => Ok(__FieldTag::__release_state),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ModelFeature;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ModelFeature")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__feature => {
if !fields.insert(__FieldTag::__feature) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for feature",
));
}
result.feature = map
.next_value::<std::option::Option<std::string::String>>()?
.unwrap_or_default();
}
__FieldTag::__release_state => {
if !fields.insert(__FieldTag::__release_state) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for release_state",
));
}
result.release_state = 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::ModelFeatures {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__model_feature,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ModelFeatures")
}
fn visit_str<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 {
"modelFeature" => Ok(__FieldTag::__model_feature),
"model_feature" => Ok(__FieldTag::__model_feature),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ModelFeatures;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ModelFeatures")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__model_feature => {
if !fields.insert(__FieldTag::__model_feature) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for model_feature",
));
}
result.model_feature = map.next_value::<std::option::Option<std::vec::Vec<crate::model::ModelFeature>>>()?.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::ModelMetadata {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__model_features,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for ModelMetadata")
}
fn visit_str<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 {
"modelFeatures" => Ok(__FieldTag::__model_features),
"model_features" => Ok(__FieldTag::__model_features),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::ModelMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct ModelMetadata")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__model_features => {
if !fields.insert(__FieldTag::__model_features) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for model_features",
));
}
result.model_features = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
crate::model::ModelFeatures,
>,
>>()?
.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::LanguageMetadata {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__models,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for LanguageMetadata")
}
fn visit_str<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 {
"models" => Ok(__FieldTag::__models),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::LanguageMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LanguageMetadata")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__models => {
if !fields.insert(__FieldTag::__models) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for models",
));
}
result.models = map
.next_value::<std::option::Option<
std::collections::HashMap<
std::string::String,
crate::model::ModelMetadata,
>,
>>()?
.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::AccessMetadata {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__constraint_type,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for AccessMetadata")
}
fn visit_str<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 {
"constraintType" => Ok(__FieldTag::__constraint_type),
"constraint_type" => Ok(__FieldTag::__constraint_type),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::AccessMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct AccessMetadata")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__constraint_type => {
if !fields.insert(__FieldTag::__constraint_type) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for constraint_type",
));
}
result.constraint_type =
map.next_value::<std::option::Option<
crate::model::access_metadata::ConstraintType,
>>()?
.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::LocationsMetadata {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(PartialEq, Eq, Hash)]
enum __FieldTag {
__languages,
__access_metadata,
Unknown(std::string::String),
}
impl<'de> serde::de::Deserialize<'de> for __FieldTag {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = __FieldTag;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a field name for LocationsMetadata")
}
fn visit_str<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 {
"languages" => Ok(__FieldTag::__languages),
"accessMetadata" => Ok(__FieldTag::__access_metadata),
"access_metadata" => Ok(__FieldTag::__access_metadata),
_ => Ok(__FieldTag::Unknown(value.to_string())),
}
}
}
deserializer.deserialize_identifier(Visitor)
}
}
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = super::LocationsMetadata;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("struct LocationsMetadata")
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<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::__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<crate::model::LanguageMetadata>>(
)?;
}
__FieldTag::__access_metadata => {
if !fields.insert(__FieldTag::__access_metadata) {
return std::result::Result::Err(A::Error::duplicate_field(
"multiple values for access_metadata",
));
}
result.access_metadata = map
.next_value::<std::option::Option<crate::model::AccessMetadata>>(
)?;
}
__FieldTag::Unknown(key) => {
let value = map.next_value::<serde_json::Value>()?;
result._unknown_fields.insert(key, value);
}
}
}
std::result::Result::Ok(result)
}
}
deserializer.deserialize_any(Visitor)
}
}