Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_inner_shape_operation_input.rs

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_required_inner_shape_operation_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.inner {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_2 = object.key("inner").start_object();
    9         -
        crate::protocol_serde::shape_inner_shape::ser_inner_shape(&mut object_2, var_1)?;
   10         -
        object_2.finish();
   11         -
    }
   12         -
    Ok(())
   13         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_response_code_default_operation.rs

@@ -1,0 +32,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_response_code_default_operation_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::response_code_default_operation::ResponseCodeDefaultOperationOutput,
    9         -
    crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   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::response_code_default_operation::ResponseCodeDefaultOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_response_code_default_operation_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   25         -
    crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_response_code_http_fallback_operation.rs

@@ -1,0 +32,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_response_code_http_fallback_operation_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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
    9         -
    crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_response_code_http_fallback_operation_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   25         -
    crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_response_code_required_operation.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_response_code_required_operation_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::response_code_required_operation::ResponseCodeRequiredOperationOutput,
    9         -
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   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::response_code_required_operation::ResponseCodeRequiredOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_response_code_required_operation_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput,
   25         -
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::default();
   30         -
        output = output.set_response_code(Some(_response_status as _));
   31         -
        crate::serde_util::response_code_required_operation_output_output_correct_errors(output)
   32         -
            .build()
   33         -
            .map_err(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError::unhandled)?
   34         -
    })
   35         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_type_complexity_operation.rs

@@ -1,0 +80,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_type_complexity_operation_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::type_complexity_operation::TypeComplexityOperationOutput,
    9         -
    crate::operation::type_complexity_operation::TypeComplexityOperationError,
   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::type_complexity_operation::TypeComplexityOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::type_complexity_operation::TypeComplexityOperationError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_type_complexity_operation_http_response(
   22         -
    _response_status: u16,
   23         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   24         -
    _response_body: &[u8],
   25         -
) -> std::result::Result<
   26         -
    crate::operation::type_complexity_operation::TypeComplexityOperationOutput,
   27         -
    crate::operation::type_complexity_operation::TypeComplexityOperationError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder::default();
   32         -
        output = crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation(_response_body, output)
   33         -
            .map_err(crate::operation::type_complexity_operation::TypeComplexityOperationError::unhandled)?;
   34         -
        output.build()
   35         -
    })
   36         -
}
   37         -
   38         -
pub fn ser_type_complexity_operation_input(
   39         -
    input: &crate::operation::type_complexity_operation::TypeComplexityOperationInput,
   40         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   41         -
    let mut out = String::new();
   42         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   43         -
    crate::protocol_serde::shape_type_complexity_operation_input::ser_type_complexity_operation_input_input(&mut object, input)?;
   44         -
    object.finish();
   45         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   46         -
}
   47         -
   48         -
pub(crate) fn de_type_complexity_operation(
   49         -
    _value: &[u8],
   50         -
    mut builder: crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder,
   51         -
) -> ::std::result::Result<
   52         -
    crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder,
   53         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   54         -
> {
   55         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   56         -
    let tokens = &mut tokens_owned;
   57         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   58         -
    loop {
   59         -
        match tokens.next().transpose()? {
   60         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   61         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   62         -
                "list" => {
   63         -
                    builder = builder.set_list(crate::protocol_serde::shape_list_a::de_list_a(tokens, _value)?);
   64         -
                }
   65         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   66         -
            },
   67         -
            other => {
   68         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   69         -
                    "expected object key or end object, found: {other:?}"
   70         -
                )))
   71         -
            }
   72         -
        }
   73         -
    }
   74         -
    if tokens.next().is_some() {
   75         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   76         -
            "found more JSON tokens after completing parsing",
   77         -
        ));
   78         -
    }
   79         -
    Ok(builder)
   80         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_type_complexity_operation_input.rs

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_type_complexity_operation_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::type_complexity_operation::TypeComplexityOperationInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.list {
    7         -
        let mut array_2 = object.key("list").start_array();
    8         -
        for item_3 in var_1 {
    9         -
            {
   10         -
                let mut array_4 = array_2.value().start_array();
   11         -
                for item_5 in item_3 {
   12         -
                    {
   13         -
                        let mut array_6 = array_4.value().start_array();
   14         -
                        for item_7 in item_5 {
   15         -
                            {
   16         -
                                #[allow(unused_mut)]
   17         -
                                let mut object_8 = array_6.value().start_object();
   18         -
                                for (key_9, value_10) in item_7 {
   19         -
                                    {
   20         -
                                        #[allow(unused_mut)]
   21         -
                                        let mut object_11 = object_8.key(key_9.as_str()).start_object();
   22         -
                                        crate::protocol_serde::shape_empty_structure::ser_empty_structure(&mut object_11, value_10)?;
   23         -
                                        object_11.finish();
   24         -
                                    }
   25         -
                                }
   26         -
                                object_8.finish();
   27         -
                            }
   28         -
                        }
   29         -
                        array_6.finish();
   30         -
                    }
   31         -
                }
   32         -
                array_4.finish();
   33         -
            }
   34         -
        }
   35         -
        array_2.finish();
   36         -
    }
   37         -
    Ok(())
   38         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_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         -
                "fieldList" => {
   21         -
                    builder = builder.set_field_list(
   22         -
                        crate::protocol_serde::shape_validation_exception_field_list::de_validation_exception_field_list(tokens, _value)?,
   23         -
                    );
   24         -
                }
   25         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   26         -
            },
   27         -
            other => {
   28         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29         -
                    "expected object key or end object, found: {other:?}"
   30         -
                )))
   31         -
            }
   32         -
        }
   33         -
    }
   34         -
    if tokens.next().is_some() {
   35         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "found more JSON tokens after completing parsing",
   37         -
        ));
   38         -
    }
   39         -
    Ok(builder)
   40         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_validation_exception_field.rs

