Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406

Files changed:

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_list_snapshot_blocks.rs

@@ -1,0 +198,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_snapshot_blocks_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::list_snapshot_blocks::ListSnapshotBlocksOutput,
    9         -
    crate::operation::list_snapshot_blocks::ListSnapshotBlocksError,
   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::list_snapshot_blocks::ListSnapshotBlocksError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "AccessDeniedException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::AccessDeniedError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::AccessDeniedErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                crate::serde_util::access_denied_exception_correct_errors(output)
   31         -
                    .build()
   32         -
                    .map_err(crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::unhandled)?
   33         -
            };
   34         -
            if tmp.message.is_none() {
   35         -
                tmp.message = _error_message;
   36         -
            }
   37         -
            tmp
   38         -
        }),
   39         -
        "InternalServerException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::InternalServerError({
   40         -
            #[allow(unused_mut)]
   41         -
            let mut tmp = {
   42         -
                #[allow(unused_mut)]
   43         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   44         -
                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
   45         -
                    .map_err(crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::unhandled)?;
   46         -
                let output = output.meta(generic);
   47         -
                output.build()
   48         -
            };
   49         -
            if tmp.message.is_none() {
   50         -
                tmp.message = _error_message;
   51         -
            }
   52         -
            tmp
   53         -
        }),
   54         -
        "RequestThrottledException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::RequestThrottledError({
   55         -
            #[allow(unused_mut)]
   56         -
            let mut tmp = {
   57         -
                #[allow(unused_mut)]
   58         -
                let mut output = crate::types::error::builders::RequestThrottledErrorBuilder::default();
   59         -
                output = crate::protocol_serde::shape_request_throttled_exception::de_request_throttled_exception_json_err(_response_body, output)
   60         -
                    .map_err(crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::unhandled)?;
   61         -
                let output = output.meta(generic);
   62         -
                output.build()
   63         -
            };
   64         -
            if tmp.message.is_none() {
   65         -
                tmp.message = _error_message;
   66         -
            }
   67         -
            tmp
   68         -
        }),
   69         -
        "ResourceNotFoundException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::ResourceNotFoundError({
   70         -
            #[allow(unused_mut)]
   71         -
            let mut tmp = {
   72         -
                #[allow(unused_mut)]
   73         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   74         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   75         -
                    .map_err(crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::unhandled)?;
   76         -
                let output = output.meta(generic);
   77         -
                output.build()
   78         -
            };
   79         -
            if tmp.message.is_none() {
   80         -
                tmp.message = _error_message;
   81         -
            }
   82         -
            tmp
   83         -
        }),
   84         -
        "ServiceQuotaExceededException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::ServiceQuotaExceededError({
   85         -
            #[allow(unused_mut)]
   86         -
            let mut tmp = {
   87         -
                #[allow(unused_mut)]
   88         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededErrorBuilder::default();
   89         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   90         -
                    _response_body,
   91         -
                    output,
   92         -
                )
   93         -
                .map_err(crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::unhandled)?;
   94         -
                let output = output.meta(generic);
   95         -
                output.build()
   96         -
            };
   97         -
            if tmp.message.is_none() {
   98         -
                tmp.message = _error_message;
   99         -
            }
  100         -
            tmp
  101         -
        }),
  102         -
        "ValidationException" => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::ValidationError({
  103         -
            #[allow(unused_mut)]
  104         -
            let mut tmp = {
  105         -
                #[allow(unused_mut)]
  106         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
  107         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  108         -
                    .map_err(crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::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         -
        _ => crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::generic(generic),
  118         -
    })
  119         -
}
  120         -
  121         -
#[allow(clippy::unnecessary_wraps)]
  122         -
pub fn de_list_snapshot_blocks_http_response(
  123         -
    _response_status: u16,
  124         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  125         -
    _response_body: &[u8],
  126         -
) -> std::result::Result<
  127         -
    crate::operation::list_snapshot_blocks::ListSnapshotBlocksOutput,
  128         -
    crate::operation::list_snapshot_blocks::ListSnapshotBlocksError,
  129         -
> {
  130         -
    Ok({
  131         -
        #[allow(unused_mut)]
  132         -
        let mut output = crate::operation::list_snapshot_blocks::builders::ListSnapshotBlocksOutputBuilder::default();
  133         -
        output = crate::protocol_serde::shape_list_snapshot_blocks::de_list_snapshot_blocks(_response_body, output)
  134         -
            .map_err(crate::operation::list_snapshot_blocks::ListSnapshotBlocksError::unhandled)?;
  135         -
        output.build()
  136         -
    })
  137         -
}
  138         -
  139         -
pub(crate) fn de_list_snapshot_blocks(
  140         -
    _value: &[u8],
  141         -
    mut builder: crate::operation::list_snapshot_blocks::builders::ListSnapshotBlocksOutputBuilder,
  142         -
) -> ::std::result::Result<
  143         -
    crate::operation::list_snapshot_blocks::builders::ListSnapshotBlocksOutputBuilder,
  144         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  145         -
> {
  146         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  147         -
    let tokens = &mut tokens_owned;
  148         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  149         -
    loop {
  150         -
        match tokens.next().transpose()? {
  151         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  152         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  153         -
                "BlockSize" => {
  154         -
                    builder = builder.set_block_size(
  155         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  156         -
                            .map(i32::try_from)
  157         -
                            .transpose()?,
  158         -
                    );
  159         -
                }
  160         -
                "Blocks" => {
  161         -
                    builder = builder.set_blocks(crate::protocol_serde::shape_blocks::de_blocks(tokens, _value)?);
  162         -
                }
  163         -
                "ExpiryTime" => {
  164         -
                    builder = builder.set_expiry_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  165         -
                        tokens.next(),
  166         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
  167         -
                    )?);
  168         -
                }
  169         -
                "NextToken" => {
  170         -
                    builder = builder.set_next_token(
  171         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  172         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  173         -
                            .transpose()?,
  174         -
                    );
  175         -
                }
  176         -
                "VolumeSize" => {
  177         -
                    builder = builder.set_volume_size(
  178         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  179         -
                            .map(i64::try_from)
  180         -
                            .transpose()?,
  181         -
                    );
  182         -
                }
  183         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  184         -
            },
  185         -
            other => {
  186         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  187         -
                    "expected object key or end object, found: {other:?}"
  188         -
                )))
  189         -
            }
  190         -
        }
  191         -
    }
  192         -
    if tokens.next().is_some() {
  193         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  194         -
            "found more JSON tokens after completing parsing",
  195         -
        ));
  196         -
    }
  197         -
    Ok(builder)
  198         -
}

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_put_snapshot_block.rs

