Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

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

@@ -1,0 +220,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_kitchen_sink_operation_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::kitchen_sink_operation::KitchenSinkOperationInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.blob {
    7         -
        object.key("Blob").string_unchecked(&::aws_smithy_types::base64::encode(var_1));
    8         -
    }
    9         -
    if let Some(var_2) = &input.boolean {
   10         -
        object.key("Boolean").boolean(*var_2);
   11         -
    }
   12         -
    if let Some(var_3) = &input.double {
   13         -
        object.key("Double").number(
   14         -
            #[allow(clippy::useless_conversion)]
   15         -
            ::aws_smithy_types::Number::Float((*var_3).into()),
   16         -
        );
   17         -
    }
   18         -
    if let Some(var_4) = &input.empty_struct {
   19         -
        #[allow(unused_mut)]
   20         -
        let mut object_5 = object.key("EmptyStruct").start_object();
   21         -
        crate::protocol_serde::shape_empty_struct::ser_empty_struct(&mut object_5, var_4)?;
   22         -
        object_5.finish();
   23         -
    }
   24         -
    if let Some(var_6) = &input.float {
   25         -
        object.key("Float").number(
   26         -
            #[allow(clippy::useless_conversion)]
   27         -
            ::aws_smithy_types::Number::Float((*var_6).into()),
   28         -
        );
   29         -
    }
   30         -
    if let Some(var_7) = &input.httpdate_timestamp {
   31         -
        object
   32         -
            .key("HttpdateTimestamp")
   33         -
            .date_time(var_7, ::aws_smithy_types::date_time::Format::HttpDate)?;
   34         -
    }
   35         -
    if let Some(var_8) = &input.integer {
   36         -
        object.key("Integer").number(
   37         -
            #[allow(clippy::useless_conversion)]
   38         -
            ::aws_smithy_types::Number::NegInt((*var_8).into()),
   39         -
        );
   40         -
    }
   41         -
    if let Some(var_9) = &input.iso8601_timestamp {
   42         -
        object
   43         -
            .key("Iso8601Timestamp")
   44         -
            .date_time(var_9, ::aws_smithy_types::date_time::Format::DateTime)?;
   45         -
    }
   46         -
    if let Some(var_10) = &input.json_value {
   47         -
        object.key("JsonValue").string(var_10.as_str());
   48         -
    }
   49         -
    if let Some(var_11) = &input.list_of_lists {
   50         -
        let mut array_12 = object.key("ListOfLists").start_array();
   51         -
        for item_13 in var_11 {
   52         -
            {
   53         -
                let mut array_14 = array_12.value().start_array();
   54         -
                for item_15 in item_13 {
   55         -
                    {
   56         -
                        array_14.value().string(item_15.as_str());
   57         -
                    }
   58         -
                }
   59         -
                array_14.finish();
   60         -
            }
   61         -
        }
   62         -
        array_12.finish();
   63         -
    }
   64         -
    if let Some(var_16) = &input.list_of_maps_of_strings {
   65         -
        let mut array_17 = object.key("ListOfMapsOfStrings").start_array();
   66         -
        for item_18 in var_16 {
   67         -
            {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut object_19 = array_17.value().start_object();
   70         -
                for (key_20, value_21) in item_18 {
   71         -
                    {
   72         -
                        object_19.key(key_20.as_str()).string(value_21.as_str());
   73         -
                    }
   74         -
                }
   75         -
                object_19.finish();
   76         -
            }
   77         -
        }
   78         -
        array_17.finish();
   79         -
    }
   80         -
    if let Some(var_22) = &input.list_of_strings {
   81         -
        let mut array_23 = object.key("ListOfStrings").start_array();
   82         -
        for item_24 in var_22 {
   83         -
            {
   84         -
                array_23.value().string(item_24.as_str());
   85         -
            }
   86         -
        }
   87         -
        array_23.finish();
   88         -
    }
   89         -
    if let Some(var_25) = &input.list_of_structs {
   90         -
        let mut array_26 = object.key("ListOfStructs").start_array();
   91         -
        for item_27 in var_25 {
   92         -
            {
   93         -
                #[allow(unused_mut)]
   94         -
                let mut object_28 = array_26.value().start_object();
   95         -
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(&mut object_28, item_27)?;
   96         -
                object_28.finish();
   97         -
            }
   98         -
        }
   99         -
        array_26.finish();
  100         -
    }
  101         -
    if let Some(var_29) = &input.long {
  102         -
        object.key("Long").number(
  103         -
            #[allow(clippy::useless_conversion)]
  104         -
            ::aws_smithy_types::Number::NegInt((*var_29).into()),
  105         -
        );
  106         -
    }
  107         -
    if let Some(var_30) = &input.map_of_lists_of_strings {
  108         -
        #[allow(unused_mut)]
  109         -
        let mut object_31 = object.key("MapOfListsOfStrings").start_object();
  110         -
        for (key_32, value_33) in var_30 {
  111         -
            {
  112         -
                let mut array_34 = object_31.key(key_32.as_str()).start_array();
  113         -
                for item_35 in value_33 {
  114         -
                    {
  115         -
                        array_34.value().string(item_35.as_str());
  116         -
                    }
  117         -
                }
  118         -
                array_34.finish();
  119         -
            }
  120         -
        }
  121         -
        object_31.finish();
  122         -
    }
  123         -
    if let Some(var_36) = &input.map_of_maps {
  124         -
        #[allow(unused_mut)]
  125         -
        let mut object_37 = object.key("MapOfMaps").start_object();
  126         -
        for (key_38, value_39) in var_36 {
  127         -
            {
  128         -
                #[allow(unused_mut)]
  129         -
                let mut object_40 = object_37.key(key_38.as_str()).start_object();
  130         -
                for (key_41, value_42) in value_39 {
  131         -
                    {
  132         -
                        object_40.key(key_41.as_str()).string(value_42.as_str());
  133         -
                    }
  134         -
                }
  135         -
                object_40.finish();
  136         -
            }
  137         -
        }
  138         -
        object_37.finish();
  139         -
    }
  140         -
    if let Some(var_43) = &input.map_of_strings {
  141         -
        #[allow(unused_mut)]
  142         -
        let mut object_44 = object.key("MapOfStrings").start_object();
  143         -
        for (key_45, value_46) in var_43 {
  144         -
            {
  145         -
                object_44.key(key_45.as_str()).string(value_46.as_str());
  146         -
            }
  147         -
        }
  148         -
        object_44.finish();
  149         -
    }
  150         -
    if let Some(var_47) = &input.map_of_structs {
  151         -
        #[allow(unused_mut)]
  152         -
        let mut object_48 = object.key("MapOfStructs").start_object();
  153         -
        for (key_49, value_50) in var_47 {
  154         -
            {
  155         -
                #[allow(unused_mut)]
  156         -
                let mut object_51 = object_48.key(key_49.as_str()).start_object();
  157         -
                crate::protocol_serde::shape_simple_struct::ser_simple_struct(&mut object_51, value_50)?;
  158         -
                object_51.finish();
  159         -
            }
  160         -
        }
  161         -
        object_48.finish();
  162         -
    }
  163         -
    if let Some(var_52) = &input.recursive_list {
  164         -
        let mut array_53 = object.key("RecursiveList").start_array();
  165         -
        for item_54 in var_52 {
  166         -
            {
  167         -
                #[allow(unused_mut)]
  168         -
                let mut object_55 = array_53.value().start_object();
  169         -
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(&mut object_55, item_54)?;
  170         -
                object_55.finish();
  171         -
            }
  172         -
        }
  173         -
        array_53.finish();
  174         -
    }
  175         -
    if let Some(var_56) = &input.recursive_map {
  176         -
        #[allow(unused_mut)]
  177         -
        let mut object_57 = object.key("RecursiveMap").start_object();
  178         -
        for (key_58, value_59) in var_56 {
  179         -
            {
  180         -
                #[allow(unused_mut)]
  181         -
                let mut object_60 = object_57.key(key_58.as_str()).start_object();
  182         -
                crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(&mut object_60, value_59)?;
  183         -
                object_60.finish();
  184         -
            }
  185         -
        }
  186         -
        object_57.finish();
  187         -
    }
  188         -
    if let Some(var_61) = &input.recursive_struct {
  189         -
        #[allow(unused_mut)]
  190         -
        let mut object_62 = object.key("RecursiveStruct").start_object();
  191         -
        crate::protocol_serde::shape_kitchen_sink::ser_kitchen_sink(&mut object_62, var_61)?;
  192         -
        object_62.finish();
  193         -
    }
  194         -
    if let Some(var_63) = &input.simple_struct {
  195         -
        #[allow(unused_mut)]
  196         -
        let mut object_64 = object.key("SimpleStruct").start_object();
  197         -
        crate::protocol_serde::shape_simple_struct::ser_simple_struct(&mut object_64, var_63)?;
  198         -
        object_64.finish();
  199         -
    }
  200         -
    if let Some(var_65) = &input.string {
  201         -
        object.key("String").string(var_65.as_str());
  202         -
    }
  203         -
    if let Some(var_66) = &input.struct_with_json_name {
  204         -
        #[allow(unused_mut)]
  205         -
        let mut object_67 = object.key("StructWithJsonName").start_object();
  206         -
        crate::protocol_serde::shape_struct_with_json_name::ser_struct_with_json_name(&mut object_67, var_66)?;
  207         -
        object_67.finish();
  208         -
    }
  209         -
    if let Some(var_68) = &input.timestamp {
  210         -
        object
  211         -
            .key("Timestamp")
  212         -
            .date_time(var_68, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  213         -
    }
  214         -
    if let Some(var_69) = &input.unix_timestamp {
  215         -
        object
  216         -
            .key("UnixTimestamp")
  217         -
            .date_time(var_69, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
  218         -
    }
  219         -
    Ok(())
  220         -
}

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

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

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

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

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

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_list_of_maps_of_strings<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::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         -
                        let value = crate::protocol_serde::shape_map_of_strings::de_map_of_strings(tokens, _value)?;
   24         -
                        if let Some(value) = value {
   25         -
                            items.push(value);
   26         -
                        } else {
   27         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                "dense list cannot contain null values",
   29         -
                            ));
   30         -
                        }
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(items))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start array or null",
   38         -
        )),
   39         -
    }
   40         -
}

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

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

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

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

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

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_map_of_kitchen_sinks<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, crate::types::KitchenSink>>,
    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_kitchen_sink::de_kitchen_sink(tokens, _value)?;
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

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

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_map_of_lists_of_strings<'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::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_list_of_strings::de_list_of_strings(tokens, _value)?;
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

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

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_map_of_map_of_strings<'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::collections::HashMap<::std::string::String, ::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_map_of_strings::de_map_of_strings(tokens, _value)?;
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

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

