Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36 (ignoring whitespace)

Files changed:

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

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

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

@@ -1,0 +7,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_foo_header(
    3         -
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
    5         -
    let headers = header_map.get_all("X-Foo");
    6         -
    ::aws_smithy_http::header::one_or_none(headers)
    7         -
}

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

@@ -1,0 +19,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_simple_union(
    3         -
    object_2: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::SimpleUnion,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    match input {
    7         -
        crate::types::SimpleUnion::Int(inner) => {
    8         -
            object_2.key("int").number(
    9         -
                #[allow(clippy::useless_conversion)]
   10         -
                ::aws_smithy_types::Number::NegInt((*inner).into()),
   11         -
            );
   12         -
        }
   13         -
        crate::types::SimpleUnion::String(inner) => {
   14         -
            object_2.key("string").string(inner.as_str());
   15         -
        }
   16         -
        crate::types::SimpleUnion::Unknown => return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant("SimpleUnion")),
   17         -
    }
   18         -
    Ok(())
   19         -
}

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

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_singleton_event<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::SingletonEvent>, ::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::SingletonEventBuilder::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         -
                        "value" => {
   19         -
                            builder = builder.set_value(
   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/rest_json/rust-client-codegen/src/protocol_serde/shape_singleton_event_stream.rs

@@ -1,0 +78,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_singleton_event_stream_payload(
    3         -
    _value: &[u8],
    4         -
) -> ::std::result::Result<crate::types::SingletonEventStream, ::aws_smithy_json::deserialize::error::DeserializeError> {
    5         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    6         -
    let tokens = &mut tokens_owned;
    7         -
    let result = crate::protocol_serde::shape_singleton_event_stream::de_singleton_event_stream(tokens, _value)?
    8         -
        .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("expected payload member value"));
    9         -
    if tokens.next().is_some() {
   10         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   11         -
            "found more JSON tokens after completing parsing",
   12         -
        ));
   13         -
    }
   14         -
    result
   15         -
}
   16         -
   17         -
pub(crate) fn de_singleton_event_stream<'a, I>(
   18         -
    tokens: &mut ::std::iter::Peekable<I>,
   19         -
    _value: &'a [u8],
   20         -
) -> ::std::result::Result<Option<crate::types::SingletonEventStream>, ::aws_smithy_json::deserialize::error::DeserializeError>
   21         -
where
   22         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   23         -
{
   24         -
    let mut variant = None;
   25         -
    match tokens.next().transpose()? {
   26         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   27         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
   28         -
            match tokens.next().transpose()? {
   29         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   30         -
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   31         -
                    if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
   32         -
                        tokens.peek()
   33         -
                    {
   34         -
                        let _ = tokens.next().expect("peek returned a token")?;
   35         -
                        continue;
   36         -
                    }
   37         -
                    let key = key.to_unescaped()?;
   38         -
                    if key == "__type" {
   39         -
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   40         -
                        continue;
   41         -
                    }
   42         -
                    if variant.is_some() {
   43         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44         -
                            "encountered mixed variants in union",
   45         -
                        ));
   46         -
                    }
   47         -
                    variant = match key.as_ref() {
   48         -
                        "singleton" => Some(crate::types::SingletonEventStream::Singleton(
   49         -
                            crate::protocol_serde::shape_singleton_event::de_singleton_event(tokens, _value)?.ok_or_else(|| {
   50         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'singleton' cannot be null")
   51         -
                            })?,
   52         -
                        )),
   53         -
                        _ => {
   54         -
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   55         -
                            Some(crate::types::SingletonEventStream::Unknown)
   56         -
                        }
   57         -
                    };
   58         -
                }
   59         -
                other => {
   60         -
                    return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   61         -
                        "expected object key or end object, found: {other:?}"
   62         -
                    )))
   63         -
                }
   64         -
            }
   65         -
        },
   66         -
        _ => {
   67         -
            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   68         -
                "expected start object or null",
   69         -
            ))
   70         -
        }
   71         -
    }
   72         -
    if variant.is_none() {
   73         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   74         -
            "Union did not contain a valid variant.",
   75         -
        ));
   76         -
    }
   77         -
    Ok(variant)
   78         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_sparse_boolean_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, ::std::option::Option<bool>>>,
    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 = ::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?;
   22         -
                        map.insert(key, value);
   23         -
                    }
   24         -
                    other => {
   25         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   26         -
                            "expected object key or end object, found: {other:?}"
   27         -
                        )))
   28         -
                    }
   29         -
                }
   30         -
            }
   31         -
            Ok(Some(map))
   32         -
        }
   33         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "expected start object or null",
   35         -
        )),
   36         -
    }
   37         -
}

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

