Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/structure_name_punning/_structure_name_punning_input.rs

@@ -45,45 +133,144 @@
   65     65   
            ser.write_string(&STRUCTURENAMEPUNNINGINPUT_MEMBER_REGULAR_STRING, val)?;
   66     66   
        }
   67     67   
        if let Some(ref val) = self.punned_vec {
   68     68   
            ser.write_struct(&STRUCTURENAMEPUNNINGINPUT_MEMBER_PUNNED_VEC, val)?;
   69     69   
        }
   70     70   
        Ok(())
   71     71   
    }
   72     72   
}
   73     73   
impl StructureNamePunningInput {
   74     74   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   75         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   76         -
        deserializer: &mut D,
          75  +
    pub fn deserialize(
          76  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   77     77   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   78     78   
        #[allow(unused_variables, unused_mut)]
   79     79   
        let mut builder = Self::builder();
   80     80   
        #[allow(
   81     81   
            unused_variables,
   82     82   
            unreachable_code,
   83     83   
            clippy::single_match,
   84     84   
            clippy::match_single_binding,
   85     85   
            clippy::diverging_sub_expression
   86     86   
        )]
   87         -
        deserializer.read_struct(&STRUCTURENAMEPUNNINGINPUT_SCHEMA, (), |_, member, deser| {
          87  +
        deserializer.read_struct(&STRUCTURENAMEPUNNINGINPUT_SCHEMA, &mut |member, deser| {
   88     88   
            match member.member_index() {
   89     89   
                Some(0) => {
   90     90   
                    builder.regular_string = Some(deser.read_string(member)?);
   91     91   
                }
   92     92   
                Some(1) => {
   93     93   
                    builder.punned_vec = Some(crate::types::Vec::deserialize(deser)?);
   94     94   
                }
   95     95   
                _ => {}
   96     96   
            }
   97     97   
            Ok(())
   98     98   
        })?;
   99     99   
        builder
  100    100   
            .build()
  101    101   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  102    102   
    }
  103    103   
}
         104  +
impl StructureNamePunningInput {
         105  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         106  +
    pub fn deserialize_with_response(
         107  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         108  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         109  +
        _status: u16,
         110  +
        _body: &[u8],
         111  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         112  +
        Self::deserialize(deserializer)
         113  +
    }
         114  +
}
  104    115   
impl StructureNamePunningInput {
  105    116   
    /// Creates a new builder-style object to manufacture [`StructureNamePunningInput`](crate::operation::structure_name_punning::StructureNamePunningInput).
  106    117   
    pub fn builder() -> crate::operation::structure_name_punning::builders::StructureNamePunningInputBuilder {
  107    118   
        crate::operation::structure_name_punning::builders::StructureNamePunningInputBuilder::default()
  108    119   
    }
  109    120   
}
  110    121   
  111    122   
/// A builder for [`StructureNamePunningInput`](crate::operation::structure_name_punning::StructureNamePunningInput).
  112    123   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  113    124   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/operation/structure_name_punning/_structure_name_punning_output.rs

@@ -1,1 +65,76 @@
   18     18   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     19   
    fn serialize_members(
   20     20   
        &self,
   21     21   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     22   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     23   
        Ok(())
   24     24   
    }
   25     25   
}
   26     26   
impl StructureNamePunningOutput {
   27     27   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          28  +
    pub fn deserialize(
          29  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     30   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     31   
        #[allow(unused_variables, unused_mut)]
   32     32   
        let mut builder = Self::builder();
   33     33   
        #[allow(
   34     34   
            unused_variables,
   35     35   
            unreachable_code,
   36     36   
            clippy::single_match,
   37     37   
            clippy::match_single_binding,
   38     38   
            clippy::diverging_sub_expression
   39     39   
        )]
   40         -
        deserializer.read_struct(&STRUCTURENAMEPUNNINGOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&STRUCTURENAMEPUNNINGOUTPUT_SCHEMA, &mut |member, deser| {
   41     41   
            match member.member_index() {
   42     42   
                _ => {}
   43     43   
            }
   44     44   
            Ok(())
   45     45   
        })?;
   46     46   
        Ok(builder.build())
   47     47   
    }
   48     48   
}
          49  +
