Client Test

Client Test

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c

Files changed:

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_map_attribute_value.rs

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_map_attribute_value<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = crate::protocol_serde::shape_attribute_value::de_attribute_value(tokens, _value)?;
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_non_key_attribute_name_list.rs

@@ -1,0 +39,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_non_key_attribute_name_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   12         -
            let mut items = Vec::new();
   13         -
            loop {
   14         -
                match tokens.peek() {
   15         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16         -
                        tokens.next().transpose().unwrap();
   17         -
                        break;
   18         -
                    }
   19         -
                    _ => {
   20         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                            .transpose()?;
   23         -
                        if let Some(value) = value {
   24         -
                            items.push(value);
   25         -
                        } else {
   26         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   27         -
                                "dense list cannot contain null values",
   28         -
                            ));
   29         -
                        }
   30         -
                    }
   31         -
                }
   32         -
            }
   33         -
            Ok(Some(items))
   34         -
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start array or null",
   37         -
        )),
   38         -
    }
   39         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_number_set_attribute_value.rs

@@ -1,0 +39,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_number_set_attribute_value<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   12         -
            let mut items = Vec::new();
   13         -
            loop {
   14         -
                match tokens.peek() {
   15         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16         -
                        tokens.next().transpose().unwrap();
   17         -
                        break;
   18         -
                    }
   19         -
                    _ => {
   20         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                            .transpose()?;
   23         -
                        if let Some(value) = value {
   24         -
                            items.push(value);
   25         -
                        } else {
   26         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   27         -
                                "dense list cannot contain null values",
   28         -
                            ));
   29         -
                        }
   30         -
                    }
   31         -
                }
   32         -
            }
   33         -
            Ok(Some(items))
   34         -
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start array or null",
   37         -
        )),
   38         -
    }
   39         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_parameterized_statement.rs

@@ -1,0 +22,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_parameterized_statement(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ParameterizedStatement,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("Statement").string(input.statement.as_str());
    8         -
    }
    9         -
    if let Some(var_1) = &input.parameters {
   10         -
        let mut array_2 = object.key("Parameters").start_array();
   11         -
        for item_3 in var_1 {
   12         -
            {
   13         -
                #[allow(unused_mut)]
   14         -
                let mut object_4 = array_2.value().start_object();
   15         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_4, item_3)?;
   16         -
                object_4.finish();
   17         -
            }
   18         -
        }
   19         -
        array_2.finish();
   20         -
    }
   21         -
    Ok(())
   22         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_parti_ql_batch_response.rs

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_parti_ql_batch_response<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::BatchStatementResponse>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   12         -
            let mut items = Vec::new();
   13         -
            loop {
   14         -
                match tokens.peek() {
   15         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16         -
                        tokens.next().transpose().unwrap();
   17         -
                        break;
   18         -
                    }
   19         -
                    _ => {
   20         -
                        let value = crate::protocol_serde::shape_batch_statement_response::de_batch_statement_response(tokens, _value)?;
   21         -
                        if let Some(value) = value {
   22         -
                            items.push(value);
   23         -
                        } else {
   24         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25         -
                                "dense list cannot contain null values",
   26         -
                            ));
   27         -
                        }
   28         -
                    }
   29         -
                }
   30         -
            }
   31         -
            Ok(Some(items))
   32         -
        }
   33         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "expected start array or null",
   35         -
        )),
   36         -
    }
   37         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_point_in_time_recovery_description.rs