@@ -1,0 +75,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_sparse_json_lists_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::sparse_json_lists::SparseJsonListsOutput, crate::operation::sparse_json_lists::SparseJsonListsError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::sparse_json_lists::SparseJsonListsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::sparse_json_lists::SparseJsonListsError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_sparse_json_lists_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::sparse_json_lists::SparseJsonListsOutput, crate::operation::sparse_json_lists::SparseJsonListsError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::sparse_json_lists::builders::SparseJsonListsOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_sparse_json_lists::de_sparse_json_lists(_response_body, output)
   25         -
            .map_err(crate::operation::sparse_json_lists::SparseJsonListsError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_sparse_json_lists_input(
   31         -
    input: &crate::operation::sparse_json_lists::SparseJsonListsInput,
   32         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   33         -
    let mut out = String::new();
   34         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   35         -
    crate::protocol_serde::shape_sparse_json_lists_input::ser_sparse_json_lists_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_sparse_json_lists(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::sparse_json_lists::builders::SparseJsonListsOutputBuilder,
   43         -
) -> ::std::result::Result<
   44         -
    crate::operation::sparse_json_lists::builders::SparseJsonListsOutputBuilder,
   45         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   46         -
> {
   47         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   48         -
    let tokens = &mut tokens_owned;
   49         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   50         -
    loop {
   51         -
        match tokens.next().transpose()? {
   52         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   53         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   54         -
                "sparseShortList" => {
   55         -
                    builder = builder.set_sparse_short_list(crate::protocol_serde::shape_sparse_short_list::de_sparse_short_list(tokens, _value)?);
   56         -
                }
   57         -
                "sparseStringList" => {
   58         -
                    builder = builder.set_sparse_string_list(crate::protocol_serde::shape_sparse_string_list::de_sparse_string_list(tokens, _value)?);
   59         -
                }
   60         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   61         -
            },
   62         -
            other => {
   63         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   64         -
                    "expected object key or end object, found: {other:?}"
   65         -
                )))
   66         -
            }
   67         -
        }
   68         -
    }
   69         -
    if tokens.next().is_some() {
   70         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   71         -
            "found more JSON tokens after completing parsing",
   72         -
        ));
   73         -
    }
   74         -
    Ok(builder)
   75         -
}

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

@@ -1,0 +32,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_sparse_json_lists_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::sparse_json_lists::SparseJsonListsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.sparse_short_list {
    7         -
        let mut array_2 = object.key("sparseShortList").start_array();
    8         -
        for item_3 in var_1 {
    9         -
            if let Some(var_4) = item_3 {
   10         -
                array_2.value().number(
   11         -
                    #[allow(clippy::useless_conversion)]
   12         -
                    ::aws_smithy_types::Number::NegInt((*var_4).into()),
   13         -
                );
   14         -
            } else {
   15         -
                array_2.value().null();
   16         -
            }
   17         -
        }
   18         -
        array_2.finish();
   19         -
    }
   20         -
    if let Some(var_5) = &input.sparse_string_list {
   21         -
        let mut array_6 = object.key("sparseStringList").start_array();
   22         -
        for item_7 in var_5 {
   23         -
            if let Some(var_8) = item_7 {
   24         -
                array_6.value().string(var_8.as_str());
   25         -
            } else {
   26         -
                array_6.value().null();
   27         -
            }
   28         -
        }
   29         -
        array_6.finish();
   30         -
    }
   31         -
    Ok(())
   32         -
}

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

