Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

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

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_disable_kinesis_streaming_destination_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationInput,
    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.stream_arn {
   10         -
        object.key("StreamArn").string(var_2.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}

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

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

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

@@ -1,0 +193,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_enable_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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationOutput,
    9         -
    crate::operation::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError,
   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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::generic(generic),
  109         -
    })
  110         -
}
  111         -
  112         -
#[allow(clippy::unnecessary_wraps)]
  113         -
pub fn de_enable_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::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationOutput,
  119         -
    crate::operation::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError,
  120         -
> {
  121         -
    Ok({
  122         -
        #[allow(unused_mut)]
  123         -
        let mut output = crate::operation::enable_kinesis_streaming_destination::builders::EnableKinesisStreamingDestinationOutputBuilder::default();
  124         -
        output = crate::protocol_serde::shape_enable_kinesis_streaming_destination::de_enable_kinesis_streaming_destination(_response_body, output)
  125         -
            .map_err(crate::operation::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationError::unhandled)?;
  126         -
        output.build()
  127         -
    })
  128         -
}
  129         -
  130         -
pub fn ser_enable_kinesis_streaming_destination_input(
  131         -
    input: &crate::operation::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationInput,
  132         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  133         -
    let mut out = String::new();
  134         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  135         -
    crate::protocol_serde::shape_enable_kinesis_streaming_destination_input::ser_enable_kinesis_streaming_destination_input_input(
  136         -
        &mut object,
  137         -
        input,
  138         -
    )?;
  139         -
    object.finish();
  140         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  141         -
}
  142         -
  143         -
pub(crate) fn de_enable_kinesis_streaming_destination(
  144         -
    _value: &[u8],
  145         -
    mut builder: crate::operation::enable_kinesis_streaming_destination::builders::EnableKinesisStreamingDestinationOutputBuilder,
  146         -
) -> ::std::result::Result<
  147         -
    crate::operation::enable_kinesis_streaming_destination::builders::EnableKinesisStreamingDestinationOutputBuilder,
  148         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  149         -
> {
  150         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  151         -
    let tokens = &mut tokens_owned;
  152         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  153         -
    loop {
  154         -
        match tokens.next().transpose()? {
  155         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  156         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  157         -
                "TableName" => {
  158         -
                    builder = builder.set_table_name(
  159         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  160         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  161         -
                            .transpose()?,
  162         -
                    );
  163         -
                }
  164         -
                "StreamArn" => {
  165         -
                    builder = builder.set_stream_arn(
  166         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  167         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  168         -
                            .transpose()?,
  169         -
                    );
  170         -
                }
  171         -
                "DestinationStatus" => {
  172         -
                    builder = builder.set_destination_status(
  173         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  174         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::DestinationStatus::from(u.as_ref())))
  175         -
                            .transpose()?,
  176         -
                    );
  177         -
                }
  178         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  179         -
            },
  180         -
            other => {
  181         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  182         -
                    "expected object key or end object, found: {other:?}"
  183         -
                )))
  184         -
            }
  185         -
        }
  186         -
    }
  187         -
    if tokens.next().is_some() {
  188         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  189         -
            "found more JSON tokens after completing parsing",
  190         -
        ));
  191         -
    }
  192         -
    Ok(builder)
  193         -
}

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

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_enable_kinesis_streaming_destination_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::enable_kinesis_streaming_destination::EnableKinesisStreamingDestinationInput,
    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.stream_arn {
   10         -
        object.key("StreamArn").string(var_2.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}

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

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

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

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

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

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

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

@@ -1,0 +28,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_execute_statement_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::execute_statement::ExecuteStatementInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.statement {
    7         -
        object.key("Statement").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.parameters {
   10         -
        let mut array_3 = object.key("Parameters").start_array();
   11         -
        for item_4 in var_2 {
   12         -
            {
   13         -
                #[allow(unused_mut)]
   14         -
                let mut object_5 = array_3.value().start_object();
   15         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_5, item_4)?;
   16         -
                object_5.finish();
   17         -
            }
   18         -
        }
   19         -
        array_3.finish();
   20         -
    }
   21         -
    if let Some(var_6) = &input.consistent_read {
   22         -
        object.key("ConsistentRead").boolean(*var_6);
   23         -
    }
   24         -
    if let Some(var_7) = &input.next_token {
   25         -
        object.key("NextToken").string(var_7.as_str());
   26         -
    }
   27         -
    Ok(())
   28         -
}

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

