Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406 (ignoring whitespace)

Files changed:

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

@@ -1,0 +28,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_transact_write_items_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::transact_write_items::TransactWriteItemsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.transact_items {
    7         -
        let mut array_2 = object.key("TransactItems").start_array();
    8         -
        for item_3 in var_1 {
    9         -
            {
   10         -
                #[allow(unused_mut)]
   11         -
                let mut object_4 = array_2.value().start_object();
   12         -
                crate::protocol_serde::shape_transact_write_item::ser_transact_write_item(&mut object_4, item_3)?;
   13         -
                object_4.finish();
   14         -
            }
   15         -
        }
   16         -
        array_2.finish();
   17         -
    }
   18         -
    if let Some(var_5) = &input.return_consumed_capacity {
   19         -
        object.key("ReturnConsumedCapacity").string(var_5.as_str());
   20         -
    }
   21         -
    if let Some(var_6) = &input.return_item_collection_metrics {
   22         -
        object.key("ReturnItemCollectionMetrics").string(var_6.as_str());
   23         -
    }
   24         -
    if let Some(var_7) = &input.client_request_token {
   25         -
        object.key("ClientRequestToken").string(var_7.as_str());
   26         -
    }
   27         -
    Ok(())
   28         -
}

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

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_transaction_canceled_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::TransactionCanceledErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::TransactionCanceledErrorBuilder, ::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         -
                "CancellationReasons" => {
   21         -
                    builder = builder.set_cancellation_reasons(crate::protocol_serde::shape_cancellation_reason_list::de_cancellation_reason_list(
   22         -
                        tokens, _value,
   23         -
                    )?);
   24         -
                }
   25         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   26         -
            },
   27         -
            other => {
   28         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29         -
                    "expected object key or end object, found: {other:?}"
   30         -
                )))
   31         -
            }
   32         -
        }
   33         -
    }
   34         -
    if tokens.next().is_some() {
   35         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "found more JSON tokens after completing parsing",
   37         -
        ));
   38         -
    }
   39         -
    Ok(builder)
   40         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_transaction_conflict_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_transaction_conflict_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::TransactionConflictErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::TransactionConflictErrorBuilder, ::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_transaction_in_progress_exception.rs

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

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

@@ -1,0 +119,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_untag_resource_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::untag_resource::UntagResourceOutput, crate::operation::untag_resource::UntagResourceError> {
    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::untag_resource::UntagResourceError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::untag_resource::UntagResourceError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "InternalServerError" => crate::operation::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::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         -
        "LimitExceededException" => crate::operation::untag_resource::UntagResourceError::LimitExceededError({
   50         -
            #[allow(unused_mut)]
   51         -
            let mut tmp = {
   52         -
                #[allow(unused_mut)]
   53         -
                let mut output = crate::types::error::builders::LimitExceededErrorBuilder::default();
   54         -
                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
   55         -
                    .map_err(crate::operation::untag_resource::UntagResourceError::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         -
        "ResourceInUseException" => crate::operation::untag_resource::UntagResourceError::ResourceInUseError({
   65         -
            #[allow(unused_mut)]
   66         -
            let mut tmp = {
   67         -
                #[allow(unused_mut)]
   68         -
                let mut output = crate::types::error::builders::ResourceInUseErrorBuilder::default();
   69         -
                output = crate::protocol_serde::shape_resource_in_use_exception::de_resource_in_use_exception_json_err(_response_body, output)
   70         -
                    .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)?;
   71         -
                let output = output.meta(generic);
   72         -
                output.build()
   73         -
            };
   74         -
            if tmp.message.is_none() {
   75         -
                tmp.message = _error_message;
   76         -
            }
   77         -
            tmp
   78         -
        }),
   79         -
        "ResourceNotFoundException" => crate::operation::untag_resource::UntagResourceError::ResourceNotFoundError({
   80         -
            #[allow(unused_mut)]
   81         -
            let mut tmp = {
   82         -
                #[allow(unused_mut)]
   83         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   84         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   85         -
                    .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)?;
   86         -
                let output = output.meta(generic);
   87         -
                output.build()
   88         -
            };
   89         -
            if tmp.message.is_none() {
   90         -
                tmp.message = _error_message;
   91         -
            }
   92         -
            tmp
   93         -
        }),
   94         -
        _ => crate::operation::untag_resource::UntagResourceError::generic(generic),
   95         -
    })
   96         -
}
   97         -
   98         -
