Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_global_table_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_global_table::DescribeGlobalTableInput,
    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         -
    Ok(())
   10         -
}

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

@@ -1,0 +145,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_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::describe_global_table_settings::DescribeGlobalTableSettingsOutput,
    9         -
    crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError,
   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::describe_global_table_settings::DescribeGlobalTableSettingsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "GlobalTableNotFoundException" => {
   23         -
            crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError::GlobalTableNotFoundError({
   24         -
                #[allow(unused_mut)]
   25         -
                let mut tmp = {
   26         -
                    #[allow(unused_mut)]
   27         -
                    let mut output = crate::types::error::builders::GlobalTableNotFoundErrorBuilder::default();
   28         -
                    output = crate::protocol_serde::shape_global_table_not_found_exception::de_global_table_not_found_exception_json_err(
   29         -
                        _response_body,
   30         -
                        output,
   31         -
                    )
   32         -
                    .map_err(crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError::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         -
        }
   42         -
        "InternalServerError" => crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError::InternalServerError({
   43         -
            #[allow(unused_mut)]
   44         -
            let mut tmp = {
   45         -
                #[allow(unused_mut)]
   46         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   47         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   48         -
                    .map_err(crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError::unhandled)?;
   49         -
                let output = output.meta(generic);
   50         -
                output.build()
   51         -
            };
   52         -
            if tmp.message.is_none() {
   53         -
                tmp.message = _error_message;
   54         -
            }
   55         -
            tmp
   56         -
        }),
   57         -
        "InvalidEndpointException" => crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError::InvalidEndpointError({
   58         -
            #[allow(unused_mut)]
   59         -
            let mut tmp = {
   60         -
                #[allow(unused_mut)]
   61         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   62         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   63         -
                    .map_err(crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError::unhandled)?;
   64         -
                let output = output.meta(generic);
   65         -
                output.build()
   66         -
            };
   67         -
            if tmp.message.is_none() {
   68         -
                tmp.message = _error_message;
   69         -
            }
   70         -
            tmp
   71         -
        }),
   72         -
        _ => crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError::generic(generic),
   73         -
    })
   74         -
}
   75         -
   76         -
#[allow(clippy::unnecessary_wraps)]
   77         -
pub fn de_describe_global_table_settings_http_response(
   78         -
    _response_status: u16,
   79         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   80         -
    _response_body: &[u8],
   81         -
) -> std::result::Result<
   82         -
    crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsOutput,
   83         -
    crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError,
   84         -
> {
   85         -
    Ok({
   86         -
        #[allow(unused_mut)]
   87         -
        let mut output = crate::operation::describe_global_table_settings::builders::DescribeGlobalTableSettingsOutputBuilder::default();
   88         -
        output = crate::protocol_serde::shape_describe_global_table_settings::de_describe_global_table_settings(_response_body, output)
   89         -
            .map_err(crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsError::unhandled)?;
   90         -
        output.build()
   91         -
    })
   92         -
}
   93         -
   94         -
pub fn ser_describe_global_table_settings_input(
   95         -
    input: &crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsInput,
   96         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   97         -
    let mut out = String::new();
   98         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   99         -
    crate::protocol_serde::shape_describe_global_table_settings_input::ser_describe_global_table_settings_input_input(&mut object, input)?;
  100         -
    object.finish();
  101         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  102         -
}
  103         -
  104         -
pub(crate) fn de_describe_global_table_settings(
  105         -
    _value: &[u8],
  106         -
    mut builder: crate::operation::describe_global_table_settings::builders::DescribeGlobalTableSettingsOutputBuilder,
  107         -
) -> ::std::result::Result<
  108         -
    crate::operation::describe_global_table_settings::builders::DescribeGlobalTableSettingsOutputBuilder,
  109         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  110         -
> {
  111         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  112         -
    let tokens = &mut tokens_owned;
  113         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  114         -
    loop {
  115         -
        match tokens.next().transpose()? {
  116         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  117         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  118         -
                "GlobalTableName" => {
  119         -
                    builder = builder.set_global_table_name(
  120         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  121         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  122         -
                            .transpose()?,
  123         -
                    );
  124         -
                }
  125         -
                "ReplicaSettings" => {
  126         -
                    builder = builder.set_replica_settings(
  127         -
                        crate::protocol_serde::shape_replica_settings_description_list::de_replica_settings_description_list(tokens, _value)?,
  128         -
                    );
  129         -
                }
  130         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  131         -
            },
  132         -
            other => {
  133         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  134         -
                    "expected object key or end object, found: {other:?}"
  135         -
                )))
  136         -
            }
  137         -
        }
  138         -
    }
  139         -
    if tokens.next().is_some() {
  140         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  141         -
            "found more JSON tokens after completing parsing",
  142         -
        ));
  143         -
    }
  144         -
    Ok(builder)
  145         -
}

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_global_table_settings_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_global_table_settings::DescribeGlobalTableSettingsInput,
    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         -
    Ok(())
   10         -
}

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

