Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

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

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_complex_nested_error_data<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ComplexNestedErrorData>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::ComplexNestedErrorDataBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "Foo" => {
   19         -
                            builder = builder.set_foo(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   26         -
                    },
   27         -
                    other => {
   28         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29         -
                            "expected object key or end object, found: {other:?}"
   30         -
                        )))
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(builder.build()))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start object or null",
   38         -
        )),
   39         -
    }
   40         -
}

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

@@ -1,0 +42,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_content_type_parameters_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::content_type_parameters::ContentTypeParametersOutput,
    9         -
    crate::operation::content_type_parameters::ContentTypeParametersError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::content_type_parameters::ContentTypeParametersError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::content_type_parameters::ContentTypeParametersError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_content_type_parameters_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::content_type_parameters::ContentTypeParametersOutput,
   25         -
    crate::operation::content_type_parameters::ContentTypeParametersError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::content_type_parameters::builders::ContentTypeParametersOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_content_type_parameters_input(
   35         -
    input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
   36         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   37         -
    let mut out = String::new();
   38         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   39         -
    crate::protocol_serde::shape_content_type_parameters_input::ser_content_type_parameters_input_input(&mut object, input)?;
   40         -
    object.finish();
   41         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   42         -
}

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

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

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

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

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

@@ -1,0 +69,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         -
) -> ::std::result::Result<Option<crate::types::Dialog>, ::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::DialogBuilder::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         -
                        "language" => {
   19         -
                            builder = builder.set_language(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "greeting" => {
   26         -
                            builder = builder.set_greeting(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        "farewell" => {
   33         -
                            builder = builder.set_farewell(crate::protocol_serde::shape_farewell::de_farewell(tokens, _value)?);
   34         -
                        }
   35         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   36         -
                    },
   37         -
                    other => {
   38         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   39         -
                            "expected object key or end object, found: {other:?}"
   40         -
                        )))
   41         -
                    }
   42         -
                }
   43         -
            }
   44         -
            Ok(Some(builder.build()))
   45         -
        }
   46         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   47         -
            "expected start object or null",
   48         -
        )),
   49         -
    }
   50         -
}
   51         -
   52         -
pub fn ser_dialog(
   53         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   54         -
    input: &crate::types::Dialog,
   55         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   56         -
    if let Some(var_1) = &input.language {
   57         -
        object.key("language").string(var_1.as_str());
   58         -
    }
   59         -
    {
   60         -
        object.key("greeting").string(input.greeting.as_str());
   61         -
    }
   62         -
    if let Some(var_2) = &input.farewell {
   63         -
        #[allow(unused_mut)]
   64         -
        let mut object_3 = object.key("farewell").start_object();
   65         -
        crate::protocol_serde::shape_farewell::ser_farewell(&mut object_3, var_2)?;
   66         -
        object_3.finish();
   67         -
    }
   68         -
    Ok(())
   69         -
}

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

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

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

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

tmp-codegen-diff/codegen-client-test/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 +50,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         -
) -> ::std::result::Result<Option<crate::types::Farewell>, ::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::FarewellBuilder::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         -
                        "phrase" => {
   19         -
                            builder = builder.set_phrase(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   26         -
                    },
   27         -
                    other => {
   28         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29         -
                            "expected object key or end object, found: {other:?}"
   30         -
                        )))
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(builder.build()))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start object or null",
   38         -
        )),
   39         -
    }
   40         -
}
   41         -
   42         -
pub fn ser_farewell(
   43         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44         -
    input: &crate::types::Farewell,
   45         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   46         -
    {
   47         -
        object.key("phrase").string(input.phrase.as_str());
   48         -
    }
   49         -
    Ok(())
   50         -
}

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

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_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         -
    ::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_rpc10/rust-client-codegen/src/protocol_serde/shape_greeting_struct.rs

@@ -1,0 +50,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         -
) -> ::std::result::Result<Option<crate::types::GreetingStruct>, ::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::GreetingStructBuilder::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         -
                        "hi" => {
   19         -
                            builder = builder.set_hi(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   26         -
                    },
   27         -
                    other => {
   28         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29         -
                            "expected object key or end object, found: {other:?}"
   30         -
                        )))
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(builder.build()))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start object or null",
   38         -
        )),
   39         -
    }
   40         -
}
   41         -
   42         -
pub fn ser_greeting_struct(
   43         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44         -
    input: &crate::types::GreetingStruct,
   45         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   46         -
    if let Some(var_1) = &input.hi {
   47         -
        object.key("hi").string(var_1.as_str());
   48         -
    }
   49         -
    Ok(())
   50         -
}

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

@@ -1,0 +135,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         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  109         -
    loop {
  110         -
        match tokens.next().transpose()? {
  111         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  112         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  113         -
                "greeting" => {
  114         -
                    builder = builder.set_greeting(
  115         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  116         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  117         -
                            .transpose()?,
  118         -
                    );
  119         -
                }
  120         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  121         -
            },
  122         -
            other => {
  123         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  124         -
                    "expected object key or end object, found: {other:?}"
  125         -
                )))
  126         -
            }
  127         -
        }
  128         -
    }
  129         -
    if tokens.next().is_some() {
  130         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  131         -
            "found more JSON tokens after completing parsing",
  132         -
        ));
  133         -
    }
  134         -
    Ok(builder)
  135         -
}

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         -
}