#[allow(clippy::unnecessary_wraps)]
   99         -
pub fn de_untag_resource_http_response(
  100         -
    _response_status: u16,
  101         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  102         -
    _response_body: &[u8],
  103         -
) -> std::result::Result<crate::operation::untag_resource::UntagResourceOutput, crate::operation::untag_resource::UntagResourceError> {
  104         -
    Ok({
  105         -
        #[allow(unused_mut)]
  106         -
        let mut output = crate::operation::untag_resource::builders::UntagResourceOutputBuilder::default();
  107         -
        output.build()
  108         -
    })
  109         -
}
  110         -
  111         -
pub fn ser_untag_resource_input(
  112         -
    input: &crate::operation::untag_resource::UntagResourceInput,
  113         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  114         -
    let mut out = String::new();
  115         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  116         -
    crate::protocol_serde::shape_untag_resource_input::ser_untag_resource_input_input(&mut object, input)?;
  117         -
    object.finish();
  118         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  119         -
}

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

@@ -1,0 +19,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_untag_resource_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::untag_resource::UntagResourceInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.resource_arn {
    7         -
        object.key("ResourceArn").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.tag_keys {
   10         -
        let mut array_3 = object.key("TagKeys").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         -
}

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

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

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

@@ -1,0 +158,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_update_continuous_backups_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::update_continuous_backups::UpdateContinuousBackupsOutput,
    9         -
    crate::operation::update_continuous_backups::UpdateContinuousBackupsError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::update_continuous_backups::UpdateContinuousBackupsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => {
   18         -
            return Err(crate::operation::update_continuous_backups::UpdateContinuousBackupsError::unhandled(
   19         -
                generic,
   20         -
            ))
   21         -
        }
   22         -
    };
   23         -
   24         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   25         -
    Err(match error_code {
   26         -
        "ContinuousBackupsUnavailableException" => {
   27         -
            crate::operation::update_continuous_backups::UpdateContinuousBackupsError::ContinuousBackupsUnavailableError({
   28         -
                #[allow(unused_mut)]
   29         -
                let mut tmp = {
   30         -
                    #[allow(unused_mut)]
   31         -
                    let mut output = crate::types::error::builders::ContinuousBackupsUnavailableErrorBuilder::default();
   32         -
                    output =
   33         -
                        crate::protocol_serde::shape_continuous_backups_unavailable_exception::de_continuous_backups_unavailable_exception_json_err(
   34         -
                            _response_body,
   35         -
                            output,
   36         -
                        )
   37         -
                        .map_err(crate::operation::update_continuous_backups::UpdateContinuousBackupsError::unhandled)?;
   38         -
                    let output = output.meta(generic);
   39         -
                    output.build()
   40         -
                };
   41         -
                if tmp.message.is_none() {
   42         -
                    tmp.message = _error_message;
   43         -
                }
   44         -
                tmp
   45         -
            })
   46         -
        }
   47         -
        "InternalServerError" => crate::operation::update_continuous_backups::UpdateContinuousBackupsError::InternalServerError({
   48         -
            #[allow(unused_mut)]
   49         -
            let mut tmp = {
   50         -
                #[allow(unused_mut)]
   51         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   52         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   53         -
                    .map_err(crate::operation::update_continuous_backups::UpdateContinuousBackupsError::unhandled)?;
   54         -
                let output = output.meta(generic);
   55         -
                output.build()
   56         -
            };
   57         -
            if tmp.message.is_none() {
   58         -
                tmp.message = _error_message;
   59         -
            }
   60         -
            tmp
   61         -
        }),
   62         -
        "InvalidEndpointException" => crate::operation::update_continuous_backups::UpdateContinuousBackupsError::InvalidEndpointError({
   63         -
            #[allow(unused_mut)]
   64         -
            let mut tmp = {
   65         -
                #[allow(unused_mut)]
   66         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   67         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   68         -
                    .map_err(crate::operation::update_continuous_backups::UpdateContinuousBackupsError::unhandled)?;
   69         -
                let output = output.meta(generic);
   70         -
                output.build()
   71         -
            };
   72         -
            if tmp.message.is_none() {
   73         -
                tmp.message = _error_message;
   74         -
            }
   75         -
            tmp
   76         -
        }),
   77         -
        "TableNotFoundException" => crate::operation::update_continuous_backups::UpdateContinuousBackupsError::TableNotFoundError({
   78         -
            #[allow(unused_mut)]
   79         -
            let mut tmp = {
   80         -
                #[allow(unused_mut)]
   81         -
                let mut output = crate::types::error::builders::TableNotFoundErrorBuilder::default();
   82         -
                output = crate::protocol_serde::shape_table_not_found_exception::de_table_not_found_exception_json_err(_response_body, output)
   83         -
                    .map_err(crate::operation::update_continuous_backups::UpdateContinuousBackupsError::unhandled)?;
   84         -
                let output = output.meta(generic);
   85         -
                output.build()
   86         -
            };
   87         -
            if tmp.message.is_none() {
   88         -
                tmp.message = _error_message;
   89         -
            }
   90         -
            tmp
   91         -
        }),
   92         -
        _ => crate::operation::update_continuous_backups::UpdateContinuousBackupsError::generic(generic),
   93         -
    })
   94         -
}
   95         -
   96         -
