Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36 (ignoring whitespace)

Files changed:

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

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_put_item_input_attribute_map<'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_put_request.rs

@@ -1,0 +60,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_put_request(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::PutRequest,
    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         -
    Ok(())
   20         -
}
   21         -
   22         -
pub(crate) fn de_put_request<'a, I>(
   23         -
    tokens: &mut ::std::iter::Peekable<I>,
   24         -
    _value: &'a [u8],
   25         -
) -> ::std::result::Result<Option<crate::types::PutRequest>, ::aws_smithy_json::deserialize::error::DeserializeError>
   26         -
where
   27         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   28         -
{
   29         -
    match tokens.next().transpose()? {
   30         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   31         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   32         -
            #[allow(unused_mut)]
   33         -
            let mut builder = crate::types::builders::PutRequestBuilder::default();
   34         -
            loop {
   35         -
                match tokens.next().transpose()? {
   36         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   37         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   38         -
                        "Item" => {
   39         -
                            builder = builder.set_item(
   40         -
                                crate::protocol_serde::shape_put_item_input_attribute_map::de_put_item_input_attribute_map(tokens, _value)?,
   41         -
                            );
   42         -
                        }
   43         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   44         -
                    },
   45         -
                    other => {
   46         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   47         -
                            "expected object key or end object, found: {other:?}"
   48         -
                        )))
   49         -
                    }
   50         -
                }
   51         -
            }
   52         -
            Ok(Some(crate::serde_util::put_request_correct_errors(builder).build().map_err(|err| {
   53         -
                ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err)
   54         -
            })?))
   55         -
        }
   56         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   57         -
            "expected start object or null",
   58         -
        )),
   59         -
    }
   60         -
}

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

@@ -1,0 +172,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_query_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::query::QueryOutput, crate::operation::query::QueryError> {
    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::query::QueryError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::query::QueryError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "InternalServerError" => crate::operation::query::QueryError::InternalServerError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::query::QueryError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                output.build()
   28         -
            };
   29         -
            if tmp.message.is_none() {
   30         -
                tmp.message = _error_message;
   31         -
            }
   32         -
            tmp
   33         -
        }),
   34         -
        "InvalidEndpointException" => crate::operation::query::QueryError::InvalidEndpointError({
   35         -
            #[allow(unused_mut)]
   36         -
            let mut tmp = {
   37         -
                #[allow(unused_mut)]
   38         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   39         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   40         -
                    .map_err(crate::operation::query::QueryError::unhandled)?;
   41         -
                let output = output.meta(generic);
   42         -
                output.build()
   43         -
            };
   44         -
            if tmp.message.is_none() {
   45         -
                tmp.message = _error_message;
   46         -
            }
   47         -
            tmp
   48         -
        }),
   49         -
        "ProvisionedThroughputExceededException" => {
   50         -
            crate::operation::query::QueryError::ProvisionedThroughputExceededError({
   51         -
                #[allow(unused_mut)]
   52         -
                let mut tmp = {
   53         -
                    #[allow(unused_mut)]
   54         -
                    let mut output = crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder::default();
   55         -
                    output = crate::protocol_serde::shape_provisioned_throughput_exceeded_exception::de_provisioned_throughput_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::query::QueryError::unhandled)?;
   56         -
                    let output = output.meta(generic);
   57         -
                    output.build()
   58         -
                };
   59         -
                if tmp.message.is_none() {
   60         -
                    tmp.message = _error_message;
   61         -
                }
   62         -
                tmp
   63         -
            })
   64         -
        }
   65         -
        "RequestLimitExceeded" => crate::operation::query::QueryError::RequestLimitExceeded({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::RequestLimitExceededBuilder::default();
   70         -
                output = crate::protocol_serde::shape_request_limit_exceeded::de_request_limit_exceeded_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::query::QueryError::unhandled)?;
   72         -
                let output = output.meta(generic);
   73         -
                output.build()
   74         -
            };
   75         -
            if tmp.message.is_none() {
   76         -
                tmp.message = _error_message;
   77         -
            }
   78         -
            tmp
   79         -
        }),
   80         -
        "ResourceNotFoundException" => crate::operation::query::QueryError::ResourceNotFoundError({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   85         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   86         -
                    .map_err(crate::operation::query::QueryError::unhandled)?;
   87         -
                let output = output.meta(generic);
   88         -
                output.build()
   89         -
            };
   90         -
            if tmp.message.is_none() {
   91         -
                tmp.message = _error_message;
   92         -
            }
   93         -
            tmp
   94         -
        }),
   95         -
        _ => crate::operation::query::QueryError::generic(generic),
   96         -
    })
   97         -
}
   98         -
   99         -
