Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_invalid_greeting.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_invalid_greeting_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::InvalidGreetingBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::InvalidGreetingBuilder, ::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/json_rpc11/rust-client-codegen/src/protocol_serde/shape_json_enums.rs

@@ -1,0 +96,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_json_enums_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::json_enums::JsonEnumsOutput, crate::operation::json_enums::JsonEnumsError> {
    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::json_enums::JsonEnumsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::json_enums::JsonEnumsError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_json_enums_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::json_enums::JsonEnumsOutput, crate::operation::json_enums::JsonEnumsError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::json_enums::builders::JsonEnumsOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_json_enums::de_json_enums(_response_body, output)
   25         -
            .map_err(crate::operation::json_enums::JsonEnumsError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_json_enums_input(
   31         -
    input: &crate::operation::json_enums::JsonEnumsInput,
   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_json_enums_input::ser_json_enums_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_json_enums(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::json_enums::builders::JsonEnumsOutputBuilder,
   43         -
) -> ::std::result::Result<crate::operation::json_enums::builders::JsonEnumsOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   44         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   45         -
    let tokens = &mut tokens_owned;
   46         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   47         -
    loop {
   48         -
        match tokens.next().transpose()? {
   49         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   50         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   51         -
                "fooEnum1" => {
   52         -
                    builder = builder.set_foo_enum1(
   53         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   54         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::FooEnum::from(u.as_ref())))
   55         -
                            .transpose()?,
   56         -
                    );
   57         -
                }
   58         -
                "fooEnum2" => {
   59         -
                    builder = builder.set_foo_enum2(
   60         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   61         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::FooEnum::from(u.as_ref())))
   62         -
                            .transpose()?,
   63         -
                    );
   64         -
                }
   65         -
                "fooEnum3" => {
   66         -
                    builder = builder.set_foo_enum3(
   67         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   68         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::FooEnum::from(u.as_ref())))
   69         -
                            .transpose()?,
   70         -
                    );
   71         -
                }
   72         -
                "fooEnumList" => {
   73         -
                    builder = builder.set_foo_enum_list(crate::protocol_serde::shape_foo_enum_list::de_foo_enum_list(tokens, _value)?);
   74         -
                }
   75         -
                "fooEnumSet" => {
   76         -
                    builder = builder.set_foo_enum_set(crate::protocol_serde::shape_foo_enum_set::de_foo_enum_set(tokens, _value)?);
   77         -
                }
   78         -
                "fooEnumMap" => {
   79         -
                    builder = builder.set_foo_enum_map(crate::protocol_serde::shape_foo_enum_map::de_foo_enum_map(tokens, _value)?);
   80         -
                }
   81         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   82         -
            },
   83         -
            other => {
   84         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   85         -
                    "expected object key or end object, found: {other:?}"
   86         -
                )))
   87         -
            }
   88         -
        }
   89         -
    }
   90         -
    if tokens.next().is_some() {
   91         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   92         -
            "found more JSON tokens after completing parsing",
   93         -
        ));
   94         -
    }
   95         -
    Ok(builder)
   96         -
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_json_enums_input.rs