impl StructureNamePunningOutput {
          50  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          51  +
    pub fn deserialize_with_response(
          52  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          53  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          54  +
        _status: u16,
          55  +
        _body: &[u8],
          56  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          57  +
        Ok(Self::builder().build())
          58  +
    }
          59  +
}
   49     60   
impl StructureNamePunningOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::operation::structure_name_punning::StructureNamePunningOutput).
   51     62   
    pub fn builder() -> crate::operation::structure_name_punning::builders::StructureNamePunningOutputBuilder {
   52     63   
        crate::operation::structure_name_punning::builders::StructureNamePunningOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`StructureNamePunningOutput`](crate::operation::structure_name_punning::StructureNamePunningOutput).
   57     68   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   58     69   
#[non_exhaustive]

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

@@ -1,1 +70,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_err_collisions;
   27         -
   28         -
pub(crate) mod shape_match;
   29         -
   30         -
pub(crate) mod shape_option;
   31         -
   32         -
pub(crate) mod shape_reserved_words_as_members;
   33         -
   34         -
pub(crate) mod shape_result;
   35         -
   36         -
pub(crate) mod shape_rpc_echo;
   37         -
   38         -
pub(crate) mod shape_structure_name_punning;
   39         -
   40         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   41         -
    if data.is_empty() {
   42         -
        b"{}"
   43         -
    } else {
   44         -
        data
   45         -
    }
   46         -
}
   47         -
   48         -
pub(crate) mod shape_colliding_error;
   49         -
   50         -
pub(crate) mod shape_colliding_exception;
   51         -
   52         -
pub(crate) mod shape_match_input;
   53         -
   54         -
pub(crate) mod shape_option_input;
   55         -
   56         -
pub(crate) mod shape_reserved_words_as_members_input;
   57         -
   58         -
pub(crate) mod shape_result_input;
   59         -
   60         -
pub(crate) mod shape_rpc_echo_input;
   61         -
   62         -
pub(crate) mod shape_structure_name_punning_input;
   63         -
   64         -
pub(crate) mod shape_validation_exception;
   65         -
   66         -
pub(crate) mod shape_validation_exception_field_list;
   67         -
   68         -
pub(crate) mod shape_vec;
   69         -
   70         -
pub(crate) mod shape_validation_exception_field;

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/protocol_serde/shape_colliding_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_colliding_error_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::CollidingErrorBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::CollidingErrorBuilder, ::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/naming_test_ops/rust-client-codegen/src/protocol_serde/shape_colliding_exception.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_colliding_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::CollidingExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::CollidingExceptionBuilder, ::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/naming_test_ops/rust-client-codegen/src/protocol_serde/shape_err_collisions.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_err_collisions_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::err_collisions::ErrCollisionsOutput, crate::operation::err_collisions::ErrCollisionsError> {
    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::err_collisions::ErrCollisionsError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::err_collisions::ErrCollisionsError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "CollidingError" => crate::operation::err_collisions::ErrCollisionsError::CollidingError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::CollidingErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_colliding_error::de_colliding_error_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::err_collisions::ErrCollisionsError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                output.build()
   28         -
            };
   29         -
            if tmp.message.is_none() {
   30         -
                tmp.message = _error_message;
   31         -
            }
   32         -
            tmp
   33         -
        }),
   34         -
        "CollidingException" => crate::operation::err_collisions::ErrCollisionsError::CollidingException({
   35         -
            #[allow(unused_mut)]
   36         -
            let mut tmp = {
   37         -
                #[allow(unused_mut)]
   38         -
                let mut output = crate::types::error::builders::CollidingExceptionBuilder::default();
   39         -
                output = crate::protocol_serde::shape_colliding_exception::de_colliding_exception_json_err(_response_body, output)
   40         -
                    .map_err(crate::operation::err_collisions::ErrCollisionsError::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::err_collisions::ErrCollisionsError::generic(generic),
   50         -
    })
   51         -
}
   52         -
   53         -
#[allow(clippy::unnecessary_wraps)]
   54         -
pub fn de_err_collisions_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::err_collisions::ErrCollisionsOutput, crate::operation::err_collisions::ErrCollisionsError> {
   59         -
    Ok({
   60         -
        #[allow(unused_mut)]
   61         -
        let mut output = crate::operation::err_collisions::builders::ErrCollisionsOutputBuilder::default();
   62         -
        output.build()
   63         -
    })
   64         -
}
   65         -
   66         -
pub fn ser_err_collisions_input(
   67         -
    _input: &crate::operation::err_collisions::ErrCollisionsInput,
   68         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   69         -
    Ok(::aws_smithy_types::body::SdkBody::from("{}"))
   70         -
}

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

@@ -1,0 +58,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_match_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::match_::MatchOutput, crate::operation::match_::MatchError> {
    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::match_::MatchError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::match_::MatchError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "ValidationException" => crate::operation::match_::MatchError::ValidationException({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
   24         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::match_::MatchError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                crate::serde_util::validation_exception_correct_errors(output)
   28         -
                    .build()
   29         -
                    .map_err(crate::operation::match_::MatchError::unhandled)?
   30         -
            };
   31         -
            tmp
   32         -
        }),
   33         -
        _ => crate::operation::match_::MatchError::generic(generic),
   34         -
    })
   35         -
}
   36         -
   37         -
