Client Test

Client Test

rev. 163d4d6410694aaf071424777ecbecd050925f36

Files changed:

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/do_nothing/_do_nothing_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 DoNothingOutput {
   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(&DONOTHINGOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&DONOTHINGOUTPUT_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 DoNothingOutput {
          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 DoNothingOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
   51     62   
    pub fn builder() -> crate::operation::do_nothing::builders::DoNothingOutputBuilder {
   52     63   
        crate::operation::do_nothing::builders::DoNothingOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`DoNothingOutput`](crate::operation::do_nothing::DoNothingOutput).
   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/pokemon-service-client/rust-client-codegen/src/operation/get_pokemon_species.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `GetPokemonSpecies`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GetPokemonSpecies;
    6      6   
impl GetPokemonSpecies {
    7      7   
    /// Creates a new `GetPokemonSpecies`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_pokemon_species::GetPokemonSpeciesInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_pokemon_species::GetPokemonSpeciesOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::get_pokemon_species::GetPokemonSpeciesInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::get_pokemon_species::GetPokemonSpeciesOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::get_pokemon_species::GetPokemonSpeciesError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +233,320 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct GetPokemonSpeciesResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetPokemonSpeciesResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139         -
        let headers = response.headers();
  140         -
        let body = response.body().bytes().expect("body loaded");
  141    144   
        #[allow(unused_mut)]
  142    145   
        let mut force_error = false;
  143    146   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_get_pokemon_species::de_get_pokemon_species_http_error(status, headers, body)
         147  +
        if !success && status != 200 || force_error {
         148  +
            let headers = response.headers();
         149  +
            let body = response.body().bytes().expect("body loaded");
         150  +
            #[allow(unused_mut)]
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
         154  +
         155  +
            let generic = generic_builder.build();
         156  +
            let error_code = match generic.code() {
         157  +
                ::std::option::Option::Some(code) => code,
         158  +
                ::std::option::Option::None => {
         159  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         160  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         161  +
                            crate::operation::get_pokemon_species::GetPokemonSpeciesError::unhandled(generic),
         162  +
                        ),
         163  +
                    ))
         164  +
                }
         165  +
            };
         166  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         167  +
            let protocol = _cfg
         168  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         169  +
                .expect("a SharedClientProtocol is required");
         170  +
            let err = match error_code {
         171  +
                "ResourceNotFoundException" => crate::operation::get_pokemon_species::GetPokemonSpeciesError::ResourceNotFoundError({
         172  +
                    let mut tmp = match protocol
         173  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         174  +
                        .and_then(|mut deser| {
         175  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         176  +
                                &mut *deser,
         177  +
                                response.headers(),
         178  +
                                response.status().into(),
         179  +
                                body,
         180  +
                            )
         181  +
                        }) {
         182  +
                        ::std::result::Result::Ok(val) => val,
         183  +
                        ::std::result::Result::Err(e) => {
         184  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         185  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         186  +
                            ))
         187  +
                        }
         188  +
                    };
         189  +
                    tmp.meta = generic;
         190  +
                    tmp
         191  +
                }),
         192  +
                "ValidationException" => crate::operation::get_pokemon_species::GetPokemonSpeciesError::ValidationError({
         193  +
                    let mut tmp = match protocol
         194  +
                        .deserialize_response(response, crate::types::error::ValidationError::SCHEMA, _cfg)
         195  +
                        .and_then(|mut deser| {
         196  +
                            crate::types::error::ValidationError::deserialize_with_response(
         197  +
                                &mut *deser,
         198  +
                                response.headers(),
         199  +
                                response.status().into(),
         200  +
                                body,
         201  +
                            )
         202  +
                        }) {
         203  +
                        ::std::result::Result::Ok(val) => val,
         204  +
                        ::std::result::Result::Err(e) => {
         205  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         206  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         207  +
                            ))
         208  +
                        }
         209  +
                    };
         210  +
                    tmp.meta = generic;
         211  +
                    tmp
         212  +
                }),
         213  +
                _ => crate::operation::get_pokemon_species::GetPokemonSpeciesError::generic(generic),
         214  +
            };
         215  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         216  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         217  +
            ))
  146    218   
        } else {
  147         -
            crate::protocol_serde::shape_get_pokemon_species::de_get_pokemon_species_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         219  +
            let protocol = _cfg
         220  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         221  +
                .expect("a SharedClientProtocol is required");
         222  +
            let mut deser = protocol
         223  +
                .deserialize_response(response, GetPokemonSpecies::OUTPUT_SCHEMA, _cfg)
         224  +
                .map_err(|e| {
         225  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         226  +
                })?;
         227  +
            let body = response.body().bytes().expect("body loaded");
         228  +
            let output = crate::operation::get_pokemon_species::GetPokemonSpeciesOutput::deserialize_with_response(
         229  +
                &mut *deser,
         230  +
                response.headers(),
         231  +
                response.status().into(),
         232  +
                body,
         233  +
            )
         234  +
            .map_err(|e| {
         235  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         236  +
            })?;
         237  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         238  +
        }
  150    239   
    }
  151    240   
}
  152    241   
#[derive(Debug)]
  153    242   
struct GetPokemonSpeciesRequestSerializer;
  154    243   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetPokemonSpeciesRequestSerializer {
  155    244   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    245   
    fn serialize_input(
  157    246   
        &self,
  158    247   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    248   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    249   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    250   
        let input = input
  162    251   
            .downcast::<crate::operation::get_pokemon_species::GetPokemonSpeciesInput>()
  163    252   
            .expect("correct type");
  164         -
        let _header_serialization_settings = _cfg
  165         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  166         -
            .cloned()
  167         -
            .unwrap_or_default();
  168         -
        let mut request_builder = {
  169         -
            #[allow(clippy::uninlined_format_args)]
  170         -
            fn uri_base(
  171         -
                _input: &crate::operation::get_pokemon_species::GetPokemonSpeciesInput,
  172         -
                output: &mut ::std::string::String,
  173         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174         -
                use ::std::fmt::Write as _;
  175         -
                let input_1 = &_input.name;
  176         -
                let input_1 = input_1
  177         -
                    .as_ref()
  178         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?;
  179         -
                let name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  180         -
                if name.is_empty() {
  181         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  182         -
                        "name",
  183         -
                        "cannot be empty or unset",
  184         -
                    ));
         253  +
        let protocol = _cfg
         254  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         255  +
            .expect("a SharedClientProtocol is required");
         256  +
        if protocol.supports_http_bindings() {
         257  +
            let mut request = protocol
         258  +
                .serialize_body(&input, GetPokemonSpecies::INPUT_SCHEMA, "", _cfg)
         259  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         260  +
            {
         261  +
                let mut uri = "/pokemon-species/{name}".to_string();
         262  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         263  +
                if let Some(ref val) = input.name {
         264  +
                    uri = uri.replace("{name}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  185    265   
                }
  186         -
                ::std::write!(output, "/pokemon-species/{name}", name = name).expect("formatting should succeed");
  187         -
                ::std::result::Result::Ok(())
  188         -
            }
  189         -
            #[allow(clippy::unnecessary_wraps)]
  190         -
            fn update_http_builder(
  191         -
                input: &crate::operation::get_pokemon_species::GetPokemonSpeciesInput,
  192         -
                builder: ::http_1x::request::Builder,
  193         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  194         -
                let mut uri = ::std::string::String::new();
  195         -
                uri_base(input, &mut uri)?;
  196         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         266  +
                if !query_params.is_empty() {
         267  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         268  +
                    let pairs: Vec<String> = query_params
         269  +
                        .iter()
         270  +
                        .map(|(k, v)| {
         271  +
                            format!(
         272  +
                                "{}={}",
         273  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         274  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         275  +
                            )
         276  +
                        })
         277  +
                        .collect();
         278  +
                    uri.push_str(&pairs.join("&"));
         279  +
                }
         280  +
                request.set_uri(uri.as_str()).expect("valid URI");
  197    281   
            }
  198         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  199         -
            builder
  200         -
        };
  201         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  202    282   
  203         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         283  +
            return ::std::result::Result::Ok(request);
         284  +
        } else {
         285  +
            let mut request = protocol
         286  +
                .serialize_request(&input, GetPokemonSpecies::INPUT_SCHEMA, "", _cfg)
         287  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         288  +
         289  +
            return ::std::result::Result::Ok(request);
         290  +
        }
  204    291   
    }
  205    292   
}
  206    293   
#[derive(Debug)]
  207    294   
struct GetPokemonSpeciesEndpointParamsInterceptor;
  208    295   
  209    296   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetPokemonSpeciesEndpointParamsInterceptor {
  210    297   
    fn name(&self) -> &'static str {
  211    298   
        "GetPokemonSpeciesEndpointParamsInterceptor"
  212    299   
    }
  213    300   

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_pokemon_species/_get_pokemon_species_input.rs

@@ -5,5 +109,122 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27     27   
    "name",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_label();
   31     31   
static GETPOKEMONSPECIESINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    GETPOKEMONSPECIESINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&GETPOKEMONSPECIESINPUT_MEMBER_NAME],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/pokemon-species/{name}", None));
   36     37   