@@ -1,0 +51,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_validation_exception_field<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ValidationExceptionField>, ::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::ValidationExceptionFieldBuilder::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         -
                        "path" => {
   19         -
                            builder = builder.set_path(
   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         -
                        "message" => {
   26         -
                            builder = builder.set_message(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   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(
   42         -
                crate::serde_util::validation_exception_field_correct_errors(builder)
   43         -
                    .build()
   44         -
                    .map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
   45         -
            ))
   46         -
        }
   47         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
            "expected start object or null",
   49         -
        )),
   50         -
    }
   51         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_validation_exception_field_list.rs

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

@@ -1,0 +109,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn validation_exception_correct_errors(
    3         -
    mut builder: crate::types::error::builders::ValidationErrorBuilder,
    4         -
) -> crate::types::error::builders::ValidationErrorBuilder {
    5         -
    if builder.message.is_none() {
    6         -
        builder.message = Some(Default::default())
    7         -
    }
    8         -
    builder
    9         -
}
   10         -
   11         -
pub(crate) fn required_header_collection_operation_output_output_correct_errors(
   12         -
    mut builder: crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder,
   13         -
) -> crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder {
   14         -
    if builder.required_header_list.is_none() {
   15         -
        builder.required_header_list = Some(Default::default())
   16         -
    }
   17         -
    if builder.required_header_set.is_none() {
   18         -
        builder.required_header_set = Some(Default::default())
   19         -
    }
   20         -
    builder
   21         -
}
   22         -
   23         -
pub(crate) fn response_code_required_operation_output_output_correct_errors(
   24         -
    mut builder: crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder,
   25         -
) -> crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder {
   26         -
    if builder.response_code.is_none() {
   27         -
        builder.response_code = Some(Default::default())
   28         -
    }
   29         -
    builder
   30         -
}
   31         -
   32         -
pub(crate) fn inner_shape_correct_errors(mut builder: crate::types::builders::InnerShapeBuilder) -> crate::types::builders::InnerShapeBuilder {
   33         -
    if builder.required_inner_most_shape.is_none() {
   34         -
        builder.required_inner_most_shape = {
   35         -
            let builder = crate::types::builders::InnermostShapeBuilder::default();
   36         -
            crate::serde_util::innermost_shape_correct_errors(builder).build().ok()
   37         -
        }
   38         -
    }
   39         -
    builder
   40         -
}
   41         -
   42         -
pub(crate) fn innermost_shape_correct_errors(
   43         -
    mut builder: crate::types::builders::InnermostShapeBuilder,
   44         -
) -> crate::types::builders::InnermostShapeBuilder {
   45         -
    if builder.a_string.is_none() {
   46         -
        builder.a_string = Some(Default::default())
   47         -
    }
   48         -
    if builder.a_boolean.is_none() {
   49         -
        builder.a_boolean = Some(Default::default())
   50         -
    }
   51         -
    if builder.a_byte.is_none() {
   52         -
        builder.a_byte = Some(Default::default())
   53         -
    }
   54         -
    if builder.a_short.is_none() {
   55         -
        builder.a_short = Some(Default::default())
   56         -
    }
   57         -
    if builder.an_int.is_none() {
   58         -
        builder.an_int = Some(Default::default())
   59         -
    }
   60         -
    if builder.a_long.is_none() {
   61         -
        builder.a_long = Some(Default::default())
   62         -
    }
   63         -
    if builder.a_float.is_none() {
   64         -
        builder.a_float = Some(Default::default())
   65         -
    }
   66         -
    if builder.a_double.is_none() {
   67         -
        builder.a_double = Some(Default::default())
   68         -
    }
   69         -
    if builder.a_big_integer.is_none() {
   70         -
        builder.a_big_integer = Some(Default::default())
   71         -
    }
   72         -
    if builder.a_big_decimal.is_none() {
   73         -
        builder.a_big_decimal = Some(Default::default())
   74         -
    }
   75         -
    if builder.a_timestamp.is_none() {
   76         -
        builder.a_timestamp = Some(::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64))
   77         -
    }
   78         -
    if builder.a_document.is_none() {
   79         -
        builder.a_document = Some(::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64))
   80         -
    }
   81         -
    if builder.a_string_list.is_none() {
   82         -
        builder.a_string_list = Some(Default::default())
   83         -
    }
   84         -
    if builder.a_string_map.is_none() {
   85         -
        builder.a_string_map = Some(Default::default())
   86         -
    }
   87         -
    if builder.a_string_set.is_none() {
   88         -
        builder.a_string_set = Some(Default::default())
   89         -
    }
   90         -
    if builder.a_blob.is_none() {
   91         -
        builder.a_blob = Some(::aws_smithy_types::Blob::new(""))
   92         -
    }
   93         -
    if builder.a_union.is_none() {
   94         -
        builder.a_union = Some(crate::types::AUnion::Unknown)
   95         -
    }
   96         -
    builder
   97         -
}
   98         -
   99         -