@@ -1,0 +199,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_execute_transaction_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::execute_transaction::ExecuteTransactionOutput,
    9         -
    crate::operation::execute_transaction::ExecuteTransactionError,
   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::execute_transaction::ExecuteTransactionError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::execute_transaction::ExecuteTransactionError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "IdempotentParameterMismatchException" => crate::operation::execute_transaction::ExecuteTransactionError::IdempotentParameterMismatchError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::IdempotentParameterMismatchErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_idempotent_parameter_mismatch_exception::de_idempotent_parameter_mismatch_exception_json_err(
   28         -
                    _response_body,
   29         -
                    output,
   30         -
                )
   31         -
                .map_err(crate::operation::execute_transaction::ExecuteTransactionError::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::execute_transaction::ExecuteTransactionError::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::execute_transaction::ExecuteTransactionError::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         -
        "ProvisionedThroughputExceededException" => {
   56         -
            crate::operation::execute_transaction::ExecuteTransactionError::ProvisionedThroughputExceededError({
   57         -
                #[allow(unused_mut)]
   58         -
                let mut tmp = {
   59         -
                    #[allow(unused_mut)]
   60         -
                    let mut output = crate::types::error::builders::ProvisionedThroughputExceededErrorBuilder::default();
   61         -
                    output = crate::protocol_serde::shape_provisioned_throughput_exceeded_exception::de_provisioned_throughput_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::execute_transaction::ExecuteTransactionError::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         -
        }
   71         -
        "RequestLimitExceeded" => crate::operation::execute_transaction::ExecuteTransactionError::RequestLimitExceeded({
   72         -
            #[allow(unused_mut)]
   73         -
            let mut tmp = {
   74         -
                #[allow(unused_mut)]
   75         -
                let mut output = crate::types::error::builders::RequestLimitExceededBuilder::default();
   76         -
                output = crate::protocol_serde::shape_request_limit_exceeded::de_request_limit_exceeded_json_err(_response_body, output)
   77         -
                    .map_err(crate::operation::execute_transaction::ExecuteTransactionError::unhandled)?;
   78         -
                let output = output.meta(generic);
   79         -
                output.build()
   80         -
            };
   81         -
            if tmp.message.is_none() {
   82         -
                tmp.message = _error_message;
   83         -
            }
   84         -
            tmp
   85         -
        }),
   86         -
        "ResourceNotFoundException" => crate::operation::execute_transaction::ExecuteTransactionError::ResourceNotFoundError({
   87         -
            #[allow(unused_mut)]
   88         -
            let mut tmp = {
   89         -
                #[allow(unused_mut)]
   90         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   91         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   92         -
                    .map_err(crate::operation::execute_transaction::ExecuteTransactionError::unhandled)?;
   93         -
                let output = output.meta(generic);
   94         -
                output.build()
   95         -
            };
   96         -
            if tmp.message.is_none() {
   97         -
                tmp.message = _error_message;
   98         -
            }
   99         -
            tmp
  100         -
        }),
  101         -
        "TransactionCanceledException" => crate::operation::execute_transaction::ExecuteTransactionError::TransactionCanceledError({
  102         -
            #[allow(unused_mut)]
  103         -
            let mut tmp = {
  104         -
                #[allow(unused_mut)]
  105         -
                let mut output = crate::types::error::builders::TransactionCanceledErrorBuilder::default();
  106         -
                output =
  107         -
                    crate::protocol_serde::shape_transaction_canceled_exception::de_transaction_canceled_exception_json_err(_response_body, output)
  108         -
                        .map_err(crate::operation::execute_transaction::ExecuteTransactionError::unhandled)?;
  109         -
                let output = output.meta(generic);
  110         -
                output.build()
  111         -
            };
  112         -
            if tmp.message.is_none() {
  113         -
                tmp.message = _error_message;
  114         -
            }
  115         -
            tmp
  116         -
        }),
  117         -
        "TransactionInProgressException" => crate::operation::execute_transaction::ExecuteTransactionError::TransactionInProgressError({
  118         -
            #[allow(unused_mut)]
  119         -
            let mut tmp = {
  120         -
                #[allow(unused_mut)]
  121         -
                let mut output = crate::types::error::builders::TransactionInProgressErrorBuilder::default();
  122         -
                output = crate::protocol_serde::shape_transaction_in_progress_exception::de_transaction_in_progress_exception_json_err(
  123         -
                    _response_body,
  124         -
                    output,
  125         -
                )
  126         -
                .map_err(crate::operation::execute_transaction::ExecuteTransactionError::unhandled)?;
  127         -
                let output = output.meta(generic);
  128         -
                output.build()
  129         -
            };
  130         -
            if tmp.message.is_none() {
  131         -
                tmp.message = _error_message;
  132         -
            }
  133         -
            tmp
  134         -
        }),
  135         -
        _ => crate::operation::execute_transaction::ExecuteTransactionError::generic(generic),
  136         -
    })
  137         -
}
  138         -
  139         -
#[allow(clippy::unnecessary_wraps)]
  140         -
pub fn de_execute_transaction_http_response(
  141         -
    _response_status: u16,
  142         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  143         -
    _response_body: &[u8],
  144         -
) -> std::result::Result<
  145         -
    crate::operation::execute_transaction::ExecuteTransactionOutput,
  146         -
    crate::operation::execute_transaction::ExecuteTransactionError,
  147         -
> {
  148         -
    Ok({
  149         -
        #[allow(unused_mut)]
  150         -
        let mut output = crate::operation::execute_transaction::builders::ExecuteTransactionOutputBuilder::default();
  151         -
        output = crate::protocol_serde::shape_execute_transaction::de_execute_transaction(_response_body, output)
  152         -
            .map_err(crate::operation::execute_transaction::ExecuteTransactionError::unhandled)?;
  153         -
        output.build()
  154         -
    })
  155         -
}
  156         -
  157         -
pub fn ser_execute_transaction_input(
  158         -
    input: &crate::operation::execute_transaction::ExecuteTransactionInput,
  159         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  160         -
    let mut out = String::new();
  161         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  162         -
    crate::protocol_serde::shape_execute_transaction_input::ser_execute_transaction_input_input(&mut object, input)?;
  163         -
    object.finish();
  164         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  165         -
}
  166         -
  167         -
pub(crate) fn de_execute_transaction(
  168         -
    _value: &[u8],
  169         -
    mut builder: crate::operation::execute_transaction::builders::ExecuteTransactionOutputBuilder,
  170         -
) -> ::std::result::Result<
  171         -
    crate::operation::execute_transaction::builders::ExecuteTransactionOutputBuilder,
  172         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  173         -
> {
  174         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  175         -
    let tokens = &mut tokens_owned;
  176         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  177         -
    loop {
  178         -
        match tokens.next().transpose()? {
  179         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  180         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  181         -
                "Responses" => {
  182         -
                    builder = builder.set_responses(crate::protocol_serde::shape_item_response_list::de_item_response_list(tokens, _value)?);
  183         -
                }
  184         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  185         -
            },
  186         -
            other => {
  187         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  188         -
                    "expected object key or end object, found: {other:?}"
  189         -
                )))
  190         -
            }
  191         -
        }
  192         -
    }
  193         -
    if tokens.next().is_some() {
  194         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  195         -
            "found more JSON tokens after completing parsing",
  196         -
        ));
  197         -
    }
  198         -
    Ok(builder)
  199         -
}

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

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

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

