Client Test

Client Test

rev. 2915cec5ef64cb1ed4992565a748d76a11505b3b

Files changed:

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

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

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

@@ -1,0 +194,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_my_union<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
    depth: u32,
    6         -
) -> ::std::result::Result<Option<crate::types::MyUnion>, ::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         -
    let mut variant = None;
   16         -
    match tokens.next().transpose()? {
   17         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   18         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
   19         -
            match tokens.next().transpose()? {
   20         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   21         -
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   22         -
                    if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
   23         -
                        tokens.peek()
   24         -
                    {
   25         -
                        let _ = tokens.next().expect("peek returned a token")?;
   26         -
                        continue;
   27         -
                    }
   28         -
                    let key = key.to_unescaped()?;
   29         -
                    if key == "__type" {
   30         -
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   31         -
                        continue;
   32         -
                    }
   33         -
                    if variant.is_some() {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   35         -
                            "encountered mixed variants in union",
   36         -
                        ));
   37         -
                    }
   38         -
                    variant = match key.as_ref() {
   39         -
                        "stringValue" => Some(crate::types::MyUnion::StringValue(
   40         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   41         -
                                .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   42         -
                                .transpose()?
   43         -
                                .ok_or_else(|| {
   44         -
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'stringValue' cannot be null")
   45         -
                                })?,
   46         -
                        )),
   47         -
                        "booleanValue" => Some(crate::types::MyUnion::BooleanValue(
   48         -
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?.ok_or_else(|| {
   49         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'booleanValue' cannot be null")
   50         -
                            })?,
   51         -
                        )),
   52         -
                        "numberValue" => Some(crate::types::MyUnion::NumberValue(
   53         -
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   54         -
                                .map(i32::try_from)
   55         -
                                .transpose()?
   56         -
                                .ok_or_else(|| {
   57         -
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'numberValue' cannot be null")
   58         -
                                })?,
   59         -
                        )),
   60         -
                        "blobValue" => Some(crate::types::MyUnion::BlobValue(
   61         -
                            ::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?.ok_or_else(|| {
   62         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'blobValue' cannot be null")
   63         -
                            })?,
   64         -
                        )),
   65         -
                        "timestampValue" => Some(crate::types::MyUnion::TimestampValue(
   66         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   67         -
                                tokens.next(),
   68         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   69         -
                            )?
   70         -
                            .ok_or_else(|| {
   71         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'timestampValue' cannot be null")
   72         -
                            })?,
   73         -
                        )),
   74         -
                        "enumValue" => Some(crate::types::MyUnion::EnumValue(
   75         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   76         -
                                .map(|s| s.to_unescaped().map(|u| crate::types::FooEnum::from(u.as_ref())))
   77         -
                                .transpose()?
   78         -
                                .ok_or_else(|| {
   79         -
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'enumValue' cannot be null")
   80         -
                                })?,
   81         -
                        )),
   82         -
                        "intEnumValue" => Some(crate::types::MyUnion::IntEnumValue(
   83         -
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   84         -
                                .map(i32::try_from)
   85         -
                                .transpose()?
   86         -
                                .ok_or_else(|| {
   87         -
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'intEnumValue' cannot be null")
   88         -
                                })?,
   89         -
                        )),
   90         -
                        "listValue" => Some(crate::types::MyUnion::ListValue(
   91         -
                            crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)?.ok_or_else(|| {
   92         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'listValue' cannot be null")
   93         -
                            })?,
   94         -
                        )),
   95         -
                        "mapValue" => Some(crate::types::MyUnion::MapValue(
   96         -
                            crate::protocol_serde::shape_string_map::de_string_map(tokens, _value, depth + 1)?.ok_or_else(|| {
   97         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'mapValue' cannot be null")
   98         -
                            })?,
   99         -
                        )),
  100         -
                        "structureValue" => Some(crate::types::MyUnion::StructureValue(
  101         -
                            crate::protocol_serde::shape_greeting_struct::de_greeting_struct(tokens, _value, depth + 1)?.ok_or_else(|| {
  102         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'structureValue' cannot be null")
  103         -
                            })?,
  104         -
                        )),
  105         -
                        _ => {
  106         -
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
  107         -
                            Some(crate::types::MyUnion::Unknown)
  108         -
                        }
  109         -
                    };
  110         -
                }
  111         -
                other => {
  112         -
                    return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  113         -
                        "expected object key or end object, found: {other:?}"
  114         -
                    )))
  115         -
                }
  116         -
            }
  117         -
        },
  118         -
        _ => {
  119         -
            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  120         -
                "expected start object or null",
  121         -
            ))
  122         -
        }
  123         -
    }
  124         -
    if variant.is_none() {
  125         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  126         -
            "Union did not contain a valid variant.",
  127         -
        ));
  128         -
    }
  129         -
    Ok(variant)
  130         -
}
  131         -
  132         -