#[allow(clippy::unnecessary_wraps)]
   97         -
pub fn de_update_continuous_backups_http_response(
   98         -
    _response_status: u16,
   99         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  100         -
    _response_body: &[u8],
  101         -
) -> std::result::Result<
  102         -
    crate::operation::update_continuous_backups::UpdateContinuousBackupsOutput,
  103         -
    crate::operation::update_continuous_backups::UpdateContinuousBackupsError,
  104         -
> {
  105         -
    Ok({
  106         -
        #[allow(unused_mut)]
  107         -
        let mut output = crate::operation::update_continuous_backups::builders::UpdateContinuousBackupsOutputBuilder::default();
  108         -
        output = crate::protocol_serde::shape_update_continuous_backups::de_update_continuous_backups(_response_body, output)
  109         -
            .map_err(crate::operation::update_continuous_backups::UpdateContinuousBackupsError::unhandled)?;
  110         -
        output.build()
  111         -
    })
  112         -
}
  113         -
  114         -
pub fn ser_update_continuous_backups_input(
  115         -
    input: &crate::operation::update_continuous_backups::UpdateContinuousBackupsInput,
  116         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  117         -
    let mut out = String::new();
  118         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  119         -
    crate::protocol_serde::shape_update_continuous_backups_input::ser_update_continuous_backups_input_input(&mut object, input)?;
  120         -
    object.finish();
  121         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  122         -
}
  123         -
  124         -
pub(crate) fn de_update_continuous_backups(
  125         -
    _value: &[u8],
  126         -
    mut builder: crate::operation::update_continuous_backups::builders::UpdateContinuousBackupsOutputBuilder,
  127         -
) -> ::std::result::Result<
  128         -
    crate::operation::update_continuous_backups::builders::UpdateContinuousBackupsOutputBuilder,
  129         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  130         -
> {
  131         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  132         -
    let tokens = &mut tokens_owned;
  133         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  134         -
    loop {
  135         -
        match tokens.next().transpose()? {
  136         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  137         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  138         -
                "ContinuousBackupsDescription" => {
  139         -
                    builder = builder.set_continuous_backups_description(
  140         -
                        crate::protocol_serde::shape_continuous_backups_description::de_continuous_backups_description(tokens, _value)?,
  141         -
                    );
  142         -
                }
  143         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  144         -
            },
  145         -
            other => {
  146         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  147         -
                    "expected object key or end object, found: {other:?}"
  148         -
                )))
  149         -
            }
  150         -
        }
  151         -
    }
  152         -
    if tokens.next().is_some() {
  153         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  154         -
            "found more JSON tokens after completing parsing",
  155         -
        ));
  156         -
    }
  157         -
    Ok(builder)
  158         -
}

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