@@ -1,0 +194,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_snapshot_block_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::put_snapshot_block::PutSnapshotBlockOutput, crate::operation::put_snapshot_block::PutSnapshotBlockError> {
    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::put_snapshot_block::PutSnapshotBlockError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::put_snapshot_block::PutSnapshotBlockError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "AccessDeniedException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::AccessDeniedError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::AccessDeniedErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::put_snapshot_block::PutSnapshotBlockError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                crate::serde_util::access_denied_exception_correct_errors(output)
   28         -
                    .build()
   29         -
                    .map_err(crate::operation::put_snapshot_block::PutSnapshotBlockError::unhandled)?
   30         -
            };
   31         -
            if tmp.message.is_none() {
   32         -
                tmp.message = _error_message;
   33         -
            }
   34         -
            tmp
   35         -
        }),
   36         -
        "InternalServerException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::InternalServerError({
   37         -
            #[allow(unused_mut)]
   38         -
            let mut tmp = {
   39         -
                #[allow(unused_mut)]
   40         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   41         -
                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
   42         -
                    .map_err(crate::operation::put_snapshot_block::PutSnapshotBlockError::unhandled)?;
   43         -
                let output = output.meta(generic);
   44         -
                output.build()
   45         -
            };
   46         -
            if tmp.message.is_none() {
   47         -
                tmp.message = _error_message;
   48         -
            }
   49         -
            tmp
   50         -
        }),
   51         -
        "RequestThrottledException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::RequestThrottledError({
   52         -
            #[allow(unused_mut)]
   53         -
            let mut tmp = {
   54         -
                #[allow(unused_mut)]
   55         -
                let mut output = crate::types::error::builders::RequestThrottledErrorBuilder::default();
   56         -
                output = crate::protocol_serde::shape_request_throttled_exception::de_request_throttled_exception_json_err(_response_body, output)
   57         -
                    .map_err(crate::operation::put_snapshot_block::PutSnapshotBlockError::unhandled)?;
   58         -
                let output = output.meta(generic);
   59         -
                output.build()
   60         -
            };
   61         -
            if tmp.message.is_none() {
   62         -
                tmp.message = _error_message;
   63         -
            }
   64         -
            tmp
   65         -
        }),
   66         -
        "ResourceNotFoundException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::ResourceNotFoundError({
   67         -
            #[allow(unused_mut)]
   68         -
            let mut tmp = {
   69         -
                #[allow(unused_mut)]
   70         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   71         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   72         -
                    .map_err(crate::operation::put_snapshot_block::PutSnapshotBlockError::unhandled)?;
   73         -
                let output = output.meta(generic);
   74         -
                output.build()
   75         -
            };
   76         -
            if tmp.message.is_none() {
   77         -
                tmp.message = _error_message;
   78         -
            }
   79         -
            tmp
   80         -
        }),
   81         -
        "ServiceQuotaExceededException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::ServiceQuotaExceededError({
   82         -
            #[allow(unused_mut)]
   83         -
            let mut tmp = {
   84         -
                #[allow(unused_mut)]
   85         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededErrorBuilder::default();
   86         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   87         -
                    _response_body,
   88         -
                    output,
   89         -
                )
   90         -
                .map_err(crate::operation::put_snapshot_block::PutSnapshotBlockError::unhandled)?;
   91         -
                let output = output.meta(generic);
   92         -
                output.build()
   93         -
            };
   94         -
            if tmp.message.is_none() {
   95         -
                tmp.message = _error_message;
   96         -
            }
   97         -
            tmp
   98         -
        }),
   99         -
        "ValidationException" => crate::operation::put_snapshot_block::PutSnapshotBlockError::ValidationError({
  100         -
            #[allow(unused_mut)]
  101         -
            let mut tmp = {
  102         -
                #[allow(unused_mut)]
  103         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
  104         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  105         -
                    .map_err(crate::operation::put_snapshot_block::PutSnapshotBlockError::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         -
        _ => crate::operation::put_snapshot_block::PutSnapshotBlockError::generic(generic),
  115         -
    })
  116         -
}
  117         -
  118         -
#[allow(clippy::unnecessary_wraps)]
  119         -
pub fn de_put_snapshot_block_http_response(
  120         -
    _response_status: u16,
  121         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  122         -
    _response_body: &[u8],
  123         -
) -> std::result::Result<crate::operation::put_snapshot_block::PutSnapshotBlockOutput, crate::operation::put_snapshot_block::PutSnapshotBlockError> {
  124         -
    Ok({
  125         -
        #[allow(unused_mut)]
  126         -
        let mut output = crate::operation::put_snapshot_block::builders::PutSnapshotBlockOutputBuilder::default();
  127         -
        output = output.set_checksum(
  128         -
            crate::protocol_serde::shape_put_snapshot_block_output::de_checksum_header(_response_headers).map_err(|_| {
  129         -
                crate::operation::put_snapshot_block::PutSnapshotBlockError::unhandled("Failed to parse Checksum from header `x-amz-Checksum")
  130         -
            })?,
  131         -
        );
  132         -
        output = output.set_checksum_algorithm(
  133         -
            crate::protocol_serde::shape_put_snapshot_block_output::de_checksum_algorithm_header(_response_headers).map_err(|_| {
  134         -
                crate::operation::put_snapshot_block::PutSnapshotBlockError::unhandled(
  135         -
                    "Failed to parse ChecksumAlgorithm from header `x-amz-Checksum-Algorithm",
  136         -
                )
  137         -
            })?,
  138         -
        );
  139         -
        output.build()
  140         -
    })
  141         -
}
  142         -
  143         -
pub fn ser_put_snapshot_block_headers(
  144         -
    input: &crate::operation::put_snapshot_block::PutSnapshotBlockInput,
  145         -
    mut builder: ::http_1x::request::Builder,
  146         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  147         -
    if let ::std::option::Option::Some(inner_1) = &input.checksum {
  148         -
        let formatted_2 = inner_1.as_str();
  149         -
        let header_value = formatted_2;
  150         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  151         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  152         -
                "checksum",
  153         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  154         -
            )
  155         -
        })?;
  156         -
        builder = builder.header("x-amz-Checksum", header_value);
  157         -
    }
  158         -
    if let ::std::option::Option::Some(inner_3) = &input.progress {
  159         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_3);
  160         -
        let formatted_4 = encoder.encode();
  161         -
        let header_value = formatted_4;
  162         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  163         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  164         -
                "progress",
  165         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  166         -
            )
  167         -
        })?;
  168         -
        builder = builder.header("x-amz-Progress", header_value);
  169         -
    }
  170         -
    if let ::std::option::Option::Some(inner_5) = &input.data_length {
  171         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_5);
  172         -
        let formatted_6 = encoder.encode();
  173         -
        let header_value = formatted_6;
  174         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  175         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  176         -
                "data_length",
  177         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  178         -
            )
  179         -
        })?;
  180         -
        builder = builder.header("x-amz-Data-Length", header_value);
  181         -
    }
  182         -
    if let ::std::option::Option::Some(inner_7) = &input.checksum_algorithm {
  183         -
        let formatted_8 = inner_7.as_str();
  184         -
        let header_value = formatted_8;
  185         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  186         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  187         -
                "checksum_algorithm",
  188         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  189         -
            )
  190         -
        })?;
  191         -
        builder = builder.header("x-amz-Checksum-Algorithm", header_value);
  192         -
    }
  193         -
    Ok(builder)
  194         -
}

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_put_snapshot_block_input.rs

