Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_all_query_string_types.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_all_query_string_types_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::all_query_string_types::AllQueryStringTypesOutput,
    9         -
    crate::operation::all_query_string_types::AllQueryStringTypesError,
   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::all_query_string_types::AllQueryStringTypesError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::all_query_string_types::AllQueryStringTypesError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_all_query_string_types_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::all_query_string_types::AllQueryStringTypesOutput,
   25         -
    crate::operation::all_query_string_types::AllQueryStringTypesError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::all_query_string_types::builders::AllQueryStringTypesOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_boolean_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_boolean_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<bool>>, ::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 = ::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?;
   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/rest_json/rust-client-codegen/src/protocol_serde/shape_client_optional_defaults.rs

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_client_optional_defaults(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::ClientOptionalDefaults,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.member {
    7         -
        object.key("member").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    Ok(())
   13         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_complex_error.rs

@@ -1,0 +61,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_complex_error_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::ComplexErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::ComplexErrorBuilder, ::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         -
                "Header" => {
   14         -
                    builder = builder.set_header(
   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         -
                "TopLevel" => {
   21         -
                    builder = builder.set_top_level(
   22         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   23         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   24         -
                            .transpose()?,
   25         -
                    );
   26         -
                }
   27         -
                "Nested" => {
   28         -
                    builder = builder.set_nested(crate::protocol_serde::shape_complex_nested_error_data::de_complex_nested_error_data(
   29         -
                        tokens, _value,
   30         -
                    )?);
   31         -
                }
   32         -
                "Message" => {
   33         -
                    builder = builder.set_message(
   34         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   35         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   36         -
                            .transpose()?,
   37         -
                    );
   38         -
                }
   39         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   40         -
            },
   41         -
            other => {
   42         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   43         -
                    "expected object key or end object, found: {other:?}"
   44         -
                )))
   45         -
            }
   46         -
        }
   47         -
    }
   48         -
    if tokens.next().is_some() {
   49         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50         -
            "found more JSON tokens after completing parsing",
   51         -
        ));
   52         -
    }
   53         -
    Ok(builder)
   54         -
}
   55         -
   56         -
pub(crate) fn de_header_header(
   57         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
   58         -
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
   59         -
    let headers = header_map.get_all("X-Header");
   60         -
    ::aws_smithy_http::header::one_or_none(headers)
   61         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_complex_nested_error_data.rs

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_complex_nested_error_data<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ComplexNestedErrorData>, ::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::ComplexNestedErrorDataBuilder::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         -
                        "Fooooo" => {
   19         -
                            builder = builder.set_foo(
   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         -
                        _ => ::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         -
            Ok(Some(builder.build()))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start object or null",
   38         -
        )),
   39         -
    }
   40         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_constant_and_variable_query_string.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_constant_and_variable_query_string_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::constant_and_variable_query_string::ConstantAndVariableQueryStringOutput,
    9         -
    crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringError,
   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::constant_and_variable_query_string::ConstantAndVariableQueryStringError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_constant_and_variable_query_string_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::constant_and_variable_query_string::ConstantAndVariableQueryStringOutput,
   25         -
    crate::operation::constant_and_variable_query_string::ConstantAndVariableQueryStringError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::constant_and_variable_query_string::builders::ConstantAndVariableQueryStringOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_constant_query_string.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_constant_query_string_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::constant_query_string::ConstantQueryStringOutput,
    9         -
    crate::operation::constant_query_string::ConstantQueryStringError,
   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::constant_query_string::ConstantQueryStringError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::constant_query_string::ConstantQueryStringError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_constant_query_string_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::constant_query_string::ConstantQueryStringOutput,
   25         -
    crate::operation::constant_query_string::ConstantQueryStringError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::constant_query_string::builders::ConstantQueryStringOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_content_type_parameters.rs