@@ -1,0 +52,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_point_in_time_recovery_description<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::PointInTimeRecoveryDescription>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::PointInTimeRecoveryDescriptionBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "PointInTimeRecoveryStatus" => {
   19         -
                            builder = builder.set_point_in_time_recovery_status(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::PointInTimeRecoveryStatus::from(u.as_ref())))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "EarliestRestorableDateTime" => {
   26         -
                            builder = builder.set_earliest_restorable_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   27         -
                                tokens.next(),
   28         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   29         -
                            )?);
   30         -
                        }
   31         -
                        "LatestRestorableDateTime" => {
   32         -
                            builder = builder.set_latest_restorable_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   33         -
                                tokens.next(),
   34         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   35         -
                            )?);
   36         -
                        }
   37         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   38         -
                    },
   39         -
                    other => {
   40         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   41         -
                            "expected object key or end object, found: {other:?}"
   42         -
                        )))
   43         -
                    }
   44         -
                }
   45         -
            }
   46         -
            Ok(Some(builder.build()))
   47         -
        }
   48         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   49         -
            "expected start object or null",
   50         -
        )),
   51         -
    }
   52         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_point_in_time_recovery_specification.rs

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_point_in_time_recovery_specification(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::PointInTimeRecoverySpecification,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("PointInTimeRecoveryEnabled").boolean(input.point_in_time_recovery_enabled);
    8         -
    }
    9         -
    Ok(())
   10         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_point_in_time_recovery_unavailable_exception.rs

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_point_in_time_recovery_unavailable_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::PointInTimeRecoveryUnavailableErrorBuilder,
    5         -
) -> ::std::result::Result<
    6         -
    crate::types::error::builders::PointInTimeRecoveryUnavailableErrorBuilder,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
> {
    9         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   10         -
    let tokens = &mut tokens_owned;
   11         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   12         -
    loop {
   13         -
        match tokens.next().transpose()? {
   14         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   15         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   16         -
                "message" => {
   17         -
                    builder = builder.set_message(
   18         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   19         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   20         -
                            .transpose()?,
   21         -
                    );
   22         -
                }
   23         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   24         -
            },
   25         -
            other => {
   26         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27         -
                    "expected object key or end object, found: {other:?}"
   28         -
                )))
   29         -
            }
   30         -
        }
   31         -
    }
   32         -
    if tokens.next().is_some() {
   33         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "found more JSON tokens after completing parsing",
   35         -
        ));
   36         -
    }
   37         -
    Ok(builder)
   38         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_projection.rs

@@ -1,0 +64,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_projection(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::Projection,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.projection_type {
    7         -
        object.key("ProjectionType").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.non_key_attributes {
   10         -
        let mut array_3 = object.key("NonKeyAttributes").start_array();
   11         -
        for item_4 in var_2 {
   12         -
            {
   13         -
                array_3.value().string(item_4.as_str());
   14         -
            }
   15         -
        }
   16         -
        array_3.finish();
   17         -
    }
   18         -
    Ok(())
   19         -
}
   20         -
   21         -
pub(crate) fn de_projection<'a, I>(
   22         -
    tokens: &mut ::std::iter::Peekable<I>,
   23         -
    _value: &'a [u8],
   24         -
) -> ::std::result::Result<Option<crate::types::Projection>, ::aws_smithy_json::deserialize::error::DeserializeError>
   25         -
where
   26         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   27         -
{
   28         -
    match tokens.next().transpose()? {
   29         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   30         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   31         -
            #[allow(unused_mut)]
   32         -
            let mut builder = crate::types::builders::ProjectionBuilder::default();
   33         -
            loop {
   34         -
                match tokens.next().transpose()? {
   35         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   36         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   37         -
                        "ProjectionType" => {
   38         -
                            builder = builder.set_projection_type(
   39         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   40         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::ProjectionType::from(u.as_ref())))
   41         -
                                    .transpose()?,
   42         -
                            );
   43         -
                        }
   44         -
                        "NonKeyAttributes" => {
   45         -
                            builder = builder.set_non_key_attributes(
   46         -
                                crate::protocol_serde::shape_non_key_attribute_name_list::de_non_key_attribute_name_list(tokens, _value)?,
   47         -
                            );
   48         -
                        }
   49         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   50         -
                    },
   51         -
                    other => {
   52         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   53         -
                            "expected object key or end object, found: {other:?}"
   54         -
                        )))
   55         -
                    }
   56         -
                }
   57         -
            }
   58         -
            Ok(Some(builder.build()))
   59         -
        }
   60         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   61         -
            "expected start object or null",
   62         -
        )),
   63         -
    }
   64         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_provisioned_throughput.rs