@@ -1,0 +152,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_kinesis_streaming_destination_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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationOutput,
    9         -
    crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError,
   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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "InternalServerError" => {
   23         -
            crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::InternalServerError({
   24         -
                #[allow(unused_mut)]
   25         -
                let mut tmp = {
   26         -
                    #[allow(unused_mut)]
   27         -
                    let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   28         -
                    output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   29         -
                        .map_err(crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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         -
        }
   39         -
        "InvalidEndpointException" => {
   40         -
            crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::InvalidEndpointError({
   41         -
                #[allow(unused_mut)]
   42         -
                let mut tmp = {
   43         -
                    #[allow(unused_mut)]
   44         -
                    let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   45         -
                    output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   46         -
                        .map_err(crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::unhandled)?;
   47         -
                    let output = output.meta(generic);
   48         -
                    output.build()
   49         -
                };
   50         -
                if tmp.message.is_none() {
   51         -
                    tmp.message = _error_message;
   52         -
                }
   53         -
                tmp
   54         -
            })
   55         -
        }
   56         -
        "ResourceNotFoundException" => {
   57         -
            crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::ResourceNotFoundError({
   58         -
                #[allow(unused_mut)]
   59         -
                let mut tmp = {
   60         -
                    #[allow(unused_mut)]
   61         -
                    let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   62         -
                    output =
   63         -
                        crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   64         -
                            .map_err(crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::unhandled)?;
   65         -
                    let output = output.meta(generic);
   66         -
                    output.build()
   67         -
                };
   68         -
                if tmp.message.is_none() {
   69         -
                    tmp.message = _error_message;
   70         -
                }
   71         -
                tmp
   72         -
            })
   73         -
        }
   74         -
        _ => crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::generic(generic),
   75         -
    })
   76         -
}
   77         -
   78         -
#[allow(clippy::unnecessary_wraps)]
   79         -
pub fn de_describe_kinesis_streaming_destination_http_response(
   80         -
    _response_status: u16,
   81         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   82         -
    _response_body: &[u8],
   83         -
) -> std::result::Result<
   84         -
    crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationOutput,
   85         -
    crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError,
   86         -
> {
   87         -
    Ok({
   88         -
        #[allow(unused_mut)]
   89         -
        let mut output =
   90         -
            crate::operation::describe_kinesis_streaming_destination::builders::DescribeKinesisStreamingDestinationOutputBuilder::default();
   91         -
        output =
   92         -
            crate::protocol_serde::shape_describe_kinesis_streaming_destination::de_describe_kinesis_streaming_destination(_response_body, output)
   93         -
                .map_err(crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::unhandled)?;
   94         -
        output.build()
   95         -
    })
   96         -
}
   97         -
   98         -
pub fn ser_describe_kinesis_streaming_destination_input(
   99         -
    input: &crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationInput,
  100         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  101         -
    let mut out = String::new();
  102         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  103         -
    crate::protocol_serde::shape_describe_kinesis_streaming_destination_input::ser_describe_kinesis_streaming_destination_input_input(
  104         -
        &mut object,
  105         -
        input,
  106         -
    )?;
  107         -
    object.finish();
  108         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  109         -
}
  110         -
  111         -
pub(crate) fn de_describe_kinesis_streaming_destination(
  112         -
    _value: &[u8],
  113         -
    mut builder: crate::operation::describe_kinesis_streaming_destination::builders::DescribeKinesisStreamingDestinationOutputBuilder,
  114         -
) -> ::std::result::Result<
  115         -
    crate::operation::describe_kinesis_streaming_destination::builders::DescribeKinesisStreamingDestinationOutputBuilder,
  116         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  117         -
> {
  118         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  119         -
    let tokens = &mut tokens_owned;
  120         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  121         -
    loop {
  122         -
        match tokens.next().transpose()? {
  123         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  124         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  125         -
                "TableName" => {
  126         -
                    builder = builder.set_table_name(
  127         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  128         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  129         -
                            .transpose()?,
  130         -
                    );
  131         -
                }
  132         -
                "KinesisDataStreamDestinations" => {
  133         -
                    builder = builder.set_kinesis_data_stream_destinations(
  134         -
                        crate::protocol_serde::shape_kinesis_data_stream_destinations::de_kinesis_data_stream_destinations(tokens, _value)?,
  135         -
                    );
  136         -
                }
  137         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  138         -
            },
  139         -
            other => {
  140         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  141         -
                    "expected object key or end object, found: {other:?}"
  142         -
                )))
  143         -
            }
  144         -
        }
  145         -
    }
  146         -
    if tokens.next().is_some() {
  147         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  148         -
            "found more JSON tokens after completing parsing",
  149         -
        ));
  150         -
    }
  151         -
    Ok(builder)
  152         -
}

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_kinesis_streaming_destination_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationInput,
    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         -
    Ok(())
   10         -
}

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