pub fn ser_my_union(
  133         -
    object_2: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
  134         -
    input: &crate::types::MyUnion,
  135         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
  136         -
    match input {
  137         -
        crate::types::MyUnion::StringValue(inner) => {
  138         -
            object_2.key("stringValue").string(inner.as_str());
  139         -
        }
  140         -
        crate::types::MyUnion::BooleanValue(inner) => {
  141         -
            object_2.key("booleanValue").boolean(*inner);
  142         -
        }
  143         -
        crate::types::MyUnion::NumberValue(inner) => {
  144         -
            object_2.key("numberValue").number(
  145         -
                #[allow(clippy::useless_conversion)]
  146         -
                ::aws_smithy_types::Number::NegInt((*inner).into()),
  147         -
            );
  148         -
        }
  149         -
        crate::types::MyUnion::BlobValue(inner) => {
  150         -
            object_2.key("blobValue").string_unchecked(&::aws_smithy_types::base64::encode(inner));
  151         -
        }
  152         -
        crate::types::MyUnion::TimestampValue(inner) => {
  153         -
            object_2
  154         -
                .key("timestampValue")
  155         -
                .date_time(inner, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  156         -
        }
  157         -
        crate::types::MyUnion::EnumValue(inner) => {
  158         -
            object_2.key("enumValue").string(inner.as_str());
  159         -
        }
  160         -
        crate::types::MyUnion::IntEnumValue(inner) => {
  161         -
            object_2.key("intEnumValue").number(
  162         -
                #[allow(clippy::useless_conversion)]
  163         -
                ::aws_smithy_types::Number::NegInt((*inner).into()),
  164         -
            );
  165         -
        }
  166         -
        crate::types::MyUnion::ListValue(inner) => {
  167         -
            let mut array_1 = object_2.key("listValue").start_array();
  168         -
            for item_2 in inner {
  169         -
                {
  170         -
                    array_1.value().string(item_2.as_str());
  171         -
                }
  172         -
            }
  173         -
            array_1.finish();
  174         -
        }
  175         -
        crate::types::MyUnion::MapValue(inner) => {
  176         -
            #[allow(unused_mut)]
  177         -
            let mut object_3 = object_2.key("mapValue").start_object();
  178         -
            for (key_4, value_5) in inner {
  179         -
                {
  180         -
                    object_3.key(key_4.as_str()).string(value_5.as_str());
  181         -
                }
  182         -
            }
  183         -
            object_3.finish();
  184         -
        }
  185         -
        crate::types::MyUnion::StructureValue(inner) => {
  186         -
            #[allow(unused_mut)]
  187         -
            let mut object_6 = object_2.key("structureValue").start_object();
  188         -
            crate::protocol_serde::shape_greeting_struct::ser_greeting_struct(&mut object_6, inner)?;
  189         -
            object_6.finish();
  190         -
        }
  191         -
        crate::types::MyUnion::Unknown => return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant("MyUnion")),
  192         -
    }
  193         -
    Ok(())
  194         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_no_input_and_no_output.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_no_input_and_no_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::no_input_and_no_output::NoInputAndNoOutputOutput,
    9         -
    crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   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::no_input_and_no_output::NoInputAndNoOutputError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::no_input_and_no_output::NoInputAndNoOutputError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_no_input_and_no_output_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::no_input_and_no_output::NoInputAndNoOutputOutput,
   25         -
    crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_no_input_and_no_output_input(
   35         -
    _input: &crate::operation::no_input_and_no_output::NoInputAndNoOutputInput,
   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_no_input_and_output.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_no_input_and_output_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::no_input_and_output::NoInputAndOutputOutput, crate::operation::no_input_and_output::NoInputAndOutputError>
    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::no_input_and_output::NoInputAndOutputError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    Err(crate::operation::no_input_and_output::NoInputAndOutputError::generic(generic))
   14         -
}
   15         -
   16         -
#[allow(clippy::unnecessary_wraps)]
   17         -
pub fn de_no_input_and_output_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::no_input_and_output::NoInputAndOutputOutput, crate::operation::no_input_and_output::NoInputAndOutputError>
   22         -
{
   23         -
    Ok({
   24         -
        #[allow(unused_mut)]
   25         -
        let mut output = crate::operation::no_input_and_output::builders::NoInputAndOutputOutputBuilder::default();
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_no_input_and_output_input(
   31         -
    _input: &crate::operation::no_input_and_output::NoInputAndOutputInput,
   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_operation_with_defaults.rs

@@ -1,0 +224,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_operation_with_defaults_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::operation_with_defaults::OperationWithDefaultsOutput,
    9         -
    crate::operation::operation_with_defaults::OperationWithDefaultsError,
   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::operation_with_defaults::OperationWithDefaultsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::operation_with_defaults::OperationWithDefaultsError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_operation_with_defaults_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::operation_with_defaults::OperationWithDefaultsOutput,
   25         -
    crate::operation::operation_with_defaults::OperationWithDefaultsError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::operation_with_defaults::builders::OperationWithDefaultsOutputBuilder::default();
   30         -
        output = crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults(_response_body, output)
   31         -
            .map_err(crate::operation::operation_with_defaults::OperationWithDefaultsError::unhandled)?;
   32         -
        output.build()
   33         -
    })
   34         -
}
   35         -
   36         -
pub fn ser_operation_with_defaults_input(
   37         -
    input: &crate::operation::operation_with_defaults::OperationWithDefaultsInput,
   38         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   39         -
    let mut out = String::new();
   40         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   41         -
    crate::protocol_serde::shape_operation_with_defaults_input::ser_operation_with_defaults_input_input(&mut object, input)?;
   42         -
    object.finish();
   43         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   44         -
}
   45         -
   46         -
pub(crate) fn de_operation_with_defaults(
   47         -
    _value: &[u8],
   48         -
    mut builder: crate::operation::operation_with_defaults::builders::OperationWithDefaultsOutputBuilder,
   49         -
) -> ::std::result::Result<
   50         -
    crate::operation::operation_with_defaults::builders::OperationWithDefaultsOutputBuilder,
   51         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   52         -
> {
   53         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   54         -
    let tokens = &mut tokens_owned;
   55         -
    #[allow(unused_variables)]
   56         -
    let depth = 0u32;
   57         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   58         -
    loop {
   59         -
        match tokens.next().transpose()? {
   60         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   61         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   62         -
                "defaultString" => {
   63         -
                    builder = builder.set_default_string(
   64         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   65         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   66         -
                            .transpose()?,
   67         -
                    );
   68         -
                }
   69         -
                "defaultBoolean" => {
   70         -
                    builder = builder.set_default_boolean(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   71         -
                }
   72         -
                "defaultList" => {
   73         -
                    builder = builder.set_default_list(crate::protocol_serde::shape_test_string_list::de_test_string_list(
   74         -
                        tokens,
   75         -
                        _value,
   76         -
                        depth + 1,
   77         -
                    )?);
   78         -
                }
   79         -
                "defaultDocumentMap" => {
   80         -
                    builder = builder.set_default_document_map(Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?));
   81         -
                }
   82         -
                "defaultDocumentString" => {
   83         -
                    builder = builder.set_default_document_string(Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?));
   84         -
                }
   85         -
                "defaultDocumentBoolean" => {
   86         -
                    builder = builder.set_default_document_boolean(Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?));
   87         -
                }
   88         -
                "defaultDocumentList" => {
   89         -
                    builder = builder.set_default_document_list(Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?));
   90         -
                }
   91         -
                "defaultNullDocument" => {
   92         -
                    builder = builder.set_default_null_document(Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?));
   93         -
                }
   94         -
                "defaultTimestamp" => {
   95         -
                    builder = builder.set_default_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   96         -
                        tokens.next(),
   97         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
   98         -
                    )?);
   99         -
                }
  100         -
                "defaultBlob" => {
  101         -
                    builder = builder.set_default_blob(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
  102         -
                }
  103         -
                "defaultByte" => {
  104         -
                    builder = builder.set_default_byte(
  105         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  106         -
                            .map(i8::try_from)
  107         -
                            .transpose()?,
  108         -
                    );
  109         -
                }
  110         -
                "defaultShort" => {
  111         -
                    builder = builder.set_default_short(
  112         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  113         -
                            .map(i16::try_from)
  114         -
                            .transpose()?,
  115         -
                    );
  116         -
                }
  117         -
                "defaultInteger" => {
  118         -
                    builder = builder.set_default_integer(
  119         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  120         -
                            .map(i32::try_from)
  121         -
                            .transpose()?,
  122         -
                    );
  123         -
                }
  124         -
                "defaultLong" => {
  125         -
                    builder = builder.set_default_long(
  126         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  127         -
                            .map(i64::try_from)
  128         -
                            .transpose()?,
  129         -
                    );
  130         -
                }
  131         -
                "defaultFloat" => {
  132         -
                    builder = builder
  133         -
                        .set_default_float(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
  134         -
                }
  135         -
                "defaultDouble" => {
  136         -
                    builder = builder
  137         -
                        .set_default_double(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
  138         -
                }
  139         -
                "defaultMap" => {
  140         -
                    builder = builder.set_default_map(crate::protocol_serde::shape_test_string_map::de_test_string_map(
  141         -
                        tokens,
  142         -
                        _value,
  143         -
                        depth + 1,
  144         -
                    )?);
  145         -
                }
  146         -
                "defaultEnum" => {
  147         -
                    builder = builder.set_default_enum(
  148         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  149         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::TestEnum::from(u.as_ref())))
  150         -
                            .transpose()?,
  151         -
                    );
  152         -
                }
  153         -
                "defaultIntEnum" => {
  154         -
                    builder = builder.set_default_int_enum(
  155         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  156         -
                            .map(i32::try_from)
  157         -
                            .transpose()?,
  158         -
                    );
  159         -
                }
  160         -
                "emptyString" => {
  161         -
                    builder = builder.set_empty_string(
  162         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  163         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  164         -
                            .transpose()?,
  165         -
                    );
  166         -
                }
  167         -
                "falseBoolean" => {
  168         -
                    builder = builder.set_false_boolean(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
  169         -
                }
  170         -
                "emptyBlob" => {
  171         -
                    builder = builder.set_empty_blob(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
  172         -
                }
  173         -
                "zeroByte" => {
  174         -
                    builder = builder.set_zero_byte(
  175         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  176         -
                            .map(i8::try_from)
  177         -
                            .transpose()?,
  178         -
                    );
  179         -
                }
  180         -
                "zeroShort" => {
  181         -
                    builder = builder.set_zero_short(
  182         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  183         -
                            .map(i16::try_from)
  184         -
                            .transpose()?,
  185         -
                    );
  186         -
                }
  187         -
                "zeroInteger" => {
  188         -
                    builder = builder.set_zero_integer(
  189         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  190         -
                            .map(i32::try_from)
  191         -
                            .transpose()?,
  192         -
                    );
  193         -
                }
  194         -
                "zeroLong" => {
  195         -
                    builder = builder.set_zero_long(
  196         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  197         -
                            .map(i64::try_from)
  198         -
                            .transpose()?,
  199         -
                    );
  200         -
                }
  201         -
                "zeroFloat" => {
  202         -
                    builder = builder
  203         -
                        .set_zero_float(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
  204         -
                }
  205         -
                "zeroDouble" => {
  206         -
                    builder = builder
  207         -
                        .set_zero_double(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
  208         -
                }
  209         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  210         -
            },
  211         -
            other => {
  212         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  213         -
                    "expected object key or end object, found: {other:?}"
  214         -
                )))
  215         -
            }
  216         -
        }
  217         -
    }
  218         -
    if tokens.next().is_some() {
  219         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  220         -
            "found more JSON tokens after completing parsing",
  221         -
        ));
  222         -
    }
  223         -
    Ok(builder)
  224         -
}

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