impl GetPokemonSpeciesInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GETPOKEMONSPECIESINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for GetPokemonSpeciesInput {
   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.name {
   47     48   
            ser.write_string(&GETPOKEMONSPECIESINPUT_MEMBER_NAME, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl GetPokemonSpeciesInput {
   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(&GETPOKEMONSPECIESINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&GETPOKEMONSPECIESINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69     70   
                    builder.name = Some(deser.read_string(member)?);
   70     71   
                }
   71     72   
                _ => {}
   72     73   
            }
   73     74   
            Ok(())
   74     75   
        })?;
          76  +
        builder.name = builder.name.or(Some(String::new()));
   75     77   
        builder
   76     78   
            .build()
   77     79   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   78     80   
    }
   79     81   
}
          82  +
impl GetPokemonSpeciesInput {
          83  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          84  +
    pub fn deserialize_with_response(
          85  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          86  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          87  +
        _status: u16,
          88  +
        _body: &[u8],
          89  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          90  +
        Self::deserialize(deserializer)
          91  +
    }
          92  +
}
   80     93   
impl GetPokemonSpeciesInput {
   81     94   
    /// Creates a new builder-style object to manufacture [`GetPokemonSpeciesInput`](crate::operation::get_pokemon_species::GetPokemonSpeciesInput).
   82     95   
    pub fn builder() -> crate::operation::get_pokemon_species::builders::GetPokemonSpeciesInputBuilder {
   83     96   
        crate::operation::get_pokemon_species::builders::GetPokemonSpeciesInputBuilder::default()
   84     97   
    }
   85     98   
}
   86     99   
   87    100   
/// A builder for [`GetPokemonSpeciesInput`](crate::operation::get_pokemon_species::GetPokemonSpeciesInput).
   88    101   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89    102   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_pokemon_species/_get_pokemon_species_output.rs

@@ -15,15 +153,163 @@
   35     35   
    "name",
   36     36   
    0,
   37     37   
);
   38     38   
static GETPOKEMONSPECIESOUTPUT_MEMBER_FLAVOR_TEXT_ENTRIES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   39     39   
    ::aws_smithy_schema::ShapeId::from_static(
   40     40   
        "com.aws.example.synthetic#GetPokemonSpeciesOutput$flavorTextEntries",
   41     41   
        "com.aws.example.synthetic",
   42     42   
        "GetPokemonSpeciesOutput",
   43     43   
    ),
   44     44   
    ::aws_smithy_schema::ShapeType::List,
   45         -
    "flavor_text_entries",
          45  +
    "flavorTextEntries",
   46     46   
    1,
   47     47   
);
   48     48   
static GETPOKEMONSPECIESOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    GETPOKEMONSPECIESOUTPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[&GETPOKEMONSPECIESOUTPUT_MEMBER_NAME, &GETPOKEMONSPECIESOUTPUT_MEMBER_FLAVOR_TEXT_ENTRIES],
   52     52   
);
   53     53   
impl GetPokemonSpeciesOutput {
   54     54   
    /// The schema for this shape.
   55     55   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GETPOKEMONSPECIESOUTPUT_SCHEMA;
   56     56   
}
   57     57   
impl ::aws_smithy_schema::serde::SerializableStruct for GetPokemonSpeciesOutput {
   58     58   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   59     59   
    fn serialize_members(
   60     60   
        &self,
   61     61   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   62     62   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   63     63   
        {
   64     64   
            let val = &self.name;
   65     65   
            ser.write_string(&GETPOKEMONSPECIESOUTPUT_MEMBER_NAME, val)?;
   66     66   
        }
   67     67   
        {
   68     68   
            let val = &self.flavor_text_entries;
   69     69   
   70     70   
            ser.write_list(
   71     71   
                &GETPOKEMONSPECIESOUTPUT_MEMBER_FLAVOR_TEXT_ENTRIES,
   72     72   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   73     73   
                    for item in val {
   74     74   
                        ser.write_struct(crate::types::FlavorText::SCHEMA, item)?;
   75     75   
                    }
   76     76   
                    Ok(())
   77     77   
                },
   78     78   
            )?;
   79     79   
        }
   80     80   
        Ok(())
   81     81   
    }
   82     82   
}
   83     83   
impl GetPokemonSpeciesOutput {
   84     84   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   85         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   86         -
        deserializer: &mut D,
          85  +
    pub fn deserialize(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   87     87   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   88     88   
        #[allow(unused_variables, unused_mut)]
   89     89   
        let mut builder = Self::builder();
   90     90   
        #[allow(
   91     91   
            unused_variables,
   92     92   
            unreachable_code,
   93     93   
            clippy::single_match,
   94     94   
            clippy::match_single_binding,
   95     95   
            clippy::diverging_sub_expression
   96     96   
        )]
   97         -
        deserializer.read_struct(&GETPOKEMONSPECIESOUTPUT_SCHEMA, (), |_, member, deser| {
          97  +
        deserializer.read_struct(&GETPOKEMONSPECIESOUTPUT_SCHEMA, &mut |member, deser| {
   98     98   
            match member.member_index() {
   99     99   
                Some(0) => {
  100    100   
                    builder.name = Some(deser.read_string(member)?);
  101    101   
                }
  102    102   
                Some(1) => {
  103    103   
                    builder.flavor_text_entries = Some({
  104         -
                        let container = if let Some(cap) = deser.container_size() {
  105         -
                            Vec::with_capacity(cap)
  106         -
                        } else {
  107         -
                            Vec::new()
  108         -
                        };
  109         -
                        deser.read_list(member, container, |mut list, deser| {
  110         -
                            list.push(crate::types::FlavorText::deserialize(deser)?);
  111         -
                            Ok(list)
  112         -
                        })?
         104  +
                        let mut container = Vec::new();
         105  +
                        deser.read_list(member, &mut |deser| {
         106  +
                            container.push(crate::types::FlavorText::deserialize(deser)?);
         107  +
                            Ok(())
         108  +
                        })?;
         109  +
                        container
  113    110   
                    });
  114    111   
                }
  115    112   
                _ => {}
  116    113   
            }
  117    114   
            Ok(())
  118    115   
        })?;
         116  +
        builder.name = builder.name.or(Some(String::new()));
         117  +
        builder.flavor_text_entries = builder.flavor_text_entries.or(Some(Vec::new()));
  119    118   
        builder
  120    119   
            .build()
  121    120   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  122    121   
    }
  123    122   
}
         123  +
