Client Test

Client Test

rev. 2915cec5ef64cb1ed4992565a748d76a11505b3b

Files changed:

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

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_dialog.rs

@@ -1,0 +75,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_dialog<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
    depth: u32,
    6         -
) -> ::std::result::Result<Option<crate::types::Dialog>, ::aws_smithy_json::deserialize::error::DeserializeError>
    7         -
where
    8         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    9         -
{
   10         -
    if depth >= 128u32 {
   11         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   12         -
            "maximum nesting depth exceeded",
   13         -
        ));
   14         -
    }
   15         -
    match tokens.next().transpose()? {
   16         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   17         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   18         -
            #[allow(unused_mut)]
   19         -
            let mut builder = crate::types::builders::DialogBuilder::default();
   20         -
            loop {
   21         -
                match tokens.next().transpose()? {
   22         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   24         -
                        "language" => {
   25         -
                            builder = builder.set_language(
   26         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   27         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   28         -
                                    .transpose()?,
   29         -
                            );
   30         -
                        }
   31         -
                        "greeting" => {
   32         -
                            builder = builder.set_greeting(
   33         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   34         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   35         -
                                    .transpose()?,
   36         -
                            );
   37         -
                        }
   38         -
                        "farewell" => {
   39         -
                            builder = builder.set_farewell(crate::protocol_serde::shape_farewell::de_farewell(tokens, _value, depth + 1)?);
   40         -
                        }
   41         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   42         -
                    },
   43         -
                    other => {
   44         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   45         -
                            "expected object key or end object, found: {other:?}"
   46         -
                        )))
   47         -
                    }
   48         -
                }
   49         -
            }
   50         -
            Ok(Some(builder.build()))
   51         -
        }
   52         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   53         -
            "expected start object or null",
   54         -
        )),
   55         -
    }
   56         -
}
   57         -
   58         -
pub fn ser_dialog(
   59         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   60         -
    input: &crate::types::Dialog,
   61         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   62         -
    if let Some(var_1) = &input.language {
   63         -
        object.key("language").string(var_1.as_str());
   64         -
    }
   65         -
    {
   66         -
        object.key("greeting").string(input.greeting.as_str());
   67         -
    }
   68         -
    if let Some(var_2) = &input.farewell {
   69         -
        #[allow(unused_mut)]
   70         -
        let mut object_3 = object.key("farewell").start_object();
   71         -
        crate::protocol_serde::shape_farewell::ser_farewell(&mut object_3, var_2)?;
   72         -
        object_3.finish();
   73         -
    }
   74         -
    Ok(())
   75         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_dialog_list.rs

@@ -1,0 +43,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_dialog_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
    depth: u32,
    6         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::Dialog>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    7         -
where
    8         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    9         -
{
   10         -
    if depth >= 128u32 {
   11         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   12         -
            "maximum nesting depth exceeded",
   13         -
        ));
   14         -
    }
   15         -
    match tokens.next().transpose()? {
   16         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   17         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   18         -
            let mut items = Vec::new();
   19         -
            loop {
   20         -
                match tokens.peek() {
   21         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   22         -
                        tokens.next().transpose().unwrap();
   23         -
                        break;
   24         -
                    }
   25         -
                    _ => {
   26         -
                        let value = crate::protocol_serde::shape_dialog::de_dialog(tokens, _value, depth + 1)?;
   27         -
                        if let Some(value) = value {
   28         -
                            items.push(value);
   29         -
                        } else {
   30         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
                                "dense list cannot contain null values",
   32         -
                            ));
   33         -
                        }
   34         -
                    }
   35         -
                }
   36         -
            }
   37         -
            Ok(Some(items))
   38         -
        }
   39         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   40         -
            "expected start array or null",
   41         -
        )),
   42         -
    }
   43         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_dialog_map.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_empty_input_and_empty_output.rs

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_empty_input_and_empty_output_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::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
    9         -
    crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   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::empty_input_and_empty_output::EmptyInputAndEmptyOutputError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_empty_input_and_empty_output_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::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
   27         -
    crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::empty_input_and_empty_output::builders::EmptyInputAndEmptyOutputOutputBuilder::default();
   32         -
        output.build()
   33         -
    })
   34         -
}
   35         -
   36         -