@@ -1,0 +84,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_sparse_json_maps_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::sparse_json_maps::SparseJsonMapsOutput, crate::operation::sparse_json_maps::SparseJsonMapsError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::sparse_json_maps::SparseJsonMapsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::sparse_json_maps::SparseJsonMapsError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_sparse_json_maps_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::sparse_json_maps::SparseJsonMapsOutput, crate::operation::sparse_json_maps::SparseJsonMapsError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps(_response_body, output)
   25         -
            .map_err(crate::operation::sparse_json_maps::SparseJsonMapsError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_sparse_json_maps_input(
   31         -
    input: &crate::operation::sparse_json_maps::SparseJsonMapsInput,
   32         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   33         -
    let mut out = String::new();
   34         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   35         -
    crate::protocol_serde::shape_sparse_json_maps_input::ser_sparse_json_maps_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_sparse_json_maps(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder,
   43         -
) -> ::std::result::Result<
   44         -
    crate::operation::sparse_json_maps::builders::SparseJsonMapsOutputBuilder,
   45         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   46         -
> {
   47         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   48         -
    let tokens = &mut tokens_owned;
   49         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   50         -
    loop {
   51         -
        match tokens.next().transpose()? {
   52         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   53         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   54         -
                "sparseBooleanMap" => {
   55         -
                    builder = builder.set_sparse_boolean_map(crate::protocol_serde::shape_sparse_boolean_map::de_sparse_boolean_map(tokens, _value)?);
   56         -
                }
   57         -
                "sparseNumberMap" => {
   58         -
                    builder = builder.set_sparse_number_map(crate::protocol_serde::shape_sparse_number_map::de_sparse_number_map(tokens, _value)?);
   59         -
                }
   60         -
                "sparseSetMap" => {
   61         -
                    builder = builder.set_sparse_set_map(crate::protocol_serde::shape_sparse_set_map::de_sparse_set_map(tokens, _value)?);
   62         -
                }
   63         -
                "sparseStringMap" => {
   64         -
                    builder = builder.set_sparse_string_map(crate::protocol_serde::shape_sparse_string_map::de_sparse_string_map(tokens, _value)?);
   65         -
                }
   66         -
                "sparseStructMap" => {
   67         -
                    builder = builder.set_sparse_struct_map(crate::protocol_serde::shape_sparse_struct_map::de_sparse_struct_map(tokens, _value)?);
   68         -
                }
   69         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   70         -
            },
   71         -
            other => {
   72         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   73         -
                    "expected object key or end object, found: {other:?}"
   74         -
                )))
   75         -
            }
   76         -
        }
   77         -
    }
   78         -
    if tokens.next().is_some() {
   79         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   80         -
            "found more JSON tokens after completing parsing",
   81         -
        ));
   82         -
    }
   83         -
    Ok(builder)
   84         -
}

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

@@ -1,0 +79,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_sparse_json_maps_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::sparse_json_maps::SparseJsonMapsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.sparse_boolean_map {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_2 = object.key("sparseBooleanMap").start_object();
    9         -
        for (key_3, value_4) in var_1 {
   10         -
            if let Some(var_5) = value_4 {
   11         -
                object_2.key(key_3.as_str()).boolean(*var_5);
   12         -
            } else {
   13         -
                object_2.key(key_3.as_str()).null();
   14         -
            }
   15         -
        }
   16         -
        object_2.finish();
   17         -
    }
   18         -
    if let Some(var_6) = &input.sparse_number_map {
   19         -
        #[allow(unused_mut)]
   20         -
        let mut object_7 = object.key("sparseNumberMap").start_object();
   21         -
        for (key_8, value_9) in var_6 {
   22         -
            if let Some(var_10) = value_9 {
   23         -
                object_7.key(key_8.as_str()).number(
   24         -
                    #[allow(clippy::useless_conversion)]
   25         -
                    ::aws_smithy_types::Number::NegInt((*var_10).into()),
   26         -
                );
   27         -
            } else {
   28         -
                object_7.key(key_8.as_str()).null();
   29         -
            }
   30         -
        }
   31         -
        object_7.finish();
   32         -
    }
   33         -
    if let Some(var_11) = &input.sparse_set_map {
   34         -
        #[allow(unused_mut)]
   35         -
        let mut object_12 = object.key("sparseSetMap").start_object();
   36         -
        for (key_13, value_14) in var_11 {
   37         -
            if let Some(var_15) = value_14 {
   38         -
                let mut array_16 = object_12.key(key_13.as_str()).start_array();
   39         -
                for item_17 in var_15 {
   40         -
                    {
   41         -
                        array_16.value().string(item_17.as_str());
   42         -
                    }
   43         -
                }
   44         -
                array_16.finish();
   45         -
            } else {
   46         -
                object_12.key(key_13.as_str()).null();
   47         -
            }
   48         -
        }
   49         -
        object_12.finish();
   50         -
    }
   51         -
    if let Some(var_18) = &input.sparse_string_map {
   52         -
        #[allow(unused_mut)]
   53         -
        let mut object_19 = object.key("sparseStringMap").start_object();
   54         -
        for (key_20, value_21) in var_18 {
   55         -
            if let Some(var_22) = value_21 {
   56         -
                object_19.key(key_20.as_str()).string(var_22.as_str());
   57         -
            } else {
   58         -
                object_19.key(key_20.as_str()).null();
   59         -
            }
   60         -
        }
   61         -
        object_19.finish();
   62         -
    }
   63         -
    if let Some(var_23) = &input.sparse_struct_map {
   64         -
        #[allow(unused_mut)]
   65         -
        let mut object_24 = object.key("sparseStructMap").start_object();
   66         -
        for (key_25, value_26) in var_23 {
   67         -
            if let Some(var_27) = value_26 {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut object_28 = object_24.key(key_25.as_str()).start_object();
   70         -
                crate::protocol_serde::shape_greeting_struct::ser_greeting_struct(&mut object_28, var_27)?;
   71         -
                object_28.finish();
   72         -
            } else {
   73         -
                object_24.key(key_25.as_str()).null();
   74         -
            }
   75         -
        }
   76         -
        object_24.finish();
   77         -
    }
   78         -
    Ok(())
   79         -
}

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