@@ -1,0 +28,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_operation_with_defaults_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::operation_with_defaults::OperationWithDefaultsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.defaults {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_2 = object.key("defaults").start_object();
    9         -
        crate::protocol_serde::shape_defaults::ser_defaults(&mut object_2, var_1)?;
   10         -
        object_2.finish();
   11         -
    }
   12         -
    if let Some(var_3) = &input.client_optional_defaults {
   13         -
        #[allow(unused_mut)]
   14         -
        let mut object_4 = object.key("clientOptionalDefaults").start_object();
   15         -
        crate::protocol_serde::shape_client_optional_defaults::ser_client_optional_defaults(&mut object_4, var_3)?;
   16         -
        object_4.finish();
   17         -
    }
   18         -
    if let Some(var_5) = &input.top_level_default {
   19         -
        object.key("topLevelDefault").string(var_5.as_str());
   20         -
    }
   21         -
    if let Some(var_6) = &input.other_top_level_default {
   22         -
        object.key("otherTopLevelDefault").number(
   23         -
            #[allow(clippy::useless_conversion)]
   24         -
            ::aws_smithy_types::Number::NegInt((*var_6).into()),
   25         -
        );
   26         -
    }
   27         -
    Ok(())
   28         -
}

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

@@ -1,0 +88,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_operation_with_nested_structure_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::operation_with_nested_structure::OperationWithNestedStructureOutput,
    9         -
    crate::operation::operation_with_nested_structure::OperationWithNestedStructureError,
   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::operation_with_nested_structure::OperationWithNestedStructureError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::operation_with_nested_structure::OperationWithNestedStructureError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_operation_with_nested_structure_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::operation_with_nested_structure::OperationWithNestedStructureOutput,
   25         -
    crate::operation::operation_with_nested_structure::OperationWithNestedStructureError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::operation_with_nested_structure::builders::OperationWithNestedStructureOutputBuilder::default();
   30         -
        output = crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure(_response_body, output)
   31         -
            .map_err(crate::operation::operation_with_nested_structure::OperationWithNestedStructureError::unhandled)?;
   32         -
        crate::serde_util::operation_with_nested_structure_output_output_correct_errors(output)
   33         -
            .build()
   34         -
            .map_err(crate::operation::operation_with_nested_structure::OperationWithNestedStructureError::unhandled)?
   35         -
    })
   36         -
}
   37         -
   38         -