@@ -1,0 +44,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_json_enums_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::json_enums::JsonEnumsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.foo_enum1 {
    7         -
        object.key("fooEnum1").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.foo_enum2 {
   10         -
        object.key("fooEnum2").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.foo_enum3 {
   13         -
        object.key("fooEnum3").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.foo_enum_list {
   16         -
        let mut array_5 = object.key("fooEnumList").start_array();
   17         -
        for item_6 in var_4 {
   18         -
            {
   19         -
                array_5.value().string(item_6.as_str());
   20         -
            }
   21         -
        }
   22         -
        array_5.finish();
   23         -
    }
   24         -
    if let Some(var_7) = &input.foo_enum_set {
   25         -
        let mut array_8 = object.key("fooEnumSet").start_array();
   26         -
        for item_9 in var_7 {
   27         -
            {
   28         -
                array_8.value().string(item_9.as_str());
   29         -
            }
   30         -
        }
   31         -
        array_8.finish();
   32         -
    }
   33         -
    if let Some(var_10) = &input.foo_enum_map {
   34         -
        #[allow(unused_mut)]
   35         -
        let mut object_11 = object.key("fooEnumMap").start_object();
   36         -
        for (key_12, value_13) in var_10 {
   37         -
            {
   38         -
                object_11.key(key_12.as_str()).string(value_13.as_str());
   39         -
            }
   40         -
        }
   41         -
        object_11.finish();
   42         -
    }
   43         -
    Ok(())
   44         -
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_json_int_enums.rs

@@ -1,0 +99,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_json_int_enums_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::json_int_enums::JsonIntEnumsOutput, crate::operation::json_int_enums::JsonIntEnumsError> {
    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::json_int_enums::JsonIntEnumsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::json_int_enums::JsonIntEnumsError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_json_int_enums_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::json_int_enums::JsonIntEnumsOutput, crate::operation::json_int_enums::JsonIntEnumsError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::json_int_enums::builders::JsonIntEnumsOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_json_int_enums::de_json_int_enums(_response_body, output)
   25         -
            .map_err(crate::operation::json_int_enums::JsonIntEnumsError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_json_int_enums_input(
   31         -
    input: &crate::operation::json_int_enums::JsonIntEnumsInput,
   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_json_int_enums_input::ser_json_int_enums_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_json_int_enums(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::json_int_enums::builders::JsonIntEnumsOutputBuilder,
   43         -
) -> ::std::result::Result<
   44         -
    crate::operation::json_int_enums::builders::JsonIntEnumsOutputBuilder,
   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         -
                "intEnum1" => {
   55         -
                    builder = builder.set_int_enum1(
   56         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   57         -
                            .map(i32::try_from)
   58         -
                            .transpose()?,
   59         -
                    );
   60         -
                }
   61         -
                "intEnum2" => {
   62         -
                    builder = builder.set_int_enum2(
   63         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   64         -
                            .map(i32::try_from)
   65         -
                            .transpose()?,
   66         -
                    );
   67         -
                }
   68         -
                "intEnum3" => {
   69         -
                    builder = builder.set_int_enum3(
   70         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   71         -
                            .map(i32::try_from)
   72         -
                            .transpose()?,
   73         -
                    );
   74         -
                }
   75         -
                "intEnumList" => {
   76         -
                    builder = builder.set_int_enum_list(crate::protocol_serde::shape_integer_enum_list::de_integer_enum_list(tokens, _value)?);
   77         -
                }
   78         -
                "intEnumSet" => {
   79         -
                    builder = builder.set_int_enum_set(crate::protocol_serde::shape_integer_enum_set::de_integer_enum_set(tokens, _value)?);
   80         -
                }
   81         -
                "intEnumMap" => {
   82         -
                    builder = builder.set_int_enum_map(crate::protocol_serde::shape_integer_enum_map::de_integer_enum_map(tokens, _value)?);
   83         -
                }
   84         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   85         -
            },
   86         -
            other => {
   87         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   88         -
                    "expected object key or end object, found: {other:?}"
   89         -
                )))
   90         -
            }
   91         -
        }
   92         -
    }
   93         -
    if tokens.next().is_some() {
   94         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   95         -
            "found more JSON tokens after completing parsing",
   96         -
        ));
   97         -
    }
   98         -
    Ok(builder)
   99         -
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_json_int_enums_input.rs

