Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406

Files changed:

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

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

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

@@ -1,0 +60,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_with_content_encoding_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::put_with_content_encoding::PutWithContentEncodingOutput,
    9         -
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   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::put_with_content_encoding::PutWithContentEncodingError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_put_with_content_encoding_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::put_with_content_encoding::PutWithContentEncodingOutput,
   25         -
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_put_with_content_encoding_headers(
   35         -
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
   36         -
    mut builder: ::http_1x::request::Builder,
   37         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   38         -
    if let ::std::option::Option::Some(inner_1) = &input.encoding {
   39         -
        let formatted_2 = inner_1.as_str();
   40         -
        let header_value = formatted_2;
   41         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   42         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   43         -
                "encoding",
   44         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   45         -
            )
   46         -
        })?;
   47         -
        builder = builder.header("Content-Encoding", header_value);
   48         -
    }
   49         -
    Ok(builder)
   50         -
}
   51         -
   52         -
pub fn ser_put_with_content_encoding_input(
   53         -
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
   54         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   55         -
    let mut out = String::new();
   56         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   57         -
    crate::protocol_serde::shape_put_with_content_encoding_input::ser_put_with_content_encoding_input_input(&mut object, input)?;
   58         -
    object.finish();
   59         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   60         -
}

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

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

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

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

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

@@ -1,0 +26,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_query_precedence_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::query_precedence::QueryPrecedenceOutput, crate::operation::query_precedence::QueryPrecedenceError> {
    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::query_precedence::QueryPrecedenceError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::query_precedence::QueryPrecedenceError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_query_precedence_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::query_precedence::QueryPrecedenceOutput, crate::operation::query_precedence::QueryPrecedenceError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::query_precedence::builders::QueryPrecedenceOutputBuilder::default();
   24         -
        output.build()
   25         -
    })
   26         -
}

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

@@ -1,0 +74,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_recursive_shapes_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::recursive_shapes::RecursiveShapesOutput, crate::operation::recursive_shapes::RecursiveShapesError> {
    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::recursive_shapes::RecursiveShapesError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::recursive_shapes::RecursiveShapesError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_recursive_shapes_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::recursive_shapes::RecursiveShapesOutput, crate::operation::recursive_shapes::RecursiveShapesError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes(_response_body, output)
   25         -
            .map_err(crate::operation::recursive_shapes::RecursiveShapesError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_recursive_shapes_input(
   31         -
    input: &crate::operation::recursive_shapes::RecursiveShapesInput,
   32         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   33         -
    let mut out = String::new();
   34         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   35         -
    crate::protocol_serde::shape_recursive_shapes_input::ser_recursive_shapes_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_recursive_shapes(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder,
   43         -
) -> ::std::result::Result<
   44         -
    crate::operation::recursive_shapes::builders::RecursiveShapesOutputBuilder,
   45         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   46         -
> {
   47         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   48         -
    let tokens = &mut tokens_owned;
   49         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   50         -
    loop {
   51         -
        match tokens.next().transpose()? {
   52         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   53         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   54         -
                "nested" => {
   55         -
                    builder = builder.set_nested(
   56         -
                        crate::protocol_serde::shape_recursive_shapes_input_output_nested1::de_recursive_shapes_input_output_nested1(tokens, _value)?,
   57         -
                    );
   58         -
                }
   59         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   60         -
            },
   61         -
            other => {
   62         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   63         -
                    "expected object key or end object, found: {other:?}"
   64         -
                )))
   65         -
            }
   66         -
        }
   67         -
    }
   68         -
    if tokens.next().is_some() {
   69         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   70         -
            "found more JSON tokens after completing parsing",
   71         -
        ));
   72         -
    }
   73         -
    Ok(builder)
   74         -
}

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

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

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

@@ -1,0 +64,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_recursive_shapes_input_output_nested1<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::RecursiveShapesInputOutputNested1>, ::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::RecursiveShapesInputOutputNested1Builder::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         -
                        "foo" => {
   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         -
                        "nested" => {
   26         -
                            builder = builder.set_nested(
   27         -
                                crate::protocol_serde::shape_recursive_shapes_input_output_nested2::de_recursive_shapes_input_output_nested2(
   28         -
                                    tokens, _value,
   29         -
                                )?
   30         -
                                .map(Box::new),
   31         -
                            );
   32         -
                        }
   33         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   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(builder.build()))
   43         -
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45         -
            "expected start object or null",
   46         -
        )),
   47         -
    }
   48         -
}
   49         -
   50         -
pub fn ser_recursive_shapes_input_output_nested1(
   51         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   52         -
    input: &crate::types::RecursiveShapesInputOutputNested1,
   53         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   54         -
    if let Some(var_1) = &input.foo {
   55         -
        object.key("foo").string(var_1.as_str());
   56         -
    }
   57         -
    if let Some(var_2) = &input.nested {
   58         -
        #[allow(unused_mut)]
   59         -
        let mut object_3 = object.key("nested").start_object();
   60         -
        crate::protocol_serde::shape_recursive_shapes_input_output_nested2::ser_recursive_shapes_input_output_nested2(&mut object_3, var_2)?;
   61         -
        object_3.finish();
   62         -
    }
   63         -
    Ok(())
   64         -
}

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