@@ -1,0 +16,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_update_continuous_backups_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::update_continuous_backups::UpdateContinuousBackupsInput,
    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.point_in_time_recovery_specification {
   10         -
        #[allow(unused_mut)]
   11         -
        let mut object_3 = object.key("PointInTimeRecoverySpecification").start_object();
   12         -
        crate::protocol_serde::shape_point_in_time_recovery_specification::ser_point_in_time_recovery_specification(&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_update_contributor_insights.rs

@@ -1,0 +138,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_update_contributor_insights_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::update_contributor_insights::UpdateContributorInsightsOutput,
    9         -
    crate::operation::update_contributor_insights::UpdateContributorInsightsError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::update_contributor_insights::UpdateContributorInsightsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => {
   18         -
            return Err(crate::operation::update_contributor_insights::UpdateContributorInsightsError::unhandled(
   19         -
                generic,
   20         -
            ))
   21         -
        }
   22         -
    };
   23         -
   24         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   25         -
    Err(match error_code {
   26         -
        "InternalServerError" => crate::operation::update_contributor_insights::UpdateContributorInsightsError::InternalServerError({
   27         -
            #[allow(unused_mut)]
   28         -
            let mut tmp = {
   29         -
                #[allow(unused_mut)]
   30         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   31         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   32         -
                    .map_err(crate::operation::update_contributor_insights::UpdateContributorInsightsError::unhandled)?;
   33         -
                let output = output.meta(generic);
   34         -
                output.build()
   35         -
            };
   36         -
            if tmp.message.is_none() {
   37         -
                tmp.message = _error_message;
   38         -
            }
   39         -
            tmp
   40         -
        }),
   41         -
        "ResourceNotFoundException" => crate::operation::update_contributor_insights::UpdateContributorInsightsError::ResourceNotFoundError({
   42         -
            #[allow(unused_mut)]
   43         -
            let mut tmp = {
   44         -
                #[allow(unused_mut)]
   45         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   46         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   47         -
                    .map_err(crate::operation::update_contributor_insights::UpdateContributorInsightsError::unhandled)?;
   48         -
                let output = output.meta(generic);
   49         -
                output.build()
   50         -
            };
   51         -
            if tmp.message.is_none() {
   52         -
                tmp.message = _error_message;
   53         -
            }
   54         -
            tmp
   55         -
        }),
   56         -
        _ => crate::operation::update_contributor_insights::UpdateContributorInsightsError::generic(generic),
   57         -
    })
   58         -
}
   59         -
   60         -
#[allow(clippy::unnecessary_wraps)]
   61         -
pub fn de_update_contributor_insights_http_response(
   62         -
    _response_status: u16,
   63         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   64         -
    _response_body: &[u8],
   65         -
) -> std::result::Result<
   66         -
    crate::operation::update_contributor_insights::UpdateContributorInsightsOutput,
   67         -
    crate::operation::update_contributor_insights::UpdateContributorInsightsError,
   68         -
> {
   69         -
    Ok({
   70         -
        #[allow(unused_mut)]
   71         -
        let mut output = crate::operation::update_contributor_insights::builders::UpdateContributorInsightsOutputBuilder::default();
   72         -
        output = crate::protocol_serde::shape_update_contributor_insights::de_update_contributor_insights(_response_body, output)
   73         -
            .map_err(crate::operation::update_contributor_insights::UpdateContributorInsightsError::unhandled)?;
   74         -
        output.build()
   75         -
    })
   76         -
}
   77         -
   78         -
pub fn ser_update_contributor_insights_input(
   79         -
    input: &crate::operation::update_contributor_insights::UpdateContributorInsightsInput,
   80         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   81         -
    let mut out = String::new();
   82         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   83         -
    crate::protocol_serde::shape_update_contributor_insights_input::ser_update_contributor_insights_input_input(&mut object, input)?;
   84         -
    object.finish();
   85         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   86         -
}
   87         -
   88         -
pub(crate) fn de_update_contributor_insights(
   89         -
    _value: &[u8],
   90         -
    mut builder: crate::operation::update_contributor_insights::builders::UpdateContributorInsightsOutputBuilder,
   91         -
) -> ::std::result::Result<
   92         -
    crate::operation::update_contributor_insights::builders::UpdateContributorInsightsOutputBuilder,
   93         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   94         -