@@ -1,0 +48,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_map_of_strings<'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::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         -
                        match value {
   25         -
                            Some(value) => {
   26         -
                                map.insert(key, value);
   27         -
                            }
   28         -
                            None => {
   29         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   30         -
                                    "dense map cannot contain null values",
   31         -
                                ))
   32         -
                            }
   33         -
                        }
   34         -
                    }
   35         -
                    other => {
   36         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   37         -
                            "expected object key or end object, found: {other:?}"
   38         -
                        )))
   39         -
                    }
   40         -
                }
   41         -
            }
   42         -
            Ok(Some(map))
   43         -
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45         -
            "expected start object or null",
   46         -
        )),
   47         -
    }
   48         -
}

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

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_map_of_structs<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, crate::types::SimpleStruct>>,
    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_simple_struct::de_simple_struct(tokens, _value)?;
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

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

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

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

@@ -1,0 +76,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_null_operation_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::null_operation::NullOperationOutput, crate::operation::null_operation::NullOperationError> {
    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::null_operation::NullOperationError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::null_operation::NullOperationError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_null_operation_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::null_operation::NullOperationOutput, crate::operation::null_operation::NullOperationError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::null_operation::builders::NullOperationOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_null_operation::de_null_operation(_response_body, output)
   25         -
            .map_err(crate::operation::null_operation::NullOperationError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_null_operation_input(
   31         -
    input: &crate::operation::null_operation::NullOperationInput,
   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_null_operation_input::ser_null_operation_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_null_operation(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::null_operation::builders::NullOperationOutputBuilder,
   43         -
) -> ::std::result::Result<
   44         -
    crate::operation::null_operation::builders::NullOperationOutputBuilder,
   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         -
                "string" => {
   55         -
                    builder = builder.set_string(
   56         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   57         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   58         -
                            .transpose()?,
   59         -
                    );
   60         -
                }
   61         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   62         -
            },
   63         -
            other => {
   64         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   65         -
                    "expected object key or end object, found: {other:?}"
   66         -
                )))
   67         -
            }
   68         -
        }
   69         -
    }
   70         -
    if tokens.next().is_some() {
   71         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   72         -
            "found more JSON tokens after completing parsing",
   73         -
        ));
   74         -
    }
   75         -
    Ok(builder)
   76         -
}

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

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

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