impl GetPokemonSpeciesOutput {
         124  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         125  +
    pub fn deserialize_with_response(
         126  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         127  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         128  +
        _status: u16,
         129  +
        _body: &[u8],
         130  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         131  +
        Self::deserialize(deserializer)
         132  +
    }
         133  +
}
  124    134   
impl GetPokemonSpeciesOutput {
  125    135   
    /// Creates a new builder-style object to manufacture [`GetPokemonSpeciesOutput`](crate::operation::get_pokemon_species::GetPokemonSpeciesOutput).
  126    136   
    pub fn builder() -> crate::operation::get_pokemon_species::builders::GetPokemonSpeciesOutputBuilder {
  127    137   
        crate::operation::get_pokemon_species::builders::GetPokemonSpeciesOutputBuilder::default()
  128    138   
    }
  129    139   
}
  130    140   
  131    141   
/// A builder for [`GetPokemonSpeciesOutput`](crate::operation::get_pokemon_species::GetPokemonSpeciesOutput).
  132    142   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  133    143   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_server_statistics.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `GetServerStatistics`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GetServerStatistics;
    6      6   
impl GetServerStatistics {
    7      7   
    /// Creates a new `GetServerStatistics`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_server_statistics::GetServerStatisticsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_server_statistics::GetServerStatisticsOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::get_server_statistics::GetServerStatisticsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::get_server_statistics::GetServerStatisticsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::get_server_statistics::GetServerStatisticsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -113,117 +228,239 @@
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct GetServerStatisticsResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetServerStatisticsResponseDeserializer {
  140    144   
    fn deserialize_nonstreaming(
  141    145   
        &self,
  142    146   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         147  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  145         -
        let headers = response.headers();
  146         -
        let body = response.body().bytes().expect("body loaded");
  147    150   
        #[allow(unused_mut)]
  148    151   
        let mut force_error = false;
  149    152   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_error(status, headers, body)
         153  +
        if !success && status != 200 || force_error {
         154  +
            let headers = response.headers();
         155  +
            let body = response.body().bytes().expect("body loaded");
         156  +
            #[allow(unused_mut)]
         157  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         158  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         159  +
            })?;
         160  +
         161  +
            let generic = generic_builder.build();
         162  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         163  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         164  +
                    crate::operation::get_server_statistics::GetServerStatisticsError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         168  +
            let protocol = _cfg
         169  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         170  +
                .expect("a SharedClientProtocol is required");
         171  +
            let mut deser = protocol
         172  +
                .deserialize_response(response, GetServerStatistics::OUTPUT_SCHEMA, _cfg)
         173  +
                .map_err(|e| {
         174  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         175  +
                })?;
         176  +
            let body = response.body().bytes().expect("body loaded");
         177  +
            let output = crate::operation::get_server_statistics::GetServerStatisticsOutput::deserialize_with_response(
         178  +
                &mut *deser,
         179  +
                response.headers(),
         180  +
                response.status().into(),
         181  +
                body,
         182  +
            )
         183  +
            .map_err(|e| {
         184  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         185  +
            })?;
         186  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         187  +
        }
  156    188   
    }
  157    189   
}
  158    190   
#[derive(Debug)]
  159    191   
struct GetServerStatisticsRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetServerStatisticsRequestSerializer {
  161    193   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    194   
    fn serialize_input(
  163    195   
        &self,
  164    196   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    197   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    198   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    199   
        let input = input
  168    200   
            .downcast::<crate::operation::get_server_statistics::GetServerStatisticsInput>()
  169    201   
            .expect("correct type");
  170         -
        let _header_serialization_settings = _cfg
  171         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  172         -
            .cloned()
  173         -
            .unwrap_or_default();
  174         -
        let mut request_builder = {
  175         -
            #[allow(clippy::uninlined_format_args)]
  176         -
            fn uri_base(
  177         -
                _input: &crate::operation::get_server_statistics::GetServerStatisticsInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                ::std::write!(output, "/stats").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::get_server_statistics::GetServerStatisticsInput,
  187         -
                builder: ::http_1x::request::Builder,
  188         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189         -
                let mut uri = ::std::string::String::new();
  190         -
                uri_base(input, &mut uri)?;
  191         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  192         -
            }
  193         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194         -
            builder
  195         -
        };
  196         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        let mut request = protocol
         206  +
            .serialize_request(&input, GetServerStatistics::INPUT_SCHEMA, "", _cfg)
         207  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  197    208   
  198         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         209  +
        return ::std::result::Result::Ok(request);
  199    210   
    }
  200    211   
}
  201    212   
#[derive(Debug)]
  202    213   
struct GetServerStatisticsEndpointParamsInterceptor;
  203    214   
  204    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetServerStatisticsEndpointParamsInterceptor {
  205    216   
    fn name(&self) -> &'static str {
  206    217   
        "GetServerStatisticsEndpointParamsInterceptor"
  207    218   
    }
  208    219   

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_server_statistics/_get_server_statistics_input.rs

@@ -1,1 +70,84 @@
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5      5   
pub struct GetServerStatisticsInput {}
    6      6   
static GETSERVERSTATISTICSINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "com.aws.example.synthetic#GetServerStatisticsInput",
    8      8   
    "com.aws.example.synthetic",
    9      9   
    "GetServerStatisticsInput",
   10     10   
);
   11     11   
static GETSERVERSTATISTICSINPUT_SCHEMA: ::aws_smithy_schema::Schema =
   12         -
    ::aws_smithy_schema::Schema::new_struct(GETSERVERSTATISTICSINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[]);
          12  +
    ::aws_smithy_schema::Schema::new_struct(GETSERVERSTATISTICSINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[])
          13  +
        .with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/stats", None));
   13     14   
impl GetServerStatisticsInput {
   14     15   
    /// The schema for this shape.
   15     16   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GETSERVERSTATISTICSINPUT_SCHEMA;
   16     17   
}
   17     18   
impl ::aws_smithy_schema::serde::SerializableStruct for GetServerStatisticsInput {
   18     19   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     20   
    fn serialize_members(
   20     21   
        &self,
   21     22   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     23   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     24   
        Ok(())
   24     25   
    }
   25     26   
}
   26     27   
impl GetServerStatisticsInput {
   27     28   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          29  +
    pub fn deserialize(
          30  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     31   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     32   
        #[allow(unused_variables, unused_mut)]
   32     33   
        let mut builder = Self::builder();
   33     34   
        #[allow(
   34     35   
            unused_variables,
   35     36   
            unreachable_code,
   36     37   
            clippy::single_match,
   37     38   
            clippy::match_single_binding,
   38     39   
            clippy::diverging_sub_expression
   39     40   
        )]
   40         -
        deserializer.read_struct(&GETSERVERSTATISTICSINPUT_SCHEMA, (), |_, member, deser| {
          41  +
        deserializer.read_struct(&GETSERVERSTATISTICSINPUT_SCHEMA, &mut |member, deser| {
   41     42   
            match member.member_index() {
   42     43   
                _ => {}
   43     44   
            }
   44     45   
            Ok(())
   45     46   
        })?;
   46     47   
        builder
   47     48   
            .build()
   48     49   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   49     50   
    }
   50     51   
}
          52  +
impl GetServerStatisticsInput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Self::builder()
          61  +
            .build()
          62  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          63  +
    }
          64  +
}
   51     65   