#[allow(clippy::unnecessary_wraps)]
  100         -
pub fn de_query_http_response(
  101         -
    _response_status: u16,
  102         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  103         -
    _response_body: &[u8],
  104         -
) -> std::result::Result<crate::operation::query::QueryOutput, crate::operation::query::QueryError> {
  105         -
    Ok({
  106         -
        #[allow(unused_mut)]
  107         -
        let mut output = crate::operation::query::builders::QueryOutputBuilder::default();
  108         -
        output = crate::protocol_serde::shape_query::de_query(_response_body, output).map_err(crate::operation::query::QueryError::unhandled)?;
  109         -
        output.build()
  110         -
    })
  111         -
}
  112         -
  113         -
pub fn ser_query_input(
  114         -
    input: &crate::operation::query::QueryInput,
  115         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  116         -
    let mut out = String::new();
  117         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  118         -
    crate::protocol_serde::shape_query_input::ser_query_input_input(&mut object, input)?;
  119         -
    object.finish();
  120         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  121         -
}
  122         -
  123         -
pub(crate) fn de_query(
  124         -
    _value: &[u8],
  125         -
    mut builder: crate::operation::query::builders::QueryOutputBuilder,
  126         -
) -> ::std::result::Result<crate::operation::query::builders::QueryOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
  127         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  128         -
    let tokens = &mut tokens_owned;
  129         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  130         -
    loop {
  131         -
        match tokens.next().transpose()? {
  132         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  133         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  134         -
                "Items" => {
  135         -
                    builder = builder.set_items(crate::protocol_serde::shape_item_list::de_item_list(tokens, _value)?);
  136         -
                }
  137         -
                "Count" => {
  138         -
                    builder = builder.set_count(
  139         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  140         -
                            .map(i32::try_from)
  141         -
                            .transpose()?,
  142         -
                    );
  143         -
                }
  144         -
                "ScannedCount" => {
  145         -
                    builder = builder.set_scanned_count(
  146         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  147         -
                            .map(i32::try_from)
  148         -
                            .transpose()?,
  149         -
                    );
  150         -
                }
  151         -
                "LastEvaluatedKey" => {
  152         -
                    builder = builder.set_last_evaluated_key(crate::protocol_serde::shape_key::de_key(tokens, _value)?);
  153         -
                }
  154         -
                "ConsumedCapacity" => {
  155         -
                    builder = builder.set_consumed_capacity(crate::protocol_serde::shape_consumed_capacity::de_consumed_capacity(tokens, _value)?);
  156         -
                }
  157         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  158         -
            },
  159         -
            other => {
  160         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  161         -
                    "expected object key or end object, found: {other:?}"
  162         -
                )))
  163         -
            }
  164         -
        }
  165         -
    }
  166         -
    if tokens.next().is_some() {
  167         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  168         -
            "found more JSON tokens after completing parsing",
  169         -
        ));
  170         -
    }
  171         -
    Ok(builder)
  172         -
}

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