pub fn ser_operation_with_nested_structure_input(
   39         -
    input: &crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput,
   40         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   41         -
    let mut out = String::new();
   42         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   43         -
    crate::protocol_serde::shape_operation_with_nested_structure_input::ser_operation_with_nested_structure_input_input(&mut object, input)?;
   44         -
    object.finish();
   45         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   46         -
}
   47         -
   48         -
pub(crate) fn de_operation_with_nested_structure(
   49         -
    _value: &[u8],
   50         -
    mut builder: crate::operation::operation_with_nested_structure::builders::OperationWithNestedStructureOutputBuilder,
   51         -
) -> ::std::result::Result<
   52         -
    crate::operation::operation_with_nested_structure::builders::OperationWithNestedStructureOutputBuilder,
   53         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   54         -
> {
   55         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   56         -
    let tokens = &mut tokens_owned;
   57         -
    #[allow(unused_variables)]
   58         -
    let depth = 0u32;
   59         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   60         -
    loop {
   61         -
        match tokens.next().transpose()? {
   62         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   63         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   64         -
                "dialog" => {
   65         -
                    builder = builder.set_dialog(crate::protocol_serde::shape_dialog::de_dialog(tokens, _value, depth + 1)?);
   66         -
                }
   67         -
                "dialogList" => {
   68         -
                    builder = builder.set_dialog_list(crate::protocol_serde::shape_dialog_list::de_dialog_list(tokens, _value, depth + 1)?);
   69         -
                }
   70         -
                "dialogMap" => {
   71         -
                    builder = builder.set_dialog_map(crate::protocol_serde::shape_dialog_map::de_dialog_map(tokens, _value, depth + 1)?);
   72         -
                }
   73         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   74         -
            },
   75         -
            other => {
   76         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   77         -
                    "expected object key or end object, found: {other:?}"
   78         -
                )))
   79         -
            }
   80         -
        }
   81         -
    }
   82         -
    if tokens.next().is_some() {
   83         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   84         -
            "found more JSON tokens after completing parsing",
   85         -
        ));
   86         -
    }
   87         -
    Ok(builder)
   88         -
}

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

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

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