@@ -1,0 +131,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_limits_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::describe_limits::DescribeLimitsOutput, crate::operation::describe_limits::DescribeLimitsError> {
    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::describe_limits::DescribeLimitsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::describe_limits::DescribeLimitsError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "InternalServerError" => crate::operation::describe_limits::DescribeLimitsError::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::describe_limits::DescribeLimitsError::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::describe_limits::DescribeLimitsError::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::describe_limits::DescribeLimitsError::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         -
        _ => crate::operation::describe_limits::DescribeLimitsError::generic(generic),
   50         -
    })
   51         -
}
   52         -
   53         -
#[allow(clippy::unnecessary_wraps)]
   54         -
pub fn de_describe_limits_http_response(
   55         -
    _response_status: u16,
   56         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   57         -
    _response_body: &[u8],
   58         -
) -> std::result::Result<crate::operation::describe_limits::DescribeLimitsOutput, crate::operation::describe_limits::DescribeLimitsError> {
   59         -
    Ok({
   60         -
        #[allow(unused_mut)]
   61         -
        let mut output = crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder::default();
   62         -
        output = crate::protocol_serde::shape_describe_limits::de_describe_limits(_response_body, output)
   63         -
            .map_err(crate::operation::describe_limits::DescribeLimitsError::unhandled)?;
   64         -
        output.build()
   65         -
    })
   66         -
}
   67         -
   68         -
pub fn ser_describe_limits_input(
   69         -
    _input: &crate::operation::describe_limits::DescribeLimitsInput,
   70         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   71         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   72         -
}
   73         -
   74         -
pub(crate) fn de_describe_limits(
   75         -
    _value: &[u8],
   76         -
    mut builder: crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder,
   77         -
) -> ::std::result::Result<
   78         -
    crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder,
   79         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   80         -
> {
   81         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   82         -
    let tokens = &mut tokens_owned;
   83         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   84         -
    loop {
   85         -
        match tokens.next().transpose()? {
   86         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   87         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   88         -
                "AccountMaxReadCapacityUnits" => {
   89         -
                    builder = builder.set_account_max_read_capacity_units(
   90         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   91         -
                            .map(i64::try_from)
   92         -
                            .transpose()?,
   93         -
                    );
   94         -
                }
   95         -
                "AccountMaxWriteCapacityUnits" => {
   96         -
                    builder = builder.set_account_max_write_capacity_units(
   97         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   98         -
                            .map(i64::try_from)
   99         -
                            .transpose()?,
  100         -
                    );
  101         -
                }
  102         -
                "TableMaxReadCapacityUnits" => {
  103         -
                    builder = builder.set_table_max_read_capacity_units(
  104         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  105         -
                            .map(i64::try_from)
  106         -
                            .transpose()?,
  107         -
                    );
  108         -
                }
  109         -
                "TableMaxWriteCapacityUnits" => {
  110         -
                    builder = builder.set_table_max_write_capacity_units(
  111         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  112         -
                            .map(i64::try_from)
  113         -
                            .transpose()?,
  114         -
                    );
  115         -
                }
  116         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  117         -
            },
  118         -
            other => {
  119         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  120         -
                    "expected object key or end object, found: {other:?}"
  121         -
                )))
  122         -
            }
  123         -
        }
  124         -
    }
  125         -
    if tokens.next().is_some() {
  126         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  127         -
            "found more JSON tokens after completing parsing",
  128         -
        ));
  129         -
    }
  130         -
    Ok(builder)
  131         -
}

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