@@ -1,0 +114,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_query_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::query::QueryInput,
    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.index_name {
   10         -
        object.key("IndexName").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.select {
   13         -
        object.key("Select").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.attributes_to_get {
   16         -
        let mut array_5 = object.key("AttributesToGet").start_array();
   17         -
        for item_6 in var_4 {
   18         -
            {
   19         -
                array_5.value().string(item_6.as_str());
   20         -
            }
   21         -
        }
   22         -
        array_5.finish();
   23         -
    }
   24         -
    if let Some(var_7) = &input.limit {
   25         -
        object.key("Limit").number(
   26         -
            #[allow(clippy::useless_conversion)]
   27         -
            ::aws_smithy_types::Number::NegInt((*var_7).into()),
   28         -
        );
   29         -
    }
   30         -
    if let Some(var_8) = &input.consistent_read {
   31         -
        object.key("ConsistentRead").boolean(*var_8);
   32         -
    }
   33         -
    if let Some(var_9) = &input.key_conditions {
   34         -
        #[allow(unused_mut)]
   35         -
        let mut object_10 = object.key("KeyConditions").start_object();
   36         -
        for (key_11, value_12) in var_9 {
   37         -
            {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut object_13 = object_10.key(key_11.as_str()).start_object();
   40         -
                crate::protocol_serde::shape_condition::ser_condition(&mut object_13, value_12)?;
   41         -
                object_13.finish();
   42         -
            }
   43         -
        }
   44         -
        object_10.finish();
   45         -
    }
   46         -
    if let Some(var_14) = &input.query_filter {
   47         -
        #[allow(unused_mut)]
   48         -
        let mut object_15 = object.key("QueryFilter").start_object();
   49         -
        for (key_16, value_17) in var_14 {
   50         -
            {
   51         -
                #[allow(unused_mut)]
   52         -
                let mut object_18 = object_15.key(key_16.as_str()).start_object();
   53         -
                crate::protocol_serde::shape_condition::ser_condition(&mut object_18, value_17)?;
   54         -
                object_18.finish();
   55         -
            }
   56         -
        }
   57         -
        object_15.finish();
   58         -
    }
   59         -
    if let Some(var_19) = &input.conditional_operator {
   60         -
        object.key("ConditionalOperator").string(var_19.as_str());
   61         -
    }
   62         -
    if let Some(var_20) = &input.scan_index_forward {
   63         -
        object.key("ScanIndexForward").boolean(*var_20);
   64         -
    }
   65         -
    if let Some(var_21) = &input.exclusive_start_key {
   66         -
        #[allow(unused_mut)]
   67         -
        let mut object_22 = object.key("ExclusiveStartKey").start_object();
   68         -
        for (key_23, value_24) in var_21 {
   69         -
            {
   70         -
                #[allow(unused_mut)]
   71         -
                let mut object_25 = object_22.key(key_23.as_str()).start_object();
   72         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_25, value_24)?;
   73         -
                object_25.finish();
   74         -
            }
   75         -
        }
   76         -
        object_22.finish();
   77         -
    }
   78         -
    if let Some(var_26) = &input.return_consumed_capacity {
   79         -
        object.key("ReturnConsumedCapacity").string(var_26.as_str());
   80         -
    }
   81         -
    if let Some(var_27) = &input.projection_expression {
   82         -
        object.key("ProjectionExpression").string(var_27.as_str());
   83         -
    }
   84         -
    if let Some(var_28) = &input.filter_expression {
   85         -
        object.key("FilterExpression").string(var_28.as_str());
   86         -
    }
   87         -
    if let Some(var_29) = &input.key_condition_expression {
   88         -
        object.key("KeyConditionExpression").string(var_29.as_str());
   89         -
    }
   90         -
    if let Some(var_30) = &input.expression_attribute_names {
   91         -
        #[allow(unused_mut)]
   92         -
        let mut object_31 = object.key("ExpressionAttributeNames").start_object();
   93         -
        for (key_32, value_33) in var_30 {
   94         -
            {
   95         -
                object_31.key(key_32.as_str()).string(value_33.as_str());
   96         -
            }
   97         -
        }
   98         -
        object_31.finish();
   99         -
    }
  100         -
    if let Some(var_34) = &input.expression_attribute_values {
  101         -
        #[allow(unused_mut)]
  102         -
        let mut object_35 = object.key("ExpressionAttributeValues").start_object();
  103         -
        for (key_36, value_37) in var_34 {
  104         -
            {
  105         -
                #[allow(unused_mut)]
  106         -
                let mut object_38 = object_35.key(key_36.as_str()).start_object();
  107         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_38, value_37)?;
  108         -
                object_38.finish();
  109         -
            }
  110         -
        }
  111         -
        object_35.finish();
  112         -
    }
  113         -
    Ok(())
  114         -
}

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

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

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

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

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

@@ -1,0 +62,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_replica_auto_scaling_description<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ReplicaAutoScalingDescription>, ::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::ReplicaAutoScalingDescriptionBuilder::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         -
                        "RegionName" => {
   19         -
                            builder = builder.set_region_name(
   20         -
                                ::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         -
                            );
   24         -
                        }
   25         -
                        "GlobalSecondaryIndexes" => {
   26         -
                            builder = builder.set_global_secondary_indexes(
   27         -
                                    crate::protocol_serde::shape_replica_global_secondary_index_auto_scaling_description_list::de_replica_global_secondary_index_auto_scaling_description_list(tokens, _value)?
   28         -
                                );
   29         -
                        }
   30         -
                        "ReplicaProvisionedReadCapacityAutoScalingSettings" => {
   31         -
                            builder = builder.set_replica_provisioned_read_capacity_auto_scaling_settings(
   32         -
                                crate::protocol_serde::shape_auto_scaling_settings_description::de_auto_scaling_settings_description(tokens, _value)?,
   33         -
                            );
   34         -
                        }
   35         -
                        "ReplicaProvisionedWriteCapacityAutoScalingSettings" => {
   36         -
                            builder = builder.set_replica_provisioned_write_capacity_auto_scaling_settings(
   37         -
                                crate::protocol_serde::shape_auto_scaling_settings_description::de_auto_scaling_settings_description(tokens, _value)?,
   38         -
                            );
   39         -
                        }
   40         -
                        "ReplicaStatus" => {
   41         -
                            builder = builder.set_replica_status(
   42         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   43         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::ReplicaStatus::from(u.as_ref())))
   44         -
                                    .transpose()?,
   45         -
                            );
   46         -
                        }
   47         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   48         -
                    },
   49         -
                    other => {
   50         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   51         -
                            "expected object key or end object, found: {other:?}"
   52         -
                        )))
   53         -
                    }
   54         -
                }
   55         -
            }
   56         -
            Ok(Some(builder.build()))
   57         -
        }
   58         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   59         -
            "expected start object or null",
   60         -
        )),
   61         -
    }
   62         -
}

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

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

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