@@ -1,0 +62,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_json_int_enums_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::json_int_enums::JsonIntEnumsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.int_enum1 {
    7         -
        object.key("intEnum1").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    if let Some(var_2) = &input.int_enum2 {
   13         -
        object.key("intEnum2").number(
   14         -
            #[allow(clippy::useless_conversion)]
   15         -
            ::aws_smithy_types::Number::NegInt((*var_2).into()),
   16         -
        );
   17         -
    }
   18         -
    if let Some(var_3) = &input.int_enum3 {
   19         -
        object.key("intEnum3").number(
   20         -
            #[allow(clippy::useless_conversion)]
   21         -
            ::aws_smithy_types::Number::NegInt((*var_3).into()),
   22         -
        );
   23         -
    }
   24         -
    if let Some(var_4) = &input.int_enum_list {
   25         -
        let mut array_5 = object.key("intEnumList").start_array();
   26         -
        for item_6 in var_4 {
   27         -
            {
   28         -
                array_5.value().number(
   29         -
                    #[allow(clippy::useless_conversion)]
   30         -
                    ::aws_smithy_types::Number::NegInt((*item_6).into()),
   31         -
                );
   32         -
            }
   33         -
        }
   34         -
        array_5.finish();
   35         -
    }
   36         -
    if let Some(var_7) = &input.int_enum_set {
   37         -
        let mut array_8 = object.key("intEnumSet").start_array();
   38         -
        for item_9 in var_7 {
   39         -
            {
   40         -
                array_8.value().number(
   41         -
                    #[allow(clippy::useless_conversion)]
   42         -
                    ::aws_smithy_types::Number::NegInt((*item_9).into()),
   43         -
                );
   44         -
            }
   45         -
        }
   46         -
        array_8.finish();
   47         -
    }
   48         -
    if let Some(var_10) = &input.int_enum_map {
   49         -
        #[allow(unused_mut)]
   50         -
        let mut object_11 = object.key("intEnumMap").start_object();
   51         -
        for (key_12, value_13) in var_10 {
   52         -
            {
   53         -
                object_11.key(key_12.as_str()).number(
   54         -
                    #[allow(clippy::useless_conversion)]
   55         -
                    ::aws_smithy_types::Number::NegInt((*value_13).into()),
   56         -
                );
   57         -
            }
   58         -
        }
   59         -
        object_11.finish();
   60         -
    }
   61         -
    Ok(())
   62         -
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_json_unions.rs

@@ -1,0 +70,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_json_unions_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::json_unions::JsonUnionsOutput, crate::operation::json_unions::JsonUnionsError> {
    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::json_unions::JsonUnionsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::json_unions::JsonUnionsError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_json_unions_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::json_unions::JsonUnionsOutput, crate::operation::json_unions::JsonUnionsError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::json_unions::builders::JsonUnionsOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_json_unions::de_json_unions(_response_body, output)
   25         -
            .map_err(crate::operation::json_unions::JsonUnionsError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_json_unions_input(
   31         -
    input: &crate::operation::json_unions::JsonUnionsInput,
   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_json_unions_input::ser_json_unions_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_json_unions(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::json_unions::builders::JsonUnionsOutputBuilder,
   43         -
) -> ::std::result::Result<crate::operation::json_unions::builders::JsonUnionsOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
   44         -
{
   45         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   46         -
    let tokens = &mut tokens_owned;
   47         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   48         -
    loop {
   49         -
        match tokens.next().transpose()? {
   50         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   51         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   52         -
                "contents" => {
   53         -
                    builder = builder.set_contents(crate::protocol_serde::shape_my_union::de_my_union(tokens, _value)?);
   54         -
                }
   55         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   56         -
            },
   57         -
            other => {
   58         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   59         -
                    "expected object key or end object, found: {other:?}"
   60         -
                )))
   61         -
            }
   62         -
        }
   63         -
    }
   64         -
    if tokens.next().is_some() {
   65         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   66         -
            "found more JSON tokens after completing parsing",
   67         -
        ));
   68         -
    }
   69         -
    Ok(builder)
   70         -
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_json_unions_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_kitchen_sink.rs