@@ -1,0 +68,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_provisioned_throughput(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ProvisionedThroughput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("ReadCapacityUnits").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((input.read_capacity_units).into()),
   10         -
        );
   11         -
    }
   12         -
    {
   13         -
        object.key("WriteCapacityUnits").number(
   14         -
            #[allow(clippy::useless_conversion)]
   15         -
            ::aws_smithy_types::Number::NegInt((input.write_capacity_units).into()),
   16         -
        );
   17         -
    }
   18         -
    Ok(())
   19         -
}
   20         -
   21         -
pub(crate) fn de_provisioned_throughput<'a, I>(
   22         -
    tokens: &mut ::std::iter::Peekable<I>,
   23         -
    _value: &'a [u8],
   24         -
) -> ::std::result::Result<Option<crate::types::ProvisionedThroughput>, ::aws_smithy_json::deserialize::error::DeserializeError>
   25         -
where
   26         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   27         -
{
   28         -
    match tokens.next().transpose()? {
   29         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   30         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   31         -
            #[allow(unused_mut)]
   32         -
            let mut builder = crate::types::builders::ProvisionedThroughputBuilder::default();
   33         -
            loop {
   34         -
                match tokens.next().transpose()? {
   35         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   36         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   37         -
                        "ReadCapacityUnits" => {
   38         -
                            builder = builder.set_read_capacity_units(
   39         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   40         -
                                    .map(i64::try_from)
   41         -
                                    .transpose()?,
   42         -
                            );
   43         -
                        }
   44         -
                        "WriteCapacityUnits" => {
   45         -
                            builder = builder.set_write_capacity_units(
   46         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   47         -
                                    .map(i64::try_from)
   48         -
                                    .transpose()?,
   49         -
                            );
   50         -
                        }
   51         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   52         -
                    },
   53         -
                    other => {
   54         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   55         -
                            "expected object key or end object, found: {other:?}"
   56         -
                        )))
   57         -
                    }
   58         -
                }
   59         -
            }
   60         -
            Ok(Some(crate::serde_util::provisioned_throughput_correct_errors(builder).build().map_err(
   61         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
   62         -
            )?))
   63         -
        }
   64         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   65         -
            "expected start object or null",
   66         -
        )),
   67         -
    }
   68         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_provisioned_throughput_description.rs

@@ -1,0 +66,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_provisioned_throughput_description<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ProvisionedThroughputDescription>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::ProvisionedThroughputDescriptionBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "LastIncreaseDateTime" => {
   19         -
                            builder = builder.set_last_increase_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   20         -
                                tokens.next(),
   21         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   22         -
                            )?);
   23         -
                        }
   24         -
                        "LastDecreaseDateTime" => {
   25         -
                            builder = builder.set_last_decrease_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   26         -
                                tokens.next(),
   27         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   28         -
                            )?);
   29         -
                        }
   30         -
                        "NumberOfDecreasesToday" => {
   31         -
                            builder = builder.set_number_of_decreases_today(
   32         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   33         -
                                    .map(i64::try_from)
   34         -
                                    .transpose()?,
   35         -
                            );
   36         -
                        }
   37         -
                        "ReadCapacityUnits" => {
   38         -
                            builder = builder.set_read_capacity_units(
   39         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   40         -
                                    .map(i64::try_from)
   41         -
                                    .transpose()?,
   42         -
                            );
   43         -
                        }
   44         -
                        "WriteCapacityUnits" => {
   45         -
                            builder = builder.set_write_capacity_units(
   46         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   47         -
                                    .map(i64::try_from)
   48         -
                                    .transpose()?,
   49         -
                            );
   50         -
                        }
   51         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   52         -
                    },
   53         -
                    other => {
   54         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   55         -
                            "expected object key or end object, found: {other:?}"
   56         -
                        )))
   57         -
                    }
   58         -
                }
   59         -
            }
   60         -
            Ok(Some(builder.build()))
   61         -
        }
   62         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   63         -
            "expected start object or null",
   64         -
        )),
   65         -
    }
   66         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_provisioned_throughput_exceeded_exception.rs

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_provisioned_throughput_exceeded_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder,
    5         -
) -> ::std::result::Result<
    6         -
    crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
