Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/string_payload/_string_payload_input.rs

@@ -5,5 +109,131 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27     27   
    "payload",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_payload();
   31     31   
static STRINGPAYLOADINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    STRINGPAYLOADINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&STRINGPAYLOADINPUT_MEMBER_PAYLOAD],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/StringPayload", None));
   36     37   
impl StringPayloadInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STRINGPAYLOADINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for StringPayloadInput {
   41     42   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     43   
    fn serialize_members(
   43     44   
        &self,
   44     45   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     46   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     47   
        if let Some(ref val) = self.payload {
   47     48   
            ser.write_string(&STRINGPAYLOADINPUT_MEMBER_PAYLOAD, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl StringPayloadInput {
   53     54   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          55  +
    pub fn deserialize(
          56  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     57   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     58   
        #[allow(unused_variables, unused_mut)]
   58     59   
        let mut builder = Self::builder();
   59     60   
        #[allow(
   60     61   
            unused_variables,
   61     62   
            unreachable_code,
   62     63   
            clippy::single_match,
   63     64   
            clippy::match_single_binding,
   64     65   
            clippy::diverging_sub_expression
   65     66   
        )]
   66         -
        deserializer.read_struct(&STRINGPAYLOADINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&STRINGPAYLOADINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69     70   
                    builder.payload = Some(deser.read_string(member)?);
   70     71   
                }
   71     72   
                _ => {}
   72     73   
            }
   73     74   
            Ok(())
   74     75   
        })?;
   75     76   
        builder
   76     77   
            .build()
   77     78   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   78     79   
    }
   79     80   
}
          81  +
impl StringPayloadInput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          83  +
    /// Header-bound members are read directly from headers, avoiding runtime
          84  +
    /// member iteration overhead. Body members are read via the deserializer.
          85  +
    pub fn deserialize_with_response(
          86  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          87  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          88  +
        _status: u16,
          89  +
        body: &[u8],
          90  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          91  +
        #[allow(unused_variables, unused_mut)]
          92  +
        let mut builder = Self::builder();
          93  +
        if !body.is_empty() {
          94  +
            let s = ::std::string::String::from_utf8_lossy(body).into_owned();
          95  +
            builder.payload = Some(s);
          96  +
        }
          97  +
        builder
          98  +
            .build()
          99  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         100  +
    }
         101  +
}
   80    102   
impl StringPayloadInput {
   81    103   
    /// Creates a new builder-style object to manufacture [`StringPayloadInput`](crate::operation::string_payload::StringPayloadInput).
   82    104   
    pub fn builder() -> crate::operation::string_payload::builders::StringPayloadInputBuilder {
   83    105   
        crate::operation::string_payload::builders::StringPayloadInputBuilder::default()
   84    106   
    }
   85    107   
}
   86    108   
   87    109   
/// A builder for [`StringPayloadInput`](crate::operation::string_payload::StringPayloadInput).
   88    110   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89    111   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/string_payload/_string_payload_output.rs