@@ -1,0 +144,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_operation_with_required_members_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::operation_with_required_members::OperationWithRequiredMembersOutput,
    9         -
    crate::operation::operation_with_required_members::OperationWithRequiredMembersError,
   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::operation_with_required_members::OperationWithRequiredMembersError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::operation_with_required_members::OperationWithRequiredMembersError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_operation_with_required_members_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::operation_with_required_members::OperationWithRequiredMembersOutput,
   25         -
    crate::operation::operation_with_required_members::OperationWithRequiredMembersError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::operation_with_required_members::builders::OperationWithRequiredMembersOutputBuilder::default();
   30         -
        output = crate::protocol_serde::shape_operation_with_required_members::de_operation_with_required_members(_response_body, output)
   31         -
            .map_err(crate::operation::operation_with_required_members::OperationWithRequiredMembersError::unhandled)?;
   32         -
        crate::serde_util::operation_with_required_members_output_output_correct_errors(output)
   33         -
            .build()
   34         -
            .map_err(crate::operation::operation_with_required_members::OperationWithRequiredMembersError::unhandled)?
   35         -
    })
   36         -
}
   37         -
   38         -
pub fn ser_operation_with_required_members_input(
   39         -
    _input: &crate::operation::operation_with_required_members::OperationWithRequiredMembersInput,
   40         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   41         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   42         -
}
   43         -
   44         -