#[allow(clippy::unnecessary_wraps)]
   38         -
pub fn de_match_http_response(
   39         -
    _response_status: u16,
   40         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   41         -
    _response_body: &[u8],
   42         -
) -> std::result::Result<crate::operation::match_::MatchOutput, crate::operation::match_::MatchError> {
   43         -
    Ok({
   44         -
        #[allow(unused_mut)]
   45         -
        let mut output = crate::operation::match_::builders::MatchOutputBuilder::default();
   46         -
        output.build()
   47         -
    })
   48         -
}
   49         -
   50         -
pub fn ser_match_input(
   51         -
    input: &crate::operation::match_::MatchInput,
   52         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   53         -
    let mut out = String::new();
   54         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   55         -
    crate::protocol_serde::shape_match_input::ser_match_input_input(&mut object, input)?;
   56         -
    object.finish();
   57         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   58         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_match_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::match_::MatchInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.r#as {
    7         -
        object.key("as").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    if let Some(var_2) = &input.r#async {
   13         -
        object.key("async").boolean(*var_2);
   14         -
    }
   15         -
    if let Some(var_3) = &input.r#enum {
   16         -
        object.key("enum").string(var_3.as_str());
   17         -
    }
   18         -
    if let Some(var_4) = &input.self_ {
   19         -
        object.key("self").boolean(*var_4);
   20         -
    }
   21         -
    if let Some(var_5) = &input.crate_ {
   22         -
        object.key("crate").boolean(*var_5);
   23         -
    }
   24         -
    if let Some(var_6) = &input.super_ {
   25         -
        object.key("super").boolean(*var_6);
   26         -
    }
   27         -
    if let Some(var_7) = &input.build_value {
   28         -
        object.key("build").string(var_7.as_str());
   29         -
    }
   30         -
    if let Some(var_8) = &input.default_value {
   31         -
        object.key("default").string(var_8.as_str());
   32         -
    }
   33         -
    if let Some(var_9) = &input.send_value {
   34         -
        object.key("send").string(var_9.as_str());
   35         -
    }
   36         -
    Ok(())
   37         -
}

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

@@ -1,0 +36,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_option_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::option::OptionOutput, crate::operation::option::OptionError> {
    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::option::OptionError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::option::OptionError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_option_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::option::OptionOutput, crate::operation::option::OptionError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::option::builders::OptionOutputBuilder::default();
   24         -
        output.build()
   25         -
    })
   26         -
}
   27         -
   28         -
pub fn ser_option_input(
   29         -
    input: &crate::operation::option::OptionInput,
   30         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   31         -
    let mut out = String::new();
   32         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   33         -
    crate::protocol_serde::shape_option_input::ser_option_input_input(&mut object, input)?;
   34         -
    object.finish();
   35         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   36         -
}

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

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

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