@@ -1,0 +28,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_replica_auto_scaling_update(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ReplicaAutoScalingUpdate,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("RegionName").string(input.region_name.as_str());
    8         -
    }
    9         -
    if let Some(var_1) = &input.replica_global_secondary_index_updates {
   10         -
        let mut array_2 = object.key("ReplicaGlobalSecondaryIndexUpdates").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_replica_global_secondary_index_auto_scaling_update::ser_replica_global_secondary_index_auto_scaling_update(&mut object_4, item_3)?;
   16         -
                object_4.finish();
   17         -
            }
   18         -
        }
   19         -
        array_2.finish();
   20         -
    }
   21         -
    if let Some(var_5) = &input.replica_provisioned_read_capacity_auto_scaling_update {
   22         -
        #[allow(unused_mut)]
   23         -
        let mut object_6 = object.key("ReplicaProvisionedReadCapacityAutoScalingUpdate").start_object();
   24         -
        crate::protocol_serde::shape_auto_scaling_settings_update::ser_auto_scaling_settings_update(&mut object_6, var_5)?;
   25         -
        object_6.finish();
   26         -
    }
   27         -
    Ok(())
   28         -
}

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

@@ -1,0 +84,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_replica_description<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ReplicaDescription>, ::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::ReplicaDescriptionBuilder::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         -
                        "RegionName" => {
   19         -
                            builder = builder.set_region_name(
   20         -
                                ::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         -
                            );
   24         -
                        }
   25         -
                        "ReplicaStatus" => {
   26         -
                            builder = builder.set_replica_status(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::ReplicaStatus::from(u.as_ref())))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        "ReplicaStatusDescription" => {
   33         -
                            builder = builder.set_replica_status_description(
   34         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   35         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   36         -
                                    .transpose()?,
   37         -
                            );
   38         -
                        }
   39         -
                        "ReplicaStatusPercentProgress" => {
   40         -
                            builder = builder.set_replica_status_percent_progress(
   41         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   42         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   43         -
                                    .transpose()?,
   44         -
                            );
   45         -
                        }
   46         -
                        "KMSMasterKeyId" => {
   47         -
                            builder = builder.set_kms_master_key_id(
   48         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   49         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   50         -
                                    .transpose()?,
   51         -
                            );
   52         -
                        }
   53         -
                        "ProvisionedThroughputOverride" => {
   54         -
                            builder = builder.set_provisioned_throughput_override(
   55         -
                                crate::protocol_serde::shape_provisioned_throughput_override::de_provisioned_throughput_override(tokens, _value)?,
   56         -
                            );
   57         -
                        }
   58         -
                        "GlobalSecondaryIndexes" => {
   59         -
                            builder = builder.set_global_secondary_indexes(
   60         -
                                    crate::protocol_serde::shape_replica_global_secondary_index_description_list::de_replica_global_secondary_index_description_list(tokens, _value)?
   61         -
                                );
   62         -
                        }
   63         -
                        "ReplicaInaccessibleDateTime" => {
   64         -
                            builder = builder.set_replica_inaccessible_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   65         -
                                tokens.next(),
   66         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   67         -
                            )?);
   68         -
                        }
   69         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   70         -
                    },
   71         -
                    other => {
   72         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   73         -
                            "expected object key or end object, found: {other:?}"
   74         -
                        )))
   75         -
                    }
   76         -
                }
   77         -
            }
   78         -
            Ok(Some(builder.build()))
   79         -
        }
   80         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   81         -
            "expected start object or null",
   82         -
        )),
   83         -
    }
   84         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_replica_description_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::ReplicaDescription>>, ::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_replica_description::de_replica_description(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_replica_global_secondary_index.rs

@@ -1,0 +16,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_replica_global_secondary_index(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ReplicaGlobalSecondaryIndex,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("IndexName").string(input.index_name.as_str());
    8         -
    }
    9         -
    if let Some(var_1) = &input.provisioned_throughput_override {
   10         -
        #[allow(unused_mut)]
   11         -
        let mut object_2 = object.key("ProvisionedThroughputOverride").start_object();
   12         -
        crate::protocol_serde::shape_provisioned_throughput_override::ser_provisioned_throughput_override(&mut object_2, var_1)?;
   13         -
        object_2.finish();
   14         -
    }
   15         -
    Ok(())
   16         -
}

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