@@ -1,0 +42,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_content_type_parameters_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::content_type_parameters::ContentTypeParametersOutput,
    9         -
    crate::operation::content_type_parameters::ContentTypeParametersError,
   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::content_type_parameters::ContentTypeParametersError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::content_type_parameters::ContentTypeParametersError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_content_type_parameters_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::content_type_parameters::ContentTypeParametersOutput,
   25         -
    crate::operation::content_type_parameters::ContentTypeParametersError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::content_type_parameters::builders::ContentTypeParametersOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_content_type_parameters_input(
   35         -
    input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
   36         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   37         -
    let mut out = String::new();
   38         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   39         -
    crate::protocol_serde::shape_content_type_parameters_input::ser_content_type_parameters_input_input(&mut object, input)?;
   40         -
    object.finish();
   41         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   42         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_content_type_parameters_input.rs

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_content_type_parameters_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.value {
    7         -
        object.key("value").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    Ok(())
   13         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_datetime_offsets.rs

@@ -1,0 +65,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_datetime_offsets_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::datetime_offsets::DatetimeOffsetsOutput, crate::operation::datetime_offsets::DatetimeOffsetsError> {
    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::datetime_offsets::DatetimeOffsetsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::datetime_offsets::DatetimeOffsetsError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_datetime_offsets_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::datetime_offsets::DatetimeOffsetsOutput, crate::operation::datetime_offsets::DatetimeOffsetsError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::datetime_offsets::builders::DatetimeOffsetsOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_datetime_offsets::de_datetime_offsets(_response_body, output)
   25         -
            .map_err(crate::operation::datetime_offsets::DatetimeOffsetsError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub(crate) fn de_datetime_offsets(
   31         -
    _value: &[u8],
   32         -
    mut builder: crate::operation::datetime_offsets::builders::DatetimeOffsetsOutputBuilder,
   33         -
) -> ::std::result::Result<
   34         -
    crate::operation::datetime_offsets::builders::DatetimeOffsetsOutputBuilder,
   35         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   36         -
> {
   37         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   38         -
    let tokens = &mut tokens_owned;
   39         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   40         -
    loop {
   41         -
        match tokens.next().transpose()? {
   42         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   43         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   44         -
                "datetime" => {
   45         -
                    builder = builder.set_datetime(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   46         -
                        tokens.next(),
   47         -
                        ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
   48         -
                    )?);
   49         -
                }
   50         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   51         -
            },
   52         -
            other => {
   53         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   54         -
                    "expected object key or end object, found: {other:?}"
   55         -
                )))
   56         -
            }
   57         -
        }
   58         -
    }
   59         -
    if tokens.next().is_some() {
   60         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   61         -
            "found more JSON tokens after completing parsing",
   62         -
        ));
   63         -
    }
   64         -
    Ok(builder)
   65         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_defaults.rs