@@ -1,0 +6,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_block_data_http_payload(
    3         -
    payload: ::aws_smithy_types::byte_stream::ByteStream,
    4         -
) -> ::std::result::Result<::aws_smithy_types::byte_stream::ByteStream, ::aws_smithy_types::error::operation::BuildError> {
    5         -
    Ok(payload)
    6         -
}

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_put_snapshot_block_output.rs

@@ -1,0 +14,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_checksum_header(
    3         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
    5         -
    let headers = header_map.get_all("x-amz-Checksum");
    6         -
    ::aws_smithy_http::header::one_or_none(headers)
    7         -
}
    8         -
    9         -
pub(crate) fn de_checksum_algorithm_header(
   10         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
   11         -
) -> ::std::result::Result<::std::option::Option<crate::types::ChecksumAlgorithm>, ::aws_smithy_http::header::ParseError> {
   12         -
    let headers = header_map.get_all("x-amz-Checksum-Algorithm");
   13         -
    ::aws_smithy_http::header::one_or_none(headers)
   14         -
}

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_request_throttled_exception.rs

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

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_resource_not_found_exception.rs

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

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_service_quota_exceeded_exception.rs

@@ -1,0 +45,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_service_quota_exceeded_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ServiceQuotaExceededErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::ServiceQuotaExceededErrorBuilder, ::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         -
                "Reason" => {
   14         -
                    builder = builder.set_reason(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| {
   17         -
                                s.to_unescaped()
   18         -
                                    .map(|u| crate::types::ServiceQuotaExceededExceptionReason::from(u.as_ref()))
   19         -
                            })
   20         -
                            .transpose()?,
   21         -
                    );
   22         -
                }
   23         -
                "Message" => {
   24         -
                    builder = builder.set_message(
   25         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   26         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   27         -
                            .transpose()?,
   28         -
                    );
   29         -
                }
   30         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   31         -
            },
   32         -
            other => {
   33         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   34         -
                    "expected object key or end object, found: {other:?}"
   35         -
                )))
   36         -
            }
   37         -
        }
   38         -
    }
   39         -
    if tokens.next().is_some() {
   40         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41         -
            "found more JSON tokens after completing parsing",
   42         -
        ));
   43         -
    }
   44         -
    Ok(builder)
   45         -
}

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_start_snapshot.rs