impl GetServerStatisticsInput {
   52     66   
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
   53     67   
    pub fn builder() -> crate::operation::get_server_statistics::builders::GetServerStatisticsInputBuilder {
   54     68   
        crate::operation::get_server_statistics::builders::GetServerStatisticsInputBuilder::default()
   55     69   
    }
   56     70   
}
   57     71   
   58     72   
/// A builder for [`GetServerStatisticsInput`](crate::operation::get_server_statistics::GetServerStatisticsInput).
   59     73   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   60     74   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_server_statistics/_get_server_statistics_output.rs

@@ -24,24 +109,121 @@
   44     44   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   45     45   
        {
   46     46   
            let val = &self.calls_count;
   47     47   
            ser.write_long(&GETSERVERSTATISTICSOUTPUT_MEMBER_CALLS_COUNT, *val)?;
   48     48   
        }
   49     49   
        Ok(())
   50     50   
    }
   51     51   
}
   52     52   
impl GetServerStatisticsOutput {
   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(&GETSERVERSTATISTICSOUTPUT_SCHEMA, (), |_, member, deser| {
          66  +
        deserializer.read_struct(&GETSERVERSTATISTICSOUTPUT_SCHEMA, &mut |member, deser| {
   67     67   
            match member.member_index() {
   68     68   
                Some(0) => {
   69     69   
                    builder.calls_count = Some(deser.read_long(member)?);
   70     70   
                }
   71     71   
                _ => {}
   72     72   
            }
   73     73   
            Ok(())
   74     74   
        })?;
          75  +
        builder.calls_count = builder.calls_count.or(Some(0i64));
   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 GetServerStatisticsOutput {
          82  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          83  +
    pub fn deserialize_with_response(
          84  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          85  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          86  +
        _status: u16,
          87  +
        _body: &[u8],
          88  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          89  +
        Self::deserialize(deserializer)
          90  +
    }
          91  +
}
   80     92   
impl GetServerStatisticsOutput {
   81     93   
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
   82     94   
    pub fn builder() -> crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder {
   83     95   
        crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder::default()
   84     96   
    }
   85     97   
}
   86     98   
   87     99   
/// A builder for [`GetServerStatisticsOutput`](crate::operation::get_server_statistics::GetServerStatisticsOutput).
   88    100   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   89    101   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_storage.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `GetStorage`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GetStorage;
    6      6   
impl GetStorage {
    7      7   
    /// Creates a new `GetStorage`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_storage::GetStorageInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_storage::GetStorageOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::get_storage::GetStorageInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::get_storage::GetStorageOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::get_storage::GetStorageError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -107,111 +232,341 @@
  127    131   
        ::std::borrow::Cow::Owned(rcb)
  128    132   
    }
  129    133   
}
  130    134   
  131    135   
#[derive(Debug)]
  132    136   
struct GetStorageResponseDeserializer;
  133    137   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetStorageResponseDeserializer {
  134    138   
    fn deserialize_nonstreaming(
  135    139   
        &self,
  136    140   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         141  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  137    142   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  138    143   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  139         -
        let headers = response.headers();
  140         -
        let body = response.body().bytes().expect("body loaded");
  141    144   
        #[allow(unused_mut)]
  142    145   
        let mut force_error = false;
  143    146   
  144         -
        let parse_result = if !success && status != 200 || force_error {
  145         -
            crate::protocol_serde::shape_get_storage::de_get_storage_http_error(status, headers, body)
         147  +
        if !success && status != 200 || force_error {
         148  +
            let headers = response.headers();
         149  +
            let body = response.body().bytes().expect("body loaded");
         150  +
            #[allow(unused_mut)]
         151  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         152  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         153  +
            })?;
         154  +
         155  +
            let generic = generic_builder.build();
         156  +
            let error_code = match generic.code() {
         157  +
                ::std::option::Option::Some(code) => code,
         158  +
                ::std::option::Option::None => {
         159  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         160  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::get_storage::GetStorageError::unhandled(generic)),
         161  +
                    ))
         162  +
                }
         163  +
            };
         164  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         165  +
            let protocol = _cfg
         166  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         167  +
                .expect("a SharedClientProtocol is required");
         168  +
            let err = match error_code {
         169  +
                "ResourceNotFoundException" => crate::operation::get_storage::GetStorageError::ResourceNotFoundError({
         170  +
                    let mut tmp = match protocol
         171  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
         172  +
                        .and_then(|mut deser| {
         173  +
                            crate::types::error::ResourceNotFoundError::deserialize_with_response(
         174  +
                                &mut *deser,
         175  +
                                response.headers(),
         176  +
                                response.status().into(),
         177  +
                                body,
         178  +
                            )
         179  +
                        }) {
         180  +
                        ::std::result::Result::Ok(val) => val,
         181  +
                        ::std::result::Result::Err(e) => {
         182  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         183  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         184  +
                            ))
         185  +
                        }
         186  +
                    };
         187  +
                    tmp.meta = generic;
         188  +
                    tmp
         189  +
                }),
         190  +
                "StorageAccessNotAuthorized" => crate::operation::get_storage::GetStorageError::StorageAccessNotAuthorized({
         191  +
                    let mut tmp = match protocol
         192  +
                        .deserialize_response(response, crate::types::error::StorageAccessNotAuthorized::SCHEMA, _cfg)
         193  +
                        .and_then(|mut deser| {
         194  +
                            crate::types::error::StorageAccessNotAuthorized::deserialize_with_response(
         195  +
                                &mut *deser,
         196  +
                                response.headers(),
         197  +
                                response.status().into(),
         198  +
                                body,
         199  +
                            )
         200  +
                        }) {
         201  +
                        ::std::result::Result::Ok(val) => val,
         202  +
                        ::std::result::Result::Err(e) => {
         203  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         204  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         205  +
                            ))
         206  +
                        }
         207  +
                    };
         208  +
                    tmp.meta = generic;
         209  +
                    if tmp.message.is_none() {
         210  +
                        tmp.message = _error_message;
         211  +
                    }
         212  +
                    tmp
         213  +
                }),
         214  +
                "ValidationException" => crate::operation::get_storage::GetStorageError::ValidationError({
         215  +
                    let mut tmp = match protocol
         216  +
                        .deserialize_response(response, crate::types::error::ValidationError::SCHEMA, _cfg)
         217  +
                        .and_then(|mut deser| {
         218  +
                            crate::types::error::ValidationError::deserialize_with_response(
         219  +
                                &mut *deser,
         220  +
                                response.headers(),
         221  +
                                response.status().into(),
         222  +
                                body,
         223  +
                            )
         224  +
                        }) {
         225  +
                        ::std::result::Result::Ok(val) => val,
         226  +
                        ::std::result::Result::Err(e) => {
         227  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         228  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         229  +
                            ))
         230  +
                        }
         231  +
                    };
         232  +
                    tmp.meta = generic;
         233  +
                    tmp
         234  +
                }),
         235  +
                _ => crate::operation::get_storage::GetStorageError::generic(generic),
         236  +
            };
         237  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         238  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         239  +
            ))
  146    240   
        } else {
  147         -
            crate::protocol_serde::shape_get_storage::de_get_storage_http_response(status, headers, body)
  148         -
        };
  149         -
        crate::protocol_serde::type_erase_result(parse_result)
         241  +
            let protocol = _cfg
         242  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         243  +
                .expect("a SharedClientProtocol is required");
         244  +
            let mut deser = protocol.deserialize_response(response, GetStorage::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         245  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         246  +
            })?;
         247  +
            let body = response.body().bytes().expect("body loaded");
         248  +
            let output = crate::operation::get_storage::GetStorageOutput::deserialize_with_response(
         249  +
                &mut *deser,
         250  +
                response.headers(),
         251  +
                response.status().into(),
         252  +
                body,
         253  +
            )
         254  +
            .map_err(|e| {
         255  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         256  +
            })?;
         257  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         258  +
        }
  150    259   
    }
  151    260   
}
  152    261   