@@ -1,0 +125,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_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::describe_table::DescribeTableOutput, crate::operation::describe_table::DescribeTableError> {
    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::describe_table::DescribeTableError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::describe_table::DescribeTableError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "InternalServerError" => crate::operation::describe_table::DescribeTableError::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::describe_table::DescribeTableError::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::describe_table::DescribeTableError::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::describe_table::DescribeTableError::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         -
        "ResourceNotFoundException" => crate::operation::describe_table::DescribeTableError::ResourceNotFoundError({
   50         -
            #[allow(unused_mut)]
   51         -
            let mut tmp = {
   52         -
                #[allow(unused_mut)]
   53         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   54         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   55         -
                    .map_err(crate::operation::describe_table::DescribeTableError::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         -
        _ => crate::operation::describe_table::DescribeTableError::generic(generic),
   65         -
    })
   66         -
}
   67         -
   68         -
#[allow(clippy::unnecessary_wraps)]
   69         -
pub fn de_describe_table_http_response(
   70         -
    _response_status: u16,
   71         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   72         -
    _response_body: &[u8],
   73         -
) -> std::result::Result<crate::operation::describe_table::DescribeTableOutput, crate::operation::describe_table::DescribeTableError> {
   74         -
    Ok({
   75         -
        #[allow(unused_mut)]
   76         -
        let mut output = crate::operation::describe_table::builders::DescribeTableOutputBuilder::default();
   77         -
        output = crate::protocol_serde::shape_describe_table::de_describe_table(_response_body, output)
   78         -
            .map_err(crate::operation::describe_table::DescribeTableError::unhandled)?;
   79         -
        output.build()
   80         -
    })
   81         -
}
   82         -
   83         -
pub fn ser_describe_table_input(
   84         -
    input: &crate::operation::describe_table::DescribeTableInput,
   85         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   86         -
    let mut out = String::new();
   87         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   88         -
    crate::protocol_serde::shape_describe_table_input::ser_describe_table_input_input(&mut object, input)?;
   89         -
    object.finish();
   90         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   91         -
}
   92         -
   93         -
pub(crate) fn de_describe_table(
   94         -
    _value: &[u8],
   95         -
    mut builder: crate::operation::describe_table::builders::DescribeTableOutputBuilder,
   96         -
) -> ::std::result::Result<
   97         -
    crate::operation::describe_table::builders::DescribeTableOutputBuilder,
   98         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   99         -
> {
  100         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  101         -
    let tokens = &mut tokens_owned;
  102         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  103         -
    loop {
  104         -
        match tokens.next().transpose()? {
  105         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  106         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  107         -
                "Table" => {
  108         -
                    builder = builder.set_table(crate::protocol_serde::shape_table_description::de_table_description(tokens, _value)?);
  109         -
                }
  110         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  111         -
            },
  112         -
            other => {
  113         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  114         -
                    "expected object key or end object, found: {other:?}"
  115         -
                )))
  116         -
            }
  117         -
        }
  118         -
    }
  119         -
    if tokens.next().is_some() {
  120         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  121         -
            "found more JSON tokens after completing parsing",
  122         -
        ));
  123         -
    }
  124         -
    Ok(builder)
  125         -
}

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_table_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_table::DescribeTableInput,
    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         -
    Ok(())
   10         -
}

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

@@ -1,0 +121,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_table_replica_auto_scaling_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::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingOutput,
    9         -
    crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError,
   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::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "InternalServerError" => crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError::InternalServerError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
   32         -
            if tmp.message.is_none() {
   33         -
                tmp.message = _error_message;
   34         -
            }
   35         -
            tmp
   36         -
        }),
   37         -
        "ResourceNotFoundException" => {
   38         -
            crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError::ResourceNotFoundError({
   39         -
                #[allow(unused_mut)]
   40         -
                let mut tmp = {
   41         -
                    #[allow(unused_mut)]
   42         -
                    let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   43         -
                    output =
   44         -
                        crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   45         -
                            .map_err(crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError::unhandled)?;
   46         -
                    let output = output.meta(generic);
   47         -
                    output.build()
   48         -
                };
   49         -
                if tmp.message.is_none() {
   50         -
                    tmp.message = _error_message;
   51         -
                }
   52         -
                tmp
   53         -
            })
   54         -
        }
   55         -
        _ => crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError::generic(generic),
   56         -
    })
   57         -
}
   58         -
   59         -