@@ -1,0 +376,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_kitchen_sink<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::KitchenSink>, ::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::KitchenSinkBuilder::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         -
                        "Blob" => {
   19         -
                            builder = builder.set_blob(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
   20         -
                        }
   21         -
                        "Boolean" => {
   22         -
                            builder = builder.set_boolean(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   23         -
                        }
   24         -
                        "Double" => {
   25         -
                            builder = builder
   26         -
                                .set_double(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
   27         -
                        }
   28         -
                        "EmptyStruct" => {
   29         -
                            builder = builder.set_empty_struct(crate::protocol_serde::shape_empty_struct::de_empty_struct(tokens, _value)?);
   30         -
                        }
   31         -
                        "Float" => {
   32         -
                            builder = builder
   33         -
                                .set_float(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
   34         -
                        }
   35         -
                        "HttpdateTimestamp" => {
   36         -
                            builder = builder.set_httpdate_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   37         -
                                tokens.next(),
   38         -
                                ::aws_smithy_types::date_time::Format::HttpDate,
   39         -
                            )?);
   40         -
                        }
   41         -
                        "Integer" => {
   42         -
                            builder = builder.set_integer(
   43         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   44         -
                                    .map(i32::try_from)
   45         -
                                    .transpose()?,
   46         -
                            );
   47         -
                        }
   48         -
                        "Iso8601Timestamp" => {
   49         -
                            builder = builder.set_iso8601_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   50         -
                                tokens.next(),
   51         -
                                ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
   52         -
                            )?);
   53         -
                        }
   54         -
                        "JsonValue" => {
   55         -
                            builder = builder.set_json_value(
   56         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   57         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   58         -
                                    .transpose()?,
   59         -
                            );
   60         -
                        }
   61         -
                        "ListOfLists" => {
   62         -
                            builder = builder.set_list_of_lists(crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(
   63         -
                                tokens, _value,
   64         -
                            )?);
   65         -
                        }
   66         -
                        "ListOfMapsOfStrings" => {
   67         -
                            builder = builder.set_list_of_maps_of_strings(
   68         -
                                crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(tokens, _value)?,
   69         -
                            );
   70         -
                        }
   71         -
                        "ListOfStrings" => {
   72         -
                            builder = builder.set_list_of_strings(crate::protocol_serde::shape_list_of_strings::de_list_of_strings(tokens, _value)?);
   73         -
                        }
   74         -
                        "ListOfStructs" => {
   75         -
                            builder = builder.set_list_of_structs(crate::protocol_serde::shape_list_of_structs::de_list_of_structs(tokens, _value)?);
   76         -
                        }
   77         -
                        "Long" => {
   78         -
                            builder = builder.set_long(
   79         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   80         -
                                    .map(i64::try_from)
   81         -
                                    .transpose()?,
   82         -
                            );
   83         -
                        }
   84         -
                        "MapOfListsOfStrings" => {
   85         -
                            builder = builder.set_map_of_lists_of_strings(
   86         -
                                crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(tokens, _value)?,
   87         -
                            );
   88         -
                        }
   89         -
                        "MapOfMaps" => {
   90         -
                            builder = builder.set_map_of_maps(crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(
   91         -
                                tokens, _value,
   92         -
                            )?);
   93         -
                        }
   94         -
                        "MapOfStrings" => {
   95         -
                            builder = builder.set_map_of_strings(crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens, _value)?);
   96         -
                        }
   97         -
                        "MapOfStructs" => {
   98         -
                            builder = builder.set_map_of_structs(crate::protocol_serde::shape_map_of_structs::de_map_of_structs(tokens, _value)?);
   99         -
                        }
  100         -
                        "RecursiveList" => {
  101         -
                            builder = builder.set_recursive_list(crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(
  102         -
                                tokens, _value,
  103         -
                            )?);
  104         -
                        }
  105         -
                        "RecursiveMap" => {
  106         -
                            builder = builder.set_recursive_map(crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(
  107         -
                                tokens, _value,
  108         -
                            )?);
  109         -
                        }
  110         -
                        "RecursiveStruct" => {
  111         -
                            builder = builder
  112         -
                                .set_recursive_struct(crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(tokens, _value)?.map(Box::new));
  113         -
                        }
  114         -
                        "SimpleStruct" => {
  115         -
                            builder = builder.set_simple_struct(crate::protocol_serde::shape_simple_struct::de_simple_struct(tokens, _value)?);
  116         -
                        }
  117         -
                        "String" => {
  118         -
                            builder = builder.set_string(
  119         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  120         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  121         -
                                    .transpose()?,
  122         -
                            );
  123         -
                        }
  124         -
                        "StructWithJsonName" => {
  125         -
                            builder = builder.set_struct_with_json_name(
  126         -
                                crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(tokens, _value)?,
  127         -
                            );
  128         -
                        }
  129         -
                        "Timestamp" => {
  130         -
                            builder = builder.set_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  131         -
                                tokens.next(),
  132         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
  133         -
                            )?);
  134         -
                        }
  135         -
                        "UnixTimestamp" => {
  136         -
                            builder = builder.set_unix_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  137         -
                                tokens.next(),
  138         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
  139         -
                            )?);
  140         -
                        }
  141         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  142         -
                    },
  143         -
                    other => {
  144         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  145         -
                            "expected object key or end object, found: {other:?}"
  146         -
                        )))
  147         -
                    }
  148         -
                }
  149         -
            }
  150         -
            Ok(Some(builder.build()))
  151         -
        }
  152         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  153         -
            "expected start object or null",
  154         -
        )),
  155         -
    }
  156         -
}
  157         -
  158         -