> {
    9         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   10         -
    let tokens = &mut tokens_owned;
   11         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   12         -
    loop {
   13         -
        match tokens.next().transpose()? {
   14         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   15         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   16         -
                "message" => {
   17         -
                    builder = builder.set_message(
   18         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   19         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   20         -
                            .transpose()?,
   21         -
                    );
   22         -
                }
   23         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   24         -
            },
   25         -
            other => {
   26         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27         -
                    "expected object key or end object, found: {other:?}"
   28         -
                )))
   29         -
            }
   30         -
        }
   31         -
    }
   32         -
    if tokens.next().is_some() {
   33         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "found more JSON tokens after completing parsing",
   35         -
        ));
   36         -
    }
   37         -
    Ok(builder)
   38         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_provisioned_throughput_override.rs

@@ -1,0 +53,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_provisioned_throughput_override(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ProvisionedThroughputOverride,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.read_capacity_units {
    7         -
        object.key("ReadCapacityUnits").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    Ok(())
   13         -
}
   14         -
   15         -
pub(crate) fn de_provisioned_throughput_override<'a, I>(
   16         -
    tokens: &mut ::std::iter::Peekable<I>,
   17         -
    _value: &'a [u8],
   18         -
) -> ::std::result::Result<Option<crate::types::ProvisionedThroughputOverride>, ::aws_smithy_json::deserialize::error::DeserializeError>
   19         -
where
   20         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   21         -
{
   22         -
    match tokens.next().transpose()? {
   23         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   24         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   25         -
            #[allow(unused_mut)]
   26         -
            let mut builder = crate::types::builders::ProvisionedThroughputOverrideBuilder::default();
   27         -
            loop {
   28         -
                match tokens.next().transpose()? {
   29         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   30         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   31         -
                        "ReadCapacityUnits" => {
   32         -
                            builder = builder.set_read_capacity_units(
   33         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   34         -
                                    .map(i64::try_from)
   35         -
                                    .transpose()?,
   36         -
                            );
   37         -
                        }
   38         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   39         -
                    },
   40         -
                    other => {
   41         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   42         -
                            "expected object key or end object, found: {other:?}"
   43         -
                        )))
   44         -
                    }
   45         -
                }
   46         -
            }
   47         -
            Ok(Some(builder.build()))
   48         -
        }
   49         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50         -
            "expected start object or null",
   51         -
        )),
   52         -
    }
   53         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_put.rs

@@ -1,0 +52,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_put(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::Put,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_1 = object.key("Item").start_object();
    9         -
        for (key_2, value_3) in &input.item {
   10         -
            {
   11         -
                #[allow(unused_mut)]
   12         -
                let mut object_4 = object_1.key(key_2.as_str()).start_object();
   13         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_4, value_3)?;
   14         -
                object_4.finish();
   15         -
            }
   16         -
        }
   17         -
        object_1.finish();
   18         -
    }
   19         -
    {
   20         -
        object.key("TableName").string(input.table_name.as_str());
   21         -
    }
   22         -
    if let Some(var_5) = &input.condition_expression {
   23         -
        object.key("ConditionExpression").string(var_5.as_str());
   24         -
    }
   25         -
    if let Some(var_6) = &input.expression_attribute_names {
   26         -
        #[allow(unused_mut)]
   27         -
        let mut object_7 = object.key("ExpressionAttributeNames").start_object();
   28         -
        for (key_8, value_9) in var_6 {
   29         -
            {
   30         -
                object_7.key(key_8.as_str()).string(value_9.as_str());
   31         -
            }
   32         -
        }
   33         -
        object_7.finish();
   34         -
    }
   35         -
    if let Some(var_10) = &input.expression_attribute_values {
   36         -
        #[allow(unused_mut)]
   37         -
        let mut object_11 = object.key("ExpressionAttributeValues").start_object();
   38         -
        for (key_12, value_13) in var_10 {
   39         -
            {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut object_14 = object_11.key(key_12.as_str()).start_object();
   42         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_14, value_13)?;
   43         -
                object_14.finish();
   44         -
            }
   45         -
        }
   46         -
        object_11.finish();
   47         -
    }
   48         -
    if let Some(var_15) = &input.return_values_on_condition_check_failure {
   49         -
        object.key("ReturnValuesOnConditionCheckFailure").string(var_15.as_str());
   50         -
    }
   51         -
    Ok(())
   52         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_put_item.rs

