Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36

Files changed:

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

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

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

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

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

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

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

@@ -1,0 +153,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_delete_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::delete_table::DeleteTableOutput, crate::operation::delete_table::DeleteTableError> {
    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::delete_table::DeleteTableError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::delete_table::DeleteTableError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "InternalServerError" => crate::operation::delete_table::DeleteTableError::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::delete_table::DeleteTableError::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::delete_table::DeleteTableError::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::delete_table::DeleteTableError::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::delete_table::DeleteTableError::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::delete_table::DeleteTableError::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::delete_table::DeleteTableError::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::delete_table::DeleteTableError::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::delete_table::DeleteTableError::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::delete_table::DeleteTableError::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::delete_table::DeleteTableError::generic(generic),
   95         -
    })
   96         -
}
   97         -
   98         -
#[allow(clippy::unnecessary_wraps)]
   99         -
pub fn de_delete_table_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::delete_table::DeleteTableOutput, crate::operation::delete_table::DeleteTableError> {
  104         -
    Ok({
  105         -
        #[allow(unused_mut)]
  106         -
        let mut output = crate::operation::delete_table::builders::DeleteTableOutputBuilder::default();
  107         -
        output = crate::protocol_serde::shape_delete_table::de_delete_table(_response_body, output)
  108         -
            .map_err(crate::operation::delete_table::DeleteTableError::unhandled)?;
  109         -
        output.build()
  110         -
    })
  111         -
}
  112         -
  113         -
pub fn ser_delete_table_input(
  114         -
    input: &crate::operation::delete_table::DeleteTableInput,
  115         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  116         -
    let mut out = String::new();
  117         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  118         -
    crate::protocol_serde::shape_delete_table_input::ser_delete_table_input_input(&mut object, input)?;
  119         -
    object.finish();
  120         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  121         -
}
  122         -
  123         -