@@ -1,0 +63,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_recursive_shapes_input_output_nested2<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::RecursiveShapesInputOutputNested2>, ::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::RecursiveShapesInputOutputNested2Builder::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         -
                        "bar" => {
   19         -
                            builder = builder.set_bar(
   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         -
                        "recursiveMember" => {
   26         -
                            builder = builder.set_recursive_member(
   27         -
                                crate::protocol_serde::shape_recursive_shapes_input_output_nested1::de_recursive_shapes_input_output_nested1(
   28         -
                                    tokens, _value,
   29         -
                                )?,
   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(builder.build()))
   42         -
        }
   43         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44         -
            "expected start object or null",
   45         -
        )),
   46         -
    }
   47         -
}
   48         -
   49         -
pub fn ser_recursive_shapes_input_output_nested2(
   50         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   51         -
    input: &crate::types::RecursiveShapesInputOutputNested2,
   52         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   53         -
    if let Some(var_1) = &input.bar {
   54         -
        object.key("bar").string(var_1.as_str());
   55         -
    }
   56         -
    if let Some(var_2) = &input.recursive_member {
   57         -
        #[allow(unused_mut)]
   58         -
        let mut object_3 = object.key("recursiveMember").start_object();
   59         -
        crate::protocol_serde::shape_recursive_shapes_input_output_nested1::ser_recursive_shapes_input_output_nested1(&mut object_3, var_2)?;
   60         -
        object_3.finish();
   61         -
    }
   62         -
    Ok(())
   63         -
}

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

@@ -1,0 +50,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_renamed_greeting<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::RenamedGreeting>, ::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::RenamedGreetingBuilder::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         -
                        "salutation" => {
   19         -
                            builder = builder.set_salutation(
   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         -
}
   41         -
   42         -
pub fn ser_renamed_greeting(
   43         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44         -
    input: &crate::types::RenamedGreeting,
   45         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   46         -
    if let Some(var_1) = &input.salutation {
   47         -
        object.key("salutation").string(var_1.as_str());
   48         -
    }
   49         -
    Ok(())
   50         -
}

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

@@ -1,0 +34,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_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::ResponseCodeHttpFallbackOutput,
    9         -
    crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackError,
   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::ResponseCodeHttpFallbackError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_response_code_http_fallback_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::response_code_http_fallback::ResponseCodeHttpFallbackOutput,
   27         -
    crate::operation::response_code_http_fallback::ResponseCodeHttpFallbackError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::response_code_http_fallback::builders::ResponseCodeHttpFallbackOutputBuilder::default();
   32         -
        output.build()
   33         -
    })
   34         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_response_code_required.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_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::ResponseCodeRequiredOutput,
    9         -
    crate::operation::response_code_required::ResponseCodeRequiredError,
   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::ResponseCodeRequiredError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::response_code_required::ResponseCodeRequiredError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_response_code_required_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::ResponseCodeRequiredOutput,
   25         -
    crate::operation::response_code_required::ResponseCodeRequiredError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::response_code_required::builders::ResponseCodeRequiredOutputBuilder::default();
   30         -
        output = output.set_response_code(Some(_response_status as _));
   31         -
        crate::serde_util::response_code_required_output_output_correct_errors(output)
   32         -
            .build()
   33         -
            .map_err(crate::operation::response_code_required::ResponseCodeRequiredError::unhandled)?
   34         -
    })
   35         -
}

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

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

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

@@ -1,0 +147,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_simple_scalar_properties_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::simple_scalar_properties::SimpleScalarPropertiesOutput,
    9         -
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   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::simple_scalar_properties::SimpleScalarPropertiesError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_simple_scalar_properties_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::simple_scalar_properties::SimpleScalarPropertiesOutput,
   25         -
    crate::operation::simple_scalar_properties::SimpleScalarPropertiesError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder::default();
   30         -
        output = crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(_response_body, output)
   31         -
            .map_err(crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::unhandled)?;
   32         -
        output = output.set_foo(
   33         -
            crate::protocol_serde::shape_simple_scalar_properties_output::de_foo_header(_response_headers).map_err(|_| {
   34         -
                crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::unhandled("Failed to parse foo from header `X-Foo")
   35         -
            })?,
   36         -
        );
   37         -
        output.build()
   38         -
    })
   39         -
}
   40         -
   41         -
pub fn ser_simple_scalar_properties_headers(
   42         -
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
   43         -
    mut builder: ::http_1x::request::Builder,
   44         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   45         -
    if let ::std::option::Option::Some(inner_1) = &input.foo {
   46         -
        let formatted_2 = inner_1.as_str();
   47         -
        let header_value = formatted_2;
   48         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   49         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   50         -
                "foo",
   51         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   52         -
            )
   53         -
        })?;
   54         -
        builder = builder.header("X-Foo", header_value);
   55         -
    }
   56         -
    Ok(builder)
   57         -
}
   58         -
   59         -