@@ -24,24 +107,126 @@
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     46   
        if let Some(ref val) = self.payload {
   47     47   
            ser.write_string(&STRINGPAYLOADOUTPUT_MEMBER_PAYLOAD, val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl StringPayloadOutput {
   53     53   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     56   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     57   
        #[allow(unused_variables, unused_mut)]
   58     58   
        let mut builder = Self::builder();
   59     59   
        #[allow(
   60     60   
            unused_variables,
   61     61   
            unreachable_code,
   62     62   
            clippy::single_match,
   63     63   
            clippy::match_single_binding,
   64     64   
            clippy::diverging_sub_expression
   65     65   
        )]
   66         -
        deserializer.read_struct(&STRINGPAYLOADOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&STRINGPAYLOADOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.payload = Some(deser.read_string(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
   75     75   
        Ok(builder.build())
   76     76   
    }
   77     77   
}
          78  +
impl StringPayloadOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          80  +
    /// Header-bound members are read directly from headers, avoiding runtime
          81  +
    /// member iteration overhead. Body members are read via the deserializer.
          82  +
    pub fn deserialize_with_response(
          83  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          84  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          85  +
        _status: u16,
          86  +
        body: &[u8],
          87  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          88  +
        #[allow(unused_variables, unused_mut)]
          89  +
        let mut builder = Self::builder();
          90  +
        if !body.is_empty() {
          91  +
            let s = ::std::string::String::from_utf8_lossy(body).into_owned();
          92  +
            builder.payload = Some(s);
          93  +
        }
          94  +
        Ok(builder.build())
          95  +
    }
          96  +
}
   78     97   
impl StringPayloadOutput {
   79     98   
    /// Creates a new builder-style object to manufacture [`StringPayloadOutput`](crate::operation::string_payload::StringPayloadOutput).
   80     99   
    pub fn builder() -> crate::operation::string_payload::builders::StringPayloadOutputBuilder {
   81    100   
        crate::operation::string_payload::builders::StringPayloadOutputBuilder::default()
   82    101   
    }
   83    102   
}
   84    103   
   85    104   
/// A builder for [`StringPayloadOutput`](crate::operation::string_payload::StringPayloadOutput).
   86    105   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   87    106   
#[non_exhaustive]

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

@@ -1,1 +86,0 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn type_erase_result<O, E>(
    3         -
    result: ::std::result::Result<O, E>,
    4         -
) -> ::std::result::Result<
    5         -
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6         -
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7         -
>
    8         -
where
    9         -
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10         -
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11         -
{
   12         -
    result
   13         -
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14         -
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15         -
        .map_err(::std::convert::Into::into)
   16         -
}
   17         -
   18      2   
pub fn parse_http_error_metadata(
   19      3   
    _response_status: u16,
   20      4   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21      5   
    response_body: &[u8],
   22      6   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23      7   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24      8   
}
   25         -
   26         -
pub(crate) mod shape_case_insensitive_error_operation;
   27         -
   28         -
pub(crate) mod shape_empty_struct_with_content_on_wire_op;
   29         -
   30         -
pub(crate) mod shape_enum_query;
   31         -
   32         -
pub(crate) mod shape_escaped_string_values;
   33         -
   34         -
pub(crate) mod shape_map_with_enum_key_op;
   35         -
   36         -
pub(crate) mod shape_null_in_non_sparse;
   37         -
   38         -
pub(crate) mod shape_primitive_int_header;
   39         -
   40         -
pub(crate) mod shape_primitive_int_op;
   41         -
   42         -
pub(crate) mod shape_query_precedence;
   43         -
   44         -
pub(crate) mod shape_status_response;
   45         -
   46         -
pub(crate) mod shape_string_payload;
   47         -
   48         -
pub(crate) mod shape_string_payload_input;
   49         -
   50         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   51         -
    if data.is_empty() {
   52         -
        b"{}"
   53         -
    } else {
   54         -
        data
   55         -
    }
   56         -
}
   57         -
   58         -
pub(crate) mod shape_case_insensitive_error;
   59         -
   60         -
pub(crate) mod shape_escaped_string_values_input;
   61         -
   62         -
pub(crate) mod shape_extra_error;
   63         -
   64         -
pub(crate) mod shape_map_with_enum_key_op_input;
   65         -
   66         -
pub(crate) mod shape_primitive_int_header_output;
   67         -
   68         -
pub(crate) mod shape_primitive_int_op_input;
   69         -
   70         -
pub(crate) mod shape_string_payload_output;
   71         -
   72         -
pub(crate) mod shape_validation_exception;
   73         -
   74         -
pub(crate) mod shape_empty_struct;
   75         -
   76         -
pub(crate) mod shape_map_with_enum_key;
   77         -
   78         -
pub(crate) mod shape_non_sparse_list;
   79         -
   80         -
pub(crate) mod shape_non_sparse_map;
   81         -
   82         -
pub(crate) mod shape_single_element_union;
   83         -
   84         -
pub(crate) mod shape_validation_exception_field_list;
   85         -
   86         -
pub(crate) mod shape_validation_exception_field;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_case_insensitive_error.rs

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

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_case_insensitive_error_operation.rs

@@ -1,0 +70,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_case_insensitive_error_operation_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
    9         -
    crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   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::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "CaseInsensitiveError" => crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::CaseInsensitiveError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::CaseInsensitiveErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_case_insensitive_error::de_case_insensitive_error_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
   32         -
            if tmp.message.is_none() {
   33         -
                tmp.message = _error_message;
   34         -
            }
   35         -
            tmp
   36         -
        }),
   37         -
        "ExtraError" => crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::ExtraError({
   38         -
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   42         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   43         -
                    .map_err(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled)?;
   44         -
                let output = output.meta(generic);
   45         -
                output.build()
   46         -
            };
   47         -
            if tmp.message.is_none() {
   48         -
                tmp.message = _error_message;
   49         -
            }
   50         -
            tmp
   51         -
        }),
   52         -
        _ => crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::generic(generic),
   53         -
    })
   54         -
}
   55         -
   56         -