pub(crate) fn de_operation_with_required_members(
   45         -
    _value: &[u8],
   46         -
    mut builder: crate::operation::operation_with_required_members::builders::OperationWithRequiredMembersOutputBuilder,
   47         -
) -> ::std::result::Result<
   48         -
    crate::operation::operation_with_required_members::builders::OperationWithRequiredMembersOutputBuilder,
   49         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   50         -
> {
   51         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   52         -
    let tokens = &mut tokens_owned;
   53         -
    #[allow(unused_variables)]
   54         -
    let depth = 0u32;
   55         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   56         -
    loop {
   57         -
        match tokens.next().transpose()? {
   58         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   59         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   60         -
                "requiredString" => {
   61         -
                    builder = builder.set_required_string(
   62         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   63         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   64         -
                            .transpose()?,
   65         -
                    );
   66         -
                }
   67         -
                "requiredBoolean" => {
   68         -
                    builder = builder.set_required_boolean(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   69         -
                }
   70         -
                "requiredList" => {
   71         -
                    builder = builder.set_required_list(crate::protocol_serde::shape_required_string_list::de_required_string_list(
   72         -
                        tokens,
   73         -
                        _value,
   74         -
                        depth + 1,
   75         -
                    )?);
   76         -
                }
   77         -
                "requiredTimestamp" => {
   78         -
                    builder = builder.set_required_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   79         -
                        tokens.next(),
   80         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
   81         -
                    )?);
   82         -
                }
   83         -
                "requiredBlob" => {
   84         -
                    builder = builder.set_required_blob(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
   85         -
                }
   86         -
                "requiredByte" => {
   87         -
                    builder = builder.set_required_byte(
   88         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   89         -
                            .map(i8::try_from)
   90         -
                            .transpose()?,
   91         -
                    );
   92         -
                }
   93         -
                "requiredShort" => {
   94         -
                    builder = builder.set_required_short(
   95         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   96         -
                            .map(i16::try_from)
   97         -
                            .transpose()?,
   98         -
                    );
   99         -
                }
  100         -
                "requiredInteger" => {
  101         -
                    builder = builder.set_required_integer(
  102         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  103         -
                            .map(i32::try_from)
  104         -
                            .transpose()?,
  105         -
                    );
  106         -
                }
  107         -
                "requiredLong" => {
  108         -
                    builder = builder.set_required_long(
  109         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  110         -
                            .map(i64::try_from)
  111         -
                            .transpose()?,
  112         -
                    );
  113         -
                }
  114         -
                "requiredFloat" => {
  115         -
                    builder = builder
  116         -
                        .set_required_float(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
  117         -
                }
  118         -
                "requiredDouble" => {
  119         -
                    builder = builder
  120         -
                        .set_required_double(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
  121         -
                }
  122         -
                "requiredMap" => {
  123         -
                    builder = builder.set_required_map(crate::protocol_serde::shape_required_string_map::de_required_string_map(
  124         -
                        tokens,
  125         -
                        _value,
  126         -
                        depth + 1,
  127         -
                    )?);
  128         -
                }
  129         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  130         -
            },
  131         -
            other => {
  132         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  133         -
                    "expected object key or end object, found: {other:?}"
  134         -
                )))
  135         -
            }
  136         -
        }
  137         -
    }
  138         -
    if tokens.next().is_some() {
  139         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  140         -
            "found more JSON tokens after completing parsing",
  141         -
        ));
  142         -
    }
  143         -
    Ok(builder)
  144         -
}

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