#[allow(clippy::unnecessary_wraps)]
   60         -
pub fn de_describe_table_replica_auto_scaling_http_response(
   61         -
    _response_status: u16,
   62         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   63         -
    _response_body: &[u8],
   64         -
) -> std::result::Result<
   65         -
    crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingOutput,
   66         -
    crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError,
   67         -
> {
   68         -
    Ok({
   69         -
        #[allow(unused_mut)]
   70         -
        let mut output = crate::operation::describe_table_replica_auto_scaling::builders::DescribeTableReplicaAutoScalingOutputBuilder::default();
   71         -
        output = crate::protocol_serde::shape_describe_table_replica_auto_scaling::de_describe_table_replica_auto_scaling(_response_body, output)
   72         -
            .map_err(crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingError::unhandled)?;
   73         -
        output.build()
   74         -
    })
   75         -
}
   76         -
   77         -
pub fn ser_describe_table_replica_auto_scaling_input(
   78         -
    input: &crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingInput,
   79         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   80         -
    let mut out = String::new();
   81         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   82         -
    crate::protocol_serde::shape_describe_table_replica_auto_scaling_input::ser_describe_table_replica_auto_scaling_input_input(&mut object, input)?;
   83         -
    object.finish();
   84         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   85         -
}
   86         -
   87         -
pub(crate) fn de_describe_table_replica_auto_scaling(
   88         -
    _value: &[u8],
   89         -
    mut builder: crate::operation::describe_table_replica_auto_scaling::builders::DescribeTableReplicaAutoScalingOutputBuilder,
   90         -
) -> ::std::result::Result<
   91         -
    crate::operation::describe_table_replica_auto_scaling::builders::DescribeTableReplicaAutoScalingOutputBuilder,
   92         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   93         -
> {
   94         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   95         -
    let tokens = &mut tokens_owned;
   96         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   97         -
    loop {
   98         -
        match tokens.next().transpose()? {
   99         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  100         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  101         -
                "TableAutoScalingDescription" => {
  102         -
                    builder = builder.set_table_auto_scaling_description(
  103         -
                        crate::protocol_serde::shape_table_auto_scaling_description::de_table_auto_scaling_description(tokens, _value)?,
  104         -
                    );
  105         -
                }
  106         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  107         -
            },
  108         -
            other => {
  109         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  110         -
                    "expected object key or end object, found: {other:?}"
  111         -
                )))
  112         -
            }
  113         -
        }
  114         -
    }
  115         -
    if tokens.next().is_some() {
  116         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  117         -
            "found more JSON tokens after completing parsing",
  118         -
        ));
  119         -
    }
  120         -
    Ok(builder)
  121         -
}

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_table_replica_auto_scaling_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_table_replica_auto_scaling::DescribeTableReplicaAutoScalingInput,
    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         -
    Ok(())
   10         -
}

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

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

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_time_to_live_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_time_to_live::DescribeTimeToLiveInput,
    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         -
    Ok(())
   10         -
}

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