@@ -1,0 +31,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_expected_attribute_value(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ExpectedAttributeValue,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.value {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_2 = object.key("Value").start_object();
    9         -
        crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_2, var_1)?;
   10         -
        object_2.finish();
   11         -
    }
   12         -
    if let Some(var_3) = &input.exists {
   13         -
        object.key("Exists").boolean(*var_3);
   14         -
    }
   15         -
    if let Some(var_4) = &input.comparison_operator {
   16         -
        object.key("ComparisonOperator").string(var_4.as_str());
   17         -
    }
   18         -
    if let Some(var_5) = &input.attribute_value_list {
   19         -
        let mut array_6 = object.key("AttributeValueList").start_array();
   20         -
        for item_7 in var_5 {
   21         -
            {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut object_8 = array_6.value().start_object();
   24         -
                crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_8, item_7)?;
   25         -
                object_8.finish();
   26         -
            }
   27         -
        }
   28         -
        array_6.finish();
   29         -
    }
   30         -
    Ok(())
   31         -
}

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

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

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

@@ -1,0 +163,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_export_description<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ExportDescription>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::ExportDescriptionBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "ExportArn" => {
   19         -
                            builder = builder.set_export_arn(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "ExportStatus" => {
   26         -
                            builder = builder.set_export_status(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::ExportStatus::from(u.as_ref())))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        "StartTime" => {
   33         -
                            builder = builder.set_start_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   34         -
                                tokens.next(),
   35         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   36         -
                            )?);
   37         -
                        }
   38         -
                        "EndTime" => {
   39         -
                            builder = builder.set_end_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   40         -
                                tokens.next(),
   41         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   42         -
                            )?);
   43         -
                        }
   44         -
                        "ExportManifest" => {
   45         -
                            builder = builder.set_export_manifest(
   46         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   47         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   48         -
                                    .transpose()?,
   49         -
                            );
   50         -
                        }
   51         -
                        "TableArn" => {
   52         -
                            builder = builder.set_table_arn(
   53         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   54         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   55         -
                                    .transpose()?,
   56         -
                            );
   57         -
                        }
   58         -
                        "TableId" => {
   59         -
                            builder = builder.set_table_id(
   60         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   61         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   62         -
                                    .transpose()?,
   63         -
                            );
   64         -
                        }
   65         -
                        "ExportTime" => {
   66         -
                            builder = builder.set_export_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   67         -
                                tokens.next(),
   68         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   69         -
                            )?);
   70         -
                        }
   71         -
                        "ClientToken" => {
   72         -
                            builder = builder.set_client_token(
   73         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   74         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   75         -
                                    .transpose()?,
   76         -
                            );
   77         -
                        }
   78         -
                        "S3Bucket" => {
   79         -
                            builder = builder.set_s3_bucket(
   80         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   81         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   82         -
                                    .transpose()?,
   83         -
                            );
   84         -
                        }
   85         -
                        "S3BucketOwner" => {
   86         -
                            builder = builder.set_s3_bucket_owner(
   87         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   88         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   89         -
                                    .transpose()?,
   90         -
                            );
   91         -
                        }
   92         -
                        "S3Prefix" => {
   93         -
                            builder = builder.set_s3_prefix(
   94         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   95         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   96         -
                                    .transpose()?,
   97         -
                            );
   98         -
                        }
   99         -
                        "S3SseAlgorithm" => {
  100         -
                            builder = builder.set_s3_sse_algorithm(
  101         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  102         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::S3SseAlgorithm::from(u.as_ref())))
  103         -
                                    .transpose()?,
  104         -
                            );
  105         -
                        }
  106         -
                        "S3SseKmsKeyId" => {
  107         -
                            builder = builder.set_s3_sse_kms_key_id(
  108         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  109         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  110         -
                                    .transpose()?,
  111         -
                            );
  112         -
                        }
  113         -
                        "FailureCode" => {
  114         -
                            builder = builder.set_failure_code(
  115         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  116         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  117         -
                                    .transpose()?,
  118         -
                            );
  119         -
                        }
  120         -
                        "FailureMessage" => {
  121         -
                            builder = builder.set_failure_message(
  122         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  123         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  124         -
                                    .transpose()?,
  125         -
                            );
  126         -
                        }
  127         -
                        "ExportFormat" => {
  128         -
                            builder = builder.set_export_format(
  129         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  130         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::ExportFormat::from(u.as_ref())))
  131         -
                                    .transpose()?,
  132         -
                            );
  133         -
                        }
  134         -
                        "BilledSizeBytes" => {
  135         -
                            builder = builder.set_billed_size_bytes(
  136         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  137         -
                                    .map(i64::try_from)
  138         -
                                    .transpose()?,
  139         -
                            );
  140         -
                        }
  141         -
                        "ItemCount" => {
  142         -
                            builder = builder.set_item_count(
  143         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  144         -
                                    .map(i64::try_from)
  145         -
                                    .transpose()?,
  146         -
                            );
  147         -
                        }
  148         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  149         -
                    },
  150         -
                    other => {
  151         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  152         -
                            "expected object key or end object, found: {other:?}"
  153         -
                        )))
  154         -
                    }
  155         -
                }
  156         -
            }
  157         -
            Ok(Some(builder.build()))
  158         -
        }
  159         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  160         -
            "expected start object or null",
  161         -
        )),
  162         -
    }
  163         -
}