@@ -1,0 +60,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_replica_global_secondary_index_auto_scaling_description<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<crate::types::ReplicaGlobalSecondaryIndexAutoScalingDescription>,
    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         -
            #[allow(unused_mut)]
   16         -
            let mut builder = crate::types::builders::ReplicaGlobalSecondaryIndexAutoScalingDescriptionBuilder::default();
   17         -
            loop {
   18         -
                match tokens.next().transpose()? {
   19         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   20         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   21         -
                        "IndexName" => {
   22         -
                            builder = builder.set_index_name(
   23         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   24         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   25         -
                                    .transpose()?,
   26         -
                            );
   27         -
                        }
   28         -
                        "IndexStatus" => {
   29         -
                            builder = builder.set_index_status(
   30         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   31         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::IndexStatus::from(u.as_ref())))
   32         -
                                    .transpose()?,
   33         -
                            );
   34         -
                        }
   35         -
                        "ProvisionedReadCapacityAutoScalingSettings" => {
   36         -
                            builder = builder.set_provisioned_read_capacity_auto_scaling_settings(
   37         -
                                crate::protocol_serde::shape_auto_scaling_settings_description::de_auto_scaling_settings_description(tokens, _value)?,
   38         -
                            );
   39         -
                        }
   40         -
                        "ProvisionedWriteCapacityAutoScalingSettings" => {
   41         -
                            builder = builder.set_provisioned_write_capacity_auto_scaling_settings(
   42         -
                                crate::protocol_serde::shape_auto_scaling_settings_description::de_auto_scaling_settings_description(tokens, _value)?,
   43         -
                            );
   44         -
                        }
   45         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   46         -
                    },
   47         -
                    other => {
   48         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   49         -
                            "expected object key or end object, found: {other:?}"
   50         -
                        )))
   51         -
                    }
   52         -
                }
   53         -
            }
   54         -
            Ok(Some(builder.build()))
   55         -
        }
   56         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   57         -
            "expected start object or null",
   58         -
        )),
   59         -
    }
   60         -
}

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

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

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

@@ -1,0 +16,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_replica_global_secondary_index_auto_scaling_update(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ReplicaGlobalSecondaryIndexAutoScalingUpdate,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.index_name {
    7         -
        object.key("IndexName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.provisioned_read_capacity_auto_scaling_update {
   10         -
        #[allow(unused_mut)]
   11         -
        let mut object_3 = object.key("ProvisionedReadCapacityAutoScalingUpdate").start_object();
   12         -
        crate::protocol_serde::shape_auto_scaling_settings_update::ser_auto_scaling_settings_update(&mut object_3, var_2)?;
   13         -
        object_3.finish();
   14         -
    }
   15         -
    Ok(())
   16         -
}

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

@@ -1,0 +45,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_replica_global_secondary_index_description<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ReplicaGlobalSecondaryIndexDescription>, ::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::ReplicaGlobalSecondaryIndexDescriptionBuilder::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         -
                        "IndexName" => {
   19         -
                            builder = builder.set_index_name(
   20         -
                                ::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         -
                            );
   24         -
                        }
   25         -
                        "ProvisionedThroughputOverride" => {
   26         -
                            builder = builder.set_provisioned_throughput_override(
   27         -
                                crate::protocol_serde::shape_provisioned_throughput_override::de_provisioned_throughput_override(tokens, _value)?,
   28         -
                            );
   29         -
                        }
   30         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   31         -
                    },
   32         -
                    other => {
   33         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   34         -
                            "expected object key or end object, found: {other:?}"
   35         -
                        )))
   36         -
                    }
   37         -
                }
   38         -
            }
   39         -
            Ok(Some(builder.build()))
   40         -
        }
   41         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   42         -
            "expected start object or null",
   43         -
        )),
   44         -
    }
   45         -
}