@@ -1,0 +68,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_reserved_words_as_members_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::reserved_words_as_members::ReservedWordsAsMembersOutput,
    9         -
    crate::operation::reserved_words_as_members::ReservedWordsAsMembersError,
   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::reserved_words_as_members::ReservedWordsAsMembersError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => {
   18         -
            return Err(crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::unhandled(
   19         -
                generic,
   20         -
            ))
   21         -
        }
   22         -
    };
   23         -
   24         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   25         -
    Err(match error_code {
   26         -
        "ValidationException" => crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::ValidationException({
   27         -
            #[allow(unused_mut)]
   28         -
            let mut tmp = {
   29         -
                #[allow(unused_mut)]
   30         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
   31         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   32         -
                    .map_err(crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::unhandled)?;
   33         -
                let output = output.meta(generic);
   34         -
                crate::serde_util::validation_exception_correct_errors(output)
   35         -
                    .build()
   36         -
                    .map_err(crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::unhandled)?
   37         -
            };
   38         -
            tmp
   39         -
        }),
   40         -
        _ => crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::generic(generic),
   41         -
    })
   42         -
}
   43         -
   44         -
#[allow(clippy::unnecessary_wraps)]
   45         -
pub fn de_reserved_words_as_members_http_response(
   46         -
    _response_status: u16,
   47         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   48         -
    _response_body: &[u8],
   49         -
) -> std::result::Result<
   50         -
    crate::operation::reserved_words_as_members::ReservedWordsAsMembersOutput,
   51         -
    crate::operation::reserved_words_as_members::ReservedWordsAsMembersError,
   52         -
> {
   53         -
    Ok({
   54         -
        #[allow(unused_mut)]
   55         -
        let mut output = crate::operation::reserved_words_as_members::builders::ReservedWordsAsMembersOutputBuilder::default();
   56         -
        output.build()
   57         -
    })
   58         -
}
   59         -
   60         -
pub fn ser_reserved_words_as_members_input(
   61         -
    input: &crate::operation::reserved_words_as_members::ReservedWordsAsMembersInput,
   62         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   63         -
    let mut out = String::new();
   64         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   65         -
    crate::protocol_serde::shape_reserved_words_as_members_input::ser_reserved_words_as_members_input_input(&mut object, input)?;
   66         -
    object.finish();
   67         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   68         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_reserved_words_as_members_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::reserved_words_as_members::ReservedWordsAsMembersInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.r#as {
    7         -
        object.key("as").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    if let Some(var_2) = &input.r#async {
   13         -
        object.key("async").boolean(*var_2);
   14         -
    }
   15         -
    if let Some(var_3) = &input.r#enum {
   16         -
        object.key("enum").string(var_3.as_str());
   17         -
    }
   18         -
    if let Some(var_4) = &input.self_ {
   19         -
        object.key("self").boolean(*var_4);
   20         -
    }
   21         -
    if let Some(var_5) = &input.crate_ {
   22         -
        object.key("crate").boolean(*var_5);
   23         -
    }
   24         -
    if let Some(var_6) = &input.super_ {
   25         -
        object.key("super").boolean(*var_6);
   26         -
    }
   27         -
    if let Some(var_7) = &input.build_value {
   28         -
        object.key("build").string(var_7.as_str());
   29         -
    }
   30         -
    if let Some(var_8) = &input.default_value {
   31         -
        object.key("default").string(var_8.as_str());
   32         -
    }
   33         -
    if let Some(var_9) = &input.send_value {
   34         -
        object.key("send").string(var_9.as_str());
   35         -
    }
   36         -
    Ok(())
   37         -
}

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

@@ -1,0 +68,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_result_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::result::ResultOutput, crate::operation::result::ResultError> {
    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::result::ResultError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::result::ResultError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_result_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::result::ResultOutput, crate::operation::result::ResultError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::result::builders::ResultOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_result::de_result(_response_body, output).map_err(crate::operation::result::ResultError::unhandled)?;
   25         -
        output.build()
   26         -
    })
   27         -
}
   28         -
   29         -
pub fn ser_result_input(
   30         -
    input: &crate::operation::result::ResultInput,
   31         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   32         -
    let mut out = String::new();
   33         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   34         -
    crate::protocol_serde::shape_result_input::ser_result_input_input(&mut object, input)?;
   35         -
    object.finish();
   36         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   37         -
}
   38         -
   39         -