#[derive(Debug)]
  153    262   
struct GetStorageRequestSerializer;
  154    263   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetStorageRequestSerializer {
  155    264   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  156    265   
    fn serialize_input(
  157    266   
        &self,
  158    267   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  159    268   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  160    269   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  161    270   
        let input = input.downcast::<crate::operation::get_storage::GetStorageInput>().expect("correct type");
  162         -
        let _header_serialization_settings = _cfg
  163         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  164         -
            .cloned()
  165         -
            .unwrap_or_default();
  166         -
        let mut request_builder = {
  167         -
            #[allow(clippy::uninlined_format_args)]
  168         -
            fn uri_base(
  169         -
                _input: &crate::operation::get_storage::GetStorageInput,
  170         -
                output: &mut ::std::string::String,
  171         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172         -
                use ::std::fmt::Write as _;
  173         -
                let input_1 = &_input.user;
  174         -
                let input_1 = input_1
  175         -
                    .as_ref()
  176         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("user", "cannot be empty or unset"))?;
  177         -
                let user = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  178         -
                if user.is_empty() {
  179         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  180         -
                        "user",
  181         -
                        "cannot be empty or unset",
  182         -
                    ));
         271  +
        let protocol = _cfg
         272  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         273  +
            .expect("a SharedClientProtocol is required");
         274  +
        if protocol.supports_http_bindings() {
         275  +
            let mut request = protocol
         276  +
                .serialize_body(&input, GetStorage::INPUT_SCHEMA, "", _cfg)
         277  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         278  +
            {
         279  +
                let mut uri = "/pokedex/{user}".to_string();
         280  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         281  +
                if let Some(ref val) = input.user {
         282  +
                    uri = uri.replace("{user}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  183    283   
                }
  184         -
                ::std::write!(output, "/pokedex/{user}", user = user).expect("formatting should succeed");
  185         -
                ::std::result::Result::Ok(())
  186         -
            }
  187         -
            #[allow(clippy::unnecessary_wraps)]
  188         -
            fn update_http_builder(
  189         -
                input: &crate::operation::get_storage::GetStorageInput,
  190         -
                builder: ::http_1x::request::Builder,
  191         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  192         -
                let mut uri = ::std::string::String::new();
  193         -
                uri_base(input, &mut uri)?;
  194         -
                let builder = crate::protocol_serde::shape_get_storage::ser_get_storage_headers(input, builder)?;
  195         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         284  +
                if let Some(ref val) = input.passcode {
         285  +
                    request.headers_mut().insert("passcode", val.to_string());
         286  +
                }
         287  +
                if !query_params.is_empty() {
         288  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         289  +
                    let pairs: Vec<String> = query_params
         290  +
                        .iter()
         291  +
                        .map(|(k, v)| {
         292  +
                            format!(
         293  +
                                "{}={}",
         294  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         295  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         296  +
                            )
         297  +
                        })
         298  +
                        .collect();
         299  +
                    uri.push_str(&pairs.join("&"));
         300  +
                }
         301  +
                request.set_uri(uri.as_str()).expect("valid URI");
  196    302   
            }
  197         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  198         -
            builder
  199         -
        };
  200         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  201    303   
  202         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         304  +
            return ::std::result::Result::Ok(request);
         305  +
        } else {
         306  +
            let mut request = protocol
         307  +
                .serialize_request(&input, GetStorage::INPUT_SCHEMA, "", _cfg)
         308  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         309  +
         310  +
            return ::std::result::Result::Ok(request);
         311  +
        }
  203    312   
    }
  204    313   
}
  205    314   
#[derive(Debug)]
  206    315   
struct GetStorageEndpointParamsInterceptor;
  207    316   
  208    317   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetStorageEndpointParamsInterceptor {
  209    318   
    fn name(&self) -> &'static str {
  210    319   
        "GetStorageEndpointParamsInterceptor"
  211    320   
    }
  212    321   

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_storage/_get_storage_input.rs

@@ -32,32 +137,177 @@
   52     52   
    ::aws_smithy_schema::ShapeType::String,
   53     53   
    "passcode",
   54     54   
    1,
   55     55   
)
   56     56   
.with_http_header("passcode");
   57     57   
static GETSTORAGEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   58     58   
    GETSTORAGEINPUT_SCHEMA_ID,
   59     59   
    ::aws_smithy_schema::ShapeType::Structure,
   60     60   
    &[&GETSTORAGEINPUT_MEMBER_USER, &GETSTORAGEINPUT_MEMBER_PASSCODE],
   61     61   
)
   62         -
.with_sensitive();
          62  +
.with_sensitive()
          63  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/pokedex/{user}", None));
   63     64   
impl GetStorageInput {
   64     65   
    /// The schema for this shape.
   65     66   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GETSTORAGEINPUT_SCHEMA;
   66     67   
}
   67     68   
impl ::aws_smithy_schema::serde::SerializableStruct for GetStorageInput {
   68     69   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   69     70   
    fn serialize_members(
   70     71   
        &self,
   71     72   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   72     73   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   73     74   
        if let Some(ref val) = self.user {
   74     75   
            ser.write_string(&GETSTORAGEINPUT_MEMBER_USER, val)?;
   75     76   
        }
   76     77   
        if let Some(ref val) = self.passcode {
   77     78   
            ser.write_string(&GETSTORAGEINPUT_MEMBER_PASSCODE, val)?;
   78     79   
        }
   79     80   
        Ok(())
   80     81   
    }
   81     82   
}
   82     83   
impl GetStorageInput {
   83     84   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   84         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   85         -
        deserializer: &mut D,
          85  +
    pub fn deserialize(
          86  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   86     87   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   87     88   
        #[allow(unused_variables, unused_mut)]
   88     89   
        let mut builder = Self::builder();
   89     90   
        #[allow(
   90     91   
            unused_variables,
   91     92   
            unreachable_code,
   92     93   
            clippy::single_match,
   93     94   
            clippy::match_single_binding,
   94     95   
            clippy::diverging_sub_expression
   95     96   
        )]
   96         -
        deserializer.read_struct(&GETSTORAGEINPUT_SCHEMA, (), |_, member, deser| {
          97  +
        deserializer.read_struct(&GETSTORAGEINPUT_SCHEMA, &mut |member, deser| {
   97     98   
            match member.member_index() {
   98     99   
                Some(0) => {
   99    100   
                    builder.user = Some(deser.read_string(member)?);
  100    101   
                }
  101    102   
                Some(1) => {
  102    103   
                    builder.passcode = Some(deser.read_string(member)?);
  103    104   
                }
  104    105   
                _ => {}
  105    106   
            }
  106    107   
            Ok(())
  107    108   
        })?;
         109  +
        builder.user = builder.user.or(Some(String::new()));
         110  +
        builder.passcode = builder.passcode.or(Some(String::new()));
         111  +
        builder
         112  +
            .build()
         113  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         114  +
    }
         115  +
}
         116  +