@@ -1,0 +209,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_item_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::put_item::PutItemOutput, crate::operation::put_item::PutItemError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::put_item::PutItemError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::put_item::PutItemError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "ConditionalCheckFailedException" => crate::operation::put_item::PutItemError::ConditionalCheckFailedError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::ConditionalCheckFailedErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_conditional_check_failed_exception::de_conditional_check_failed_exception_json_err(
   25         -
                    _response_body,
   26         -
                    output,
   27         -
                )
   28         -
                .map_err(crate::operation::put_item::PutItemError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
   32         -
            if tmp.message.is_none() {
   33         -
                tmp.message = _error_message;
   34         -
            }
   35         -
            tmp
   36         -
        }),
   37         -
        "InternalServerError" => crate::operation::put_item::PutItemError::InternalServerError({
   38         -
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   42         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   43         -
                    .map_err(crate::operation::put_item::PutItemError::unhandled)?;
   44         -
                let output = output.meta(generic);
   45         -
                output.build()
   46         -
            };
   47         -
            if tmp.message.is_none() {
   48         -
                tmp.message = _error_message;
   49         -
            }
   50         -
            tmp
   51         -
        }),
   52         -
        "InvalidEndpointException" => crate::operation::put_item::PutItemError::InvalidEndpointError({
   53         -
            #[allow(unused_mut)]
   54         -
            let mut tmp = {
   55         -
                #[allow(unused_mut)]
   56         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   57         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   58         -
                    .map_err(crate::operation::put_item::PutItemError::unhandled)?;
   59         -
                let output = output.meta(generic);
   60         -
                output.build()
   61         -
            };
   62         -
            if tmp.message.is_none() {
   63         -
                tmp.message = _error_message;
   64         -
            }
   65         -
            tmp
   66         -
        }),
   67         -
        "ItemCollectionSizeLimitExceededException" => crate::operation::put_item::PutItemError::ItemCollectionSizeLimitExceededError({
   68         -
            #[allow(unused_mut)]
   69         -
            let mut tmp = {
   70         -
                #[allow(unused_mut)]
   71         -
                let mut output = crate::types::error::builders::ItemCollectionSizeLimitExceededErrorBuilder::default();
   72         -
                output = crate::protocol_serde::shape_item_collection_size_limit_exceeded_exception::de_item_collection_size_limit_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::put_item::PutItemError::unhandled)?;
   73         -
                let output = output.meta(generic);
   74         -
                output.build()
   75         -
            };
   76         -
            if tmp.message.is_none() {
   77         -
                tmp.message = _error_message;
   78         -
            }
   79         -
            tmp
   80         -
        }),
   81         -
        "ProvisionedThroughputExceededException" => {
   82         -
            crate::operation::put_item::PutItemError::ProvisionedThroughputExceededError({
   83         -
                #[allow(unused_mut)]
   84         -
                let mut tmp = {
   85         -
                    #[allow(unused_mut)]
   86         -
                    let mut output = crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder::default();
   87         -
                    output = crate::protocol_serde::shape_provisioned_throughput_exceeded_exception::de_provisioned_throughput_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::put_item::PutItemError::unhandled)?;
   88         -
                    let output = output.meta(generic);
   89         -
                    output.build()
   90         -
                };
   91         -
                if tmp.message.is_none() {
   92         -
                    tmp.message = _error_message;
   93         -
                }
   94         -
                tmp
   95         -
            })
   96         -
        }
   97         -
        "RequestLimitExceeded" => crate::operation::put_item::PutItemError::RequestLimitExceeded({
   98         -
            #[allow(unused_mut)]
   99         -
            let mut tmp = {
  100         -
                #[allow(unused_mut)]
  101         -
                let mut output = crate::types::error::builders::RequestLimitExceededBuilder::default();
  102         -
                output = crate::protocol_serde::shape_request_limit_exceeded::de_request_limit_exceeded_json_err(_response_body, output)
  103         -
                    .map_err(crate::operation::put_item::PutItemError::unhandled)?;
  104         -
                let output = output.meta(generic);
  105         -
                output.build()
  106         -
            };
  107         -
            if tmp.message.is_none() {
  108         -
                tmp.message = _error_message;
  109         -
            }
  110         -
            tmp
  111         -
        }),
  112         -
        "ResourceNotFoundException" => crate::operation::put_item::PutItemError::ResourceNotFoundError({
  113         -
            #[allow(unused_mut)]
  114         -
            let mut tmp = {
  115         -
                #[allow(unused_mut)]
  116         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
  117         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
  118         -
                    .map_err(crate::operation::put_item::PutItemError::unhandled)?;
  119         -
                let output = output.meta(generic);
  120         -
                output.build()
  121         -
            };
  122         -
            if tmp.message.is_none() {
  123         -
                tmp.message = _error_message;
  124         -
            }
  125         -
            tmp
  126         -
        }),
  127         -
        "TransactionConflictException" => crate::operation::put_item::PutItemError::TransactionConflictError({
  128         -
            #[allow(unused_mut)]
  129         -
            let mut tmp = {
  130         -
                #[allow(unused_mut)]
  131         -
                let mut output = crate::types::error::builders::TransactionConflictErrorBuilder::default();
  132         -
                output =
  133         -
                    crate::protocol_serde::shape_transaction_conflict_exception::de_transaction_conflict_exception_json_err(_response_body, output)
  134         -
                        .map_err(crate::operation::put_item::PutItemError::unhandled)?;
  135         -
                let output = output.meta(generic);
  136         -
                output.build()
  137         -
            };
  138         -
            if tmp.message.is_none() {
  139         -
                tmp.message = _error_message;
  140         -
            }
  141         -
            tmp
  142         -
        }),
  143         -
        _ => crate::operation::put_item::PutItemError::generic(generic),
  144         -
    })
  145         -
}
  146         -
  147         -