@@ -1,0 +270,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_start_snapshot_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::start_snapshot::StartSnapshotOutput, crate::operation::start_snapshot::StartSnapshotError> {
    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::start_snapshot::StartSnapshotError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::start_snapshot::StartSnapshotError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "AccessDeniedException" => crate::operation::start_snapshot::StartSnapshotError::AccessDeniedError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::AccessDeniedErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::start_snapshot::StartSnapshotError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                crate::serde_util::access_denied_exception_correct_errors(output)
   28         -
                    .build()
   29         -
                    .map_err(crate::operation::start_snapshot::StartSnapshotError::unhandled)?
   30         -
            };
   31         -
            if tmp.message.is_none() {
   32         -
                tmp.message = _error_message;
   33         -
            }
   34         -
            tmp
   35         -
        }),
   36         -
        "ConcurrentLimitExceededException" => crate::operation::start_snapshot::StartSnapshotError::ConcurrentLimitExceededError({
   37         -
            #[allow(unused_mut)]
   38         -
            let mut tmp = {
   39         -
                #[allow(unused_mut)]
   40         -
                let mut output = crate::types::error::builders::ConcurrentLimitExceededErrorBuilder::default();
   41         -
                output = crate::protocol_serde::shape_concurrent_limit_exceeded_exception::de_concurrent_limit_exceeded_exception_json_err(
   42         -
                    _response_body,
   43         -
                    output,
   44         -
                )
   45         -
                .map_err(crate::operation::start_snapshot::StartSnapshotError::unhandled)?;
   46         -
                let output = output.meta(generic);
   47         -
                output.build()
   48         -
            };
   49         -
            if tmp.message.is_none() {
   50         -
                tmp.message = _error_message;
   51         -
            }
   52         -
            tmp
   53         -
        }),
   54         -
        "ConflictException" => crate::operation::start_snapshot::StartSnapshotError::ConflictError({
   55         -
            #[allow(unused_mut)]
   56         -
            let mut tmp = {
   57         -
                #[allow(unused_mut)]
   58         -
                let mut output = crate::types::error::builders::ConflictErrorBuilder::default();
   59         -
                output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
   60         -
                    .map_err(crate::operation::start_snapshot::StartSnapshotError::unhandled)?;
   61         -
                let output = output.meta(generic);
   62         -
                output.build()
   63         -
            };
   64         -
            if tmp.message.is_none() {
   65         -
                tmp.message = _error_message;
   66         -
            }
   67         -
            tmp
   68         -
        }),
   69         -
        "InternalServerException" => crate::operation::start_snapshot::StartSnapshotError::InternalServerError({
   70         -
            #[allow(unused_mut)]
   71         -
            let mut tmp = {
   72         -
                #[allow(unused_mut)]
   73         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   74         -
                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
   75         -
                    .map_err(crate::operation::start_snapshot::StartSnapshotError::unhandled)?;
   76         -
                let output = output.meta(generic);
   77         -
                output.build()
   78         -
            };
   79         -
            if tmp.message.is_none() {
   80         -
                tmp.message = _error_message;
   81         -
            }
   82         -
            tmp
   83         -
        }),
   84         -
        "RequestThrottledException" => crate::operation::start_snapshot::StartSnapshotError::RequestThrottledError({
   85         -
            #[allow(unused_mut)]
   86         -
            let mut tmp = {
   87         -
                #[allow(unused_mut)]
   88         -
                let mut output = crate::types::error::builders::RequestThrottledErrorBuilder::default();
   89         -
                output = crate::protocol_serde::shape_request_throttled_exception::de_request_throttled_exception_json_err(_response_body, output)
   90         -
                    .map_err(crate::operation::start_snapshot::StartSnapshotError::unhandled)?;
   91         -
                let output = output.meta(generic);
   92         -
                output.build()
   93         -
            };
   94         -
            if tmp.message.is_none() {
   95         -
                tmp.message = _error_message;
   96         -
            }
   97         -
            tmp
   98         -
        }),
   99         -
        "ResourceNotFoundException" => crate::operation::start_snapshot::StartSnapshotError::ResourceNotFoundError({
  100         -
            #[allow(unused_mut)]
  101         -
            let mut tmp = {
  102         -
                #[allow(unused_mut)]
  103         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
  104         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
  105         -
                    .map_err(crate::operation::start_snapshot::StartSnapshotError::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         -
        "ServiceQuotaExceededException" => crate::operation::start_snapshot::StartSnapshotError::ServiceQuotaExceededError({
  115         -
            #[allow(unused_mut)]
  116         -
            let mut tmp = {
  117         -
                #[allow(unused_mut)]
  118         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededErrorBuilder::default();
  119         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
  120         -
                    _response_body,
  121         -
                    output,
  122         -
                )
  123         -
                .map_err(crate::operation::start_snapshot::StartSnapshotError::unhandled)?;
  124         -
                let output = output.meta(generic);
  125         -
                output.build()
  126         -
            };
  127         -
            if tmp.message.is_none() {
  128         -
                tmp.message = _error_message;
  129         -
            }
  130         -
            tmp
  131         -
        }),
  132         -
        "ValidationException" => crate::operation::start_snapshot::StartSnapshotError::ValidationError({
  133         -
            #[allow(unused_mut)]
  134         -
            let mut tmp = {
  135         -
                #[allow(unused_mut)]
  136         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
  137         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  138         -
                    .map_err(crate::operation::start_snapshot::StartSnapshotError::unhandled)?;
  139         -
                let output = output.meta(generic);
  140         -
                output.build()
  141         -
            };
  142         -
            if tmp.message.is_none() {
  143         -
                tmp.message = _error_message;
  144         -
            }
  145         -
            tmp
  146         -
        }),
  147         -
        _ => crate::operation::start_snapshot::StartSnapshotError::generic(generic),
  148         -
    })
  149         -
}
  150         -
  151         -