pub(crate) fn de_delete_table(
  124         -
    _value: &[u8],
  125         -
    mut builder: crate::operation::delete_table::builders::DeleteTableOutputBuilder,
  126         -
) -> ::std::result::Result<crate::operation::delete_table::builders::DeleteTableOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
  127         -
{
  128         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  129         -
    let tokens = &mut tokens_owned;
  130         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  131         -
    loop {
  132         -
        match tokens.next().transpose()? {
  133         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  134         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  135         -
                "TableDescription" => {
  136         -
                    builder = builder.set_table_description(crate::protocol_serde::shape_table_description::de_table_description(tokens, _value)?);
  137         -
                }
  138         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  139         -
            },
  140         -
            other => {
  141         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  142         -
                    "expected object key or end object, found: {other:?}"
  143         -
                )))
  144         -
            }
  145         -
        }
  146         -
    }
  147         -
    if tokens.next().is_some() {
  148         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  149         -
            "found more JSON tokens after completing parsing",
  150         -
        ));
  151         -
    }
  152         -
    Ok(builder)
  153         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_delete_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_delete_table_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::delete_table::DeleteTableInput,
    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_backup.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_backup_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_backup::DescribeBackupOutput, crate::operation::describe_backup::DescribeBackupError> {
    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_backup::DescribeBackupError::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_backup::DescribeBackupError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "BackupNotFoundException" => crate::operation::describe_backup::DescribeBackupError::BackupNotFoundError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::BackupNotFoundErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_backup_not_found_exception::de_backup_not_found_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::describe_backup::DescribeBackupError::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         -
        "InternalServerError" => crate::operation::describe_backup::DescribeBackupError::InternalServerError({
   35         -
            #[allow(unused_mut)]
   36         -
            let mut tmp = {
   37         -
                #[allow(unused_mut)]
   38         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   39         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   40         -
                    .map_err(crate::operation::describe_backup::DescribeBackupError::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         -
        "InvalidEndpointException" => crate::operation::describe_backup::DescribeBackupError::InvalidEndpointError({
   50         -
            #[allow(unused_mut)]
   51         -
            let mut tmp = {
   52         -
                #[allow(unused_mut)]
   53         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   54         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   55         -
                    .map_err(crate::operation::describe_backup::DescribeBackupError::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_backup::DescribeBackupError::generic(generic),
   65         -
    })
   66         -
}
   67         -
   68         -
#[allow(clippy::unnecessary_wraps)]
   69         -
pub fn de_describe_backup_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_backup::DescribeBackupOutput, crate::operation::describe_backup::DescribeBackupError> {
   74         -
    Ok({
   75         -
        #[allow(unused_mut)]
   76         -
        let mut output = crate::operation::describe_backup::builders::DescribeBackupOutputBuilder::default();
   77         -
        output = crate::protocol_serde::shape_describe_backup::de_describe_backup(_response_body, output)
   78         -
            .map_err(crate::operation::describe_backup::DescribeBackupError::unhandled)?;
   79         -
        output.build()
   80         -
    })
   81         -
}
   82         -
   83         -
pub fn ser_describe_backup_input(
   84         -
    input: &crate::operation::describe_backup::DescribeBackupInput,
   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_backup_input::ser_describe_backup_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_backup(
   94         -
    _value: &[u8],
   95         -
    mut builder: crate::operation::describe_backup::builders::DescribeBackupOutputBuilder,
   96         -
) -> ::std::result::Result<
   97         -
    crate::operation::describe_backup::builders::DescribeBackupOutputBuilder,
   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         -
                "BackupDescription" => {
  108         -
                    builder = builder.set_backup_description(crate::protocol_serde::shape_backup_description::de_backup_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_backup_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_backup_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_backup::DescribeBackupInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.backup_arn {
    7         -
        object.key("BackupArn").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

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

@@ -1,0 +137,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_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::describe_continuous_backups::DescribeContinuousBackupsOutput,
    9         -
    crate::operation::describe_continuous_backups::DescribeContinuousBackupsError,
   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_continuous_backups::DescribeContinuousBackupsError::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::describe_continuous_backups::DescribeContinuousBackupsError::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::describe_continuous_backups::DescribeContinuousBackupsError::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::describe_continuous_backups::DescribeContinuousBackupsError::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         -
        "InvalidEndpointException" => crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::InvalidEndpointError({
   42         -
            #[allow(unused_mut)]
   43         -
            let mut tmp = {
   44         -
                #[allow(unused_mut)]
   45         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   46         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   47         -
                    .map_err(crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::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         -
        "TableNotFoundException" => crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::TableNotFoundError({
   57         -
            #[allow(unused_mut)]
   58         -
            let mut tmp = {
   59         -
                #[allow(unused_mut)]
   60         -
                let mut output = crate::types::error::builders::TableNotFoundErrorBuilder::default();
   61         -
                output = crate::protocol_serde::shape_table_not_found_exception::de_table_not_found_exception_json_err(_response_body, output)
   62         -
                    .map_err(crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::unhandled)?;
   63         -
                let output = output.meta(generic);
   64         -
                output.build()
   65         -
            };
   66         -
            if tmp.message.is_none() {
   67         -
                tmp.message = _error_message;
   68         -
            }
   69         -
            tmp
   70         -
        }),
   71         -
        _ => crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::generic(generic),
   72         -
    })
   73         -
}
   74         -
   75         -
#[allow(clippy::unnecessary_wraps)]
   76         -
pub fn de_describe_continuous_backups_http_response(
   77         -
    _response_status: u16,
   78         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   79         -
    _response_body: &[u8],
   80         -
) -> std::result::Result<
   81         -
    crate::operation::describe_continuous_backups::DescribeContinuousBackupsOutput,
   82         -
    crate::operation::describe_continuous_backups::DescribeContinuousBackupsError,
   83         -
> {
   84         -
    Ok({
   85         -
        #[allow(unused_mut)]
   86         -
        let mut output = crate::operation::describe_continuous_backups::builders::DescribeContinuousBackupsOutputBuilder::default();
   87         -
        output = crate::protocol_serde::shape_describe_continuous_backups::de_describe_continuous_backups(_response_body, output)
   88         -
            .map_err(crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::unhandled)?;
   89         -
        output.build()
   90         -
    })
   91         -
}
   92         -
   93         -
pub fn ser_describe_continuous_backups_input(
   94         -
    input: &crate::operation::describe_continuous_backups::DescribeContinuousBackupsInput,
   95         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   96         -
    let mut out = String::new();
   97         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   98         -
    crate::protocol_serde::shape_describe_continuous_backups_input::ser_describe_continuous_backups_input_input(&mut object, input)?;
   99         -
    object.finish();
  100         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  101         -
}
  102         -
  103         -
pub(crate) fn de_describe_continuous_backups(
  104         -
    _value: &[u8],
  105         -
    mut builder: crate::operation::describe_continuous_backups::builders::DescribeContinuousBackupsOutputBuilder,
  106         -
) -> ::std::result::Result<
  107         -
    crate::operation::describe_continuous_backups::builders::DescribeContinuousBackupsOutputBuilder,
  108         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  109         -
> {
  110         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  111         -
    let tokens = &mut tokens_owned;
  112         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  113         -
    loop {
  114         -
        match tokens.next().transpose()? {
  115         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  116         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  117         -
                "ContinuousBackupsDescription" => {
  118         -
                    builder = builder.set_continuous_backups_description(
  119         -
                        crate::protocol_serde::shape_continuous_backups_description::de_continuous_backups_description(tokens, _value)?,
  120         -
                    );
  121         -
                }
  122         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  123         -
            },
  124         -
            other => {
  125         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  126         -
                    "expected object key or end object, found: {other:?}"
  127         -
                )))
  128         -
            }
  129         -
        }
  130         -
    }
  131         -
    if tokens.next().is_some() {
  132         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  133         -
            "found more JSON tokens after completing parsing",
  134         -
        ));
  135         -
    }
  136         -
    Ok(builder)
  137         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_describe_continuous_backups_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_continuous_backups_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_continuous_backups::DescribeContinuousBackupsInput,
    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_contributor_insights.rs

@@ -1,0 +148,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_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::describe_contributor_insights::DescribeContributorInsightsOutput,
    9         -
    crate::operation::describe_contributor_insights::DescribeContributorInsightsError,
   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_contributor_insights::DescribeContributorInsightsError::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_contributor_insights::DescribeContributorInsightsError::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_contributor_insights::DescribeContributorInsightsError::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_contributor_insights::DescribeContributorInsightsError::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" => crate::operation::describe_contributor_insights::DescribeContributorInsightsError::ResourceNotFoundError({
   38         -
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   42         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   43         -
                    .map_err(crate::operation::describe_contributor_insights::DescribeContributorInsightsError::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         -
        _ => crate::operation::describe_contributor_insights::DescribeContributorInsightsError::generic(generic),
   53         -
    })
   54         -
}
   55         -
   56         -
#[allow(clippy::unnecessary_wraps)]
   57         -
pub fn de_describe_contributor_insights_http_response(
   58         -
    _response_status: u16,
   59         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   60         -
    _response_body: &[u8],
   61         -
) -> std::result::Result<
   62         -
    crate::operation::describe_contributor_insights::DescribeContributorInsightsOutput,
   63         -
    crate::operation::describe_contributor_insights::DescribeContributorInsightsError,
   64         -
> {
   65         -
    Ok({
   66         -
        #[allow(unused_mut)]
   67         -
        let mut output = crate::operation::describe_contributor_insights::builders::DescribeContributorInsightsOutputBuilder::default();
   68         -
        output = crate::protocol_serde::shape_describe_contributor_insights::de_describe_contributor_insights(_response_body, output)
   69         -
            .map_err(crate::operation::describe_contributor_insights::DescribeContributorInsightsError::unhandled)?;
   70         -
        output.build()
   71         -
    })
   72         -
}
   73         -
   74         -
pub fn ser_describe_contributor_insights_input(
   75         -
    input: &crate::operation::describe_contributor_insights::DescribeContributorInsightsInput,
   76         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   77         -
    let mut out = String::new();
   78         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   79         -
    crate::protocol_serde::shape_describe_contributor_insights_input::ser_describe_contributor_insights_input_input(&mut object, input)?;
   80         -
    object.finish();
   81         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   82         -
}
   83         -
   84         -
pub(crate) fn de_describe_contributor_insights(
   85         -
    _value: &[u8],
   86         -
    mut builder: crate::operation::describe_contributor_insights::builders::DescribeContributorInsightsOutputBuilder,
   87         -
) -> ::std::result::Result<
   88         -
    crate::operation::describe_contributor_insights::builders::DescribeContributorInsightsOutputBuilder,
   89         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   90         -
> {
   91         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   92         -
    let tokens = &mut tokens_owned;
   93         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   94         -
    loop {
   95         -
        match tokens.next().transpose()? {
   96         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   97         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   98         -
                "TableName" => {
   99         -
                    builder = builder.set_table_name(
  100         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  101         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  102         -
                            .transpose()?,
  103         -
                    );
  104         -
                }
  105         -
                "IndexName" => {
  106         -
                    builder = builder.set_index_name(
  107         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  108         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  109         -
                            .transpose()?,
  110         -
                    );
  111         -
                }
  112         -
                "ContributorInsightsRuleList" => {
  113         -
                    builder = builder.set_contributor_insights_rule_list(
  114         -
                        crate::protocol_serde::shape_contributor_insights_rule_list::de_contributor_insights_rule_list(tokens, _value)?,
  115         -
                    );
  116         -
                }
  117         -
                "ContributorInsightsStatus" => {
  118         -
                    builder = builder.set_contributor_insights_status(
  119         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  120         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::ContributorInsightsStatus::from(u.as_ref())))
  121         -
                            .transpose()?,
  122         -
                    );
  123         -
                }
  124         -
                "LastUpdateDateTime" => {
  125         -
                    builder = builder.set_last_update_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  126         -
                        tokens.next(),
  127         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
  128         -
                    )?);
  129         -
                }
  130         -
                "FailureException" => {
  131         -
                    builder = builder.set_failure_exception(crate::protocol_serde::shape_failure_exception::de_failure_exception(tokens, _value)?);
  132         -
                }
  133         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  134         -
            },
  135         -
            other => {
  136         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  137         -
                    "expected object key or end object, found: {other:?}"
  138         -
                )))
  139         -
            }
  140         -
        }
  141         -
    }
  142         -
    if tokens.next().is_some() {
  143         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  144         -
            "found more JSON tokens after completing parsing",
  145         -
        ));
  146         -
    }
  147         -
    Ok(builder)
  148         -
}

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

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

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