> {
   95         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   96         -
    let tokens = &mut tokens_owned;
   97         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   98         -
    loop {
   99         -
        match tokens.next().transpose()? {
  100         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  101         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  102         -
                "TableName" => {
  103         -
                    builder = builder.set_table_name(
  104         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  105         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  106         -
                            .transpose()?,
  107         -
                    );
  108         -
                }
  109         -
                "IndexName" => {
  110         -
                    builder = builder.set_index_name(
  111         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  112         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  113         -
                            .transpose()?,
  114         -
                    );
  115         -
                }
  116         -
                "ContributorInsightsStatus" => {
  117         -
                    builder = builder.set_contributor_insights_status(
  118         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  119         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::ContributorInsightsStatus::from(u.as_ref())))
  120         -
                            .transpose()?,
  121         -
                    );
  122         -
                }
  123         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  124         -
            },
  125         -
            other => {
  126         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  127         -
                    "expected object key or end object, found: {other:?}"
  128         -
                )))
  129         -
            }
  130         -
        }
  131         -
    }
  132         -
    if tokens.next().is_some() {
  133         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  134         -
            "found more JSON tokens after completing parsing",
  135         -
        ));
  136         -
    }
  137         -
    Ok(builder)
  138         -
}

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

@@ -1,0 +16,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_update_contributor_insights_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::update_contributor_insights::UpdateContributorInsightsInput,
    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.contributor_insights_action {
   13         -
        object.key("ContributorInsightsAction").string(var_3.as_str());
   14         -
    }
   15         -
    Ok(())
   16         -
}

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

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

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

@@ -1,0 +180,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_update_global_table_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::update_global_table::UpdateGlobalTableOutput, crate::operation::update_global_table::UpdateGlobalTableError>
    8         -
{
    9         -
    #[allow(unused_mut)]
   10         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11         -
        .map_err(crate::operation::update_global_table::UpdateGlobalTableError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::update_global_table::UpdateGlobalTableError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "GlobalTableNotFoundException" => crate::operation::update_global_table::UpdateGlobalTableError::GlobalTableNotFoundError({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::GlobalTableNotFoundErrorBuilder::default();
   25         -
                output = crate::protocol_serde::shape_global_table_not_found_exception::de_global_table_not_found_exception_json_err(
   26         -
                    _response_body,
   27         -
                    output,
   28         -
                )
   29         -
                .map_err(crate::operation::update_global_table::UpdateGlobalTableError::unhandled)?;
   30         -
                let output = output.meta(generic);
   31         -
                output.build()
   32         -
            };
   33         -
            if tmp.message.is_none() {
   34         -
                tmp.message = _error_message;
   35         -
            }
   36         -
            tmp
   37         -
        }),
   38         -
        "InternalServerError" => crate::operation::update_global_table::UpdateGlobalTableError::InternalServerError({
   39         -
            #[allow(unused_mut)]
   40         -
            let mut tmp = {
   41         -
                #[allow(unused_mut)]
   42         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   43         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   44         -
                    .map_err(crate::operation::update_global_table::UpdateGlobalTableError::unhandled)?;
   45         -
                let output = output.meta(generic);
   46         -
                output.build()
   47         -
            };
   48         -
            if tmp.message.is_none() {
   49         -
                tmp.message = _error_message;
   50         -
            }
   51         -
            tmp
   52         -
        }),
   53         -
        "InvalidEndpointException" => crate::operation::update_global_table::UpdateGlobalTableError::InvalidEndpointError({
   54         -
            #[allow(unused_mut)]
   55         -
            let mut tmp = {
   56         -
                #[allow(unused_mut)]
   57         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   58         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   59         -
                    .map_err(crate::operation::update_global_table::UpdateGlobalTableError::unhandled)?;
   60         -
                let output = output.meta(generic);
   61         -
                output.build()
   62         -
            };
   63         -
            if tmp.message.is_none() {
   64         -
                tmp.message = _error_message;
   65         -
            }
   66         -
            tmp
   67         -
        }),
   68         -
        "ReplicaAlreadyExistsException" => crate::operation::update_global_table::UpdateGlobalTableError::ReplicaAlreadyExistsError({
   69         -
            #[allow(unused_mut)]
   70         -
            let mut tmp = {
   71         -
                #[allow(unused_mut)]
   72         -
                let mut output = crate::types::error::builders::ReplicaAlreadyExistsErrorBuilder::default();
   73         -
                output = crate::protocol_serde::shape_replica_already_exists_exception::de_replica_already_exists_exception_json_err(
   74         -
                    _response_body,
   75         -
                    output,
   76         -
                )
   77         -
                .map_err(crate::operation::update_global_table::UpdateGlobalTableError::unhandled)?;
   78         -
                let output = output.meta(generic);
   79         -
                output.build()
   80         -
            };
   81         -
            if tmp.message.is_none() {
   82         -
                tmp.message = _error_message;
   83         -
            }
   84         -
            tmp
   85         -
        }),
   86         -
        "ReplicaNotFoundException" => crate::operation::update_global_table::UpdateGlobalTableError::ReplicaNotFoundError({
   87         -
            #[allow(unused_mut)]
   88         -
            let mut tmp = {
   89         -
                #[allow(unused_mut)]
   90         -
                let mut output = crate::types::error::builders::ReplicaNotFoundErrorBuilder::default();
   91         -
                output = crate::protocol_serde::shape_replica_not_found_exception::de_replica_not_found_exception_json_err(_response_body, output)
   92         -
                    .map_err(crate::operation::update_global_table::UpdateGlobalTableError::unhandled)?;
   93         -
                let output = output.meta(generic);
   94         -
                output.build()
   95         -
            };
   96         -
            if tmp.message.is_none() {
   97         -
                tmp.message = _error_message;
   98         -
            }
   99         -
            tmp
  100         -
        }),
  101         -
        "TableNotFoundException" => crate::operation::update_global_table::UpdateGlobalTableError::TableNotFoundError({
  102         -
            #[allow(unused_mut)]
  103         -
            let mut tmp = {
  104         -
                #[allow(unused_mut)]
  105         -
                let mut output = crate::types::error::builders::TableNotFoundErrorBuilder::default();
  106         -
                output = crate::protocol_serde::shape_table_not_found_exception::de_table_not_found_exception_json_err(_response_body, output)
  107         -
                    .map_err(crate::operation::update_global_table::UpdateGlobalTableError::unhandled)?;
  108         -
                let output = output.meta(generic);
  109         -
                output.build()
  110         -
            };
  111         -
            if tmp.message.is_none() {
  112         -
                tmp.message = _error_message;
  113         -
            }
  114         -
            tmp
  115         -
        }),
  116         -
        _ => crate::operation::update_global_table::UpdateGlobalTableError::generic(generic),
  117         -
    })
  118         -
}
  119         -
  120         -