@@ -1,0 +194,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_disable_kinesis_streaming_destination_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::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationOutput,
    9         -
    crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError,
   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::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "InternalServerError" => {
   23         -
            crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::InternalServerError({
   24         -
                #[allow(unused_mut)]
   25         -
                let mut tmp = {
   26         -
                    #[allow(unused_mut)]
   27         -
                    let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   28         -
                    output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   29         -
                        .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::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         -
        }
   39         -
        "InvalidEndpointException" => {
   40         -
            crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::InvalidEndpointError({
   41         -
                #[allow(unused_mut)]
   42         -
                let mut tmp = {
   43         -
                    #[allow(unused_mut)]
   44         -
                    let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   45         -
                    output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   46         -
                        .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
   47         -
                    let output = output.meta(generic);
   48         -
                    output.build()
   49         -
                };
   50         -
                if tmp.message.is_none() {
   51         -
                    tmp.message = _error_message;
   52         -
                }
   53         -
                tmp
   54         -
            })
   55         -
        }
   56         -
        "LimitExceededException" => {
   57         -
            crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::LimitExceededError({
   58         -
                #[allow(unused_mut)]
   59         -
                let mut tmp = {
   60         -
                    #[allow(unused_mut)]
   61         -
                    let mut output = crate::types::error::builders::LimitExceededErrorBuilder::default();
   62         -
                    output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
   63         -
                        .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
   64         -
                    let output = output.meta(generic);
   65         -
                    output.build()
   66         -
                };
   67         -
                if tmp.message.is_none() {
   68         -
                    tmp.message = _error_message;
   69         -
                }
   70         -
                tmp
   71         -
            })
   72         -
        }
   73         -
        "ResourceInUseException" => {
   74         -
            crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::ResourceInUseError({
   75         -
                #[allow(unused_mut)]
   76         -
                let mut tmp = {
   77         -
                    #[allow(unused_mut)]
   78         -
                    let mut output = crate::types::error::builders::ResourceInUseErrorBuilder::default();
   79         -
                    output = crate::protocol_serde::shape_resource_in_use_exception::de_resource_in_use_exception_json_err(_response_body, output)
   80         -
                        .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::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         -
        }
   90         -
        "ResourceNotFoundException" => {
   91         -
            crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::ResourceNotFoundError({
   92         -
                #[allow(unused_mut)]
   93         -
                let mut tmp = {
   94         -
                    #[allow(unused_mut)]
   95         -
                    let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   96         -
                    output =
   97         -
                        crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   98         -
                            .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
   99         -
                    let output = output.meta(generic);
  100         -
                    output.build()
  101         -
                };
  102         -
                if tmp.message.is_none() {
  103         -
                    tmp.message = _error_message;
  104         -
                }
  105         -
                tmp
  106         -
            })
  107         -
        }
  108         -
        _ => crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::generic(generic),
  109         -
    })
  110         -
}
  111         -
  112         -
#[allow(clippy::unnecessary_wraps)]
  113         -
pub fn de_disable_kinesis_streaming_destination_http_response(
  114         -
    _response_status: u16,
  115         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  116         -
    _response_body: &[u8],
  117         -
) -> std::result::Result<
  118         -
    crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationOutput,
  119         -
    crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError,
  120         -
> {
  121         -
    Ok({
  122         -
        #[allow(unused_mut)]
  123         -
        let mut output =
  124         -
            crate::operation::disable_kinesis_streaming_destination::builders::DisableKinesisStreamingDestinationOutputBuilder::default();
  125         -
        output = crate::protocol_serde::shape_disable_kinesis_streaming_destination::de_disable_kinesis_streaming_destination(_response_body, output)
  126         -
            .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
  127         -
        output.build()
  128         -
    })
  129         -
}
  130         -
  131         -
pub fn ser_disable_kinesis_streaming_destination_input(
  132         -
    input: &crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationInput,
  133         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  134         -
    let mut out = String::new();
  135         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  136         -
    crate::protocol_serde::shape_disable_kinesis_streaming_destination_input::ser_disable_kinesis_streaming_destination_input_input(
  137         -
        &mut object,
  138         -
        input,
  139         -
    )?;
  140         -
    object.finish();
  141         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  142         -
}
  143         -
  144         -
pub(crate) fn de_disable_kinesis_streaming_destination(
  145         -
    _value: &[u8],
  146         -
    mut builder: crate::operation::disable_kinesis_streaming_destination::builders::DisableKinesisStreamingDestinationOutputBuilder,
  147         -
) -> ::std::result::Result<
  148         -
    crate::operation::disable_kinesis_streaming_destination::builders::DisableKinesisStreamingDestinationOutputBuilder,
  149         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  150         -
> {
  151         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  152         -
    let tokens = &mut tokens_owned;
  153         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  154         -
    loop {
  155         -
        match tokens.next().transpose()? {
  156         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  157         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  158         -
                "TableName" => {
  159         -
                    builder = builder.set_table_name(
  160         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  161         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  162         -
                            .transpose()?,
  163         -
                    );
  164         -
                }
  165         -
                "StreamArn" => {
  166         -
                    builder = builder.set_stream_arn(
  167         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  168         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  169         -
                            .transpose()?,
  170         -
                    );
  171         -
                }
  172         -
                "DestinationStatus" => {
  173         -
                    builder = builder.set_destination_status(
  174         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  175         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::DestinationStatus::from(u.as_ref())))
  176         -
                            .transpose()?,
  177         -
                    );
  178         -
                }
  179         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  180         -
            },
  181         -
            other => {
  182         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  183         -
                    "expected object key or end object, found: {other:?}"
  184         -
                )))
  185         -
            }
  186         -
        }
  187         -
    }
  188         -
    if tokens.next().is_some() {
  189         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  190         -
            "found more JSON tokens after completing parsing",
  191         -
        ));
  192         -
    }
  193         -
    Ok(builder)
  194         -
}