@@ -1,0 +149,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_defaults(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::Defaults,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("defaultString").string(input.default_string.as_str());
    8         -
    }
    9         -
    if !input.default_boolean {
   10         -
        object.key("defaultBoolean").boolean(input.default_boolean);
   11         -
    }
   12         -
    {
   13         -
        let mut array_1 = object.key("defaultList").start_array();
   14         -
        for item_2 in &input.default_list {
   15         -
            {
   16         -
                array_1.value().string(item_2.as_str());
   17         -
            }
   18         -
        }
   19         -
        array_1.finish();
   20         -
    }
   21         -
    {
   22         -
        object.key("defaultDocumentMap").document(&input.default_document_map);
   23         -
    }
   24         -
    {
   25         -
        object.key("defaultDocumentString").document(&input.default_document_string);
   26         -
    }
   27         -
    {
   28         -
        object.key("defaultDocumentBoolean").document(&input.default_document_boolean);
   29         -
    }
   30         -
    {
   31         -
        object.key("defaultDocumentList").document(&input.default_document_list);
   32         -
    }
   33         -
    if let Some(var_3) = &input.default_null_document {
   34         -
        object.key("defaultNullDocument").document(var_3);
   35         -
    }
   36         -
    {
   37         -
        object
   38         -
            .key("defaultTimestamp")
   39         -
            .date_time(&input.default_timestamp, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
   40         -
    }
   41         -
    {
   42         -
        object
   43         -
            .key("defaultBlob")
   44         -
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.default_blob));
   45         -
    }
   46         -
    if input.default_byte != 1 {
   47         -
        object.key("defaultByte").number(
   48         -
            #[allow(clippy::useless_conversion)]
   49         -
            ::aws_smithy_types::Number::NegInt((input.default_byte).into()),
   50         -
        );
   51         -
    }
   52         -
    if input.default_short != 1 {
   53         -
        object.key("defaultShort").number(
   54         -
            #[allow(clippy::useless_conversion)]
   55         -
            ::aws_smithy_types::Number::NegInt((input.default_short).into()),
   56         -
        );
   57         -
    }
   58         -
    if input.default_integer != 10 {
   59         -
        object.key("defaultInteger").number(
   60         -
            #[allow(clippy::useless_conversion)]
   61         -
            ::aws_smithy_types::Number::NegInt((input.default_integer).into()),
   62         -
        );
   63         -
    }
   64         -
    if input.default_long != 100 {
   65         -
        object.key("defaultLong").number(
   66         -
            #[allow(clippy::useless_conversion)]
   67         -
            ::aws_smithy_types::Number::NegInt((input.default_long).into()),
   68         -
        );
   69         -
    }
   70         -
    if input.default_float != 1.0 {
   71         -
        object.key("defaultFloat").number(
   72         -
            #[allow(clippy::useless_conversion)]
   73         -
            ::aws_smithy_types::Number::Float((input.default_float).into()),
   74         -
        );
   75         -
    }
   76         -
    if input.default_double != 1.0 {
   77         -
        object.key("defaultDouble").number(
   78         -
            #[allow(clippy::useless_conversion)]
   79         -
            ::aws_smithy_types::Number::Float((input.default_double).into()),
   80         -
        );
   81         -
    }
   82         -
    {
   83         -
        #[allow(unused_mut)]
   84         -
        let mut object_4 = object.key("defaultMap").start_object();
   85         -
        for (key_5, value_6) in &input.default_map {
   86         -
            {
   87         -
                object_4.key(key_5.as_str()).string(value_6.as_str());
   88         -
            }
   89         -
        }
   90         -
        object_4.finish();
   91         -
    }
   92         -
    {
   93         -
        object.key("defaultEnum").string(input.default_enum.as_str());
   94         -
    }
   95         -
    if input.default_int_enum != 1 {
   96         -
        object.key("defaultIntEnum").number(
   97         -
            #[allow(clippy::useless_conversion)]
   98         -
            ::aws_smithy_types::Number::NegInt((input.default_int_enum).into()),
   99         -
        );
  100         -
    }
  101         -
    {
  102         -
        object.key("emptyString").string(input.empty_string.as_str());
  103         -
    }
  104         -
    if input.false_boolean {
  105         -
        object.key("falseBoolean").boolean(input.false_boolean);
  106         -
    }
  107         -
    {
  108         -
        object
  109         -
            .key("emptyBlob")
  110         -
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.empty_blob));
  111         -
    }
  112         -
    if input.zero_byte != 0 {
  113         -
        object.key("zeroByte").number(
  114         -
            #[allow(clippy::useless_conversion)]
  115         -
            ::aws_smithy_types::Number::NegInt((input.zero_byte).into()),
  116         -
        );
  117         -
    }
  118         -
    if input.zero_short != 0 {
  119         -
        object.key("zeroShort").number(
  120         -
            #[allow(clippy::useless_conversion)]
  121         -
            ::aws_smithy_types::Number::NegInt((input.zero_short).into()),
  122         -
        );
  123         -
    }
  124         -
    if input.zero_integer != 0 {
  125         -
        object.key("zeroInteger").number(
  126         -
            #[allow(clippy::useless_conversion)]
  127         -
            ::aws_smithy_types::Number::NegInt((input.zero_integer).into()),
  128         -
        );
  129         -
    }
  130         -
    if input.zero_long != 0 {
  131         -
        object.key("zeroLong").number(
  132         -
            #[allow(clippy::useless_conversion)]
  133         -
            ::aws_smithy_types::Number::NegInt((input.zero_long).into()),
  134         -
        );
  135         -
    }
  136         -
    if input.zero_float != 0.0 {
  137         -
        object.key("zeroFloat").number(
  138         -
            #[allow(clippy::useless_conversion)]
  139         -
            ::aws_smithy_types::Number::Float((input.zero_float).into()),
  140         -
        );
  141         -
    }
  142         -
    if input.zero_double != 0.0 {
  143         -
        object.key("zeroDouble").number(
  144         -
            #[allow(clippy::useless_conversion)]
  145         -
            ::aws_smithy_types::Number::Float((input.zero_double).into()),
  146         -
        );
  147         -
    }
  148         -
    Ok(())
  149         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_dense_boolean_map.rs