@@ -1,0 +72,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_endpoints_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_endpoints::DescribeEndpointsOutput, crate::operation::describe_endpoints::DescribeEndpointsError>
    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::describe_endpoints::DescribeEndpointsError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    Err(crate::operation::describe_endpoints::DescribeEndpointsError::generic(generic))
   14         -
}
   15         -
   16         -
#[allow(clippy::unnecessary_wraps)]
   17         -
pub fn de_describe_endpoints_http_response(
   18         -
    _response_status: u16,
   19         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   20         -
    _response_body: &[u8],
   21         -
) -> std::result::Result<crate::operation::describe_endpoints::DescribeEndpointsOutput, crate::operation::describe_endpoints::DescribeEndpointsError>
   22         -
{
   23         -
    Ok({
   24         -
        #[allow(unused_mut)]
   25         -
        let mut output = crate::operation::describe_endpoints::builders::DescribeEndpointsOutputBuilder::default();
   26         -
        output = crate::protocol_serde::shape_describe_endpoints::de_describe_endpoints(_response_body, output)
   27         -
            .map_err(crate::operation::describe_endpoints::DescribeEndpointsError::unhandled)?;
   28         -
        crate::serde_util::describe_endpoints_output_output_correct_errors(output)
   29         -
            .build()
   30         -
            .map_err(crate::operation::describe_endpoints::DescribeEndpointsError::unhandled)?
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_describe_endpoints_input(
   35         -
    _input: &crate::operation::describe_endpoints::DescribeEndpointsInput,
   36         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   38         -
}
   39         -
   40         -
pub(crate) fn de_describe_endpoints(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::describe_endpoints::builders::DescribeEndpointsOutputBuilder,
   43         -
) -> ::std::result::Result<
   44         -
    crate::operation::describe_endpoints::builders::DescribeEndpointsOutputBuilder,
   45         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   46         -
> {
   47         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   48         -
    let tokens = &mut tokens_owned;
   49         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   50         -
    loop {
   51         -
        match tokens.next().transpose()? {
   52         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   53         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   54         -
                "Endpoints" => {
   55         -
                    builder = builder.set_endpoints(crate::protocol_serde::shape_endpoints::de_endpoints(tokens, _value)?);
   56         -
                }
   57         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   58         -
            },
   59         -
            other => {
   60         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   61         -
                    "expected object key or end object, found: {other:?}"
   62         -
                )))
   63         -
            }
   64         -
        }
   65         -
    }
   66         -
    if tokens.next().is_some() {
   67         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   68         -
            "found more JSON tokens after completing parsing",
   69         -
        ));
   70         -
    }
   71         -
    Ok(builder)
   72         -
}