impl GetStorageInput {
         117  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         118  +
    /// Header-bound members are read directly from headers, avoiding runtime
         119  +
    /// member iteration overhead. Body members are read via the deserializer.
         120  +
    pub fn deserialize_with_response(
         121  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         122  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         123  +
        _status: u16,
         124  +
        _body: &[u8],
         125  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         126  +
        #[allow(unused_variables, unused_mut)]
         127  +
        let mut builder = Self::builder();
         128  +
        if let Some(val) = headers.get("passcode") {
         129  +
            builder.passcode = Some(val.to_string());
         130  +
        }
         131  +
        #[allow(
         132  +
            unused_variables,
         133  +
            unreachable_code,
         134  +
            clippy::single_match,
         135  +
            clippy::match_single_binding,
         136  +
            clippy::diverging_sub_expression
         137  +
        )]
         138  +
        deserializer.read_struct(&GETSTORAGEINPUT_SCHEMA, &mut |member, deser| {
         139  +
            match member.member_index() {
         140  +
                Some(0) => {
         141  +
                    builder.user = Some(deser.read_string(member)?);
         142  +
                }
         143  +
                Some(1) => { /* read from headers above */ }
         144  +
                _ => {}
         145  +
            }
         146  +
            Ok(())
         147  +
        })?;
  108    148   
        builder
  109    149   
            .build()
  110    150   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  111    151   
    }
  112    152   
}
  113    153   
impl GetStorageInput {
  114    154   
    /// Creates a new builder-style object to manufacture [`GetStorageInput`](crate::operation::get_storage::GetStorageInput).
  115    155   
    pub fn builder() -> crate::operation::get_storage::builders::GetStorageInputBuilder {
  116    156   
        crate::operation::get_storage::builders::GetStorageInputBuilder::default()
  117    157   
    }

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/get_storage/_get_storage_output.rs

@@ -35,35 +130,132 @@
   55     55   
                    }
   56     56   
                    Ok(())
   57     57   
                },
   58     58   
            )?;
   59     59   
        }
   60     60   
        Ok(())
   61     61   
    }
   62     62   
}
   63     63   
impl GetStorageOutput {
   64     64   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   65         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   66         -
        deserializer: &mut D,
          65  +
    pub fn deserialize(
          66  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   67     67   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   68     68   
        #[allow(unused_variables, unused_mut)]
   69     69   
        let mut builder = Self::builder();
   70     70   
        #[allow(
   71     71   
            unused_variables,
   72     72   
            unreachable_code,
   73     73   
            clippy::single_match,
   74     74   
            clippy::match_single_binding,
   75     75   
            clippy::diverging_sub_expression
   76     76   
        )]
   77         -
        deserializer.read_struct(&GETSTORAGEOUTPUT_SCHEMA, (), |_, member, deser| {
          77  +
        deserializer.read_struct(&GETSTORAGEOUTPUT_SCHEMA, &mut |member, deser| {
   78     78   
            match member.member_index() {
   79     79   
                Some(0) => {
   80         -
                    builder.collection = Some({
   81         -
                        let container = if let Some(cap) = deser.container_size() {
   82         -
                            Vec::with_capacity(cap)
   83         -
                        } else {
   84         -
                            Vec::new()
   85         -
                        };
   86         -
                        deser.read_list(member, container, |mut list, deser| {
   87         -
                            list.push(deser.read_string(member)?);
   88         -
                            Ok(list)
   89         -
                        })?
   90         -
                    });
          80  +
                    builder.collection = Some(deser.read_string_list(member)?);
   91     81   
                }
   92     82   
                _ => {}
   93     83   
            }
   94     84   
            Ok(())
   95     85   
        })?;
          86  +
        builder.collection = builder.collection.or(Some(Vec::new()));
   96     87   
        builder
   97     88   
            .build()
   98     89   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   99     90   
    }
  100     91   
}
          92  +
impl GetStorageOutput {
          93  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          94  +
    pub fn deserialize_with_response(
          95  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          96  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          97  +
        _status: u16,
          98  +
        _body: &[u8],
          99  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         100  +
        Self::deserialize(deserializer)
         101  +
    }
         102  +
}
  101    103   
impl GetStorageOutput {
  102    104   
    /// Creates a new builder-style object to manufacture [`GetStorageOutput`](crate::operation::get_storage::GetStorageOutput).
  103    105   
    pub fn builder() -> crate::operation::get_storage::builders::GetStorageOutputBuilder {
  104    106   
        crate::operation::get_storage::builders::GetStorageOutputBuilder::default()
  105    107   
    }
  106    108   
}
  107    109   
  108    110   
/// A builder for [`GetStorageOutput`](crate::operation::get_storage::GetStorageOutput).
  109    111   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  110    112   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/stream_pokemon_radio.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `StreamPokemonRadio`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct StreamPokemonRadio;
    6      6   
impl StreamPokemonRadio {
    7      7   
    /// Creates a new `StreamPokemonRadio`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::stream_pokemon_radio::StreamPokemonRadioInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::stream_pokemon_radio::StreamPokemonRadioInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::stream_pokemon_radio::StreamPokemonRadioError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -123,127 +233,225 @@
  143    147   
            return ::std::option::Option::None;
  144    148   
        }
  145    149   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  146    150   
            crate::protocol_serde::shape_stream_pokemon_radio::de_stream_pokemon_radio_http_response(response),
  147    151   
        ))
  148    152   
    }
  149    153   
  150    154   
    fn deserialize_nonstreaming(
  151    155   
        &self,
  152    156   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         157  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  153    158   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  154    159   
        // For streaming operations, we only hit this case if its an error
  155    160   
        let body = response.body().bytes().expect("body loaded");
  156         -
        crate::protocol_serde::type_erase_result(crate::protocol_serde::shape_stream_pokemon_radio::de_stream_pokemon_radio_http_error(
  157         -
            response.status().as_u16(),
  158         -
            response.headers(),
  159         -
            body,
         161  +
        let status = response.status().as_u16();
         162  +
        let headers = response.headers();
         163  +
        #[allow(unused_mut)]
         164  +
        let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         165  +
            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         166  +
        })?;
         167  +
         168  +
        let generic = generic_builder.build();
         169  +
        ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         170  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         171  +
                crate::operation::stream_pokemon_radio::StreamPokemonRadioError::generic(generic),
         172  +
            ),
  160    173   
        ))
  161    174   
    }
  162    175   
}
  163    176   
#[derive(Debug)]
  164    177   
struct StreamPokemonRadioRequestSerializer;
  165    178   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StreamPokemonRadioRequestSerializer {
  166    179   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  167    180   
    fn serialize_input(
  168    181   
        &self,
  169    182   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  170    183   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  171    184   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  172    185   
        let input = input
  173    186   
            .downcast::<crate::operation::stream_pokemon_radio::StreamPokemonRadioInput>()
  174    187   
            .expect("correct type");
  175         -
        let _header_serialization_settings = _cfg
  176         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  177         -
            .cloned()
  178         -
            .unwrap_or_default();
  179         -
        let mut request_builder = {
  180         -
            #[allow(clippy::uninlined_format_args)]
  181         -
            fn uri_base(
  182         -
                _input: &crate::operation::stream_pokemon_radio::StreamPokemonRadioInput,
  183         -
                output: &mut ::std::string::String,
  184         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  185         -
                use ::std::fmt::Write as _;
  186         -
                ::std::write!(output, "/radio").expect("formatting should succeed");
  187         -
                ::std::result::Result::Ok(())
  188         -
            }
  189         -
            #[allow(clippy::unnecessary_wraps)]
  190         -
            fn update_http_builder(
  191         -
                input: &crate::operation::stream_pokemon_radio::StreamPokemonRadioInput,
  192         -
                builder: ::http_1x::request::Builder,
  193         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  194         -
                let mut uri = ::std::string::String::new();
  195         -
                uri_base(input, &mut uri)?;
  196         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  197         -
            }
  198         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  199         -
            builder
  200         -
        };
  201         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         188  +
        let protocol = _cfg
         189  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         190  +
            .expect("a SharedClientProtocol is required");
         191  +
        let mut request = protocol
         192  +
            .serialize_request(&input, StreamPokemonRadio::INPUT_SCHEMA, "", _cfg)
         193  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  202    194   
  203         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         195  +
        return ::std::result::Result::Ok(request);
  204    196   
    }
  205    197   
}
  206    198   