@@ -1,0 +43,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_dense_boolean_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::collections::HashMap<::std::string::String, bool>>, ::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         -
            let mut map = ::std::collections::HashMap::new();
   13         -
            loop {
   14         -
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   17         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   18         -
                        let value = ::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?;
   19         -
                        match value {
   20         -
                            Some(value) => {
   21         -
                                map.insert(key, value);
   22         -
                            }
   23         -
                            None => {
   24         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25         -
                                    "dense map cannot contain null values",
   26         -
                                ))
   27         -
                            }
   28         -
                        }
   29         -
                    }
   30         -
                    other => {
   31         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   32         -
                            "expected object key or end object, found: {other:?}"
   33         -
                        )))
   34         -
                    }
   35         -
                }
   36         -
            }
   37         -
            Ok(Some(map))
   38         -
        }
   39         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   40         -
            "expected start object or null",
   41         -
        )),
   42         -
    }
   43         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_dense_number_map.rs

@@ -1,0 +45,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_dense_number_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::collections::HashMap<::std::string::String, i32>>, ::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         -
            let mut map = ::std::collections::HashMap::new();
   13         -
            loop {
   14         -
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   17         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   18         -
                        let value = ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   19         -
                            .map(i32::try_from)
   20         -
                            .transpose()?;
   21         -
                        match value {
   22         -
                            Some(value) => {
   23         -
                                map.insert(key, value);
   24         -
                            }
   25         -
                            None => {
   26         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   27         -
                                    "dense map cannot contain null values",
   28         -
                                ))
   29         -
                            }
   30         -
                        }
   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         -
            Ok(Some(map))
   40         -
        }
   41         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   42         -
            "expected start object or null",
   43         -
        )),
   44         -
    }
   45         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_dense_set_map.rs

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_dense_set_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = crate::protocol_serde::shape_string_set::de_string_set(tokens, _value)?;
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_dense_string_map.rs

@@ -1,0 +48,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_dense_string_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   22         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23         -
                            .transpose()?;
   24         -
                        match value {
   25         -
                            Some(value) => {
   26         -
                                map.insert(key, value);
   27         -
                            }
   28         -
                            None => {
   29         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30         -
                                    "dense map cannot contain null values",
   31         -
                                ))
   32         -
                            }
   33         -
                        }
   34         -
                    }
   35         -
                    other => {
   36         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   37         -
                            "expected object key or end object, found: {other:?}"
   38         -
                        )))
   39         -
                    }
   40         -
                }
   41         -
            }
   42         -
            Ok(Some(map))
   43         -
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45         -
            "expected start object or null",
   46         -
        )),
   47         -
    }
   48         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_dense_struct_map.rs

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_dense_struct_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, crate::types::GreetingStruct>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = crate::protocol_serde::shape_greeting_struct::de_greeting_struct(tokens, _value)?;
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}