#[allow(clippy::unnecessary_wraps)]
  152         -
pub fn de_start_snapshot_http_response(
  153         -
    _response_status: u16,
  154         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  155         -
    _response_body: &[u8],
  156         -
) -> std::result::Result<crate::operation::start_snapshot::StartSnapshotOutput, crate::operation::start_snapshot::StartSnapshotError> {
  157         -
    Ok({
  158         -
        #[allow(unused_mut)]
  159         -
        let mut output = crate::operation::start_snapshot::builders::StartSnapshotOutputBuilder::default();
  160         -
        output = crate::protocol_serde::shape_start_snapshot::de_start_snapshot(_response_body, output)
  161         -
            .map_err(crate::operation::start_snapshot::StartSnapshotError::unhandled)?;
  162         -
        output.build()
  163         -
    })
  164         -
}
  165         -
  166         -
pub fn ser_start_snapshot_input(
  167         -
    input: &crate::operation::start_snapshot::StartSnapshotInput,
  168         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  169         -
    let mut out = String::new();
  170         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  171         -
    crate::protocol_serde::shape_start_snapshot_input::ser_start_snapshot_input_input(&mut object, input)?;
  172         -
    object.finish();
  173         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  174         -
}
  175         -
  176         -
pub(crate) fn de_start_snapshot(
  177         -
    _value: &[u8],
  178         -
    mut builder: crate::operation::start_snapshot::builders::StartSnapshotOutputBuilder,
  179         -
) -> ::std::result::Result<
  180         -
    crate::operation::start_snapshot::builders::StartSnapshotOutputBuilder,
  181         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  182         -