pub fn ser_kitchen_sink(
  159         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
  160         -
    input: &crate::types::KitchenSink,
  161         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
  162         -
    if let Some(var_1) = &input.blob {
  163         -
        object.key("Blob").string_unchecked(&::aws_smithy_types::base64::encode(var_1));
  164         -
    }
  165         -
    if let Some(var_2) = &input.boolean {
  166         -
        object.key("Boolean").boolean(*var_2);
  167         -
    }
  168         -
    if let Some(var_3) = &input.double {
  169         -
        object.key("Double").number(
  170         -
            #[allow(clippy::useless_conversion)]
  171         -
            ::aws_smithy_types::Number::Float((*var_3).into()),
  172         -
        );
  173         -
    }
  174         -
    if let Some(var_4) = &input.empty_struct {
  175         -
        #[allow(unused_mut)]
  176         -
        let mut object_5 = object.key("EmptyStruct").start_object();
  177         -
        crate::protocol_serde::shape_empty_struct::ser_empty_struct(&mut object_5, var_4)?;
  178         -
        object_5.finish();
  179         -
    }
  180         -
    if let Some(var_6) = &input.float {
  181         -
        object.key("Float").number(
  182         -
            #[allow(clippy::useless_conversion)]
  183         -
            ::aws_smithy_types::Number::Float((*var_6).into()),
  184         -
        );
  185         -
    }
  186         -
    if let Some(var_7) = &input.httpdate_timestamp {
  187         -
        object
  188         -
            .key("HttpdateTimestamp")
  189         -
            .date_time(var_7, ::aws_smithy_types::date_time::Format::HttpDate)?;
  190         -
    }
  191         -
    if let Some(var_8) = &input.integer {
  192         -
        object.key("Integer").number(
  193         -
            #[allow(clippy::useless_conversion)]
  194         -
            ::aws_smithy_types::Number::NegInt((*var_8).into()),
  195         -
        );
  196         -
    }
  197         -
    if let Some(var_9) = &input.iso8601_timestamp {
  198         -
        object
  199         -
            .key("Iso8601Timestamp")
  200         -
            .date_time(var_9, ::aws_smithy_types::date_time::Format::DateTime)?;
  201         -
    }
  202         -
    if let Some(var_10) = &input.json_value {
  203         -
        object.key("JsonValue").string(var_10.as_str());
  204         -
    }
  205         -
    if let Some(var_11) = &input.list_of_lists {
  206         -
        let mut array_12 = object.key("ListOfLists").start_array();
  207         -
        for item_13 in var_11 {
  208         -
            {
  209         -
                let mut array_14 = array_12.value().start_array();
  210         -
                for item_15 in item_13 {
  211         -
                    {
  212         -
                        array_14.value().string(item_15.as_str());
  213         -
                    }
  214         -
                }
  215         -
                array_14.finish();
  216         -
            }
  217         -
        }
  218         -
        array_12.finish();
  219         -
    }
  220         -
    if let Some(var_16) = &input.list_of_maps_of_strings {
  221         -
        let mut array_17 = object.key("ListOfMapsOfStrings").start_array();
  222         -
        for item_18 in var_16 {
  223         -
            {
  224         -
                #[allow(unused_mut)]
  225         -
                let mut object_19 = array_17.value().start_object();
  226         -
                for (key_20, value_21) in item_18 {
  227         -
                    {
  228         -
                        object_19.key(key_20.as_str()).string(value_21.as_str());
  229         -
                    }
  230         -
                }
  231         -
                object_19.finish();
  232         -
            }
  233         -
        }
  234         -
        array_17.finish();
  235         -
    }
  236         -
    if let Some(var_22) = &input.list_of_strings {
  237         -
        let mut array_23 = object.key("ListOfStrings").start_array();
  238         -
        for item_24 in var_22 {
  239         -
            {
  240         -
                array_23.value().string(item_24.as_str());
  241         -
            }
  242         -
        }
  243         -
        array_23.finish();
  244         -
    }
  245         -
    if let Some(var_25) = &input.list_of_structs {
  246         -
        let mut array_26 = object.key("ListOfStructs").start_array();
  247         -
        for item_27 in var_25 {
  248         -
            {
  249         -
                #[allow(unused_mut)]
  250         -
                let mut object_28 = array_26.value().start_object();
  251         -
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(&mut object_28, item_27)?;
  252         -
                object_28.finish();
  253         -
            }
  254         -
        }
  255         -
        array_26.finish();
  256         -
    }
  257         -
    if let Some(var_29) = &input.long {
  258         -
        object.key("Long").number(
  259         -
            #[allow(clippy::useless_conversion)]
  260         -
            ::aws_smithy_types::Number::NegInt((*var_29).into()),
  261         -
        );
  262         -
    }
  263         -
    if let Some(var_30) = &input.map_of_lists_of_strings {
  264         -
        #[allow(unused_mut)]
  265         -
        let mut object_31 = object.key("MapOfListsOfStrings").start_object();
  266         -
        for (key_32, value_33) in var_30 {
  267         -
            {
  268         -
                let mut array_34 = object_31.key(key_32.as_str()).start_array();
  269         -
                for item_35 in value_33 {
  270         -
                    {
  271         -
                        array_34.value().string(item_35.as_str());
  272         -
                    }
  273         -
                }
  274         -
                array_34.finish();
  275         -
            }
  276         -
        }
  277         -
        object_31.finish();
  278         -
    }
  279         -
    if let Some(var_36) = &input.map_of_maps {
  280         -
        #[allow(unused_mut)]
  281         -
        let mut object_37 = object.key("MapOfMaps").start_object();
  282         -
        for (key_38, value_39) in var_36 {
  283         -
            {
  284         -
                #[allow(unused_mut)]
  285         -
                let mut object_40 = object_37.key(key_38.as_str()).start_object();
  286         -
                for (key_41, value_42) in value_39 {
  287         -
                    {
  288         -
                        object_40.key(key_41.as_str()).string(value_42.as_str());
  289         -
                    }
  290         -
                }
  291         -
                object_40.finish();
  292         -
            }
  293         -
        }
  294         -
        object_37.finish();
  295         -
    }
  296         -
    if let Some(var_43) = &input.map_of_strings {
  297         -
        #[allow(unused_mut)]
  298         -
        let mut object_44 = object.key("MapOfStrings").start_object();
  299         -
        for (key_45, value_46) in var_43 {
  300         -
            {
  301         -
                object_44.key(key_45.as_str()).string(value_46.as_str());
  302         -
            }
  303         -
        }
  304         -
        object_44.finish();
  305         -
    }
  306         -
    if let Some(var_47) = &input.map_of_structs {
  307         -
        #[allow(unused_mut)]
  308         -
        let mut object_48 = object.key("MapOfStructs").start_object();
  309         -
        for (key_49, value_50) in var_47 {
  310         -
            {
  311         -
                #[allow(unused_mut)]
  312         -
                let mut object_51 = object_48.key(key_49.as_str()).start_object();
  313         -
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(&mut object_51, value_50)?;
  314         -
                object_51.finish();
  315         -
            }
  316         -
        }
  317         -
        object_48.finish();
  318         -
    }
  319         -
    if let Some(var_52) = &input.recursive_list {
  320         -
        let mut array_53 = object.key("RecursiveList").start_array();
  321         -
        for item_54 in var_52 {
  322         -
            {
  323         -
                #[allow(unused_mut)]
  324         -
                let mut object_55 = array_53.value().start_object();
  325         -
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(&mut object_55, item_54)?;
  326         -
                object_55.finish();
  327         -
            }
  328         -
        }
  329         -
        array_53.finish();
  330         -
    }
  331         -
    if let Some(var_56) = &input.recursive_map {
  332         -
        #[allow(unused_mut)]
  333         -
        let mut object_57 = object.key("RecursiveMap").start_object();
  334         -
        for (key_58, value_59) in var_56 {
  335         -
            {
  336         -
                #[allow(unused_mut)]
  337         -
                let mut object_60 = object_57.key(key_58.as_str()).start_object();
  338         -
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(&mut object_60, value_59)?;
  339         -
                object_60.finish();
  340         -
            }
  341         -
        }
  342         -
        object_57.finish();
  343         -
    }
  344         -
    if let Some(var_61) = &input.recursive_struct {
  345         -
        #[allow(unused_mut)]
  346         -
        let mut object_62 = object.key("RecursiveStruct").start_object();
  347         -
        crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(&mut object_62, var_61)?;
  348         -
        object_62.finish();
  349         -
    }
  350         -
    if let Some(var_63) = &input.simple_struct {
  351         -
        #[allow(unused_mut)]
  352         -
        let mut object_64 = object.key("SimpleStruct").start_object();
  353         -
        crate::protocol_serde::shape_simple_struct::ser_simple_struct(&mut object_64, var_63)?;
  354         -
        object_64.finish();
  355         -
    }
  356         -
    if let Some(var_65) = &input.string {
  357         -
        object.key("String").string(var_65.as_str());
  358         -
    }
  359         -
    if let Some(var_66) = &input.struct_with_json_name {
  360         -
        #[allow(unused_mut)]
  361         -
        let mut object_67 = object.key("StructWithJsonName").start_object();
  362         -
        crate::protocol_serde::shape_struct_with_json_name::ser_struct_with_json_name(&mut object_67, var_66)?;
  363         -
        object_67.finish();
  364         -
    }
  365         -
    if let Some(var_68) = &input.timestamp {
  366         -
        object
  367         -
            .key("Timestamp")
  368         -
            .date_time(var_68, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  369         -
    }
  370         -
    if let Some(var_69) = &input.unix_timestamp {
  371         -
        object
  372         -
            .key("UnixTimestamp")
  373         -
            .date_time(var_69, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  374         -
    }
  375         -
    Ok(())
  376         -
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/protocol_serde/shape_kitchen_sink_operation.rs

@@ -1,0 +235,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_kitchen_sink_operation_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput,
    9         -
    crate::operation::kitchen_sink_operation::KitchenSinkOperationError,
   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::kitchen_sink_operation::KitchenSinkOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::kitchen_sink_operation::KitchenSinkOperationError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "ErrorWithMembers" => crate::operation::kitchen_sink_operation::KitchenSinkOperationError::ErrorWithMembers({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ErrorWithMembersBuilder::default();
   27         -
                output = crate::protocol_serde::shape_error_with_members::de_error_with_members_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::kitchen_sink_operation::KitchenSinkOperationError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
   32         -
            if tmp.message.is_none() {
   33         -
                tmp.message = _error_message;
   34         -
            }
   35         -
            tmp
   36         -
        }),
   37         -
        "ErrorWithoutMembers" => crate::operation::kitchen_sink_operation::KitchenSinkOperationError::ErrorWithoutMembers({
   38         -
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::ErrorWithoutMembersBuilder::default();
   42         -
                output = crate::protocol_serde::shape_error_without_members::de_error_without_members_json_err(_response_body, output)
   43         -
                    .map_err(crate::operation::kitchen_sink_operation::KitchenSinkOperationError::unhandled)?;
   44         -
                let output = output.meta(generic);
   45         -
                output.build()
   46         -
            };
   47         -
            if tmp.message.is_none() {
   48         -
                tmp.message = _error_message;
   49         -
            }
   50         -
            tmp
   51         -
        }),
   52         -
        _ => crate::operation::kitchen_sink_operation::KitchenSinkOperationError::generic(generic),
   53         -
    })
   54         -
}
   55         -
   56         -