@@ -1,0 +85,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_optional_input_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::operation_with_optional_input_output::OperationWithOptionalInputOutputOutput,
    9         -
    crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputError,
   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_optional_input_output::OperationWithOptionalInputOutputError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_operation_with_optional_input_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::operation_with_optional_input_output::OperationWithOptionalInputOutputOutput,
   25         -
    crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::operation_with_optional_input_output::builders::OperationWithOptionalInputOutputOutputBuilder::default();
   30         -
        output = crate::protocol_serde::shape_operation_with_optional_input_output::de_operation_with_optional_input_output(_response_body, output)
   31         -
            .map_err(crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputError::unhandled)?;
   32         -
        output.build()
   33         -
    })
   34         -
}
   35         -
   36         -
pub fn ser_operation_with_optional_input_output_input(
   37         -
    input: &crate::operation::operation_with_optional_input_output::OperationWithOptionalInputOutputInput,
   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_optional_input_output_input::ser_operation_with_optional_input_output_input_input(
   42         -
        &mut object,
   43         -
        input,
   44         -
    )?;
   45         -
    object.finish();
   46         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   47         -
}
   48         -
   49         -
pub(crate) fn de_operation_with_optional_input_output(
   50         -
    _value: &[u8],
   51         -
    mut builder: crate::operation::operation_with_optional_input_output::builders::OperationWithOptionalInputOutputOutputBuilder,
   52         -
) -> ::std::result::Result<
   53         -
    crate::operation::operation_with_optional_input_output::builders::OperationWithOptionalInputOutputOutputBuilder,
   54         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   55         -
> {
   56         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   57         -
    let tokens = &mut tokens_owned;
   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         -
                "Value" => {
   64         -
                    builder = builder.set_value(
   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         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   71         -
            },
   72         -
            other => {
   73         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   74         -
                    "expected object key or end object, found: {other:?}"
   75         -
                )))
   76         -
            }
   77         -
        }
   78         -
    }
   79         -
    if tokens.next().is_some() {
   80         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   81         -
            "found more JSON tokens after completing parsing",
   82         -
        ));
   83         -
    }
   84         -
    Ok(builder)
   85         -
}

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

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