#[allow(clippy::unnecessary_wraps)]
  121         -
pub fn de_update_global_table_http_response(
  122         -
    _response_status: u16,
  123         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  124         -
    _response_body: &[u8],
  125         -
) -> std::result::Result<crate::operation::update_global_table::UpdateGlobalTableOutput, crate::operation::update_global_table::UpdateGlobalTableError>
  126         -
{
  127         -
    Ok({
  128         -
        #[allow(unused_mut)]
  129         -
        let mut output = crate::operation::update_global_table::builders::UpdateGlobalTableOutputBuilder::default();
  130         -
        output = crate::protocol_serde::shape_update_global_table::de_update_global_table(_response_body, output)
  131         -
            .map_err(crate::operation::update_global_table::UpdateGlobalTableError::unhandled)?;
  132         -
        output.build()
  133         -
    })
  134         -
}
  135         -
  136         -
pub fn ser_update_global_table_input(
  137         -
    input: &crate::operation::update_global_table::UpdateGlobalTableInput,
  138         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  139         -
    let mut out = String::new();
  140         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  141         -
    crate::protocol_serde::shape_update_global_table_input::ser_update_global_table_input_input(&mut object, input)?;
  142         -
    object.finish();
  143         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  144         -
}
  145         -
  146         -
pub(crate) fn de_update_global_table(
  147         -
    _value: &[u8],
  148         -
    mut builder: crate::operation::update_global_table::builders::UpdateGlobalTableOutputBuilder,
  149         -
) -> ::std::result::Result<
  150         -
    crate::operation::update_global_table::builders::UpdateGlobalTableOutputBuilder,
  151         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  152         -
> {
  153         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  154         -
    let tokens = &mut tokens_owned;
  155         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  156         -
    loop {
  157         -
        match tokens.next().transpose()? {
  158         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  159         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  160         -
                "GlobalTableDescription" => {
  161         -
                    builder = builder.set_global_table_description(
  162         -
                        crate::protocol_serde::shape_global_table_description::de_global_table_description(tokens, _value)?,
  163         -
                    );
  164         -
                }
  165         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  166         -
            },
  167         -
            other => {
  168         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  169         -
                    "expected object key or end object, found: {other:?}"
  170         -
                )))
  171         -
            }
  172         -
        }
  173         -
    }
  174         -
    if tokens.next().is_some() {
  175         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  176         -
            "found more JSON tokens after completing parsing",
  177         -
        ));
  178         -
    }
  179         -
    Ok(builder)
  180         -
}

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