#[allow(clippy::unnecessary_wraps)]
  148         -
pub fn de_put_item_http_response(
  149         -
    _response_status: u16,
  150         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  151         -
    _response_body: &[u8],
  152         -
) -> std::result::Result<crate::operation::put_item::PutItemOutput, crate::operation::put_item::PutItemError> {
  153         -
    Ok({
  154         -
        #[allow(unused_mut)]
  155         -
        let mut output = crate::operation::put_item::builders::PutItemOutputBuilder::default();
  156         -
        output = crate::protocol_serde::shape_put_item::de_put_item(_response_body, output)
  157         -
            .map_err(crate::operation::put_item::PutItemError::unhandled)?;
  158         -
        output.build()
  159         -
    })
  160         -
}
  161         -
  162         -
pub fn ser_put_item_input(
  163         -
    input: &crate::operation::put_item::PutItemInput,
  164         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  165         -
    let mut out = String::new();
  166         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  167         -
    crate::protocol_serde::shape_put_item_input::ser_put_item_input_input(&mut object, input)?;
  168         -
    object.finish();
  169         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  170         -
}
  171         -
  172         -
pub(crate) fn de_put_item(
  173         -
    _value: &[u8],
  174         -
    mut builder: crate::operation::put_item::builders::PutItemOutputBuilder,
  175         -
) -> ::std::result::Result<crate::operation::put_item::builders::PutItemOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
  176         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  177         -
    let tokens = &mut tokens_owned;
  178         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  179         -
    loop {
  180         -
        match tokens.next().transpose()? {
  181         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  182         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  183         -
                "Attributes" => {
  184         -
                    builder = builder.set_attributes(crate::protocol_serde::shape_attribute_map::de_attribute_map(tokens, _value)?);
  185         -
                }
  186         -
                "ConsumedCapacity" => {
  187         -
                    builder = builder.set_consumed_capacity(crate::protocol_serde::shape_consumed_capacity::de_consumed_capacity(tokens, _value)?);
  188         -
                }
  189         -
                "ItemCollectionMetrics" => {
  190         -
                    builder = builder.set_item_collection_metrics(crate::protocol_serde::shape_item_collection_metrics::de_item_collection_metrics(
  191         -
                        tokens, _value,
  192         -
                    )?);
  193         -
                }
  194         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  195         -
            },
  196         -
            other => {
  197         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  198         -
                    "expected object key or end object, found: {other:?}"
  199         -
                )))
  200         -
            }
  201         -
        }
  202         -
    }
  203         -
    if tokens.next().is_some() {
  204         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  205         -
            "found more JSON tokens after completing parsing",
  206         -
        ));
  207         -
    }
  208         -
    Ok(builder)
  209         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_put_item_input.rs