pub(crate) fn validation_exception_field_correct_errors(
  100         -
    mut builder: crate::types::builders::ValidationExceptionFieldBuilder,
  101         -
) -> crate::types::builders::ValidationExceptionFieldBuilder {
  102         -
    if builder.path.is_none() {
  103         -
        builder.path = Some(Default::default())
  104         -
    }
  105         -
    if builder.message.is_none() {
  106         -
        builder.message = Some(Default::default())
  107         -
    }
  108         -
    builder
  109         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/serialization_settings.rs

@@ -1,0 +89,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/*
    3         -
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4         -
 * SPDX-License-Identifier: Apache-2.0
    5         -
 */
    6         -
    7         -
#![allow(dead_code)]
    8         -
    9         -
use aws_smithy_http::header::set_request_header_if_absent;
   10         -
use aws_smithy_types::config_bag::{Storable, StoreReplace};
   11         -
use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
   12         -
   13         -
/// Configuration for how default protocol headers are serialized
   14         -
#[derive(Clone, Debug, Default)]
   15         -
pub(crate) struct HeaderSerializationSettings {
   16         -
    omit_default_content_length: bool,
   17         -
    omit_default_content_type: bool,
   18         -
}
   19         -
   20         -
impl HeaderSerializationSettings {
   21         -
    /// Creates new [`HeaderSerializationSettings`]
   22         -
    pub(crate) fn new() -> Self {
   23         -
        Default::default()
   24         -
    }
   25         -
   26         -
    /// Omit the default `Content-Length` header during serialization
   27         -
    pub(crate) fn omit_default_content_length(self) -> Self {
   28         -
        Self {
   29         -
            omit_default_content_length: true,
   30         -
            ..self
   31         -
        }
   32         -
    }
   33         -
   34         -
    /// Omit the default `Content-Type` header during serialization
   35         -
    pub(crate) fn omit_default_content_type(self) -> Self {
   36         -
        Self {
   37         -
            omit_default_content_type: true,
   38         -
            ..self
   39         -
        }
   40         -
    }
   41         -
   42         -
    /// Returns true if the given default header name should be serialized
   43         -
    fn include_header(&self, header: &HeaderName) -> bool {
   44         -
        (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE)
   45         -
    }
   46         -
   47         -
    /// Sets a default header on the given request builder if it should be serialized
   48         -
    pub(crate) fn set_default_header(
   49         -
        &self,
   50         -
        mut request: http_1x::request::Builder,
   51         -
        header_name: HeaderName,
   52         -
        value: &str,
   53         -
    ) -> http_1x::request::Builder {
   54         -
        if self.include_header(&header_name) {
   55         -
            request = set_request_header_if_absent(request, header_name, value);
   56         -
        }
   57         -
        request
   58         -
    }
   59         -
}
   60         -
   61         -
impl Storable for HeaderSerializationSettings {
   62         -
    type Storer = StoreReplace<Self>;
   63         -
}
   64         -
   65         -
#[cfg(test)]
   66         -
mod tests {
   67         -
    use super::*;
   68         -
   69         -
    #[test]
   70         -
    fn test_include_header() {
   71         -
        let settings = HeaderSerializationSettings::default();
   72         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   73         -
        assert!(settings.include_header(&CONTENT_TYPE));
   74         -
   75         -
        let settings = HeaderSerializationSettings::default().omit_default_content_length();
   76         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   77         -
        assert!(settings.include_header(&CONTENT_TYPE));
   78         -
   79         -
        let settings = HeaderSerializationSettings::default().omit_default_content_type();
   80         -
        assert!(settings.include_header(&CONTENT_LENGTH));
   81         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   82         -
   83         -
        let settings = HeaderSerializationSettings::default()
   84         -
            .omit_default_content_type()
   85         -
            .omit_default_content_length();
   86         -
        assert!(!settings.include_header(&CONTENT_LENGTH));
   87         -
        assert!(!settings.include_header(&CONTENT_TYPE));
   88         -
    }
   89         -
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/types/_a_union.rs

@@ -37,37 +0,135 @@
   57     57   
    }
   58     58   
    /// Returns true if this is a [`Time`](crate::types::AUnion::Time).
   59     59   
    pub fn is_time(&self) -> bool {
   60     60   
        self.as_time().is_ok()
   61     61   
    }
   62     62   
    /// Returns true if the enum instance is the `Unknown` variant.
   63     63   
    pub fn is_unknown(&self) -> bool {
   64     64   
        matches!(self, Self::Unknown)
   65     65   
    }
   66     66   
}
          67  +
static AUNION_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
          68  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#AUnion", "aws.protocoltests.misc", "AUnion");
          69  +
static AUNION_MEMBER_I32: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          70  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#AUnion$i32", "aws.protocoltests.misc", "AUnion"),
          71  +
    ::aws_smithy_schema::ShapeType::Integer,
          72  +
    "i32",
          73  +
    0,
          74  +
);
          75  +
static AUNION_MEMBER_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          76  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#AUnion$string", "aws.protocoltests.misc", "AUnion"),
          77  +
    ::aws_smithy_schema::ShapeType::String,
          78  +
    "string",
          79  +
    1,
          80  +
);
          81  +
static AUNION_MEMBER_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          82  +
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#AUnion$time", "aws.protocoltests.misc", "AUnion"),
          83  +
    ::aws_smithy_schema::ShapeType::Timestamp,
          84  +
    "time",
          85  +
    2,
          86  +
);
          87  +
static AUNION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          88  +
    AUNION_SCHEMA_ID,
          89  +
    ::aws_smithy_schema::ShapeType::Union,
          90  +
    &[&AUNION_MEMBER_I32, &AUNION_MEMBER_STRING, &AUNION_MEMBER_TIME],
          91  +
);
          92  +