pub(crate) fn de_result(
   40         -
    _value: &[u8],
   41         -
    mut builder: crate::operation::result::builders::ResultOutputBuilder,
   42         -
) -> ::std::result::Result<crate::operation::result::builders::ResultOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   43         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   44         -
    let tokens = &mut tokens_owned;
   45         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   46         -
    loop {
   47         -
        match tokens.next().transpose()? {
   48         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   49         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   50         -
                "pv_member" => {
   51         -
                    builder = builder.set_pv_member(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   52         -
                }
   53         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   54         -
            },
   55         -
            other => {
   56         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   57         -
                    "expected object key or end object, found: {other:?}"
   58         -
                )))
   59         -
            }
   60         -
        }
   61         -
    }
   62         -
    if tokens.next().is_some() {
   63         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   64         -
            "found more JSON tokens after completing parsing",
   65         -
        ));
   66         -
    }
   67         -
    Ok(builder)
   68         -
}

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

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

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

@@ -1,0 +58,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_rpc_echo_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::rpc_echo::RpcEchoOutput, crate::operation::rpc_echo::RPCEchoError> {
    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::rpc_echo::RPCEchoError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::rpc_echo::RPCEchoError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "ValidationException" => crate::operation::rpc_echo::RPCEchoError::ValidationException({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
   24         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::rpc_echo::RPCEchoError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                crate::serde_util::validation_exception_correct_errors(output)
   28         -
                    .build()
   29         -
                    .map_err(crate::operation::rpc_echo::RPCEchoError::unhandled)?
   30         -
            };
   31         -
            tmp
   32         -
        }),
   33         -
        _ => crate::operation::rpc_echo::RPCEchoError::generic(generic),
   34         -
    })
   35         -
}
   36         -
   37         -
#[allow(clippy::unnecessary_wraps)]
   38         -
pub fn de_rpc_echo_http_response(
   39         -
    _response_status: u16,
   40         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   41         -
    _response_body: &[u8],
   42         -
) -> std::result::Result<crate::operation::rpc_echo::RpcEchoOutput, crate::operation::rpc_echo::RPCEchoError> {
   43         -
    Ok({
   44         -
        #[allow(unused_mut)]
   45         -
        let mut output = crate::operation::rpc_echo::builders::RpcEchoOutputBuilder::default();
   46         -
        output.build()
   47         -
    })
   48         -
}
   49         -
   50         -
pub fn ser_rpc_echo_input(
   51         -
    input: &crate::operation::rpc_echo::RpcEchoInput,
   52         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   53         -
    let mut out = String::new();
   54         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   55         -
    crate::protocol_serde::shape_rpc_echo_input::ser_rpc_echo_input_input(&mut object, input)?;
   56         -
    object.finish();
   57         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   58         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_rpc_echo_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::rpc_echo::RpcEchoInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.r#as {
    7         -
        object.key("as").number(
    8         -
            #[allow(clippy::useless_conversion)]
    9         -
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10         -
        );
   11         -
    }
   12         -
    if let Some(var_2) = &input.r#async {
   13         -
        object.key("async").boolean(*var_2);
   14         -
    }
   15         -
    if let Some(var_3) = &input.r#enum {
   16         -
        object.key("enum").string(var_3.as_str());
   17         -
    }
   18         -
    if let Some(var_4) = &input.self_ {
   19         -
        object.key("self").boolean(*var_4);
   20         -
    }
   21         -
    if let Some(var_5) = &input.crate_ {
   22         -
        object.key("crate").boolean(*var_5);
   23         -
    }
   24         -
    if let Some(var_6) = &input.super_ {
   25         -
        object.key("super").boolean(*var_6);
   26         -
    }
   27         -
    if let Some(var_7) = &input.build_value {
   28         -
        object.key("build").string(var_7.as_str());
   29         -
    }
   30         -
    if let Some(var_8) = &input.default_value {
   31         -
        object.key("default").string(var_8.as_str());
   32         -
    }
   33         -
    if let Some(var_9) = &input.send_value {
   34         -
        object.key("send").string(var_9.as_str());
   35         -
    }
   36         -
    Ok(())
   37         -
}