@@ -1,0 +39,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_sparse_number_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, ::std::option::Option<i32>>>,
    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 = ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   22         -
                            .map(i32::try_from)
   23         -
                            .transpose()?;
   24         -
                        map.insert(key, value);
   25         -
                    }
   26         -
                    other => {
   27         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28         -
                            "expected object key or end object, found: {other:?}"
   29         -
                        )))
   30         -
                    }
   31         -
                }
   32         -
            }
   33         -
            Ok(Some(map))
   34         -
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start object or null",
   37         -
        )),
   38         -
    }
   39         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_sparse_set_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, ::std::option::Option<::std::vec::Vec<::std::string::String>>>>,
    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_string_set::de_string_set(tokens, _value)?;
   22         -
                        map.insert(key, value);
   23         -
                    }
   24         -
                    other => {
   25         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   26         -
                            "expected object key or end object, found: {other:?}"
   27         -
                        )))
   28         -
                    }
   29         -
                }
   30         -
            }
   31         -
            Ok(Some(map))
   32         -
        }
   33         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "expected start object or null",
   35         -
        )),
   36         -
    }
   37         -
}

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

@@ -1,0 +34,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_sparse_short_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<::std::option::Option<i16>>>, ::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         -
                        items.push(
   21         -
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   22         -
                                .map(i16::try_from)
   23         -
                                .transpose()?,
   24         -
                        );
   25         -
                    }
   26         -
                }
   27         -
            }
   28         -
            Ok(Some(items))
   29         -
        }
   30         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "expected start array or null",
   32         -
        )),
   33         -
    }
   34         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_sparse_string_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_sparse_string_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
    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::StartArray { .. }) => {
   15         -
            let mut items = Vec::new();
   16         -
            loop {
   17         -
                match tokens.peek() {
   18         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   19         -
                        tokens.next().transpose().unwrap();
   20         -
                        break;
   21         -
                    }
   22         -
                    _ => {
   23         -
                        items.push(
   24         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   25         -
                                .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   26         -
                                .transpose()?,
   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/rest_json/rust-client-codegen/src/protocol_serde/shape_sparse_string_map.rs

@@ -1,0 +39,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_sparse_string_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, ::std::option::Option<::std::string::String>>>,
    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 = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   22         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   23         -
                            .transpose()?;
   24         -
                        map.insert(key, value);
   25         -
                    }
   26         -
                    other => {
   27         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28         -
                            "expected object key or end object, found: {other:?}"
   29         -
                        )))
   30         -
                    }
   31         -
                }
   32         -
            }
   33         -
            Ok(Some(map))
   34         -
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start object or null",
   37         -
        )),
   38         -
    }
   39         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_sparse_struct_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, ::std::option::Option<crate::types::GreetingStruct>>>,
    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_greeting_struct::de_greeting_struct(tokens, _value)?;
   22         -
                        map.insert(key, value);
   23         -
                    }
   24         -
                    other => {
   25         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   26         -
                            "expected object key or end object, found: {other:?}"
   27         -
                        )))
   28         -
                    }
   29         -
                }
   30         -
            }
   31         -
            Ok(Some(map))
   32         -
        }
   33         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "expected start object or null",
   35         -
        )),
   36         -
    }
   37         -
}