@@ -1,0 +161,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_operation_with_required_members_with_defaults_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::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsOutput,
    9         -
    crate::operation::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsError,
   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::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_operation_with_required_members_with_defaults_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::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsOutput,
   25         -
    crate::operation::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output =
   30         -
            crate::operation::operation_with_required_members_with_defaults::builders::OperationWithRequiredMembersWithDefaultsOutputBuilder::default(
   31         -
            );
   32         -
        output = crate::protocol_serde::shape_operation_with_required_members_with_defaults::de_operation_with_required_members_with_defaults(
   33         -
            _response_body,
   34         -
            output,
   35         -
        )
   36         -
        .map_err(crate::operation::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsError::unhandled)?;
   37         -
        crate::serde_util::operation_with_required_members_with_defaults_output_output_correct_errors(output).build()
   38         -
    })
   39         -
}
   40         -
   41         -
pub fn ser_operation_with_required_members_with_defaults_input(
   42         -
    _input: &crate::operation::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsInput,
   43         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   44         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   45         -
}
   46         -
   47         -
pub(crate) fn de_operation_with_required_members_with_defaults(
   48         -
    _value: &[u8],
   49         -
    mut builder: crate::operation::operation_with_required_members_with_defaults::builders::OperationWithRequiredMembersWithDefaultsOutputBuilder,
   50         -
) -> ::std::result::Result<
   51         -
    crate::operation::operation_with_required_members_with_defaults::builders::OperationWithRequiredMembersWithDefaultsOutputBuilder,
   52         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   53         -