impl AUnion {
          93  +
    /// The schema for this shape.
          94  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &AUNION_SCHEMA;
          95  +
}
          96  +
impl ::aws_smithy_schema::serde::SerializableStruct for AUnion {
          97  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          98  +
    fn serialize_members(
          99  +
        &self,
         100  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         101  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         102  +
        match self {
         103  +
            Self::I32(val) => {
         104  +
                ser.write_integer(&AUNION_MEMBER_I32, *val)?;
         105  +
            }
         106  +
            Self::String(val) => {
         107  +
                ser.write_string(&AUNION_MEMBER_STRING, val)?;
         108  +
            }
         109  +
            Self::Time(val) => {
         110  +
                ser.write_timestamp(&AUNION_MEMBER_TIME, val)?;
         111  +
            }
         112  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
         113  +
        }
         114  +
        Ok(())
         115  +
    }
         116  +
}
         117  +
impl AUnion {
         118  +
    /// Deserializes this union from a [`ShapeDeserializer`].
         119  +
    pub fn deserialize(
         120  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         121  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         122  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
         123  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
         124  +
        deserializer.read_struct(&AUNION_SCHEMA, &mut |member, deser| {
         125  +
            result = ::std::option::Option::Some(match member.member_index() {
         126  +
                Some(0) => Self::I32(deser.read_integer(member)?),
         127  +
                Some(1) => Self::String(deser.read_string(member)?),
         128  +
                Some(2) => Self::Time(deser.read_timestamp(member)?),
         129  +
                _ => Self::Unknown,
         130  +
            });
         131  +
            Ok(())
         132  +
        })?;
         133  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
         134  +
    }
         135  +
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/types/_empty_structure.rs

@@ -1,1 +62,73 @@
   15     15   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   16     16   
    fn serialize_members(
   17     17   
        &self,
   18     18   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   19     19   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   20     20   
        Ok(())
   21     21   
    }
   22     22   
}
   23     23   
impl EmptyStructure {
   24     24   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   25         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   26         -
        deserializer: &mut D,
          25  +
    pub fn deserialize(
          26  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   27     27   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   28     28   
        #[allow(unused_variables, unused_mut)]
   29     29   
        let mut builder = Self::builder();
   30     30   
        #[allow(
   31     31   
            unused_variables,
   32     32   
            unreachable_code,
   33     33   
            clippy::single_match,
   34     34   
            clippy::match_single_binding,
   35     35   
            clippy::diverging_sub_expression
   36     36   
        )]
   37         -
        deserializer.read_struct(&EMPTYSTRUCTURE_SCHEMA, (), |_, member, deser| {
          37  +
        deserializer.read_struct(&EMPTYSTRUCTURE_SCHEMA, &mut |member, deser| {
   38     38   
            match member.member_index() {
   39     39   
                _ => {}
   40     40   
            }
   41     41   
            Ok(())
   42     42   
        })?;
   43     43   
        Ok(builder.build())
   44     44   
    }
   45     45   
}
          46  +
impl EmptyStructure {
          47  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          48  +
    pub fn deserialize_with_response(
          49  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          50  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          51  +
        _status: u16,
          52  +
        _body: &[u8],
          53  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          54  +
        Ok(Self::builder().build())
          55  +
    }
          56  +
}
   46     57   
impl EmptyStructure {
   47     58   
    /// Creates a new builder-style object to manufacture [`EmptyStructure`](crate::types::EmptyStructure).
   48     59   
    pub fn builder() -> crate::types::builders::EmptyStructureBuilder {
   49     60   
        crate::types::builders::EmptyStructureBuilder::default()
   50     61   
    }
   51     62   
}
   52     63   
   53     64   
/// A builder for [`EmptyStructure`](crate::types::EmptyStructure).
   54     65   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   55     66   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/types/_inner_shape.rs

@@ -1,1 +106,117 @@
   14     14   
}
   15     15   
static INNERSHAPE_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
   16     16   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#InnerShape", "aws.protocoltests.misc", "InnerShape");
   17     17   
static INNERSHAPE_MEMBER_REQUIRED_INNER_MOST_SHAPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   18     18   
    ::aws_smithy_schema::ShapeId::from_static(
   19     19   
        "aws.protocoltests.misc#InnerShape$requiredInnerMostShape",
   20     20   
        "aws.protocoltests.misc",
   21     21   
        "InnerShape",
   22     22   
    ),
   23     23   
    ::aws_smithy_schema::ShapeType::Structure,
   24         -
    "required_inner_most_shape",
          24  +
    "requiredInnerMostShape",
   25     25   
    0,
   26     26   
);
   27     27   
static INNERSHAPE_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   28     28   
    INNERSHAPE_SCHEMA_ID,
   29     29   
    ::aws_smithy_schema::ShapeType::Structure,
   30     30   
    &[&INNERSHAPE_MEMBER_REQUIRED_INNER_MOST_SHAPE],
   31     31   
);
   32     32   
impl InnerShape {
   33     33   
    /// The schema for this shape.
   34     34   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &INNERSHAPE_SCHEMA;
   35     35   
}
   36     36   