pub fn ser_empty_input_and_empty_output_input(
   37         -
    _input: &crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
   38         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   39         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   40         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_endpoint_operation.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_endpoint_operation_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::endpoint_operation::EndpointOperationOutput, crate::operation::endpoint_operation::EndpointOperationError>
    8         -
{
    9         -
    #[allow(unused_mut)]
   10         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11         -
        .map_err(crate::operation::endpoint_operation::EndpointOperationError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    Err(crate::operation::endpoint_operation::EndpointOperationError::generic(generic))
   14         -
}
   15         -
   16         -
#[allow(clippy::unnecessary_wraps)]
   17         -
pub fn de_endpoint_operation_http_response(
   18         -
    _response_status: u16,
   19         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   20         -
    _response_body: &[u8],
   21         -
) -> std::result::Result<crate::operation::endpoint_operation::EndpointOperationOutput, crate::operation::endpoint_operation::EndpointOperationError>
   22         -
{
   23         -
    Ok({
   24         -
        #[allow(unused_mut)]
   25         -
        let mut output = crate::operation::endpoint_operation::builders::EndpointOperationOutputBuilder::default();
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_endpoint_operation_input(
   31         -
    _input: &crate::operation::endpoint_operation::EndpointOperationInput,
   32         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   33         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   34         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_endpoint_with_host_label_operation.rs

@@ -1,0 +42,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_endpoint_with_host_label_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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
    9         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_endpoint_with_host_label_operation_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   25         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_endpoint_with_host_label_operation_input(
   35         -
    input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
   36         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   37         -
    let mut out = String::new();
   38         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   39         -
    crate::protocol_serde::shape_endpoint_with_host_label_operation_input::ser_endpoint_with_host_label_operation_input_input(&mut object, input)?;
   40         -
    object.finish();
   41         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   42         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_endpoint_with_host_label_operation_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_farewell.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_foo_error.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_greeting_struct.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_greeting_with_errors.rs

@@ -1,0 +137,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_greeting_with_errors_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::greeting_with_errors::GreetingWithErrorsOutput,
    9         -
    crate::operation::greeting_with_errors::GreetingWithErrorsError,
   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::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "InvalidGreeting" => crate::operation::greeting_with_errors::GreetingWithErrorsError::InvalidGreeting({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::InvalidGreetingBuilder::default();
   27         -
                output = crate::protocol_serde::shape_invalid_greeting::de_invalid_greeting_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::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         -
        "ComplexError" => crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError({
   38         -
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::ComplexErrorBuilder::default();
   42         -
                output = crate::protocol_serde::shape_complex_error::de_complex_error_json_err(_response_body, output)
   43         -
                    .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::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         -
        "FooError" => crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError({
   53         -
            #[allow(unused_mut)]
   54         -
            let mut tmp = {
   55         -
                #[allow(unused_mut)]
   56         -
                let mut output = crate::types::error::builders::FooErrorBuilder::default();
   57         -
                output = crate::protocol_serde::shape_foo_error::de_foo_error_json_err(_response_body, output)
   58         -
                    .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   59         -
                let output = output.meta(generic);
   60         -
                output.build()
   61         -
            };
   62         -
            if tmp.message.is_none() {
   63         -
                tmp.message = _error_message;
   64         -
            }
   65         -
            tmp
   66         -
        }),
   67         -
        _ => crate::operation::greeting_with_errors::GreetingWithErrorsError::generic(generic),
   68         -
    })
   69         -
}
   70         -
   71         -
#[allow(clippy::unnecessary_wraps)]
   72         -
pub fn de_greeting_with_errors_http_response(
   73         -
    _response_status: u16,
   74         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   75         -
    _response_body: &[u8],
   76         -
) -> std::result::Result<
   77         -
    crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
   78         -
    crate::operation::greeting_with_errors::GreetingWithErrorsError,
   79         -
> {
   80         -
    Ok({
   81         -
        #[allow(unused_mut)]
   82         -
        let mut output = crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder::default();
   83         -
        output = crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors(_response_body, output)
   84         -
            .map_err(crate::operation::greeting_with_errors::GreetingWithErrorsError::unhandled)?;
   85         -
        output.build()
   86         -
    })
   87         -
}
   88         -
   89         -
pub fn ser_greeting_with_errors_input(
   90         -
    input: &crate::operation::greeting_with_errors::GreetingWithErrorsInput,
   91         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   92         -
    let mut out = String::new();
   93         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   94         -
    crate::protocol_serde::shape_greeting_with_errors_input::ser_greeting_with_errors_input_input(&mut object, input)?;
   95         -
    object.finish();
   96         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   97         -
}
   98         -
   99         -
pub(crate) fn de_greeting_with_errors(
  100         -
    _value: &[u8],
  101         -
    mut builder: crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder,
  102         -
) -> ::std::result::Result<
  103         -
    crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder,
  104         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  105         -
> {
  106         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  107         -
    let tokens = &mut tokens_owned;
  108         -
    #[allow(unused_variables)]
  109         -
    let depth = 0u32;
  110         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  111         -
    loop {
  112         -
        match tokens.next().transpose()? {
  113         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  114         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  115         -
                "greeting" => {
  116         -
                    builder = builder.set_greeting(
  117         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  118         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  119         -
                            .transpose()?,
  120         -
                    );
  121         -
                }
  122         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  123         -
            },
  124         -
            other => {
  125         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  126         -
                    "expected object key or end object, found: {other:?}"
  127         -
                )))
  128         -
            }
  129         -
        }
  130         -
    }
  131         -
    if tokens.next().is_some() {
  132         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  133         -
            "found more JSON tokens after completing parsing",
  134         -
        ));
  135         -
    }
  136         -
    Ok(builder)
  137         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_greeting_with_errors_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_host_with_path_operation.rs

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_host_with_path_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::host_with_path_operation::HostWithPathOperationOutput,
    9         -
    crate::operation::host_with_path_operation::HostWithPathOperationError,
   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::host_with_path_operation::HostWithPathOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::host_with_path_operation::HostWithPathOperationError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_host_with_path_operation_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::host_with_path_operation::HostWithPathOperationOutput,
   25         -
    crate::operation::host_with_path_operation::HostWithPathOperationError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::host_with_path_operation::builders::HostWithPathOperationOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_host_with_path_operation_input(
   35         -
    _input: &crate::operation::host_with_path_operation::HostWithPathOperationInput,
   36         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   38         -
}

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

@@ -1,0 +37,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         -
    #[allow(unused_variables)]
    9         -
    let depth = 0u32;
   10         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   11         -
    loop {
   12         -
        match tokens.next().transpose()? {
   13         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   14         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   15         -
                "Message" => {
   16         -
                    builder = builder.set_message(
   17         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   18         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   19         -
                            .transpose()?,
   20         -
                    );
   21         -
                }
   22         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   23         -
            },
   24         -
            other => {
   25         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   26         -
                    "expected object key or end object, found: {other:?}"
   27         -
                )))
   28         -
            }
   29         -
        }
   30         -
    }
   31         -
    if tokens.next().is_some() {
   32         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33         -
            "found more JSON tokens after completing parsing",
   34         -
        ));
   35         -
    }
   36         -
    Ok(builder)
   37         -
}

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

@@ -1,0 +72,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         -
    #[allow(unused_variables)]
   48         -
    let depth = 0u32;
   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         -
                "contents" => {
   55         -
                    builder = builder.set_contents(crate::protocol_serde::shape_my_union::de_my_union(tokens, _value, depth + 1)?);
   56         -
                }
   57         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   58         -
            },
   59         -
            other => {
   60         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   61         -
                    "expected object key or end object, found: {other:?}"
   62         -
                )))
   63         -
            }
   64         -
        }
   65         -
    }
   66         -
    if tokens.next().is_some() {
   67         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   68         -
            "found more JSON tokens after completing parsing",
   69         -
        ));
   70         -
    }
   71         -
    Ok(builder)
   72         -
}