@@ -1,0 +22,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_update_global_table_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::update_global_table::UpdateGlobalTableInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.global_table_name {
    7         -
        object.key("GlobalTableName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.replica_updates {
   10         -
        let mut array_3 = object.key("ReplicaUpdates").start_array();
   11         -
        for item_4 in var_2 {
   12         -
            {
   13         -
                #[allow(unused_mut)]
   14         -
                let mut object_5 = array_3.value().start_object();
   15         -
                crate::protocol_serde::shape_replica_update::ser_replica_update(&mut object_5, item_4)?;
   16         -
                object_5.finish();
   17         -
            }
   18         -
        }
   19         -
        array_3.finish();
   20         -
    }
   21         -
    Ok(())
   22         -
}

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

@@ -1,0 +207,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_update_global_table_settings_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
    9         -
    crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => {
   18         -
            return Err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled(
   19         -
                generic,
   20         -
            ))
   21         -
        }
   22         -
    };
   23         -
   24         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   25         -
    Err(match error_code {
   26         -
        "GlobalTableNotFoundException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::GlobalTableNotFoundError({
   27         -
            #[allow(unused_mut)]
   28         -
            let mut tmp = {
   29         -
                #[allow(unused_mut)]
   30         -
                let mut output = crate::types::error::builders::GlobalTableNotFoundErrorBuilder::default();
   31         -
                output = crate::protocol_serde::shape_global_table_not_found_exception::de_global_table_not_found_exception_json_err(
   32         -
                    _response_body,
   33         -
                    output,
   34         -
                )
   35         -
                .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
   36         -
                let output = output.meta(generic);
   37         -
                output.build()
   38         -
            };
   39         -
            if tmp.message.is_none() {
   40         -
                tmp.message = _error_message;
   41         -
            }
   42         -
            tmp
   43         -
        }),
   44         -
        "IndexNotFoundException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::IndexNotFoundError({
   45         -
            #[allow(unused_mut)]
   46         -
            let mut tmp = {
   47         -
                #[allow(unused_mut)]
   48         -
                let mut output = crate::types::error::builders::IndexNotFoundErrorBuilder::default();
   49         -
                output = crate::protocol_serde::shape_index_not_found_exception::de_index_not_found_exception_json_err(_response_body, output)
   50         -
                    .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
   51         -
                let output = output.meta(generic);
   52         -
                output.build()
   53         -
            };
   54         -
            if tmp.message.is_none() {
   55         -
                tmp.message = _error_message;
   56         -
            }
   57         -
            tmp
   58         -
        }),
   59         -
        "InternalServerError" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::InternalServerError({
   60         -
            #[allow(unused_mut)]
   61         -
            let mut tmp = {
   62         -
                #[allow(unused_mut)]
   63         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   64         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   65         -
                    .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
   66         -
                let output = output.meta(generic);
   67         -
                output.build()
   68         -
            };
   69         -
            if tmp.message.is_none() {
   70         -
                tmp.message = _error_message;
   71         -
            }
   72         -
            tmp
   73         -
        }),
   74         -
        "InvalidEndpointException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::InvalidEndpointError({
   75         -
            #[allow(unused_mut)]
   76         -
            let mut tmp = {
   77         -
                #[allow(unused_mut)]
   78         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   79         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   80         -
                    .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
   81         -
                let output = output.meta(generic);
   82         -
                output.build()
   83         -
            };
   84         -
            if tmp.message.is_none() {
   85         -
                tmp.message = _error_message;
   86         -
            }
   87         -
            tmp
   88         -
        }),
   89         -
        "LimitExceededException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::LimitExceededError({
   90         -
            #[allow(unused_mut)]
   91         -
            let mut tmp = {
   92         -
                #[allow(unused_mut)]
   93         -
                let mut output = crate::types::error::builders::LimitExceededErrorBuilder::default();
   94         -
                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
   95         -
                    .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
   96         -
                let output = output.meta(generic);
   97         -
                output.build()
   98         -
            };
   99         -
            if tmp.message.is_none() {
  100         -
                tmp.message = _error_message;
  101         -
            }
  102         -
            tmp
  103         -
        }),
  104         -
        "ReplicaNotFoundException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::ReplicaNotFoundError({
  105         -
            #[allow(unused_mut)]
  106         -
            let mut tmp = {
  107         -
                #[allow(unused_mut)]
  108         -
                let mut output = crate::types::error::builders::ReplicaNotFoundErrorBuilder::default();
  109         -
                output = crate::protocol_serde::shape_replica_not_found_exception::de_replica_not_found_exception_json_err(_response_body, output)
  110         -
                    .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
  111         -
                let output = output.meta(generic);
  112         -
                output.build()
  113         -
            };
  114         -
            if tmp.message.is_none() {
  115         -
                tmp.message = _error_message;
  116         -
            }
  117         -
            tmp
  118         -
        }),
  119         -
        "ResourceInUseException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::ResourceInUseError({
  120         -
            #[allow(unused_mut)]
  121         -
            let mut tmp = {
  122         -
                #[allow(unused_mut)]
  123         -
                let mut output = crate::types::error::builders::ResourceInUseErrorBuilder::default();
  124         -
                output = crate::protocol_serde::shape_resource_in_use_exception::de_resource_in_use_exception_json_err(_response_body, output)
  125         -
                    .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
  126         -
                let output = output.meta(generic);
  127         -
                output.build()
  128         -
            };
  129         -
            if tmp.message.is_none() {
  130         -
                tmp.message = _error_message;
  131         -
            }
  132         -
            tmp
  133         -
        }),
  134         -
        _ => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::generic(generic),
  135         -
    })
  136         -
}
  137         -
  138         -