#[allow(clippy::unnecessary_wraps)]
   57         -
pub fn de_case_insensitive_error_operation_http_response(
   58         -
    _response_status: u16,
   59         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   60         -
    _response_body: &[u8],
   61         -
) -> std::result::Result<
   62         -
    crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
   63         -
    crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   64         -
> {
   65         -
    Ok({
   66         -
        #[allow(unused_mut)]
   67         -
        let mut output = crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationOutputBuilder::default();
   68         -
        output.build()
   69         -
    })
   70         -
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_empty_struct.rs

@@ -1,0 +21,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_empty_struct<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::EmptyStruct>, ::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::EmptyStructBuilder::default();
   14         -
            ::aws_smithy_json::deserialize::token::skip_to_end(tokens)?;
   15         -
            Ok(Some(builder.build()))
   16         -
        }
   17         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   18         -
            "expected start object or null",
   19         -
        )),
   20         -
    }
   21         -
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_empty_struct_with_content_on_wire_op.rs

@@ -1,0 +91,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_empty_struct_with_content_on_wire_op_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
    9         -
    crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "ExtraError" => crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::ExtraError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
   32         -
            if tmp.message.is_none() {
   33         -
                tmp.message = _error_message;
   34         -
            }
   35         -
            tmp
   36         -
        }),
   37         -
        _ => crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::generic(generic),
   38         -
    })
   39         -
}
   40         -
   41         -
#[allow(clippy::unnecessary_wraps)]
   42         -
pub fn de_empty_struct_with_content_on_wire_op_http_response(
   43         -
    _response_status: u16,
   44         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   45         -
    _response_body: &[u8],
   46         -
) -> std::result::Result<
   47         -
    crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
   48         -
    crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   49         -
> {
   50         -
    Ok({
   51         -
        #[allow(unused_mut)]
   52         -
        let mut output = crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpOutputBuilder::default();
   53         -
        output = crate::protocol_serde::shape_empty_struct_with_content_on_wire_op::de_empty_struct_with_content_on_wire_op(_response_body, output)
   54         -
            .map_err(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled)?;
   55         -
        output.build()
   56         -
    })
   57         -
}
   58         -
   59         -
pub(crate) fn de_empty_struct_with_content_on_wire_op(
   60         -
    _value: &[u8],
   61         -
    mut builder: crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpOutputBuilder,
   62         -
) -> ::std::result::Result<
   63         -
    crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpOutputBuilder,
   64         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   65         -
> {
   66         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   67         -
    let tokens = &mut tokens_owned;
   68         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   69         -
    loop {
   70         -
        match tokens.next().transpose()? {
   71         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   72         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   73         -
                "empty" => {
   74         -
                    builder = builder.set_empty(crate::protocol_serde::shape_empty_struct::de_empty_struct(tokens, _value)?);
   75         -
                }
   76         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   77         -
            },
   78         -
            other => {
   79         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   80         -
                    "expected object key or end object, found: {other:?}"
   81         -
                )))
   82         -
            }
   83         -
        }
   84         -
    }
   85         -
    if tokens.next().is_some() {
   86         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   87         -
            "found more JSON tokens after completing parsing",
   88         -
        ));
   89         -
    }
   90         -
    Ok(builder)
   91         -
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_enum_query.rs

@@ -1,0 +63,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_enum_query_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::enum_query::EnumQueryOutput, crate::operation::enum_query::EnumQueryError> {
    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::enum_query::EnumQueryError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::enum_query::EnumQueryError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "ValidationException" => crate::operation::enum_query::EnumQueryError::ValidationError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::enum_query::EnumQueryError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                crate::serde_util::validation_exception_correct_errors(output)
   28         -
                    .build()
   29         -
                    .map_err(crate::operation::enum_query::EnumQueryError::unhandled)?
   30         -
            };
   31         -
            tmp
   32         -
        }),
   33         -
        "ExtraError" => crate::operation::enum_query::EnumQueryError::ExtraError({
   34         -
            #[allow(unused_mut)]
   35         -
            let mut tmp = {
   36         -
                #[allow(unused_mut)]
   37         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   38         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   39         -
                    .map_err(crate::operation::enum_query::EnumQueryError::unhandled)?;
   40         -
                let output = output.meta(generic);
   41         -
                output.build()
   42         -
            };
   43         -
            if tmp.message.is_none() {
   44         -
                tmp.message = _error_message;
   45         -
            }
   46         -
            tmp
   47         -
        }),
   48         -
        _ => crate::operation::enum_query::EnumQueryError::generic(generic),
   49         -
    })
   50         -
}
   51         -
   52         -