pub fn ser_simple_scalar_properties_input(
   60         -
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
   61         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   62         -
    let mut out = String::new();
   63         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   64         -
    crate::protocol_serde::shape_simple_scalar_properties_input::ser_simple_scalar_properties_input_input(&mut object, input)?;
   65         -
    object.finish();
   66         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   67         -
}
   68         -
   69         -
pub(crate) fn de_simple_scalar_properties(
   70         -
    _value: &[u8],
   71         -
    mut builder: crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder,
   72         -
) -> ::std::result::Result<
   73         -
    crate::operation::simple_scalar_properties::builders::SimpleScalarPropertiesOutputBuilder,
   74         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   75         -
> {
   76         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   77         -
    let tokens = &mut tokens_owned;
   78         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   79         -
    loop {
   80         -
        match tokens.next().transpose()? {
   81         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   82         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   83         -
                "byteValue" => {
   84         -
                    builder = builder.set_byte_value(
   85         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   86         -
                            .map(i8::try_from)
   87         -
                            .transpose()?,
   88         -
                    );
   89         -
                }
   90         -
                "DoubleDribble" => {
   91         -
                    builder = builder
   92         -
                        .set_double_value(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
   93         -
                }
   94         -
                "falseBooleanValue" => {
   95         -
                    builder = builder.set_false_boolean_value(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   96         -
                }
   97         -
                "floatValue" => {
   98         -
                    builder = builder
   99         -
                        .set_float_value(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
  100         -
                }
  101         -
                "integerValue" => {
  102         -
                    builder = builder.set_integer_value(
  103         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  104         -
                            .map(i32::try_from)
  105         -
                            .transpose()?,
  106         -
                    );
  107         -
                }
  108         -
                "longValue" => {
  109         -
                    builder = builder.set_long_value(
  110         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  111         -
                            .map(i64::try_from)
  112         -
                            .transpose()?,
  113         -
                    );
  114         -
                }
  115         -
                "shortValue" => {
  116         -
                    builder = builder.set_short_value(
  117         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  118         -
                            .map(i16::try_from)
  119         -
                            .transpose()?,
  120         -
                    );
  121         -
                }
  122         -
                "stringValue" => {
  123         -
                    builder = builder.set_string_value(
  124         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  125         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  126         -
                            .transpose()?,
  127         -
                    );
  128         -
                }
  129         -
                "trueBooleanValue" => {
  130         -
                    builder = builder.set_true_boolean_value(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
  131         -
                }
  132         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  133         -
            },
  134         -
            other => {
  135         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  136         -
                    "expected object key or end object, found: {other:?}"
  137         -
                )))
  138         -
            }
  139         -
        }
  140         -
    }
  141         -
    if tokens.next().is_some() {
  142         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  143         -
            "found more JSON tokens after completing parsing",
  144         -
        ));
  145         -
    }
  146         -
    Ok(builder)
  147         -
}

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

@@ -1,0 +52,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_simple_scalar_properties_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.byte_value {
    7         -
        object.key("byteValue").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    if let Some(var_2) = &input.double_value {
   13         -
        object.key("DoubleDribble").number(
   14         -
            #[allow(clippy::useless_conversion)]
   15         -
            ::aws_smithy_types::Number::Float((*var_2).into()),
   16         -
        );
   17         -
    }
   18         -
    if let Some(var_3) = &input.false_boolean_value {
   19         -
        object.key("falseBooleanValue").boolean(*var_3);
   20         -
    }
   21         -
    if let Some(var_4) = &input.float_value {
   22         -
        object.key("floatValue").number(
   23         -
            #[allow(clippy::useless_conversion)]
   24         -
            ::aws_smithy_types::Number::Float((*var_4).into()),
   25         -
        );
   26         -
    }
   27         -
    if let Some(var_5) = &input.integer_value {
   28         -
        object.key("integerValue").number(
   29         -
            #[allow(clippy::useless_conversion)]
   30         -
            ::aws_smithy_types::Number::NegInt((*var_5).into()),
   31         -
        );
   32         -
    }
   33         -
    if let Some(var_6) = &input.long_value {
   34         -
        object.key("longValue").number(
   35         -
            #[allow(clippy::useless_conversion)]
   36         -
            ::aws_smithy_types::Number::NegInt((*var_6).into()),
   37         -
        );
   38         -
    }
   39         -
    if let Some(var_7) = &input.short_value {
   40         -
        object.key("shortValue").number(
   41         -
            #[allow(clippy::useless_conversion)]
   42         -
            ::aws_smithy_types::Number::NegInt((*var_7).into()),
   43         -
        );
   44         -
    }
   45         -
    if let Some(var_8) = &input.string_value {
   46         -
        object.key("stringValue").string(var_8.as_str());
   47         -
    }
   48         -
    if let Some(var_9) = &input.true_boolean_value {
   49         -
        object.key("trueBooleanValue").boolean(*var_9);
   50         -
    }
   51         -
    Ok(())
   52         -
}