impl ::aws_smithy_schema::serde::SerializableStruct for InnerShape {
   37     37   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   38     38   
    fn serialize_members(
   39     39   
        &self,
   40     40   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   41     41   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   42     42   
        {
   43     43   
            let val = &self.required_inner_most_shape;
   44     44   
            ser.write_struct(&INNERSHAPE_MEMBER_REQUIRED_INNER_MOST_SHAPE, val)?;
   45     45   
        }
   46     46   
        Ok(())
   47     47   
    }
   48     48   
}
   49     49   
impl InnerShape {
   50     50   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   51         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   52         -
        deserializer: &mut D,
          51  +
    pub fn deserialize(
          52  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   53     53   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   54     54   
        #[allow(unused_variables, unused_mut)]
   55     55   
        let mut builder = Self::builder();
   56     56   
        #[allow(
   57     57   
            unused_variables,
   58     58   
            unreachable_code,
   59     59   
            clippy::single_match,
   60     60   
            clippy::match_single_binding,
   61     61   
            clippy::diverging_sub_expression
   62     62   
        )]
   63         -
        deserializer.read_struct(&INNERSHAPE_SCHEMA, (), |_, member, deser| {
          63  +
        deserializer.read_struct(&INNERSHAPE_SCHEMA, &mut |member, deser| {
   64     64   
            match member.member_index() {
   65     65   
                Some(0) => {
   66     66   
                    builder.required_inner_most_shape = Some(crate::types::InnermostShape::deserialize(deser)?);
   67     67   
                }
   68     68   
                _ => {}
   69     69   
            }
   70     70   
            Ok(())
   71     71   
        })?;
   72     72   
        builder
   73     73   
            .build()
   74     74   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   75     75   
    }
   76     76   
}
          77  +
impl InnerShape {
          78  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          79  +
    pub fn deserialize_with_response(
          80  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          81  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          82  +
        _status: u16,
          83  +
        _body: &[u8],
          84  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          85  +
        Self::deserialize(deserializer)
          86  +
    }
          87  +
}
   77     88   
impl InnerShape {
   78     89   
    /// Creates a new builder-style object to manufacture [`InnerShape`](crate::types::InnerShape).
   79     90   
    pub fn builder() -> crate::types::builders::InnerShapeBuilder {
   80     91   
        crate::types::builders::InnerShapeBuilder::default()
   81     92   
    }
   82     93   
}
   83     94   
   84     95   
/// A builder for [`InnerShape`](crate::types::InnerShape).
   85     96   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   86     97   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/types/_innermost_shape.rs

@@ -93,93 +285,285 @@
  113    113   
}
  114    114   
static INNERMOSTSHAPE_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
  115    115   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#InnermostShape", "aws.protocoltests.misc", "InnermostShape");
  116    116   
static INNERMOSTSHAPE_MEMBER_A_STRING: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  117    117   
    ::aws_smithy_schema::ShapeId::from_static(
  118    118   
        "aws.protocoltests.misc#InnermostShape$aString",
  119    119   
        "aws.protocoltests.misc",
  120    120   
        "InnermostShape",
  121    121   
    ),
  122    122   
    ::aws_smithy_schema::ShapeType::String,
  123         -
    "a_string",
         123  +
    "aString",
  124    124   
    0,
  125    125   
);
  126    126   
static INNERMOSTSHAPE_MEMBER_A_BOOLEAN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  127    127   
    ::aws_smithy_schema::ShapeId::from_static(
  128    128   
        "aws.protocoltests.misc#InnermostShape$aBoolean",
  129    129   
        "aws.protocoltests.misc",
  130    130   
        "InnermostShape",
  131    131   
    ),
  132    132   
    ::aws_smithy_schema::ShapeType::Boolean,
  133         -
    "a_boolean",
         133  +
    "aBoolean",
  134    134   
    1,
  135    135   
);
  136    136   
static INNERMOSTSHAPE_MEMBER_A_BYTE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  137    137   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#InnermostShape$aByte", "aws.protocoltests.misc", "InnermostShape"),
  138    138   
    ::aws_smithy_schema::ShapeType::Byte,
  139         -
    "a_byte",
         139  +
    "aByte",
  140    140   
    2,
  141    141   
);
  142    142   
static INNERMOSTSHAPE_MEMBER_A_SHORT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  143    143   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#InnermostShape$aShort", "aws.protocoltests.misc", "InnermostShape"),
  144    144   
    ::aws_smithy_schema::ShapeType::Short,
  145         -
    "a_short",
         145  +
    "aShort",
  146    146   
    3,
  147    147   
);
  148    148   
static INNERMOSTSHAPE_MEMBER_AN_INT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  149    149   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#InnermostShape$anInt", "aws.protocoltests.misc", "InnermostShape"),
  150    150   
    ::aws_smithy_schema::ShapeType::Integer,
  151         -
    "an_int",
         151  +
    "anInt",
  152    152   
    4,
  153    153   
);
  154    154   
static INNERMOSTSHAPE_MEMBER_A_LONG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  155    155   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#InnermostShape$aLong", "aws.protocoltests.misc", "InnermostShape"),
  156    156   
    ::aws_smithy_schema::ShapeType::Long,
  157         -
    "a_long",
         157  +
    "aLong",
  158    158   
    5,
  159    159   
);
  160    160   
static INNERMOSTSHAPE_MEMBER_A_FLOAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  161    161   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#InnermostShape$aFloat", "aws.protocoltests.misc", "InnermostShape"),
  162    162   
    ::aws_smithy_schema::ShapeType::Float,
  163         -
    "a_float",
         163  +
    "aFloat",
  164    164   
    6,
  165    165   
);
  166    166   