> {
   54         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   55         -
    let tokens = &mut tokens_owned;
   56         -
    #[allow(unused_variables)]
   57         -
    let depth = 0u32;
   58         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   59         -
    loop {
   60         -
        match tokens.next().transpose()? {
   61         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   62         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   63         -
                "requiredString" => {
   64         -
                    builder = builder.set_required_string(
   65         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   66         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   67         -
                            .transpose()?,
   68         -
                    );
   69         -
                }
   70         -
                "requiredBoolean" => {
   71         -
                    builder = builder.set_required_boolean(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   72         -
                }
   73         -
                "requiredList" => {
   74         -
                    builder = builder.set_required_list(crate::protocol_serde::shape_required_string_list::de_required_string_list(
   75         -
                        tokens,
   76         -
                        _value,
   77         -
                        depth + 1,
   78         -
                    )?);
   79         -
                }
   80         -
                "requiredTimestamp" => {
   81         -
                    builder = builder.set_required_timestamp(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   82         -
                        tokens.next(),
   83         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
   84         -
                    )?);
   85         -
                }
   86         -
                "requiredBlob" => {
   87         -
                    builder = builder.set_required_blob(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
   88         -
                }
   89         -
                "requiredByte" => {
   90         -
                    builder = builder.set_required_byte(
   91         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   92         -
                            .map(i8::try_from)
   93         -
                            .transpose()?,
   94         -
                    );
   95         -
                }
   96         -
                "requiredShort" => {
   97         -
                    builder = builder.set_required_short(
   98         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   99         -
                            .map(i16::try_from)
  100         -
                            .transpose()?,
  101         -
                    );
  102         -
                }
  103         -
                "requiredInteger" => {
  104         -
                    builder = builder.set_required_integer(
  105         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  106         -
                            .map(i32::try_from)
  107         -
                            .transpose()?,
  108         -
                    );
  109         -
                }
  110         -
                "requiredLong" => {
  111         -
                    builder = builder.set_required_long(
  112         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  113         -
                            .map(i64::try_from)
  114         -
                            .transpose()?,
  115         -
                    );
  116         -
                }
  117         -
                "requiredFloat" => {
  118         -
                    builder = builder
  119         -
                        .set_required_float(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f32_lossy()));
  120         -
                }
  121         -
                "requiredDouble" => {
  122         -
                    builder = builder
  123         -
                        .set_required_double(::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?.map(|v| v.to_f64_lossy()));
  124         -
                }
  125         -
                "requiredMap" => {
  126         -
                    builder = builder.set_required_map(crate::protocol_serde::shape_required_string_map::de_required_string_map(
  127         -
                        tokens,
  128         -
                        _value,
  129         -
                        depth + 1,
  130         -
                    )?);
  131         -
                }
  132         -
                "requiredEnum" => {
  133         -
                    builder = builder.set_required_enum(
  134         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  135         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::RequiredEnum::from(u.as_ref())))
  136         -
                            .transpose()?,
  137         -
                    );
  138         -
                }
  139         -
                "requiredIntEnum" => {
  140         -
                    builder = builder.set_required_int_enum(
  141         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  142         -
                            .map(i32::try_from)
  143         -
                            .transpose()?,
  144         -
                    );
  145         -
                }
  146         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  147         -
            },
  148         -
            other => {
  149         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  150         -
                    "expected object key or end object, found: {other:?}"
  151         -
                )))
  152         -
            }
  153         -
        }
  154         -
    }
  155         -
    if tokens.next().is_some() {
  156         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  157         -
            "found more JSON tokens after completing parsing",
  158         -
        ));
  159         -
    }
  160         -
    Ok(builder)
  161         -
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_put_with_content_encoding.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_put_with_content_encoding_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
    9         -
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::put_with_content_encoding::PutWithContentEncodingError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_put_with_content_encoding_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::put_with_content_encoding::PutWithContentEncodingOutput,
   25         -
    crate::operation::put_with_content_encoding::PutWithContentEncodingError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::put_with_content_encoding::builders::PutWithContentEncodingOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_put_with_content_encoding_input(
   35         -
    input: &crate::operation::put_with_content_encoding::PutWithContentEncodingInput,
   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_put_with_content_encoding_input::ser_put_with_content_encoding_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_put_with_content_encoding_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/protocol_serde/shape_query_incompatible_operation.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_query_incompatible_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::query_incompatible_operation::QueryIncompatibleOperationOutput,
    9         -
    crate::operation::query_incompatible_operation::QueryIncompatibleOperationError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::query_incompatible_operation::QueryIncompatibleOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::query_incompatible_operation::QueryIncompatibleOperationError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_query_incompatible_operation_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::query_incompatible_operation::QueryIncompatibleOperationOutput,
   27         -
    crate::operation::query_incompatible_operation::QueryIncompatibleOperationError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::query_incompatible_operation::builders::QueryIncompatibleOperationOutputBuilder::default();
   32         -
        output.build()
   33         -
    })
   34         -
}
   35         -
   36         -
pub fn ser_query_incompatible_operation_input(
   37         -
    _input: &crate::operation::query_incompatible_operation::QueryIncompatibleOperationInput,
   38         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   39         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   40         -
}