#[allow(clippy::unnecessary_wraps)]
   57         -
pub fn de_kitchen_sink_operation_http_response(
   58         -
    _response_status: u16,
   59         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   60         -
    _response_body: &[u8],
   61         -
) -> std::result::Result<
   62         -
    crate::operation::kitchen_sink_operation::KitchenSinkOperationOutput,
   63         -
    crate::operation::kitchen_sink_operation::KitchenSinkOperationError,
   64         -
> {
   65         -
    Ok({
   66         -
        #[allow(unused_mut)]
   67         -
        let mut output = crate::operation::kitchen_sink_operation::builders::KitchenSinkOperationOutputBuilder::default();
   68         -
        output = crate::protocol_serde::shape_kitchen_sink_operation::de_kitchen_sink_operation(_response_body, output)
   69         -
            .map_err(crate::operation::kitchen_sink_operation::KitchenSinkOperationError::unhandled)?;
   70         -
        output.build()
   71         -
    })
   72         -
}
   73         -
   74         -
pub fn ser_kitchen_sink_operation_input(
   75         -
    input: &crate::operation::kitchen_sink_operation::KitchenSinkOperationInput,
   76         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   77         -
    let mut out = String::new();
   78         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   79         -
    crate::protocol_serde::shape_kitchen_sink_operation_input::ser_kitchen_sink_operation_input_input(&mut object, input)?;
   80         -
    object.finish();
   81         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   82         -
}
   83         -
   84         -