static INNERMOSTSHAPE_MEMBER_A_DOUBLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  167    167   
    ::aws_smithy_schema::ShapeId::from_static(
  168    168   
        "aws.protocoltests.misc#InnermostShape$aDouble",
  169    169   
        "aws.protocoltests.misc",
  170    170   
        "InnermostShape",
  171    171   
    ),
  172    172   
    ::aws_smithy_schema::ShapeType::Double,
  173         -
    "a_double",
         173  +
    "aDouble",
  174    174   
    7,
  175    175   
);
  176    176   
static INNERMOSTSHAPE_MEMBER_A_BIG_INTEGER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  177    177   
    ::aws_smithy_schema::ShapeId::from_static(
  178    178   
        "aws.protocoltests.misc#InnermostShape$aBigInteger",
  179    179   
        "aws.protocoltests.misc",
  180    180   
        "InnermostShape",
  181    181   
    ),
  182    182   
    ::aws_smithy_schema::ShapeType::BigInteger,
  183         -
    "a_big_integer",
         183  +
    "aBigInteger",
  184    184   
    8,
  185    185   
);
  186    186   
static INNERMOSTSHAPE_MEMBER_A_BIG_DECIMAL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  187    187   
    ::aws_smithy_schema::ShapeId::from_static(
  188    188   
        "aws.protocoltests.misc#InnermostShape$aBigDecimal",
  189    189   
        "aws.protocoltests.misc",
  190    190   
        "InnermostShape",
  191    191   
    ),
  192    192   
    ::aws_smithy_schema::ShapeType::BigDecimal,
  193         -
    "a_big_decimal",
         193  +
    "aBigDecimal",
  194    194   
    9,
  195    195   
);
  196    196   
static INNERMOSTSHAPE_MEMBER_A_TIMESTAMP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  197    197   
    ::aws_smithy_schema::ShapeId::from_static(
  198    198   
        "aws.protocoltests.misc#InnermostShape$aTimestamp",
  199    199   
        "aws.protocoltests.misc",
  200    200   
        "InnermostShape",
  201    201   
    ),
  202    202   
    ::aws_smithy_schema::ShapeType::Timestamp,
  203         -
    "a_timestamp",
         203  +
    "aTimestamp",
  204    204   
    10,
  205    205   
);
  206    206   
static INNERMOSTSHAPE_MEMBER_A_DOCUMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  207    207   
    ::aws_smithy_schema::ShapeId::from_static(
  208    208   
        "aws.protocoltests.misc#InnermostShape$aDocument",
  209    209   
        "aws.protocoltests.misc",
  210    210   
        "InnermostShape",
  211    211   
    ),
  212    212   
    ::aws_smithy_schema::ShapeType::Timestamp,
  213         -
    "a_document",
         213  +
    "aDocument",
  214    214   
    11,
  215    215   
);
  216    216   
static INNERMOSTSHAPE_MEMBER_A_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  217    217   
    ::aws_smithy_schema::ShapeId::from_static(
  218    218   
        "aws.protocoltests.misc#InnermostShape$aStringList",
  219    219   
        "aws.protocoltests.misc",
  220    220   
        "InnermostShape",
  221    221   
    ),
  222    222   
    ::aws_smithy_schema::ShapeType::List,
  223         -
    "a_string_list",
         223  +
    "aStringList",
  224    224   
    12,
  225    225   
);
  226    226   
static INNERMOSTSHAPE_MEMBER_A_STRING_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  227    227   
    ::aws_smithy_schema::ShapeId::from_static(
  228    228   
        "aws.protocoltests.misc#InnermostShape$aStringMap",
  229    229   
        "aws.protocoltests.misc",
  230    230   
        "InnermostShape",
  231    231   
    ),
  232    232   
    ::aws_smithy_schema::ShapeType::Map,
  233         -
    "a_string_map",
         233  +
    "aStringMap",
  234    234   
    13,
  235    235   
);
  236    236   
static INNERMOSTSHAPE_MEMBER_A_STRING_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  237    237   
    ::aws_smithy_schema::ShapeId::from_static(
  238    238   
        "aws.protocoltests.misc#InnermostShape$aStringSet",
  239    239   
        "aws.protocoltests.misc",
  240    240   
        "InnermostShape",
  241    241   
    ),
  242    242   
    ::aws_smithy_schema::ShapeType::List,
  243         -
    "a_string_set",
         243  +
    "aStringSet",
  244    244   
    14,
  245    245   
);
  246    246   
static INNERMOSTSHAPE_MEMBER_A_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  247    247   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#InnermostShape$aBlob", "aws.protocoltests.misc", "InnermostShape"),
  248    248   
    ::aws_smithy_schema::ShapeType::Blob,
  249         -
    "a_blob",
         249  +
    "aBlob",
  250    250   
    15,
  251    251   
);
  252    252   
static INNERMOSTSHAPE_MEMBER_A_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  253    253   
    ::aws_smithy_schema::ShapeId::from_static("aws.protocoltests.misc#InnermostShape$aUnion", "aws.protocoltests.misc", "InnermostShape"),
  254    254   
    ::aws_smithy_schema::ShapeType::Union,
  255         -
    "a_union",
         255  +
    "aUnion",
  256    256   
    16,
  257    257   
);
  258    258   