#[derive(Debug)]
  207    199   
struct StreamPokemonRadioEndpointParamsInterceptor;
  208    200   
  209    201   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StreamPokemonRadioEndpointParamsInterceptor {
  210    202   
    fn name(&self) -> &'static str {
  211    203   
        "StreamPokemonRadioEndpointParamsInterceptor"
  212    204   
    }
  213    205   

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/stream_pokemon_radio/_stream_pokemon_radio_input.rs

@@ -1,1 +70,84 @@
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5      5   
pub struct StreamPokemonRadioInput {}
    6      6   
static STREAMPOKEMONRADIOINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    7      7   
    "com.aws.example.synthetic#StreamPokemonRadioInput",
    8      8   
    "com.aws.example.synthetic",
    9      9   
    "StreamPokemonRadioInput",
   10     10   
);
   11     11   
static STREAMPOKEMONRADIOINPUT_SCHEMA: ::aws_smithy_schema::Schema =
   12         -
    ::aws_smithy_schema::Schema::new_struct(STREAMPOKEMONRADIOINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[]);
          12  +
    ::aws_smithy_schema::Schema::new_struct(STREAMPOKEMONRADIOINPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[])
          13  +
        .with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/radio", None));
   13     14   
impl StreamPokemonRadioInput {
   14     15   
    /// The schema for this shape.
   15     16   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMPOKEMONRADIOINPUT_SCHEMA;
   16     17   
}
   17     18   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamPokemonRadioInput {
   18     19   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   19     20   
    fn serialize_members(
   20     21   
        &self,
   21     22   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   22     23   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   23     24   
        Ok(())
   24     25   
    }
   25     26   
}
   26     27   
impl StreamPokemonRadioInput {
   27     28   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   28         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   29         -
        deserializer: &mut D,
          29  +
    pub fn deserialize(
          30  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   30     31   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   31     32   
        #[allow(unused_variables, unused_mut)]
   32     33   
        let mut builder = Self::builder();
   33     34   
        #[allow(
   34     35   
            unused_variables,
   35     36   
            unreachable_code,
   36     37   
            clippy::single_match,
   37     38   
            clippy::match_single_binding,
   38     39   
            clippy::diverging_sub_expression
   39     40   
        )]
   40         -
        deserializer.read_struct(&STREAMPOKEMONRADIOINPUT_SCHEMA, (), |_, member, deser| {
          41  +
        deserializer.read_struct(&STREAMPOKEMONRADIOINPUT_SCHEMA, &mut |member, deser| {
   41     42   
            match member.member_index() {
   42     43   
                _ => {}
   43     44   
            }
   44     45   
            Ok(())
   45     46   
        })?;
   46     47   
        builder
   47     48   
            .build()
   48     49   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
   49     50   
    }
   50     51   
}
          52  +
impl StreamPokemonRadioInput {
          53  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          54  +
    pub fn deserialize_with_response(
          55  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          57  +
        _status: u16,
          58  +
        _body: &[u8],
          59  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          60  +
        Self::builder()
          61  +
            .build()
          62  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          63  +
    }
          64  +
}
   51     65   
impl StreamPokemonRadioInput {
   52     66   
    /// Creates a new builder-style object to manufacture [`StreamPokemonRadioInput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioInput).
   53     67   
    pub fn builder() -> crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioInputBuilder {
   54     68   
        crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioInputBuilder::default()
   55     69   
    }
   56     70   
}
   57     71   
   58     72   
/// A builder for [`StreamPokemonRadioInput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioInput).
   59     73   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   60     74   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/stream_pokemon_radio/_stream_pokemon_radio_output.rs

@@ -16,16 +111,118 @@
   36     36   
impl StreamPokemonRadioOutput {
   37     37   
    /// The schema for this shape.
   38     38   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STREAMPOKEMONRADIOOUTPUT_SCHEMA;
   39     39   
}
   40     40   
impl ::aws_smithy_schema::serde::SerializableStruct for StreamPokemonRadioOutput {
   41     41   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     42   
    fn serialize_members(
   43     43   
        &self,
   44     44   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     45   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46         -
        {
   47         -
            let val = &self.data;
   48         -
            // streaming blob is serialized as the HTTP body by the protocol, not the codec
   49         -
        }
   50     46   
        Ok(())
   51     47   
    }
   52     48   
}
   53     49   
impl StreamPokemonRadioOutput {
   54     50   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   55         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   56         -
        deserializer: &mut D,
          51  +
    pub fn deserialize(
          52  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   57     53   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   58     54   
        #[allow(unused_variables, unused_mut)]
   59     55   
        let mut builder = Self::builder();
   60     56   
        #[allow(
   61     57   
            unused_variables,
   62     58   
            unreachable_code,
   63     59   
            clippy::single_match,
   64     60   
            clippy::match_single_binding,
   65     61   
            clippy::diverging_sub_expression
   66     62   
        )]
   67         -
        deserializer.read_struct(&STREAMPOKEMONRADIOOUTPUT_SCHEMA, (), |_, member, deser| {
          63  +
        deserializer.read_struct(&STREAMPOKEMONRADIOOUTPUT_SCHEMA, &mut |member, deser| {
   68     64   
            match member.member_index() {
   69     65   
                Some(0) => {
   70     66   
                    builder.data = Some({
   71     67   
                        let _ = member;
   72     68   
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
   73     69   
                    });
   74     70   
                }
   75     71   
                _ => {}
   76     72   
            }
   77     73   
            Ok(())
   78     74   
        })?;
   79     75   
        Ok(builder.build())
   80     76   
    }
   81     77   
}
          78  +
impl StreamPokemonRadioOutput {
          79  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          80  +
    pub fn deserialize_with_response(
          81  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          82  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          83  +
        _status: u16,
          84  +
        _body: &[u8],
          85  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          86  +
        Self::deserialize(deserializer)
          87  +
    }
          88  +
}
   82     89   
impl StreamPokemonRadioOutput {
   83     90   
    /// Creates a new builder-style object to manufacture [`StreamPokemonRadioOutput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput).
   84     91   
    pub fn builder() -> crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioOutputBuilder {
   85     92   
        crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioOutputBuilder::default()
   86     93   
    }
   87     94   
}
   88     95   
   89     96   
/// A builder for [`StreamPokemonRadioOutput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput).
   90     97   
#[derive(::std::default::Default, ::std::fmt::Debug)]
   91     98   
#[non_exhaustive]

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

@@ -1,1 +0,56 @@
    8      8   
where
    9      9   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     10   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     11   
{
   12     12   
    result
   13     13   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     14   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     15   
        .map_err(::std::convert::Into::into)
   16     16   
}
   17     17   
   18         -
pub(crate) mod shape_capture_pokemon;
   19         -
   20     18   
pub fn parse_http_error_metadata(
   21     19   
    _response_status: u16,
   22     20   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   23     21   
    response_body: &[u8],
   24     22   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   25     23   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   26     24   
}
   27     25   
   28         -
pub(crate) mod shape_check_health;
   29         -
   30         -
pub(crate) mod shape_do_nothing;
   31         -
   32         -
pub(crate) mod shape_get_pokemon_species;
   33         -
   34         -
pub(crate) mod shape_get_server_statistics;
   35         -
   36         -
pub(crate) mod shape_get_storage;
          26  +
pub(crate) mod shape_capture_pokemon;
   37     27   
   38     28   
pub(crate) mod shape_stream_pokemon_radio;
   39     29   
   40     30   