#[allow(clippy::unnecessary_wraps)]
   53         -
pub fn de_enum_query_http_response(
   54         -
    _response_status: u16,
   55         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   56         -
    _response_body: &[u8],
   57         -
) -> std::result::Result<crate::operation::enum_query::EnumQueryOutput, crate::operation::enum_query::EnumQueryError> {
   58         -
    Ok({
   59         -
        #[allow(unused_mut)]
   60         -
        let mut output = crate::operation::enum_query::builders::EnumQueryOutputBuilder::default();
   61         -
        output.build()
   62         -
    })
   63         -
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_escaped_string_values.rs

@@ -1,0 +126,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_escaped_string_values_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::escaped_string_values::EscapedStringValuesOutput,
    9         -
    crate::operation::escaped_string_values::EscapedStringValuesError,
   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::escaped_string_values::EscapedStringValuesError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "ValidationException" => crate::operation::escaped_string_values::EscapedStringValuesError::ValidationError({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                crate::serde_util::validation_exception_correct_errors(output)
   31         -
                    .build()
   32         -
                    .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?
   33         -
            };
   34         -
            tmp
   35         -
        }),
   36         -
        "ExtraError" => crate::operation::escaped_string_values::EscapedStringValuesError::ExtraError({
   37         -
            #[allow(unused_mut)]
   38         -
            let mut tmp = {
   39         -
                #[allow(unused_mut)]
   40         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   41         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   42         -
                    .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
   43         -
                let output = output.meta(generic);
   44         -
                output.build()
   45         -
            };
   46         -
            if tmp.message.is_none() {
   47         -
                tmp.message = _error_message;
   48         -
            }
   49         -
            tmp
   50         -
        }),
   51         -
        _ => crate::operation::escaped_string_values::EscapedStringValuesError::generic(generic),
   52         -
    })
   53         -
}
   54         -
   55         -
#[allow(clippy::unnecessary_wraps)]
   56         -
pub fn de_escaped_string_values_http_response(
   57         -
    _response_status: u16,
   58         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   59         -
    _response_body: &[u8],
   60         -
) -> std::result::Result<
   61         -
    crate::operation::escaped_string_values::EscapedStringValuesOutput,
   62         -
    crate::operation::escaped_string_values::EscapedStringValuesError,
   63         -
> {
   64         -
    Ok({
   65         -
        #[allow(unused_mut)]
   66         -
        let mut output = crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder::default();
   67         -
        output = crate::protocol_serde::shape_escaped_string_values::de_escaped_string_values(_response_body, output)
   68         -
            .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
   69         -
        output.build()
   70         -
    })
   71         -
}
   72         -
   73         -
pub fn ser_escaped_string_values_input(
   74         -
    input: &crate::operation::escaped_string_values::EscapedStringValuesInput,
   75         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   76         -
    let mut out = String::new();
   77         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   78         -
    crate::protocol_serde::shape_escaped_string_values_input::ser_escaped_string_values_input_input(&mut object, input)?;
   79         -
    object.finish();
   80         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   81         -
}
   82         -
   83         -
pub(crate) fn de_escaped_string_values(
   84         -
    _value: &[u8],
   85         -
    mut builder: crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder,
   86         -
) -> ::std::result::Result<
   87         -
    crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder,
   88         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   89         -
> {
   90         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   91         -
    let tokens = &mut tokens_owned;
   92         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   93         -
    loop {
   94         -
        match tokens.next().transpose()? {
   95         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   96         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   97         -
                "enum" => {
   98         -
                    builder = builder.set_enum(
   99         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  100         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::EnumWithEscapedChars::from(u.as_ref())))
  101         -
                            .transpose()?,
  102         -
                    );
  103         -
                }
  104         -
                "also\"has\"quotes" => {
  105         -
                    builder = builder.set_some_string(
  106         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  107         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  108         -
                            .transpose()?,
  109         -
                    );
  110         -
                }
  111         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  112         -
            },
  113         -
            other => {
  114         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  115         -
                    "expected object key or end object, found: {other:?}"
  116         -
                )))
  117         -
            }
  118         -
        }
  119         -
    }
  120         -
    if tokens.next().is_some() {
  121         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  122         -
            "found more JSON tokens after completing parsing",
  123         -
        ));
  124         -
    }
  125         -
    Ok(builder)
  126         -
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_escaped_string_values_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_extra_error.rs

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

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_map_with_enum_key.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_with_enum_key<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<crate::types::StringEnum, ::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| crate::types::StringEnum::from(u.as_ref()))?;
   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/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_map_with_enum_key_op.rs