static INNERMOSTSHAPE_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  259    259   
    INNERMOSTSHAPE_SCHEMA_ID,
  260    260   
    ::aws_smithy_schema::ShapeType::Structure,
  261    261   
    &[
  262    262   
        &INNERMOSTSHAPE_MEMBER_A_STRING,
  263    263   
        &INNERMOSTSHAPE_MEMBER_A_BOOLEAN,
  264    264   
        &INNERMOSTSHAPE_MEMBER_A_BYTE,
  265    265   
        &INNERMOSTSHAPE_MEMBER_A_SHORT,
@@ -355,355 +528,527 @@
  375    375   
                    Ok(())
  376    376   
                },
  377    377   
            )?;
  378    378   
        }
  379    379   
        {
  380    380   
            let val = &self.a_blob;
  381    381   
            ser.write_blob(&INNERMOSTSHAPE_MEMBER_A_BLOB, val)?;
  382    382   
        }
  383    383   
        {
  384    384   
            let val = &self.a_union;
  385         -
            ser.write_null(&INNERMOSTSHAPE_MEMBER_A_UNION)?;
         385  +
            ser.write_struct(&INNERMOSTSHAPE_MEMBER_A_UNION, val)?;
  386    386   
        }
  387    387   
        Ok(())
  388    388   
    }
  389    389   
}
  390    390   
impl InnermostShape {
  391    391   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  392         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  393         -
        deserializer: &mut D,
         392  +
    pub fn deserialize(
         393  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  394    394   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  395    395   
        #[allow(unused_variables, unused_mut)]
  396    396   
        let mut builder = Self::builder();
  397    397   
        #[allow(
  398    398   
            unused_variables,
  399    399   
            unreachable_code,
  400    400   
            clippy::single_match,
  401    401   
            clippy::match_single_binding,
  402    402   
            clippy::diverging_sub_expression
  403    403   
        )]
  404         -
        deserializer.read_struct(&INNERMOSTSHAPE_SCHEMA, (), |_, member, deser| {
         404  +
        deserializer.read_struct(&INNERMOSTSHAPE_SCHEMA, &mut |member, deser| {
  405    405   
            match member.member_index() {
  406    406   
                Some(0) => {
  407    407   
                    builder.a_string = Some(deser.read_string(member)?);
  408    408   
                }
  409    409   
                Some(1) => {
  410    410   
                    builder.a_boolean = Some(deser.read_boolean(member)?);
  411    411   
                }
  412    412   
                Some(2) => {
  413    413   
                    builder.a_byte = Some(deser.read_byte(member)?);
  414    414   
                }
  415    415   
                Some(3) => {
  416    416   
                    builder.a_short = Some(deser.read_short(member)?);
  417    417   
                }
  418    418   
                Some(4) => {
  419    419   
                    builder.an_int = Some(deser.read_integer(member)?);
  420    420   
                }
  421    421   
                Some(5) => {
  422    422   
                    builder.a_long = Some(deser.read_long(member)?);
  423    423   
                }
  424    424   
                Some(6) => {
  425    425   
                    builder.a_float = Some(deser.read_float(member)?);
  426    426   
                }
  427    427   
                Some(7) => {
  428    428   
                    builder.a_double = Some(deser.read_double(member)?);
  429    429   
                }
  430    430   
                Some(8) => {
  431    431   
                    builder.a_big_integer = Some(deser.read_big_integer(member)?);
  432    432   
                }
  433    433   
                Some(9) => {
  434    434   
                    builder.a_big_decimal = Some(deser.read_big_decimal(member)?);
  435    435   
                }
  436    436   
                Some(10) => {
  437    437   
                    builder.a_timestamp = Some(deser.read_timestamp(member)?);
  438    438   
                }
  439    439   
                Some(11) => {
  440    440   
                    builder.a_document = Some(deser.read_timestamp(member)?);
  441    441   
                }
  442    442   
                Some(12) => {
  443         -
                    builder.a_string_list = Some({
  444         -
                        let container = if let Some(cap) = deser.container_size() {
  445         -
                            Vec::with_capacity(cap)
  446         -
                        } else {
  447         -
                            Vec::new()
  448         -
                        };
  449         -
                        deser.read_list(member, container, |mut list, deser| {
  450         -
                            list.push(deser.read_string(member)?);
  451         -
                            Ok(list)
  452         -
                        })?
  453         -
                    });
         443  +
                    builder.a_string_list = Some(deser.read_string_list(member)?);
  454    444   
                }
  455    445   
                Some(13) => {
  456    446   
                    builder.a_string_map = Some({
  457         -
                        let container = if let Some(cap) = deser.container_size() {
  458         -
                            std::collections::HashMap::with_capacity(cap)
  459         -
                        } else {
  460         -
                            std::collections::HashMap::new()
  461         -
                        };
  462         -
                        deser.read_map(member, container, |mut map, key, deser| {
  463         -
                            map.insert(key, deser.read_timestamp(member)?);
  464         -
                            Ok(map)
  465         -
                        })?
         447  +
                        let mut container = std::collections::HashMap::new();
         448  +
                        deser.read_map(member, &mut |key, deser| {
         449  +
                            container.insert(key, deser.read_timestamp(member)?);
         450  +
                            Ok(())
         451  +
                        })?;
         452  +
                        container
  466    453   
                    });
  467    454   
                }
  468    455   
                Some(14) => {
  469         -
                    builder.a_string_set = Some({
  470         -
                        let container = if let Some(cap) = deser.container_size() {
  471         -
                            Vec::with_capacity(cap)
  472         -
                        } else {
  473         -
                            Vec::new()
  474         -
                        };
  475         -
                        deser.read_list(member, container, |mut list, deser| {
  476         -
                            list.push(deser.read_string(member)?);
  477         -
                            Ok(list)
  478         -
                        })?
  479         -
                    });
         456  +
                    builder.a_string_set = Some(deser.read_string_list(member)?);
  480    457   
                }
  481    458   
                Some(15) => {
  482    459   
                    builder.a_blob = Some(deser.read_blob(member)?);
  483    460   
                }
  484    461   
                Some(16) => {
  485         -
                    builder.a_union = Some({
  486         -
                        let _ = member;
  487         -
                        todo!("deserialize aggregate")
  488         -
                    });
         462  +
                    builder.a_union = Some(crate::types::AUnion::deserialize(deser)?);
  489    463   
                }
  490    464   
                _ => {}
  491    465   
            }
  492    466   
            Ok(())
  493    467   
        })?;
         468  +
        builder.a_string = builder.a_string.or(Some(String::new()));
         469  +
        builder.a_boolean = builder.a_boolean.or(Some(false));
         470  +
        builder.a_byte = builder.a_byte.or(Some(0i8));
         471  +
        builder.a_short = builder.a_short.or(Some(0i16));
         472  +
        builder.an_int = builder.an_int.or(Some(0i32));
         473  +
        builder.a_long = builder.a_long.or(Some(0i64));
         474  +
        builder.a_float = builder.a_float.or(Some(0.0f32));
         475  +
        builder.a_double = builder.a_double.or(Some(0.0f64));
         476  +
        builder.a_timestamp = builder.a_timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
         477  +
        builder.a_document = builder.a_document.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
         478  +
        builder.a_string_list = builder.a_string_list.or(Some(Vec::new()));
         479  +
        builder.a_string_map = builder.a_string_map.or(Some(::std::collections::HashMap::new()));
         480  +
        builder.a_string_set = builder.a_string_set.or(Some(Vec::new()));
         481  +
        builder.a_blob = builder.a_blob.or(Some(::aws_smithy_types::Blob::new("")));
  494    482   
        builder
  495    483   
            .build()
  496    484   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  497    485   
    }
  498    486   
}
         487  +