pub(crate) mod shape_capture_pokemon_output;
   41     31   
   42     32   
pub(crate) mod shape_capturing_event;
   43     33   
   44         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   45         -
    if data.is_empty() {
   46         -
        b"{}"
   47         -
    } else {
   48         -
        data
   49         -
    }
   50         -
}
   51         -
   52         -
pub(crate) mod shape_invalid_pokeball_error;
   53         -
   54     34   
pub(crate) mod shape_master_ball_unsuccessful;
   55     35   
   56         -
pub(crate) mod shape_resource_not_found_exception;
   57         -
   58         -
pub(crate) mod shape_storage_access_not_authorized;
   59         -
   60     36   
pub(crate) mod shape_stream_pokemon_radio_output;
   61     37   
   62         -
pub(crate) mod shape_throttling_error;
   63         -
   64         -
pub(crate) mod shape_unsupported_region_error;
   65         -
   66         -
pub(crate) mod shape_validation_exception;
   67         -
   68     38   
pub fn parse_event_stream_error_metadata(
   69     39   
    payload: &::bytes::Bytes,
   70     40   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   71     41   
    crate::json_errors::parse_error_metadata(payload, &::aws_smithy_runtime_api::http::Headers::new())
   72     42   
}
   73     43   
   74     44   
pub(crate) mod shape_capturing_payload;
   75     45   
   76         -
pub(crate) mod shape_flavor_text_entries;
   77         -
   78         -
pub(crate) mod shape_species_collection;
   79         -
   80         -
pub(crate) mod shape_validation_exception_field_list;
          46  +
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
          47  +
    if data.is_empty() {
          48  +
        b"{}"
          49  +
    } else {
          50  +
        data
          51  +
    }
          52  +
}
   81     53   
   82         -
pub(crate) mod shape_flavor_text;
          54  +
pub(crate) mod shape_invalid_pokeball_error;
   83     55   
   84         -
pub(crate) mod shape_validation_exception_field;
          56  +
pub(crate) mod shape_throttling_error;

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_capture_pokemon.rs

@@ -1,1 +121,0 @@
   13     13   
        #[allow(unused_mut)]
   14     14   
        let mut output = crate::operation::capture_pokemon::builders::CapturePokemonOutputBuilder::default();
   15     15   
        output = output.set_events(Some(crate::protocol_serde::shape_capture_pokemon_output::de_events_payload(
   16     16   
            _response_body,
   17     17   
        )?));
   18     18   
        output
   19     19   
            .build()
   20     20   
            .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
   21     21   
    })
   22     22   
}
   23         -
   24         -
#[allow(clippy::unnecessary_wraps)]
   25         -
pub fn de_capture_pokemon_http_error(
   26         -
    _response_status: u16,
   27         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   28         -
    _response_body: &[u8],
   29         -
) -> std::result::Result<crate::operation::capture_pokemon::CapturePokemonOutput, crate::operation::capture_pokemon::CapturePokemonError> {
   30         -
    #[allow(unused_mut)]
   31         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   32         -
        .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   33         -
    let generic = generic_builder.build();
   34         -
    let error_code = match generic.code() {
   35         -
        Some(code) => code,
   36         -
        None => return Err(crate::operation::capture_pokemon::CapturePokemonError::unhandled(generic)),
   37         -
    };
   38         -
   39         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   40         -
    Err(match error_code {
   41         -
        "UnsupportedRegionError" => crate::operation::capture_pokemon::CapturePokemonError::UnsupportedRegionError({
   42         -
            #[allow(unused_mut)]
   43         -
            let mut tmp = {
   44         -
                #[allow(unused_mut)]
   45         -
                let mut output = crate::types::error::builders::UnsupportedRegionErrorBuilder::default();
   46         -
                output = crate::protocol_serde::shape_unsupported_region_error::de_unsupported_region_error_json_err(_response_body, output)
   47         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   48         -
                let output = output.meta(generic);
   49         -
                crate::serde_util::unsupported_region_error_correct_errors(output)
   50         -
                    .build()
   51         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
   52         -
            };
   53         -
            if tmp.message.is_none() {
   54         -
                tmp.message = _error_message;
   55         -
            }
   56         -
            tmp
   57         -
        }),
   58         -
        "ThrottlingError" => crate::operation::capture_pokemon::CapturePokemonError::ThrottlingError({
   59         -
            #[allow(unused_mut)]
   60         -
            let mut tmp = {
   61         -
                #[allow(unused_mut)]
   62         -
                let mut output = crate::types::error::builders::ThrottlingErrorBuilder::default();
   63         -
                output = crate::protocol_serde::shape_throttling_error::de_throttling_error_json_err(_response_body, output)
   64         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   65         -
                let output = output.meta(generic);
   66         -
                output.build()
   67         -
            };
   68         -
            if tmp.message.is_none() {
   69         -
                tmp.message = _error_message;
   70         -
            }
   71         -
            tmp
   72         -
        }),
   73         -
        "ValidationException" => crate::operation::capture_pokemon::CapturePokemonError::ValidationError({
   74         -
            #[allow(unused_mut)]
   75         -
            let mut tmp = {
   76         -
                #[allow(unused_mut)]
   77         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   78         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   79         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   80         -
                let output = output.meta(generic);
   81         -
                crate::serde_util::validation_exception_correct_errors(output)
   82         -
                    .build()
   83         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
   84         -
            };
   85         -
            tmp
   86         -
        }),
   87         -
        "MasterBallUnsuccessful" => crate::operation::capture_pokemon::CapturePokemonError::MasterBallUnsuccessful({
   88         -
            #[allow(unused_mut)]
   89         -
            let mut tmp = {
   90         -
                #[allow(unused_mut)]
   91         -
                let mut output = crate::types::error::builders::MasterBallUnsuccessfulBuilder::default();
   92         -
                output = crate::protocol_serde::shape_master_ball_unsuccessful::de_master_ball_unsuccessful_json_err(_response_body, output)
   93         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
   94         -
                let output = output.meta(generic);
   95         -
                output.build()
   96         -
            };
   97         -
            if tmp.message.is_none() {
   98         -
                tmp.message = _error_message;
   99         -
            }
  100         -
            tmp
  101         -
        }),
  102         -
        "InvalidPokeballError" => crate::operation::capture_pokemon::CapturePokemonError::InvalidPokeballError({
  103         -
            #[allow(unused_mut)]
  104         -
            let mut tmp = {
  105         -
                #[allow(unused_mut)]
  106         -
                let mut output = crate::types::error::builders::InvalidPokeballErrorBuilder::default();
  107         -
                output = crate::protocol_serde::shape_invalid_pokeball_error::de_invalid_pokeball_error_json_err(_response_body, output)
  108         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?;
  109         -
                let output = output.meta(generic);
  110         -
                crate::serde_util::invalid_pokeball_error_correct_errors(output)
  111         -
                    .build()
  112         -
                    .map_err(crate::operation::capture_pokemon::CapturePokemonError::unhandled)?
  113         -
            };
  114         -
            if tmp.message.is_none() {
  115         -
                tmp.message = _error_message;
  116         -
            }
  117         -
            tmp
  118         -
        }),
  119         -
        _ => crate::operation::capture_pokemon::CapturePokemonError::generic(generic),
  120         -
    })
  121         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_check_health.rs

@@ -1,0 +26,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_check_health_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::check_health::CheckHealthOutput, crate::operation::check_health::CheckHealthError> {
    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::check_health::CheckHealthError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::check_health::CheckHealthError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_check_health_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::check_health::CheckHealthOutput, crate::operation::check_health::CheckHealthError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::check_health::builders::CheckHealthOutputBuilder::default();
   24         -
        output.build()
   25         -
    })
   26         -
}