@@ -1,0 +74,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_put_item_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::put_item::PutItemInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.table_name {
    7         -
        object.key("TableName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.item {
   10         -
        #[allow(unused_mut)]
   11         -
        let mut object_3 = object.key("Item").start_object();
   12         -
        for (key_4, value_5) in var_2 {
   13         -
            {
   14         -
                #[allow(unused_mut)]
   15         -
                let mut object_6 = object_3.key(key_4.as_str()).start_object();
   16         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_6, value_5)?;
   17         -
                object_6.finish();
   18         -
            }
   19         -
        }
   20         -
        object_3.finish();
   21         -
    }
   22         -
    if let Some(var_7) = &input.expected {
   23         -
        #[allow(unused_mut)]
   24         -
        let mut object_8 = object.key("Expected").start_object();
   25         -
        for (key_9, value_10) in var_7 {
   26         -
            {
   27         -
                #[allow(unused_mut)]
   28         -
                let mut object_11 = object_8.key(key_9.as_str()).start_object();
   29         -
                crate::protocol_serde::shape_expected_attribute_value::ser_expected_attribute_value(&mut object_11, value_10)?;
   30         -
                object_11.finish();
   31         -
            }
   32         -
        }
   33         -
        object_8.finish();
   34         -
    }
   35         -
    if let Some(var_12) = &input.return_values {
   36         -
        object.key("ReturnValues").string(var_12.as_str());
   37         -
    }
   38         -
    if let Some(var_13) = &input.return_consumed_capacity {
   39         -
        object.key("ReturnConsumedCapacity").string(var_13.as_str());
   40         -
    }
   41         -
    if let Some(var_14) = &input.return_item_collection_metrics {
   42         -
        object.key("ReturnItemCollectionMetrics").string(var_14.as_str());
   43         -
    }
   44         -
    if let Some(var_15) = &input.conditional_operator {
   45         -
        object.key("ConditionalOperator").string(var_15.as_str());
   46         -
    }
   47         -
    if let Some(var_16) = &input.condition_expression {
   48         -
        object.key("ConditionExpression").string(var_16.as_str());
   49         -
    }
   50         -
    if let Some(var_17) = &input.expression_attribute_names {
   51         -
        #[allow(unused_mut)]
   52         -
        let mut object_18 = object.key("ExpressionAttributeNames").start_object();
   53         -
        for (key_19, value_20) in var_17 {
   54         -
            {
   55         -
                object_18.key(key_19.as_str()).string(value_20.as_str());
   56         -
            }
   57         -
        }
   58         -
        object_18.finish();
   59         -
    }
   60         -
    if let Some(var_21) = &input.expression_attribute_values {
   61         -
        #[allow(unused_mut)]
   62         -
        let mut object_22 = object.key("ExpressionAttributeValues").start_object();
   63         -
        for (key_23, value_24) in var_21 {
   64         -
            {
   65         -
                #[allow(unused_mut)]
   66         -
                let mut object_25 = object_22.key(key_23.as_str()).start_object();
   67         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_25, value_24)?;
   68         -
                object_25.finish();
   69         -
            }
   70         -
        }
   71         -
        object_22.finish();
   72         -
    }
   73         -
    Ok(())
   74         -
}