> {
  183         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  184         -
    let tokens = &mut tokens_owned;
  185         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  186         -
    loop {
  187         -
        match tokens.next().transpose()? {
  188         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  189         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  190         -
                "BlockSize" => {
  191         -
                    builder = builder.set_block_size(
  192         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  193         -
                            .map(i32::try_from)
  194         -
                            .transpose()?,
  195         -
                    );
  196         -
                }
  197         -
                "Description" => {
  198         -
                    builder = builder.set_description(
  199         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  200         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  201         -
                            .transpose()?,
  202         -
                    );
  203         -
                }
  204         -
                "KmsKeyArn" => {
  205         -
                    builder = builder.set_kms_key_arn(
  206         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  207         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  208         -
                            .transpose()?,
  209         -
                    );
  210         -
                }
  211         -
                "OwnerId" => {
  212         -
                    builder = builder.set_owner_id(
  213         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  214         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  215         -
                            .transpose()?,
  216         -
                    );
  217         -
                }
  218         -
                "ParentSnapshotId" => {
  219         -
                    builder = builder.set_parent_snapshot_id(
  220         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  221         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  222         -
                            .transpose()?,
  223         -
                    );
  224         -
                }
  225         -
                "SnapshotId" => {
  226         -
                    builder = builder.set_snapshot_id(
  227         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  228         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  229         -
                            .transpose()?,
  230         -
                    );
  231         -
                }
  232         -
                "StartTime" => {
  233         -
                    builder = builder.set_start_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  234         -
                        tokens.next(),
  235         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
  236         -
                    )?);
  237         -
                }
  238         -
                "Status" => {
  239         -
                    builder = builder.set_status(
  240         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  241         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::Status::from(u.as_ref())))
  242         -
                            .transpose()?,
  243         -
                    );
  244         -
                }
  245         -
                "Tags" => {
  246         -
                    builder = builder.set_tags(crate::protocol_serde::shape_tags::de_tags(tokens, _value)?);
  247         -
                }
  248         -
                "VolumeSize" => {
  249         -
                    builder = builder.set_volume_size(
  250         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  251         -
                            .map(i64::try_from)
  252         -
                            .transpose()?,
  253         -
                    );
  254         -
                }
  255         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  256         -
            },
  257         -
            other => {
  258         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  259         -
                    "expected object key or end object, found: {other:?}"
  260         -
                )))
  261         -
            }
  262         -
        }
  263         -
    }
  264         -
    if tokens.next().is_some() {
  265         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  266         -
            "found more JSON tokens after completing parsing",
  267         -
        ));
  268         -
    }
  269         -
    Ok(builder)
  270         -
}

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_start_snapshot_input.rs

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_start_snapshot_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::start_snapshot::StartSnapshotInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.client_token {
    7         -
        object.key("ClientToken").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.description {
   10         -
        object.key("Description").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.encrypted {
   13         -
        object.key("Encrypted").boolean(*var_3);
   14         -
    }
   15         -
    if let Some(var_4) = &input.kms_key_arn {
   16         -
        object.key("KmsKeyArn").string(var_4.as_str());
   17         -
    }
   18         -
    if let Some(var_5) = &input.parent_snapshot_id {
   19         -
        object.key("ParentSnapshotId").string(var_5.as_str());
   20         -
    }
   21         -
    if let Some(var_6) = &input.tags {
   22         -
        let mut array_7 = object.key("Tags").start_array();
   23         -
        for item_8 in var_6 {
   24         -
            {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut object_9 = array_7.value().start_object();
   27         -
                crate::protocol_serde::shape_tag::ser_tag(&mut object_9, item_8)?;
   28         -
                object_9.finish();
   29         -
            }
   30         -
        }
   31         -
        array_7.finish();
   32         -
    }
   33         -
    if let Some(var_10) = &input.timeout {
   34         -
        object.key("Timeout").number(
   35         -
            #[allow(clippy::useless_conversion)]
   36         -
            ::aws_smithy_types::Number::NegInt((*var_10).into()),
   37         -
        );
   38         -
    }
   39         -
    if let Some(var_11) = &input.volume_size {
   40         -
        object.key("VolumeSize").number(
   41         -
            #[allow(clippy::useless_conversion)]
   42         -
            ::aws_smithy_types::Number::NegInt((*var_11).into()),
   43         -
        );
   44         -
    }
   45         -
    Ok(())
   46         -
}

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_tag.rs

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

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_tags.rs

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

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

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/serde_util.rs

@@ -1,0 +9,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn access_denied_exception_correct_errors(
    3         -
    mut builder: crate::types::error::builders::AccessDeniedErrorBuilder,
    4         -
) -> crate::types::error::builders::AccessDeniedErrorBuilder {
    5         -
    if builder.reason.is_none() {
    6         -
        builder.reason = "no value was set".parse::<crate::types::AccessDeniedExceptionReason>().ok()
    7         -
    }
    8         -
    builder
    9         -
}