#[allow(clippy::unnecessary_wraps)]
  139         -
pub fn de_update_global_table_settings_http_response(
  140         -
    _response_status: u16,
  141         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  142         -
    _response_body: &[u8],
  143         -
) -> std::result::Result<
  144         -
    crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
  145         -
    crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
  146         -
> {
  147         -
    Ok({
  148         -
        #[allow(unused_mut)]
  149         -
        let mut output = crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsOutputBuilder::default();
  150         -
        output = crate::protocol_serde::shape_update_global_table_settings::de_update_global_table_settings(_response_body, output)
  151         -
            .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
  152         -
        output.build()
  153         -
    })
  154         -
}
  155         -
  156         -
pub fn ser_update_global_table_settings_input(
  157         -
    input: &crate::operation::update_global_table_settings::UpdateGlobalTableSettingsInput,
  158         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  159         -
    let mut out = String::new();
  160         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  161         -
    crate::protocol_serde::shape_update_global_table_settings_input::ser_update_global_table_settings_input_input(&mut object, input)?;
  162         -
    object.finish();
  163         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  164         -
}
  165         -
  166         -
pub(crate) fn de_update_global_table_settings(
  167         -
    _value: &[u8],
  168         -
    mut builder: crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsOutputBuilder,
  169         -
) -> ::std::result::Result<
  170         -
    crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsOutputBuilder,
  171         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  172         -
> {
  173         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  174         -
    let tokens = &mut tokens_owned;
  175         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  176         -
    loop {
  177         -
        match tokens.next().transpose()? {
  178         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  179         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  180         -
                "GlobalTableName" => {
  181         -
                    builder = builder.set_global_table_name(
  182         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  183         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  184         -
                            .transpose()?,
  185         -
                    );
  186         -
                }
  187         -
                "ReplicaSettings" => {
  188         -
                    builder = builder.set_replica_settings(
  189         -
                        crate::protocol_serde::shape_replica_settings_description_list::de_replica_settings_description_list(tokens, _value)?,
  190         -
                    );
  191         -
                }
  192         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  193         -
            },
  194         -
            other => {
  195         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  196         -
                    "expected object key or end object, found: {other:?}"
  197         -
                )))
  198         -
            }
  199         -
        }
  200         -
    }
  201         -
    if tokens.next().is_some() {
  202         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  203         -
            "found more JSON tokens after completing parsing",
  204         -
        ));
  205         -
    }
  206         -
    Ok(builder)
  207         -
}