pub(crate) fn de_kitchen_sink_operation(
   85         -
    _value: &[u8],
   86         -
    mut builder: crate::operation::kitchen_sink_operation::builders::KitchenSinkOperationOutputBuilder,
   87         -
) -> ::std::result::Result<
   88         -
    crate::operation::kitchen_sink_operation::builders::KitchenSinkOperationOutputBuilder,
   89         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   90         -
> {
   91         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   92         -
    let tokens = &mut tokens_owned;
   93         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   94         -
    loop {
   95         -
        match tokens.next().transpose()? {
   96         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   97         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   98         -
                "Blob" => {
   99         -
                    builder = builder.set_blob(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
  100         -
                }
  101         -
                "Boolean" => {
  102         -
                    builder = builder.set_boolean(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
  103         -
                }
  104         -
                "Double" => {
  105         -
                    builder =
  106         -
                        builder.set_double(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
  107         -
                }
  108         -
                "EmptyStruct" => {
  109         -
                    builder = builder.set_empty_struct(crate::protocol_serde::shape_empty_struct::de_empty_struct(tokens, _value)?);
  110         -
                }
  111         -
                "Float" => {
  112         -
                    builder =
  113         -
                        builder.set_float(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
  114         -
                }
  115         -
                "HttpdateTimestamp" => {
  116         -
                    builder = builder.set_httpdate_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  117         -
                        tokens.next(),
  118         -
                        ::aws_smithy_types::date_time::Format::HttpDate,
  119         -
                    )?);
  120         -
                }
  121         -
                "Integer" => {
  122         -
                    builder = builder.set_integer(
  123         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  124         -
                            .map(i32::try_from)
  125         -
                            .transpose()?,
  126         -
                    );
  127         -
                }
  128         -
                "Iso8601Timestamp" => {
  129         -
                    builder = builder.set_iso8601_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  130         -
                        tokens.next(),
  131         -
                        ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
  132         -
                    )?);
  133         -
                }
  134         -
                "JsonValue" => {
  135         -
                    builder = builder.set_json_value(
  136         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  137         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  138         -
                            .transpose()?,
  139         -
                    );
  140         -
                }
  141         -
                "ListOfLists" => {
  142         -
                    builder = builder.set_list_of_lists(crate::protocol_serde::shape_list_of_list_of_strings::de_list_of_list_of_strings(
  143         -
                        tokens, _value,
  144         -
                    )?);
  145         -
                }
  146         -
                "ListOfMapsOfStrings" => {
  147         -
                    builder = builder.set_list_of_maps_of_strings(crate::protocol_serde::shape_list_of_maps_of_strings::de_list_of_maps_of_strings(
  148         -
                        tokens, _value,
  149         -
                    )?);
  150         -
                }
  151         -
                "ListOfStrings" => {
  152         -
                    builder = builder.set_list_of_strings(crate::protocol_serde::shape_list_of_strings::de_list_of_strings(tokens, _value)?);
  153         -
                }
  154         -
                "ListOfStructs" => {
  155         -
                    builder = builder.set_list_of_structs(crate::protocol_serde::shape_list_of_structs::de_list_of_structs(tokens, _value)?);
  156         -
                }
  157         -
                "Long" => {
  158         -
                    builder = builder.set_long(
  159         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  160         -
                            .map(i64::try_from)
  161         -
                            .transpose()?,
  162         -
                    );
  163         -
                }
  164         -
                "MapOfListsOfStrings" => {
  165         -
                    builder = builder.set_map_of_lists_of_strings(crate::protocol_serde::shape_map_of_lists_of_strings::de_map_of_lists_of_strings(
  166         -
                        tokens, _value,
  167         -
                    )?);
  168         -
                }
  169         -
                "MapOfMaps" => {
  170         -
                    builder = builder.set_map_of_maps(crate::protocol_serde::shape_map_of_map_of_strings::de_map_of_map_of_strings(
  171         -
                        tokens, _value,
  172         -
                    )?);
  173         -
                }
  174         -
                "MapOfStrings" => {
  175         -
                    builder = builder.set_map_of_strings(crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens, _value)?);
  176         -
                }
  177         -
                "MapOfStructs" => {
  178         -
                    builder = builder.set_map_of_structs(crate::protocol_serde::shape_map_of_structs::de_map_of_structs(tokens, _value)?);
  179         -
                }
  180         -
                "RecursiveList" => {
  181         -
                    builder = builder.set_recursive_list(crate::protocol_serde::shape_list_of_kitchen_sinks::de_list_of_kitchen_sinks(
  182         -
                        tokens, _value,
  183         -
                    )?);
  184         -
                }
  185         -
                "RecursiveMap" => {
  186         -
                    builder = builder.set_recursive_map(crate::protocol_serde::shape_map_of_kitchen_sinks::de_map_of_kitchen_sinks(
  187         -
                        tokens, _value,
  188         -
                    )?);
  189         -
                }
  190         -
                "RecursiveStruct" => {
  191         -
                    builder = builder.set_recursive_struct(crate::protocol_serde::shape_kitchen_sink::de_kitchen_sink(tokens, _value)?.map(Box::new));
  192         -
                }
  193         -
                "SimpleStruct" => {
  194         -
                    builder = builder.set_simple_struct(crate::protocol_serde::shape_simple_struct::de_simple_struct(tokens, _value)?);
  195         -
                }
  196         -
                "String" => {
  197         -
                    builder = builder.set_string(
  198         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  199         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  200         -
                            .transpose()?,
  201         -
                    );
  202         -
                }
  203         -
                "StructWithJsonName" => {
  204         -
                    builder = builder.set_struct_with_json_name(crate::protocol_serde::shape_struct_with_json_name::de_struct_with_json_name(
  205         -
                        tokens, _value,
  206         -
                    )?);
  207         -
                }
  208         -
                "Timestamp" => {
  209         -
                    builder = builder.set_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  210         -
                        tokens.next(),
  211         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
  212         -
                    )?);
  213         -
                }
  214         -
                "UnixTimestamp" => {
  215         -
                    builder = builder.set_unix_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  216         -
                        tokens.next(),
  217         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
  218         -
                    )?);
  219         -
                }
  220         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  221         -
            },
  222         -
            other => {
  223         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  224         -
                    "expected object key or end object, found: {other:?}"
  225         -
                )))
  226         -
            }
  227         -
        }
  228         -
    }
  229         -
    if tokens.next().is_some() {
  230         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  231         -
            "found more JSON tokens after completing parsing",
  232         -
        ));
  233         -
    }
  234         -
    Ok(builder)
  235         -
}