aws-sdk-firehose 1.100.0

AWS SDK for Amazon Kinesis Firehose
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub(crate) fn de_amazonopensearchservice_destination_description<'a, I>(
    tokens: &mut ::std::iter::Peekable<I>,
) -> ::std::result::Result<Option<crate::types::AmazonopensearchserviceDestinationDescription>, ::aws_smithy_json::deserialize::error::DeserializeError>
where
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
{
    match tokens.next().transpose()? {
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
            #[allow(unused_mut)]
            let mut builder = crate::types::builders::AmazonopensearchserviceDestinationDescriptionBuilder::default();
            loop {
                match tokens.next().transpose()? {
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
                        "RoleARN" => {
                            builder = builder.set_role_arn(
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
                                    .transpose()?,
                            );
                        }
                        "DomainARN" => {
                            builder = builder.set_domain_arn(
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
                                    .transpose()?,
                            );
                        }
                        "ClusterEndpoint" => {
                            builder = builder.set_cluster_endpoint(
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
                                    .transpose()?,
                            );
                        }
                        "IndexName" => {
                            builder = builder.set_index_name(
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
                                    .transpose()?,
                            );
                        }
                        "TypeName" => {
                            builder = builder.set_type_name(
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
                                    .transpose()?,
                            );
                        }
                        "IndexRotationPeriod" => {
                            builder = builder.set_index_rotation_period(
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
                                    .map(|s| {
                                        s.to_unescaped()
                                            .map(|u| crate::types::AmazonopensearchserviceIndexRotationPeriod::from(u.as_ref()))
                                    })
                                    .transpose()?,
                            );
                        }
                        "BufferingHints" => {
                            builder = builder.set_buffering_hints(
                                crate::protocol_serde::shape_amazonopensearchservice_buffering_hints::de_amazonopensearchservice_buffering_hints(
                                    tokens,
                                )?,
                            );
                        }
                        "RetryOptions" => {
                            builder = builder.set_retry_options(
                                crate::protocol_serde::shape_amazonopensearchservice_retry_options::de_amazonopensearchservice_retry_options(tokens)?,
                            );
                        }
                        "S3BackupMode" => {
                            builder = builder.set_s3_backup_mode(
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
                                    .map(|s| {
                                        s.to_unescaped()
                                            .map(|u| crate::types::AmazonopensearchserviceS3BackupMode::from(u.as_ref()))
                                    })
                                    .transpose()?,
                            );
                        }
                        "S3DestinationDescription" => {
                            builder = builder.set_s3_destination_description(
                                crate::protocol_serde::shape_s3_destination_description::de_s3_destination_description(tokens)?,
                            );
                        }
                        "ProcessingConfiguration" => {
                            builder = builder.set_processing_configuration(
                                crate::protocol_serde::shape_processing_configuration::de_processing_configuration(tokens)?,
                            );
                        }
                        "CloudWatchLoggingOptions" => {
                            builder = builder.set_cloud_watch_logging_options(
                                crate::protocol_serde::shape_cloud_watch_logging_options::de_cloud_watch_logging_options(tokens)?,
                            );
                        }
                        "VpcConfigurationDescription" => {
                            builder = builder.set_vpc_configuration_description(
                                crate::protocol_serde::shape_vpc_configuration_description::de_vpc_configuration_description(tokens)?,
                            );
                        }
                        "DocumentIdOptions" => {
                            builder =
                                builder.set_document_id_options(crate::protocol_serde::shape_document_id_options::de_document_id_options(tokens)?);
                        }
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
                    },
                    other => {
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
                            "expected object key or end object, found: {other:?}"
                        )))
                    }
                }
            }
            Ok(Some(builder.build()))
        }
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
            "expected start object or null",
        )),
    }
}