@@ -1,0 +111,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_map_with_enum_key_op_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::map_with_enum_key_op::MapWithEnumKeyOpOutput, crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError>
    8         -
{
    9         -
    #[allow(unused_mut)]
   10         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11         -
        .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "ValidationException" => crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::ValidationError({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   25         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                crate::serde_util::validation_exception_correct_errors(output)
   29         -
                    .build()
   30         -
                    .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?
   31         -
            };
   32         -
            tmp
   33         -
        }),
   34         -
        "ExtraError" => crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::ExtraError({
   35         -
            #[allow(unused_mut)]
   36         -
            let mut tmp = {
   37         -
                #[allow(unused_mut)]
   38         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   39         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   40         -
                    .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
   41         -
                let output = output.meta(generic);
   42         -
                output.build()
   43         -
            };
   44         -
            if tmp.message.is_none() {
   45         -
                tmp.message = _error_message;
   46         -
            }
   47         -
            tmp
   48         -
        }),
   49         -
        _ => crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::generic(generic),
   50         -
    })
   51         -
}
   52         -
   53         -
#[allow(clippy::unnecessary_wraps)]
   54         -
pub fn de_map_with_enum_key_op_http_response(
   55         -
    _response_status: u16,
   56         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   57         -
    _response_body: &[u8],
   58         -
) -> std::result::Result<crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput, crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError>
   59         -
{
   60         -
    Ok({
   61         -
        #[allow(unused_mut)]
   62         -
        let mut output = crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpOutputBuilder::default();
   63         -
        output = crate::protocol_serde::shape_map_with_enum_key_op::de_map_with_enum_key_op(_response_body, output)
   64         -
            .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
   65         -
        output.build()
   66         -
    })
   67         -
}
   68         -
   69         -
pub fn ser_map_with_enum_key_op_input(
   70         -
    input: &crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput,
   71         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   72         -
    let mut out = String::new();
   73         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   74         -
    crate::protocol_serde::shape_map_with_enum_key_op_input::ser_map_with_enum_key_op_input_input(&mut object, input)?;
   75         -
    object.finish();
   76         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   77         -
}
   78         -
   79         -
pub(crate) fn de_map_with_enum_key_op(
   80         -
    _value: &[u8],
   81         -
    mut builder: crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpOutputBuilder,
   82         -
) -> ::std::result::Result<
   83         -
    crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpOutputBuilder,
   84         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   85         -
> {
   86         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   87         -
    let tokens = &mut tokens_owned;
   88         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   89         -
    loop {
   90         -
        match tokens.next().transpose()? {
   91         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   92         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   93         -
                "map" => {
   94         -
                    builder = builder.set_map(crate::protocol_serde::shape_map_with_enum_key::de_map_with_enum_key(tokens, _value)?);
   95         -
                }
   96         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   97         -
            },
   98         -
            other => {
   99         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  100         -
                    "expected object key or end object, found: {other:?}"
  101         -
                )))
  102         -
            }
  103         -
        }
  104         -
    }
  105         -
    if tokens.next().is_some() {
  106         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  107         -
            "found more JSON tokens after completing parsing",
  108         -
        ));
  109         -
    }
  110         -
    Ok(builder)
  111         -
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_map_with_enum_key_op_input.rs

@@ -1,0 +17,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_map_with_enum_key_op_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.map {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_2 = object.key("map").start_object();
    9         -
        for (key_3, value_4) in var_1 {
   10         -
            {
   11         -
                object_2.key(key_3.as_str()).string(value_4.as_str());
   12         -
            }
   13         -
        }
   14         -
        object_2.finish();
   15         -
    }
   16         -
    Ok(())
   17         -
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_non_sparse_list.rs

@@ -1,0 +39,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_non_sparse_list<'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/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_non_sparse_map.rs

@@ -1,0 +48,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_non_sparse_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::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         -
}