impl InnermostShape {
         488  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         489  +
    pub fn deserialize_with_response(
         490  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         491  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         492  +
        _status: u16,
         493  +
        _body: &[u8],
         494  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         495  +
        Self::deserialize(deserializer)
         496  +
    }
         497  +
}
  499    498   
impl InnermostShape {
  500    499   
    /// Creates a new builder-style object to manufacture [`InnermostShape`](crate::types::InnermostShape).
  501    500   
    pub fn builder() -> crate::types::builders::InnermostShapeBuilder {
  502    501   
        crate::types::builders::InnermostShapeBuilder::default()
  503    502   
    }
  504    503   
}
  505    504   
  506    505   
/// A builder for [`InnermostShape`](crate::types::InnermostShape).
  507    506   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  508    507   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/types/_validation_exception_field.rs

@@ -47,47 +135,148 @@
   67     67   
        }
   68     68   
        {
   69     69   
            let val = &self.message;
   70     70   
            ser.write_string(&VALIDATIONEXCEPTIONFIELD_MEMBER_MESSAGE, val)?;
   71     71   
        }
   72     72   
        Ok(())
   73     73   
    }
   74     74   
}
   75     75   
impl ValidationExceptionField {
   76     76   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   77         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   78         -
        deserializer: &mut D,
          77  +
    pub fn deserialize(
          78  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   79     79   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   80     80   
        #[allow(unused_variables, unused_mut)]
   81     81   
        let mut builder = Self::builder();
   82     82   
        #[allow(
   83     83   
            unused_variables,
   84     84   
            unreachable_code,
   85     85   
            clippy::single_match,
   86     86   
            clippy::match_single_binding,
   87     87   
            clippy::diverging_sub_expression
   88     88   
        )]
   89         -
        deserializer.read_struct(&VALIDATIONEXCEPTIONFIELD_SCHEMA, (), |_, member, deser| {
          89  +
        deserializer.read_struct(&VALIDATIONEXCEPTIONFIELD_SCHEMA, &mut |member, deser| {
   90     90   
            match member.member_index() {
   91     91   
                Some(0) => {
   92     92   
                    builder.path = Some(deser.read_string(member)?);
   93     93   
                }
   94     94   
                Some(1) => {
   95     95   
                    builder.message = Some(deser.read_string(member)?);
   96     96   
                }
   97     97   
                _ => {}
   98     98   
            }
   99     99   
            Ok(())
  100    100   
        })?;
         101  +
        builder.path = builder.path.or(Some(String::new()));
         102  +
        builder.message = builder.message.or(Some(String::new()));
  101    103   
        builder
  102    104   
            .build()
  103    105   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  104    106   
    }
  105    107   
}
         108  +
impl ValidationExceptionField {
         109  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         110  +
    pub fn deserialize_with_response(
         111  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         112  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         113  +
        _status: u16,
         114  +
        _body: &[u8],
         115  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         116  +
        Self::deserialize(deserializer)
         117  +
    }
         118  +
}
  106    119   
impl ValidationExceptionField {
  107    120   
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::types::ValidationExceptionField).
  108    121   
    pub fn builder() -> crate::types::builders::ValidationExceptionFieldBuilder {
  109    122   
        crate::types::builders::ValidationExceptionFieldBuilder::default()
  110    123   
    }
  111    124   
}
  112    125   
  113    126   
/// A builder for [`ValidationExceptionField`](crate::types::ValidationExceptionField).
  114    127   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  115    128   
#[non_exhaustive]