tmp-codegen-diff/codegen-client-test/dynamo/rust-client-codegen/src/protocol_serde/shape_describe_export.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_export_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_export::DescribeExportOutput, crate::operation::describe_export::DescribeExportError> {
    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_export::DescribeExportError::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_export::DescribeExportError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "ExportNotFoundException" => crate::operation::describe_export::DescribeExportError::ExportNotFoundError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::ExportNotFoundErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_export_not_found_exception::de_export_not_found_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::describe_export::DescribeExportError::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         -
        "InternalServerError" => crate::operation::describe_export::DescribeExportError::InternalServerError({
   35         -
            #[allow(unused_mut)]
   36         -
            let mut tmp = {
   37         -
                #[allow(unused_mut)]
   38         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   39         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   40         -
                    .map_err(crate::operation::describe_export::DescribeExportError::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::describe_export::DescribeExportError::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::describe_export::DescribeExportError::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_export::DescribeExportError::generic(generic),
   65         -
    })
   66         -
}
   67         -
   68         -
#[allow(clippy::unnecessary_wraps)]
   69         -
pub fn de_describe_export_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_export::DescribeExportOutput, crate::operation::describe_export::DescribeExportError> {
   74         -
    Ok({
   75         -
        #[allow(unused_mut)]
   76         -
        let mut output = crate::operation::describe_export::builders::DescribeExportOutputBuilder::default();
   77         -
        output = crate::protocol_serde::shape_describe_export::de_describe_export(_response_body, output)
   78         -
            .map_err(crate::operation::describe_export::DescribeExportError::unhandled)?;
   79         -
        output.build()
   80         -
    })
   81         -
}
   82         -
   83         -
pub fn ser_describe_export_input(
   84         -
    input: &crate::operation::describe_export::DescribeExportInput,
   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_export_input::ser_describe_export_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_export(
   94         -
    _value: &[u8],
   95         -
    mut builder: crate::operation::describe_export::builders::DescribeExportOutputBuilder,
   96         -
) -> ::std::result::Result<
   97         -
    crate::operation::describe_export::builders::DescribeExportOutputBuilder,
   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         -
                "ExportDescription" => {
  108         -
                    builder = builder.set_export_description(crate::protocol_serde::shape_export_description::de_export_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_export_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_export_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_export::DescribeExportInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.export_arn {
    7         -
        object.key("ExportArn").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.rs

@@ -1,0 +136,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_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::DescribeGlobalTableOutput,
    9         -
    crate::operation::describe_global_table::DescribeGlobalTableError,
   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::DescribeGlobalTableError::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::DescribeGlobalTableError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "GlobalTableNotFoundException" => crate::operation::describe_global_table::DescribeGlobalTableError::GlobalTableNotFoundError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::GlobalTableNotFoundErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_global_table_not_found_exception::de_global_table_not_found_exception_json_err(
   28         -
                    _response_body,
   29         -
                    output,
   30         -
                )
   31         -
                .map_err(crate::operation::describe_global_table::DescribeGlobalTableError::unhandled)?;
   32         -
                let output = output.meta(generic);
   33         -
                output.build()
   34         -
            };
   35         -
            if tmp.message.is_none() {
   36         -
                tmp.message = _error_message;
   37         -
            }
   38         -
            tmp
   39         -
        }),
   40         -
        "InternalServerError" => crate::operation::describe_global_table::DescribeGlobalTableError::InternalServerError({
   41         -
            #[allow(unused_mut)]
   42         -
            let mut tmp = {
   43         -
                #[allow(unused_mut)]
   44         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   45         -
                output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
   46         -
                    .map_err(crate::operation::describe_global_table::DescribeGlobalTableError::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         -
        "InvalidEndpointException" => crate::operation::describe_global_table::DescribeGlobalTableError::InvalidEndpointError({
   56         -
            #[allow(unused_mut)]
   57         -
            let mut tmp = {
   58         -
                #[allow(unused_mut)]
   59         -
                let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
   60         -
                output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
   61         -
                    .map_err(crate::operation::describe_global_table::DescribeGlobalTableError::unhandled)?;
   62         -
                let output = output.meta(generic);
   63         -
                output.build()
   64         -
            };
   65         -
            if tmp.message.is_none() {
   66         -
                tmp.message = _error_message;
   67         -
            }
   68         -
            tmp
   69         -
        }),
   70         -
        _ => crate::operation::describe_global_table::DescribeGlobalTableError::generic(generic),
   71         -
    })
   72         -
}
   73         -
   74         -
#[allow(clippy::unnecessary_wraps)]
   75         -
pub fn de_describe_global_table_http_response(
   76         -
    _response_status: u16,
   77         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   78         -
    _response_body: &[u8],
   79         -
) -> std::result::Result<
   80         -
    crate::operation::describe_global_table::DescribeGlobalTableOutput,
   81         -
    crate::operation::describe_global_table::DescribeGlobalTableError,
   82         -
> {
   83         -
    Ok({
   84         -
        #[allow(unused_mut)]
   85         -
        let mut output = crate::operation::describe_global_table::builders::DescribeGlobalTableOutputBuilder::default();
   86         -
        output = crate::protocol_serde::shape_describe_global_table::de_describe_global_table(_response_body, output)
   87         -
            .map_err(crate::operation::describe_global_table::DescribeGlobalTableError::unhandled)?;
   88         -
        output.build()
   89         -
    })
   90         -
}
   91         -
   92         -
pub fn ser_describe_global_table_input(
   93         -
    input: &crate::operation::describe_global_table::DescribeGlobalTableInput,
   94         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   95         -
    let mut out = String::new();
   96         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   97         -
    crate::protocol_serde::shape_describe_global_table_input::ser_describe_global_table_input_input(&mut object, input)?;
   98         -
    object.finish();
   99         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  100         -
}
  101         -
  102         -
pub(crate) fn de_describe_global_table(
  103         -
    _value: &[u8],
  104         -
    mut builder: crate::operation::describe_global_table::builders::DescribeGlobalTableOutputBuilder,
  105         -
) -> ::std::result::Result<
  106         -
    crate::operation::describe_global_table::builders::DescribeGlobalTableOutputBuilder,
  107         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  108         -
> {
  109         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  110         -
    let tokens = &mut tokens_owned;
  111         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  112         -
    loop {
  113         -
        match tokens.next().transpose()? {
  114         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  115         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  116         -
                "GlobalTableDescription" => {
  117         -
                    builder = builder.set_global_table_description(
  118         -
                        crate::protocol_serde::shape_global_table_description::de_global_table_description(tokens, _value)?,
  119         -
                    );
  120         -
                }
  121         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  122         -
            },
  123         -
            other => {
  124         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  125         -
                    "expected object key or end object, found: {other:?}"
  126         -
                )))
  127         -
            }
  128         -
        }
  129         -
    }
  130         -
    if tokens.next().is_some() {
  131         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  132         -
            "found more JSON tokens after completing parsing",
  133         -
        ));
  134         -
    }
  135         -
    Ok(builder)
  136         -
}