Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_greedy_label_in_path.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `HttpRequestWithGreedyLabelInPath`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpRequestWithGreedyLabelInPath;
    6      6   
impl HttpRequestWithGreedyLabelInPath {
    7      7   
    /// Creates a new `HttpRequestWithGreedyLabelInPath`
    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 =
          13  +
        crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +255,279 @@
  130    136   
                crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct HttpRequestWithGreedyLabelInPathResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpRequestWithGreedyLabelInPathResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        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    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_http_request_with_greedy_label_in_path::de_http_request_with_greedy_label_in_path_http_error(
  152         -
                status, headers, body,
  153         -
            )
         155  +
        if !success && status != 200 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathError::generic(generic),
         167  +
                ),
         168  +
            ))
  154    169   
        } else {
  155         -
            crate::protocol_serde::shape_http_request_with_greedy_label_in_path::de_http_request_with_greedy_label_in_path_http_response(
  156         -
                status, headers, body,
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, HttpRequestWithGreedyLabelInPath::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
  157    184   
            )
  158         -
        };
  159         -
        crate::protocol_serde::type_erase_result(parse_result)
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  160    190   
    }
  161    191   
}
  162    192   
#[derive(Debug)]
  163    193   
struct HttpRequestWithGreedyLabelInPathRequestSerializer;
  164    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpRequestWithGreedyLabelInPathRequestSerializer {
  165    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  166    196   
    fn serialize_input(
  167    197   
        &self,
  168    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  169    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  170    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  171    201   
        let input = input
  172    202   
            .downcast::<crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput>()
  173    203   
            .expect("correct type");
  174         -
        let _header_serialization_settings = _cfg
  175         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  176         -
            .cloned()
  177         -
            .unwrap_or_default();
  178         -
        let mut request_builder = {
  179         -
            #[allow(clippy::uninlined_format_args)]
  180         -
            fn uri_base(
  181         -
                _input: &crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput,
  182         -
                output: &mut ::std::string::String,
  183         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  184         -
                use ::std::fmt::Write as _;
  185         -
                let input_1 = &_input.foo;
  186         -
                let input_1 = input_1
  187         -
                    .as_ref()
  188         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("foo", "cannot be empty or unset"))?;
  189         -
                let foo = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  190         -
                if foo.is_empty() {
  191         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  192         -
                        "foo",
  193         -
                        "cannot be empty or unset",
  194         -
                    ));
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        if protocol.supports_http_bindings() {
         208  +
            let mut request = protocol
         209  +
                .serialize_body(&input, HttpRequestWithGreedyLabelInPath::INPUT_SCHEMA, "", _cfg)
         210  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         211  +
            {
         212  +
                let mut uri = "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}".to_string();
         213  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         214  +
                if let Some(ref val) = input.foo {
         215  +
                    uri = uri.replace("{foo}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  195    216   
                }
  196         -
                let input_2 = &_input.baz;
  197         -
                let input_2 = input_2
  198         -
                    .as_ref()
  199         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("baz", "cannot be empty or unset"))?;
  200         -
                let baz = ::aws_smithy_http::label::fmt_string(input_2, ::aws_smithy_http::label::EncodingStrategy::Greedy);
  201         -
                if baz.is_empty() {
  202         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  203         -
                        "baz",
  204         -
                        "cannot be empty or unset",
  205         -
                    ));
         217  +
                if let Some(ref val) = input.baz {
         218  +
                    let encoded = val
         219  +
                        .split('/')
         220  +
                        .map(::aws_smithy_schema::http_protocol::percent_encode)
         221  +
                        .collect::<Vec<_>>()
         222  +
                        .join("/");
         223  +
                    uri = uri.replace("{baz+}", &encoded);
  206    224   
                }
  207         -
                ::std::write!(output, "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz}", foo = foo, baz = baz)
  208         -
                    .expect("formatting should succeed");
  209         -
                ::std::result::Result::Ok(())
  210         -
            }
  211         -
            #[allow(clippy::unnecessary_wraps)]
  212         -
            fn update_http_builder(
  213         -
                input: &crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput,
  214         -
                builder: ::http_1x::request::Builder,
  215         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  216         -
                let mut uri = ::std::string::String::new();
  217         -
                uri_base(input, &mut uri)?;
  218         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         225  +
                if !query_params.is_empty() {
         226  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         227  +
                    let pairs: Vec<String> = query_params
         228  +
                        .iter()
         229  +
                        .map(|(k, v)| {
         230  +
                            format!(
         231  +
                                "{}={}",
         232  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         233  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         234  +
                            )
         235  +
                        })
         236  +
                        .collect();
         237  +
                    uri.push_str(&pairs.join("&"));
         238  +
                }
         239  +
                request.set_uri(uri.as_str()).expect("valid URI");
  219    240   
            }
  220         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  221         -
            builder
  222         -
        };
  223         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  224    241   
  225         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         242  +
            return ::std::result::Result::Ok(request);
         243  +
        } else {
         244  +
            let mut request = protocol
         245  +
                .serialize_request(&input, HttpRequestWithGreedyLabelInPath::INPUT_SCHEMA, "", _cfg)
         246  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         247  +
         248  +
            return ::std::result::Result::Ok(request);
         249  +
        }
  226    250   
    }
  227    251   
}
  228    252   
#[derive(Debug)]
  229    253   
struct HttpRequestWithGreedyLabelInPathEndpointParamsInterceptor;
  230    254   
  231    255   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpRequestWithGreedyLabelInPathEndpointParamsInterceptor {
  232    256   
    fn name(&self) -> &'static str {
  233    257   
        "HttpRequestWithGreedyLabelInPathEndpointParamsInterceptor"
  234    258   
    }
  235    259   

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_greedy_label_in_path/_http_request_with_greedy_label_in_path_input.rs

@@ -25,25 +135,153 @@
   45     45   
    1,
   46     46   
)
   47     47   
.with_http_label();
   48     48   
static HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   49     49   
    HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA_ID,
   50     50   
    ::aws_smithy_schema::ShapeType::Structure,
   51     51   
    &[
   52     52   
        &HTTPREQUESTWITHGREEDYLABELINPATHINPUT_MEMBER_FOO,
   53     53   
        &HTTPREQUESTWITHGREEDYLABELINPATHINPUT_MEMBER_BAZ,
   54     54   
    ],
   55         -
);
          55  +
)
          56  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
          57  +
    "GET",
          58  +
    "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}",
          59  +
    None,
          60  +
));
   56     61   
impl HttpRequestWithGreedyLabelInPathInput {
   57     62   
    /// The schema for this shape.
   58     63   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA;
   59     64   
}
   60     65   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpRequestWithGreedyLabelInPathInput {
   61     66   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   62     67   
    fn serialize_members(
   63     68   
        &self,
   64     69   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   65     70   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   66     71   
        if let Some(ref val) = self.foo {
   67     72   
            ser.write_string(&HTTPREQUESTWITHGREEDYLABELINPATHINPUT_MEMBER_FOO, val)?;
   68     73   
        }
   69     74   
        if let Some(ref val) = self.baz {
   70     75   
            ser.write_string(&HTTPREQUESTWITHGREEDYLABELINPATHINPUT_MEMBER_BAZ, val)?;
   71     76   
        }
   72     77   
        Ok(())
   73     78   
    }
   74     79   
}
   75     80   
impl HttpRequestWithGreedyLabelInPathInput {
   76     81   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   77         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   78         -
        deserializer: &mut D,
          82  +
    pub fn deserialize(
          83  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   79     84   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   80     85   
        #[allow(unused_variables, unused_mut)]
   81     86   
        let mut builder = Self::builder();
   82     87   
        #[allow(
   83     88   
            unused_variables,
   84     89   
            unreachable_code,
   85     90   
            clippy::single_match,
   86     91   
            clippy::match_single_binding,
   87     92   
            clippy::diverging_sub_expression
   88     93   
        )]
   89         -
        deserializer.read_struct(&HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA, (), |_, member, deser| {
          94  +
        deserializer.read_struct(&HTTPREQUESTWITHGREEDYLABELINPATHINPUT_SCHEMA, &mut |member, deser| {
   90     95   
            match member.member_index() {
   91     96   
                Some(0) => {
   92     97   
                    builder.foo = Some(deser.read_string(member)?);
   93     98   
                }
   94     99   
                Some(1) => {
   95    100   
                    builder.baz = Some(deser.read_string(member)?);
   96    101   
                }
   97    102   
                _ => {}
   98    103   
            }
   99    104   
            Ok(())
  100    105   
        })?;
         106  +
        builder.foo = builder.foo.or(Some(String::new()));
         107  +
        builder.baz = builder.baz.or(Some(String::new()));
  101    108   
        builder
  102    109   
            .build()
  103    110   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  104    111   
    }
  105    112   
}
         113  +
impl HttpRequestWithGreedyLabelInPathInput {
         114  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         115  +
    pub fn deserialize_with_response(
         116  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         117  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         118  +
        _status: u16,
         119  +
        _body: &[u8],
         120  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         121  +
        Self::deserialize(deserializer)
         122  +
    }
         123  +
}
  106    124   
impl HttpRequestWithGreedyLabelInPathInput {
  107    125   
    /// Creates a new builder-style object to manufacture [`HttpRequestWithGreedyLabelInPathInput`](crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput).
  108    126   
    pub fn builder() -> crate::operation::http_request_with_greedy_label_in_path::builders::HttpRequestWithGreedyLabelInPathInputBuilder {
  109    127   
        crate::operation::http_request_with_greedy_label_in_path::builders::HttpRequestWithGreedyLabelInPathInputBuilder::default()
  110    128   
    }
  111    129   
}
  112    130   
  113    131   
/// A builder for [`HttpRequestWithGreedyLabelInPathInput`](crate::operation::http_request_with_greedy_label_in_path::HttpRequestWithGreedyLabelInPathInput).
  114    132   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  115    133   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_greedy_label_in_path/_http_request_with_greedy_label_in_path_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_labels.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 `HttpRequestWithLabels`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpRequestWithLabels;
    6      6   
impl HttpRequestWithLabels {
    7      7   
    /// Creates a new `HttpRequestWithLabels`
    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::http_request_with_labels::HttpRequestWithLabelsInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_request_with_labels::HttpRequestWithLabelsOutput::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::http_request_with_labels::HttpRequestWithLabelsInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::http_request_with_labels::HttpRequestWithLabelsOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::http_request_with_labels::HttpRequestWithLabelsError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +334,315 @@
  130    134   
                crate::operation::http_request_with_labels::HttpRequestWithLabelsError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct HttpRequestWithLabelsResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpRequestWithLabelsResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  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_http_request_with_labels::de_http_request_with_labels_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::http_request_with_labels::HttpRequestWithLabelsError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_http_request_with_labels::de_http_request_with_labels_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, HttpRequestWithLabels::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::http_request_with_labels::HttpRequestWithLabelsOutput::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 HttpRequestWithLabelsRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpRequestWithLabelsRequestSerializer {
  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::http_request_with_labels::HttpRequestWithLabelsInput>()
  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::http_request_with_labels::HttpRequestWithLabelsInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                let input_1 = &_input.string;
  182         -
                let input_1 = input_1
  183         -
                    .as_ref()
  184         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("string", "cannot be empty or unset"))?;
  185         -
                let string = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  186         -
                if string.is_empty() {
  187         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  188         -
                        "string",
  189         -
                        "cannot be empty or unset",
  190         -
                    ));
         202  +
        let protocol = _cfg
         203  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         204  +
            .expect("a SharedClientProtocol is required");
         205  +
        if protocol.supports_http_bindings() {
         206  +
            let mut request = protocol
         207  +
                .serialize_body(&input, HttpRequestWithLabels::INPUT_SCHEMA, "", _cfg)
         208  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         209  +
            {
         210  +
                let mut uri = "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}".to_string();
         211  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         212  +
                if let Some(ref val) = input.string {
         213  +
                    uri = uri.replace("{string}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  191    214   
                }
  192         -
                let input_2 = &_input.short;
  193         -
                let input_2 = input_2
  194         -
                    .as_ref()
  195         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("short", "cannot be empty or unset"))?;
  196         -
                let mut short_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_2);
  197         -
                let short = short_encoder.encode();
  198         -
                if short.is_empty() {
  199         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  200         -
                        "short",
  201         -
                        "cannot be empty or unset",
  202         -
                    ));
         215  +
                if let Some(ref val) = input.short {
         216  +
                    uri = uri.replace("{short}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  203    217   
                }
  204         -
                let input_3 = &_input.integer;
  205         -
                let input_3 = input_3
  206         -
                    .as_ref()
  207         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("integer", "cannot be empty or unset"))?;
  208         -
                let mut integer_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_3);
  209         -
                let integer = integer_encoder.encode();
  210         -
                if integer.is_empty() {
  211         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  212         -
                        "integer",
  213         -
                        "cannot be empty or unset",
  214         -
                    ));
         218  +
                if let Some(ref val) = input.integer {
         219  +
                    uri = uri.replace("{integer}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  215    220   
                }
  216         -
                let input_4 = &_input.long;
  217         -
                let input_4 = input_4
  218         -
                    .as_ref()
  219         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("long", "cannot be empty or unset"))?;
  220         -
                let mut long_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_4);
  221         -
                let long = long_encoder.encode();
  222         -
                if long.is_empty() {
  223         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  224         -
                        "long",
  225         -
                        "cannot be empty or unset",
  226         -
                    ));
         221  +
                if let Some(ref val) = input.long {
         222  +
                    uri = uri.replace("{long}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  227    223   
                }
  228         -
                let input_5 = &_input.float;
  229         -
                let input_5 = input_5
  230         -
                    .as_ref()
  231         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("float", "cannot be empty or unset"))?;
  232         -
                let mut float_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_5);
  233         -
                let float = float_encoder.encode();
  234         -
                if float.is_empty() {
  235         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  236         -
                        "float",
  237         -
                        "cannot be empty or unset",
  238         -
                    ));
         224  +
                if let Some(ref val) = input.float {
         225  +
                    uri = uri.replace(
         226  +
                        "{float}",
         227  +
                        &::aws_smithy_schema::http_protocol::percent_encode(&{
         228  +
                            let s = val.to_string();
         229  +
                            match s.as_str() {
         230  +
                                "inf" => "Infinity".to_string(),
         231  +
                                "-inf" => "-Infinity".to_string(),
         232  +
                                _ => s,
         233  +
                            }
         234  +
                        }),
         235  +
                    );
  239    236   
                }
  240         -
                let input_6 = &_input.double;
  241         -
                let input_6 = input_6
  242         -
                    .as_ref()
  243         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("double", "cannot be empty or unset"))?;
  244         -
                let mut double_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_6);
  245         -
                let double = double_encoder.encode();
  246         -
                if double.is_empty() {
  247         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  248         -
                        "double",
  249         -
                        "cannot be empty or unset",
  250         -
                    ));
         237  +
                if let Some(ref val) = input.double {
         238  +
                    uri = uri.replace(
         239  +
                        "{double}",
         240  +
                        &::aws_smithy_schema::http_protocol::percent_encode(&{
         241  +
                            let s = val.to_string();
         242  +
                            match s.as_str() {
         243  +
                                "inf" => "Infinity".to_string(),
         244  +
                                "-inf" => "-Infinity".to_string(),
         245  +
                                _ => s,
         246  +
                            }
         247  +
                        }),
         248  +
                    );
  251    249   
                }
  252         -
                let input_7 = &_input.boolean;
  253         -
                let input_7 = input_7
  254         -
                    .as_ref()
  255         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("boolean", "cannot be empty or unset"))?;
  256         -
                let mut boolean_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_7);
  257         -
                let boolean = boolean_encoder.encode();
  258         -
                if boolean.is_empty() {
  259         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  260         -
                        "boolean",
  261         -
                        "cannot be empty or unset",
  262         -
                    ));
         250  +
                if let Some(ref val) = input.boolean {
         251  +
                    uri = uri.replace("{boolean}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  263    252   
                }
  264         -
                let input_8 = &_input.timestamp;
  265         -
                let input_8 = input_8
  266         -
                    .as_ref()
  267         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("timestamp", "cannot be empty or unset"))?;
  268         -
                let timestamp = ::aws_smithy_http::label::fmt_timestamp(input_8, ::aws_smithy_types::date_time::Format::DateTime)?;
  269         -
                if timestamp.is_empty() {
  270         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  271         -
                        "timestamp",
  272         -
                        "cannot be empty or unset",
  273         -
                    ));
         253  +
                if let Some(ref val) = input.timestamp {
         254  +
                    uri = uri.replace(
         255  +
                        "{timestamp}",
         256  +
                        &::aws_smithy_schema::http_protocol::percent_encode(
         257  +
                            &val.fmt(::aws_smithy_types::date_time::Format::DateTime).expect("valid timestamp"),
         258  +
                        ),
         259  +
                    );
  274    260   
                }
  275         -
                ::std::write!(
  276         -
                    output,
  277         -
                    "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}",
  278         -
                    string = string,
  279         -
                    short = short,
  280         -
                    integer = integer,
  281         -
                    long = long,
  282         -
                    float = float,
  283         -
                    double = double,
  284         -
                    boolean = boolean,
  285         -
                    timestamp = timestamp
  286         -
                )
  287         -
                .expect("formatting should succeed");
  288         -
                ::std::result::Result::Ok(())
  289         -
            }
  290         -
            #[allow(clippy::unnecessary_wraps)]
  291         -
            fn update_http_builder(
  292         -
                input: &crate::operation::http_request_with_labels::HttpRequestWithLabelsInput,
  293         -
                builder: ::http_1x::request::Builder,
  294         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  295         -
                let mut uri = ::std::string::String::new();
  296         -
                uri_base(input, &mut uri)?;
  297         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         261  +
                if !query_params.is_empty() {
         262  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         263  +
                    let pairs: Vec<String> = query_params
         264  +
                        .iter()
         265  +
                        .map(|(k, v)| {
         266  +
                            format!(
         267  +
                                "{}={}",
         268  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         269  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         270  +
                            )
         271  +
                        })
         272  +
                        .collect();
         273  +
                    uri.push_str(&pairs.join("&"));
         274  +
                }
         275  +
                request.set_uri(uri.as_str()).expect("valid URI");
  298    276   
            }
  299         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  300         -
            builder
  301         -
        };
  302         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  303    277   
  304         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         278  +
            return ::std::result::Result::Ok(request);
         279  +
        } else {
         280  +
            let mut request = protocol
         281  +
                .serialize_request(&input, HttpRequestWithLabels::INPUT_SCHEMA, "", _cfg)
         282  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         283  +
         284  +
            return ::std::result::Result::Ok(request);
         285  +
        }
  305    286   
    }
  306    287   
}
  307    288   
#[derive(Debug)]
  308    289   
struct HttpRequestWithLabelsEndpointParamsInterceptor;
  309    290   
  310    291   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpRequestWithLabelsEndpointParamsInterceptor {
  311    292   
    fn name(&self) -> &'static str {
  312    293   
        "HttpRequestWithLabelsEndpointParamsInterceptor"
  313    294   
    }
  314    295   

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_labels/_http_request_with_labels_input.rs

@@ -133,133 +279,303 @@
  153    153   
    &[
  154    154   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_STRING,
  155    155   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_SHORT,
  156    156   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_INTEGER,
  157    157   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_LONG,
  158    158   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_FLOAT,
  159    159   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_DOUBLE,
  160    160   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_BOOLEAN,
  161    161   
        &HTTPREQUESTWITHLABELSINPUT_MEMBER_TIMESTAMP,
  162    162   
    ],
  163         -
);
         163  +
)
         164  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
         165  +
    "GET",
         166  +
    "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}",
         167  +
    None,
         168  +
));
  164    169   
impl HttpRequestWithLabelsInput {
  165    170   
    /// The schema for this shape.
  166    171   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPREQUESTWITHLABELSINPUT_SCHEMA;
  167    172   
}
  168    173   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpRequestWithLabelsInput {
  169    174   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  170    175   
    fn serialize_members(
  171    176   
        &self,
  172    177   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  173    178   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  174    179   
        if let Some(ref val) = self.string {
  175    180   
            ser.write_string(&HTTPREQUESTWITHLABELSINPUT_MEMBER_STRING, val)?;
  176    181   
        }
  177    182   
        if let Some(ref val) = self.short {
  178    183   
            ser.write_short(&HTTPREQUESTWITHLABELSINPUT_MEMBER_SHORT, *val)?;
  179    184   
        }
  180    185   
        if let Some(ref val) = self.integer {
  181    186   
            ser.write_integer(&HTTPREQUESTWITHLABELSINPUT_MEMBER_INTEGER, *val)?;
  182    187   
        }
  183    188   
        if let Some(ref val) = self.long {
  184    189   
            ser.write_long(&HTTPREQUESTWITHLABELSINPUT_MEMBER_LONG, *val)?;
  185    190   
        }
  186    191   
        if let Some(ref val) = self.float {
  187    192   
            ser.write_float(&HTTPREQUESTWITHLABELSINPUT_MEMBER_FLOAT, *val)?;
  188    193   
        }
  189    194   
        if let Some(ref val) = self.double {
  190    195   
            ser.write_double(&HTTPREQUESTWITHLABELSINPUT_MEMBER_DOUBLE, *val)?;
  191    196   
        }
  192    197   
        if let Some(ref val) = self.boolean {
  193    198   
            ser.write_boolean(&HTTPREQUESTWITHLABELSINPUT_MEMBER_BOOLEAN, *val)?;
  194    199   
        }
  195    200   
        if let Some(ref val) = self.timestamp {
  196    201   
            ser.write_timestamp(&HTTPREQUESTWITHLABELSINPUT_MEMBER_TIMESTAMP, val)?;
  197    202   
        }
  198    203   
        Ok(())
  199    204   
    }
  200    205   
}
  201    206   
impl HttpRequestWithLabelsInput {
  202    207   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  203         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  204         -
        deserializer: &mut D,
         208  +
    pub fn deserialize(
         209  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  205    210   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  206    211   
        #[allow(unused_variables, unused_mut)]
  207    212   
        let mut builder = Self::builder();
  208    213   
        #[allow(
  209    214   
            unused_variables,
  210    215   
            unreachable_code,
  211    216   
            clippy::single_match,
  212    217   
            clippy::match_single_binding,
  213    218   
            clippy::diverging_sub_expression
  214    219   
        )]
  215         -
        deserializer.read_struct(&HTTPREQUESTWITHLABELSINPUT_SCHEMA, (), |_, member, deser| {
         220  +
        deserializer.read_struct(&HTTPREQUESTWITHLABELSINPUT_SCHEMA, &mut |member, deser| {
  216    221   
            match member.member_index() {
  217    222   
                Some(0) => {
  218    223   
                    builder.string = Some(deser.read_string(member)?);
  219    224   
                }
  220    225   
                Some(1) => {
  221    226   
                    builder.short = Some(deser.read_short(member)?);
  222    227   
                }
  223    228   
                Some(2) => {
  224    229   
                    builder.integer = Some(deser.read_integer(member)?);
  225    230   
                }
  226    231   
                Some(3) => {
  227    232   
                    builder.long = Some(deser.read_long(member)?);
  228    233   
                }
  229    234   
                Some(4) => {
  230    235   
                    builder.float = Some(deser.read_float(member)?);
  231    236   
                }
  232    237   
                Some(5) => {
  233    238   
                    builder.double = Some(deser.read_double(member)?);
  234    239   
                }
  235    240   
                Some(6) => {
  236    241   
                    builder.boolean = Some(deser.read_boolean(member)?);
  237    242   
                }
  238    243   
                Some(7) => {
  239    244   
                    builder.timestamp = Some(deser.read_timestamp(member)?);
  240    245   
                }
  241    246   
                _ => {}
  242    247   
            }
  243    248   
            Ok(())
  244    249   
        })?;
         250  +
        builder.string = builder.string.or(Some(String::new()));
         251  +
        builder.short = builder.short.or(Some(0i16));
         252  +
        builder.integer = builder.integer.or(Some(0i32));
         253  +
        builder.long = builder.long.or(Some(0i64));
         254  +
        builder.float = builder.float.or(Some(0.0f32));
         255  +
        builder.double = builder.double.or(Some(0.0f64));
         256  +
        builder.boolean = builder.boolean.or(Some(false));
         257  +
        builder.timestamp = builder.timestamp.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
  245    258   
        builder
  246    259   
            .build()
  247    260   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  248    261   
    }
  249    262   
}
         263  +
impl HttpRequestWithLabelsInput {
         264  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         265  +
    pub fn deserialize_with_response(
         266  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         267  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         268  +
        _status: u16,
         269  +
        _body: &[u8],
         270  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         271  +
        Self::deserialize(deserializer)
         272  +
    }
         273  +
}
  250    274   
impl HttpRequestWithLabelsInput {
  251    275   
    /// Creates a new builder-style object to manufacture [`HttpRequestWithLabelsInput`](crate::operation::http_request_with_labels::HttpRequestWithLabelsInput).
  252    276   
    pub fn builder() -> crate::operation::http_request_with_labels::builders::HttpRequestWithLabelsInputBuilder {
  253    277   
        crate::operation::http_request_with_labels::builders::HttpRequestWithLabelsInputBuilder::default()
  254    278   
    }
  255    279   
}
  256    280   
  257    281   
/// A builder for [`HttpRequestWithLabelsInput`](crate::operation::http_request_with_labels::HttpRequestWithLabelsInput).
  258    282   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  259    283   
#[non_exhaustive]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_labels/_http_request_with_labels_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 HttpRequestWithLabelsOutput {
   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(&HTTPREQUESTWITHLABELSOUTPUT_SCHEMA, (), |_, member, deser| {
          40  +
        deserializer.read_struct(&HTTPREQUESTWITHLABELSOUTPUT_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 HttpRequestWithLabelsOutput {
          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 HttpRequestWithLabelsOutput {
   50     61   
    /// Creates a new builder-style object to manufacture [`HttpRequestWithLabelsOutput`](crate::operation::http_request_with_labels::HttpRequestWithLabelsOutput).
   51     62   
    pub fn builder() -> crate::operation::http_request_with_labels::builders::HttpRequestWithLabelsOutputBuilder {
   52     63   
        crate::operation::http_request_with_labels::builders::HttpRequestWithLabelsOutputBuilder::default()
   53     64   
    }
   54     65   
}
   55     66   
   56     67   
/// A builder for [`HttpRequestWithLabelsOutput`](crate::operation::http_request_with_labels::HttpRequestWithLabelsOutput).
   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/rest_json/rust-client-codegen/src/operation/http_request_with_labels_and_timestamp_format.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_labels_and_timestamp_format/_http_request_with_labels_and_timestamp_format_input.rs

@@ -34,34 +260,274 @@
   54     54   
    "HttpRequestWithLabelsAndTimestampFormatInput",
   55     55   
);
   56     56   
static HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_EPOCH_SECONDS: ::aws_smithy_schema::Schema =
   57     57   
    ::aws_smithy_schema::Schema::new_member(
   58     58   
        ::aws_smithy_schema::ShapeId::from_static(
   59     59   
            "aws.protocoltests.restjson.synthetic#HttpRequestWithLabelsAndTimestampFormatInput$memberEpochSeconds",
   60     60   
            "aws.protocoltests.restjson.synthetic",
   61     61   
            "HttpRequestWithLabelsAndTimestampFormatInput",
   62     62   
        ),
   63     63   
        ::aws_smithy_schema::ShapeType::Timestamp,
   64         -
        "member_epoch_seconds",
          64  +
        "memberEpochSeconds",
   65     65   
        0,
   66     66   
    )
   67     67   
    .with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds)
   68     68   
    .with_http_label();
   69     69   
static HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_HTTP_DATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   70     70   
    ::aws_smithy_schema::ShapeId::from_static(
   71     71   
        "aws.protocoltests.restjson.synthetic#HttpRequestWithLabelsAndTimestampFormatInput$memberHttpDate",
   72     72   
        "aws.protocoltests.restjson.synthetic",
   73     73   
        "HttpRequestWithLabelsAndTimestampFormatInput",
   74     74   
    ),
   75     75   
    ::aws_smithy_schema::ShapeType::Timestamp,
   76         -
    "member_http_date",
          76  +
    "memberHttpDate",
   77     77   
    1,
   78     78   
)
   79     79   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate)
   80     80   
.with_http_label();
   81     81   
static HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_DATE_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   82     82   
    ::aws_smithy_schema::ShapeId::from_static(
   83     83   
        "aws.protocoltests.restjson.synthetic#HttpRequestWithLabelsAndTimestampFormatInput$memberDateTime",
   84     84   
        "aws.protocoltests.restjson.synthetic",
   85     85   
        "HttpRequestWithLabelsAndTimestampFormatInput",
   86     86   
    ),
   87     87   
    ::aws_smithy_schema::ShapeType::Timestamp,
   88         -
    "member_date_time",
          88  +
    "memberDateTime",
   89     89   
    2,
   90     90   
)
   91     91   
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime)
   92     92   
.with_http_label();
   93     93   
static HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_DEFAULT_FORMAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   94     94   
    ::aws_smithy_schema::ShapeId::from_static(
   95     95   
        "aws.protocoltests.restjson.synthetic#HttpRequestWithLabelsAndTimestampFormatInput$defaultFormat",
   96     96   
        "aws.protocoltests.restjson.synthetic",
   97     97   
        "HttpRequestWithLabelsAndTimestampFormatInput",
   98     98   
    ),
   99     99   
    ::aws_smithy_schema::ShapeType::Timestamp,
  100         -
    "default_format",
         100  +
    "defaultFormat",
  101    101   
    3,
  102    102   
)
  103    103   
.with_http_label();
  104    104   
static HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_EPOCH_SECONDS: ::aws_smithy_schema::Schema =
  105    105   
    ::aws_smithy_schema::Schema::new_member(
  106    106   
        ::aws_smithy_schema::ShapeId::from_static(
  107    107   
            "aws.protocoltests.restjson.synthetic#HttpRequestWithLabelsAndTimestampFormatInput$targetEpochSeconds",
  108    108   
            "aws.protocoltests.restjson.synthetic",
  109    109   
            "HttpRequestWithLabelsAndTimestampFormatInput",
  110    110   
        ),
  111    111   
        ::aws_smithy_schema::ShapeType::Timestamp,
  112         -
        "target_epoch_seconds",
         112  +
        "targetEpochSeconds",
  113    113   
        4,
  114    114   
    )
  115         -
    .with_http_label();
         115  +
    .with_http_label()
         116  +
    .with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::EpochSeconds);
  116    117   
static HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_HTTP_DATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  117    118   
    ::aws_smithy_schema::ShapeId::from_static(
  118    119   
        "aws.protocoltests.restjson.synthetic#HttpRequestWithLabelsAndTimestampFormatInput$targetHttpDate",
  119    120   
        "aws.protocoltests.restjson.synthetic",
  120    121   
        "HttpRequestWithLabelsAndTimestampFormatInput",
  121    122   
    ),
  122    123   
    ::aws_smithy_schema::ShapeType::Timestamp,
  123         -
    "target_http_date",
         124  +
    "targetHttpDate",
  124    125   
    5,
  125    126   
)
  126         -
.with_http_label();
         127  +
.with_http_label()
         128  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::HttpDate);
  127    129   
static HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_DATE_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  128    130   
    ::aws_smithy_schema::ShapeId::from_static(
  129    131   
        "aws.protocoltests.restjson.synthetic#HttpRequestWithLabelsAndTimestampFormatInput$targetDateTime",
  130    132   
        "aws.protocoltests.restjson.synthetic",
  131    133   
        "HttpRequestWithLabelsAndTimestampFormatInput",
  132    134   
    ),
  133    135   
    ::aws_smithy_schema::ShapeType::Timestamp,
  134         -
    "target_date_time",
         136  +
    "targetDateTime",
  135    137   
    6,
  136    138   
)
  137         -
.with_http_label();
         139  +
.with_http_label()
         140  +
.with_timestamp_format(aws_smithy_schema::traits::TimestampFormat::DateTime);
  138    141   
static HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  139         -
    HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_SCHEMA_ID,
  140         -
    ::aws_smithy_schema::ShapeType::Structure,
  141         -
    &[
  142         -
        &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_EPOCH_SECONDS,
  143         -
        &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_HTTP_DATE,
  144         -
        &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_DATE_TIME,
  145         -
        &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_DEFAULT_FORMAT,
  146         -
        &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_EPOCH_SECONDS,
  147         -
        &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_HTTP_DATE,
  148         -
        &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_DATE_TIME,
  149         -
    ],
  150         -
);
         142  +
                            HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_SCHEMA_ID,
         143  +
                            ::aws_smithy_schema::ShapeType::Structure,
         144  +
                            &[&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_EPOCH_SECONDS, &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_HTTP_DATE, &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_DATE_TIME, &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_DEFAULT_FORMAT, &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_EPOCH_SECONDS, &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_HTTP_DATE, &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_DATE_TIME],
         145  +
                        )
         146  +
    .with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}", None));
  151    147   
impl HttpRequestWithLabelsAndTimestampFormatInput {
  152    148   
    /// The schema for this shape.
  153    149   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_SCHEMA;
  154    150   
}
  155    151   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpRequestWithLabelsAndTimestampFormatInput {
  156    152   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  157    153   
    fn serialize_members(
  158    154   
        &self,
  159    155   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  160    156   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  161    157   
        if let Some(ref val) = self.member_epoch_seconds {
  162    158   
            ser.write_timestamp(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_EPOCH_SECONDS, val)?;
  163    159   
        }
  164    160   
        if let Some(ref val) = self.member_http_date {
  165    161   
            ser.write_timestamp(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_HTTP_DATE, val)?;
  166    162   
        }
  167    163   
        if let Some(ref val) = self.member_date_time {
  168    164   
            ser.write_timestamp(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_MEMBER_DATE_TIME, val)?;
  169    165   
        }
  170    166   
        if let Some(ref val) = self.default_format {
  171    167   
            ser.write_timestamp(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_DEFAULT_FORMAT, val)?;
  172    168   
        }
  173    169   
        if let Some(ref val) = self.target_epoch_seconds {
  174    170   
            ser.write_timestamp(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_EPOCH_SECONDS, val)?;
  175    171   
        }
  176    172   
        if let Some(ref val) = self.target_http_date {
  177    173   
            ser.write_timestamp(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_HTTP_DATE, val)?;
  178    174   
        }
  179    175   
        if let Some(ref val) = self.target_date_time {
  180    176   
            ser.write_timestamp(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_MEMBER_TARGET_DATE_TIME, val)?;
  181    177   
        }
  182    178   
        Ok(())
  183    179   
    }
  184    180   
}
  185    181   
impl HttpRequestWithLabelsAndTimestampFormatInput {
  186    182   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  187         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  188         -
        deserializer: &mut D,
         183  +
    pub fn deserialize(
         184  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  189    185   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  190    186   
        #[allow(unused_variables, unused_mut)]
  191    187   
        let mut builder = Self::builder();
  192    188   
        #[allow(
  193    189   
            unused_variables,
  194    190   
            unreachable_code,
  195    191   
            clippy::single_match,
  196    192   
            clippy::match_single_binding,
  197    193   
            clippy::diverging_sub_expression
  198    194   
        )]
  199         -
        deserializer.read_struct(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_SCHEMA, (), |_, member, deser| {
         195  +
        deserializer.read_struct(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATINPUT_SCHEMA, &mut |member, deser| {
  200    196   
            match member.member_index() {
  201    197   
                Some(0) => {
  202    198   
                    builder.member_epoch_seconds = Some(deser.read_timestamp(member)?);
  203    199   
                }
  204    200   
                Some(1) => {
  205    201   
                    builder.member_http_date = Some(deser.read_timestamp(member)?);
  206    202   
                }
  207    203   
                Some(2) => {
  208    204   
                    builder.member_date_time = Some(deser.read_timestamp(member)?);
  209    205   
                }
  210    206   
                Some(3) => {
  211    207   
                    builder.default_format = Some(deser.read_timestamp(member)?);
  212    208   
                }
  213    209   
                Some(4) => {
  214    210   
                    builder.target_epoch_seconds = Some(deser.read_timestamp(member)?);
  215    211   
                }
  216    212   
                Some(5) => {
  217    213   
                    builder.target_http_date = Some(deser.read_timestamp(member)?);
  218    214   
                }
  219    215   
                Some(6) => {
  220    216   
                    builder.target_date_time = Some(deser.read_timestamp(member)?);
  221    217   
                }
  222    218   
                _ => {}
  223    219   
            }
  224    220   
            Ok(())
  225    221   
        })?;
         222  +
        builder.member_epoch_seconds = builder.member_epoch_seconds.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
         223  +
        builder.member_http_date = builder.member_http_date.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
         224  +
        builder.member_date_time = builder.member_date_time.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
         225  +
        builder.default_format = builder.default_format.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
         226  +
        builder.target_epoch_seconds = builder.target_epoch_seconds.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
         227  +
        builder.target_http_date = builder.target_http_date.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
         228  +
        builder.target_date_time = builder.target_date_time.or(Some(::aws_smithy_types::DateTime::from_secs(0)));
  226    229   
        builder
  227    230   
            .build()
  228    231   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  229    232   
    }
  230    233   
}
         234  +
impl HttpRequestWithLabelsAndTimestampFormatInput {
         235  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         236  +
    pub fn deserialize_with_response(
         237  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         238  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         239  +
        _status: u16,
         240  +
        _body: &[u8],
         241  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         242  +
        Self::deserialize(deserializer)
         243  +
    }
         244  +
}
  231    245   
impl HttpRequestWithLabelsAndTimestampFormatInput {
  232    246   
    /// Creates a new builder-style object to manufacture [`HttpRequestWithLabelsAndTimestampFormatInput`](crate::operation::http_request_with_labels_and_timestamp_format::HttpRequestWithLabelsAndTimestampFormatInput).
  233    247   
    pub fn builder() -> crate::operation::http_request_with_labels_and_timestamp_format::builders::HttpRequestWithLabelsAndTimestampFormatInputBuilder
  234    248   
    {
  235    249   
        crate::operation::http_request_with_labels_and_timestamp_format::builders::HttpRequestWithLabelsAndTimestampFormatInputBuilder::default()
  236    250   
    }
  237    251   
}
  238    252   
  239    253   
/// A builder for [`HttpRequestWithLabelsAndTimestampFormatInput`](crate::operation::http_request_with_labels_and_timestamp_format::HttpRequestWithLabelsAndTimestampFormatInput).
  240    254   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_labels_and_timestamp_format/_http_request_with_labels_and_timestamp_format_output.rs

@@ -1,1 +69,80 @@
   21     21   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   22     22   
    fn serialize_members(
   23     23   
        &self,
   24     24   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   25     25   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   26     26   
        Ok(())
   27     27   
    }
   28     28   
}
   29     29   
impl HttpRequestWithLabelsAndTimestampFormatOutput {
   30     30   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   31         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   32         -
        deserializer: &mut D,
          31  +
    pub fn deserialize(
          32  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   33     33   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   34     34   
        #[allow(unused_variables, unused_mut)]
   35     35   
        let mut builder = Self::builder();
   36     36   
        #[allow(
   37     37   
            unused_variables,
   38     38   
            unreachable_code,
   39     39   
            clippy::single_match,
   40     40   
            clippy::match_single_binding,
   41     41   
            clippy::diverging_sub_expression
   42     42   
        )]
   43         -
        deserializer.read_struct(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATOUTPUT_SCHEMA, (), |_, member, deser| {
          43  +
        deserializer.read_struct(&HTTPREQUESTWITHLABELSANDTIMESTAMPFORMATOUTPUT_SCHEMA, &mut |member, deser| {
   44     44   
            match member.member_index() {
   45     45   
                _ => {}
   46     46   
            }
   47     47   
            Ok(())
   48     48   
        })?;
   49     49   
        Ok(builder.build())
   50     50   
    }
   51     51   
}
          52  +
impl HttpRequestWithLabelsAndTimestampFormatOutput {
          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  +
        Ok(Self::builder().build())
          61  +
    }
          62  +
}
   52     63   
impl HttpRequestWithLabelsAndTimestampFormatOutput {
   53     64   
    /// Creates a new builder-style object to manufacture [`HttpRequestWithLabelsAndTimestampFormatOutput`](crate::operation::http_request_with_labels_and_timestamp_format::HttpRequestWithLabelsAndTimestampFormatOutput).
   54     65   
    pub fn builder() -> crate::operation::http_request_with_labels_and_timestamp_format::builders::HttpRequestWithLabelsAndTimestampFormatOutputBuilder
   55     66   
    {
   56     67   
        crate::operation::http_request_with_labels_and_timestamp_format::builders::HttpRequestWithLabelsAndTimestampFormatOutputBuilder::default()
   57     68   
    }
   58     69   
}
   59     70   
   60     71   
/// A builder for [`HttpRequestWithLabelsAndTimestampFormatOutput`](crate::operation::http_request_with_labels_and_timestamp_format::HttpRequestWithLabelsAndTimestampFormatOutput).
   61     72   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_regex_literal.rs

@@ -1,1 +40,46 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `HttpRequestWithRegexLiteral`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpRequestWithRegexLiteral;
    6      6   
impl HttpRequestWithRegexLiteral {
    7      7   
    /// Creates a new `HttpRequestWithRegexLiteral`
    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 =
          13  +
        crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
          16  +
        crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralOutput::SCHEMA;
   11     17   
    pub(crate) async fn orchestrate(
   12     18   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     19   
        input: crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralInput,
   14     20   
    ) -> ::std::result::Result<
   15     21   
        crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralOutput,
   16     22   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     23   
            crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralError,
   18     24   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     25   
        >,
   20     26   
    > {
@@ -110,116 +239,271 @@
  130    136   
                crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralError,
  131    137   
            >::new());
  132    138   
  133    139   
        ::std::borrow::Cow::Owned(rcb)
  134    140   
    }
  135    141   
}
  136    142   
  137    143   
#[derive(Debug)]
  138    144   
struct HttpRequestWithRegexLiteralResponseDeserializer;
  139    145   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpRequestWithRegexLiteralResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         146  +
    fn deserialize_nonstreaming_with_config(
  141    147   
        &self,
  142    148   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         149  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  143    150   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  144    151   
        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    152   
        #[allow(unused_mut)]
  148    153   
        let mut force_error = false;
  149    154   
  150         -
        let parse_result = if !success && status != 200 || force_error {
  151         -
            crate::protocol_serde::shape_http_request_with_regex_literal::de_http_request_with_regex_literal_http_error(status, headers, body)
         155  +
        if !success && status != 200 || force_error {
         156  +
            let headers = response.headers();
         157  +
            let body = response.body().bytes().expect("body loaded");
         158  +
            #[allow(unused_mut)]
         159  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         160  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         161  +
            })?;
         162  +
         163  +
            let generic = generic_builder.build();
         164  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         165  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
         166  +
                    crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralError::generic(generic),
         167  +
                ),
         168  +
            ))
  152    169   
        } else {
  153         -
            crate::protocol_serde::shape_http_request_with_regex_literal::de_http_request_with_regex_literal_http_response(status, headers, body)
  154         -
        };
  155         -
        crate::protocol_serde::type_erase_result(parse_result)
         170  +
            let protocol = _cfg
         171  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         172  +
                .expect("a SharedClientProtocol is required");
         173  +
            let mut deser = protocol
         174  +
                .deserialize_response(response, HttpRequestWithRegexLiteral::OUTPUT_SCHEMA, _cfg)
         175  +
                .map_err(|e| {
         176  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         177  +
                })?;
         178  +
            let body = response.body().bytes().expect("body loaded");
         179  +
            let output = crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralOutput::deserialize_with_response(
         180  +
                &mut *deser,
         181  +
                response.headers(),
         182  +
                response.status().into(),
         183  +
                body,
         184  +
            )
         185  +
            .map_err(|e| {
         186  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         187  +
            })?;
         188  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         189  +
        }
  156    190   
    }
  157    191   
}
  158    192   
#[derive(Debug)]
  159    193   
struct HttpRequestWithRegexLiteralRequestSerializer;
  160    194   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpRequestWithRegexLiteralRequestSerializer {
  161    195   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  162    196   
    fn serialize_input(
  163    197   
        &self,
  164    198   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  165    199   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  166    200   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  167    201   
        let input = input
  168    202   
            .downcast::<crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralInput>()
  169    203   
            .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::http_request_with_regex_literal::HttpRequestWithRegexLiteralInput,
  178         -
                output: &mut ::std::string::String,
  179         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180         -
                use ::std::fmt::Write as _;
  181         -
                let input_1 = &_input.str;
  182         -
                let input_1 = input_1
  183         -
                    .as_ref()
  184         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("str", "cannot be empty or unset"))?;
  185         -
                let str = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  186         -
                if str.is_empty() {
  187         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  188         -
                        "str",
  189         -
                        "cannot be empty or unset",
  190         -
                    ));
         204  +
        let protocol = _cfg
         205  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         206  +
            .expect("a SharedClientProtocol is required");
         207  +
        if protocol.supports_http_bindings() {
         208  +
            let mut request = protocol
         209  +
                .serialize_body(&input, HttpRequestWithRegexLiteral::INPUT_SCHEMA, "", _cfg)
         210  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         211  +
            {
         212  +
                let mut uri = "/ReDosLiteral/{str}/(a+)+".to_string();
         213  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         214  +
                if let Some(ref val) = input.str {
         215  +
                    uri = uri.replace("{str}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  191    216   
                }
  192         -
                ::std::write!(output, "/ReDosLiteral/{str}/(a+)+", str = str).expect("formatting should succeed");
  193         -
                ::std::result::Result::Ok(())
  194         -
            }
  195         -
            #[allow(clippy::unnecessary_wraps)]
  196         -
            fn update_http_builder(
  197         -
                input: &crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralInput,
  198         -
                builder: ::http_1x::request::Builder,
  199         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  200         -
                let mut uri = ::std::string::String::new();
  201         -
                uri_base(input, &mut uri)?;
  202         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
         217  +
                if !query_params.is_empty() {
         218  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         219  +
                    let pairs: Vec<String> = query_params
         220  +
                        .iter()
         221  +
                        .map(|(k, v)| {
         222  +
                            format!(
         223  +
                                "{}={}",
         224  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         225  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         226  +
                            )
         227  +
                        })
         228  +
                        .collect();
         229  +
                    uri.push_str(&pairs.join("&"));
         230  +
                }
         231  +
                request.set_uri(uri.as_str()).expect("valid URI");
  203    232   
            }
  204         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  205         -
            builder
  206         -
        };
  207         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
  208    233   
  209         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         234  +
            return ::std::result::Result::Ok(request);
         235  +
        } else {
         236  +
            let mut request = protocol
         237  +
                .serialize_request(&input, HttpRequestWithRegexLiteral::INPUT_SCHEMA, "", _cfg)
         238  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         239  +
         240  +
            return ::std::result::Result::Ok(request);
         241  +
        }
  210    242   
    }
  211    243   
}
  212    244   
#[derive(Debug)]
  213    245   
struct HttpRequestWithRegexLiteralEndpointParamsInterceptor;
  214    246   
  215    247   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpRequestWithRegexLiteralEndpointParamsInterceptor {
  216    248   
    fn name(&self) -> &'static str {
  217    249   
        "HttpRequestWithRegexLiteralEndpointParamsInterceptor"
  218    250   
    }
  219    251   

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_regex_literal/_http_request_with_regex_literal_input.rs

@@ -5,5 +109,122 @@
   25     25   
    ),
   26     26   
    ::aws_smithy_schema::ShapeType::String,
   27     27   
    "str",
   28     28   
    0,
   29     29   
)
   30     30   
.with_http_label();
   31     31   
static HTTPREQUESTWITHREGEXLITERALINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     32   
    HTTPREQUESTWITHREGEXLITERALINPUT_SCHEMA_ID,
   33     33   
    ::aws_smithy_schema::ShapeType::Structure,
   34     34   
    &[&HTTPREQUESTWITHREGEXLITERALINPUT_MEMBER_STR],
   35         -
);
          35  +
)
          36  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/ReDosLiteral/{str}/(a+)+", None));
   36     37   
impl HttpRequestWithRegexLiteralInput {
   37     38   
    /// The schema for this shape.
   38     39   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPREQUESTWITHREGEXLITERALINPUT_SCHEMA;
   39     40   
}
   40     41   
impl ::aws_smithy_schema::serde::SerializableStruct for HttpRequestWithRegexLiteralInput {
   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.str {
   47     48   
            ser.write_string(&HTTPREQUESTWITHREGEXLITERALINPUT_MEMBER_STR, val)?;
   48     49   
        }
   49     50   
        Ok(())
   50     51   
    }
   51     52   
}
   52     53   
impl HttpRequestWithRegexLiteralInput {
   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(&HTTPREQUESTWITHREGEXLITERALINPUT_SCHEMA, (), |_, member, deser| {
          67  +
        deserializer.read_struct(&HTTPREQUESTWITHREGEXLITERALINPUT_SCHEMA, &mut |member, deser| {
   67     68   
            match member.member_index() {
   68     69   
                Some(0) => {
   69     70   
                    builder.str = Some(deser.read_string(member)?);
   70     71   
                }
   71     72   
                _ => {}
   72     73   
            }
   73     74   
            Ok(())
   74     75   
        })?;
          76  +
        builder.str = builder.str.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 HttpRequestWithRegexLiteralInput {
          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 HttpRequestWithRegexLiteralInput {
   81     94   
    /// Creates a new builder-style object to manufacture [`HttpRequestWithRegexLiteralInput`](crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralInput).
   82     95   
    pub fn builder() -> crate::operation::http_request_with_regex_literal::builders::HttpRequestWithRegexLiteralInputBuilder {
   83     96   
        crate::operation::http_request_with_regex_literal::builders::HttpRequestWithRegexLiteralInputBuilder::default()
   84     97   
    }
   85     98   
}
   86     99   
   87    100   
/// A builder for [`HttpRequestWithRegexLiteralInput`](crate::operation::http_request_with_regex_literal::HttpRequestWithRegexLiteralInput).
   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/rest_json/rust-client-codegen/src/operation/http_request_with_regex_literal/_http_request_with_regex_literal_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_response_code.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 `HttpResponseCode`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct HttpResponseCode;
    6      6   
impl HttpResponseCode {
    7      7   
    /// Creates a new `HttpResponseCode`
    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::http_response_code::HttpResponseCodeInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::http_response_code::HttpResponseCodeOutput::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::http_response_code::HttpResponseCodeInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::http_response_code::HttpResponseCodeOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::http_response_code::HttpResponseCodeError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -110,114 +228,239 @@
  130    134   
                crate::operation::http_response_code::HttpResponseCodeError,
  131    135   
            >::new());
  132    136   
  133    137   
        ::std::borrow::Cow::Owned(rcb)
  134    138   
    }
  135    139   
}
  136    140   
  137    141   
#[derive(Debug)]
  138    142   
struct HttpResponseCodeResponseDeserializer;
  139    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpResponseCodeResponseDeserializer {
  140         -
    fn deserialize_nonstreaming(
         144  +
    fn deserialize_nonstreaming_with_config(
  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_http_response_code::de_http_response_code_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::http_response_code::HttpResponseCodeError::generic(generic),
         165  +
                ),
         166  +
            ))
  152    167   
        } else {
  153         -
            crate::protocol_serde::shape_http_response_code::de_http_response_code_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, HttpResponseCode::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::http_response_code::HttpResponseCodeOutput::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 HttpResponseCodeRequestSerializer;
  160    192   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpResponseCodeRequestSerializer {
  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::http_response_code::HttpResponseCodeInput>()
  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::http_response_code::HttpResponseCodeInput,
  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, "/HttpResponseCode").expect("formatting should succeed");
  182         -
                ::std::result::Result::Ok(())
  183         -
            }
  184         -
            #[allow(clippy::unnecessary_wraps)]
  185         -
            fn update_http_builder(
  186         -
                input: &crate::operation::http_response_code::HttpResponseCodeInput,
  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("PUT").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, HttpResponseCode::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 HttpResponseCodeEndpointParamsInterceptor;
  203    214   
  204    215   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpResponseCodeEndpointParamsInterceptor {
  205    216   
    fn name(&self) -> &'static str {
  206    217   
        "HttpResponseCodeEndpointParamsInterceptor"
  207    218   
    }
  208    219   
@@ -247,258 +350,381 @@
  267    278   
            .expect("the config must have a deserializer");
  268    279   
  269    280   
        let parsed = de.deserialize_streaming(&mut http_response);
  270    281   
        let parsed = parsed.unwrap_or_else(|| {
  271    282   
            let http_response = http_response.map(|body| {
  272    283   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  273    284   
                    body.bytes().unwrap(),
  274    285   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  275    286   
                )))
  276    287   
            });
  277         -
            de.deserialize_nonstreaming(&http_response)
         288  +
            // Build a config bag with the protocol for schema-based deserialization
         289  +
            #[allow(unused_mut)]
         290  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         291  +
            {
         292  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         293  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         294  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         295  +
                ));
         296  +
                test_cfg.push_shared_layer(layer.freeze());
         297  +
            }
         298  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  278    299   
        });
  279    300   
        let parsed = parsed
  280    301   
            .expect("should be successful response")
  281    302   
            .downcast::<crate::operation::http_response_code::HttpResponseCodeOutput>()
  282    303   
            .unwrap();
  283    304   
        ::pretty_assertions::assert_eq!(parsed.status, expected_output.status, "Unexpected value for `status`");
  284    305   
    }
  285    306   
  286    307   
    /// This test ensures that clients gracefully handle cases where
  287    308   
    /// the service responds with no payload rather than an empty JSON
  288    309   
    /// object.
  289    310   
    /// Test ID: RestJsonHttpResponseCodeWithNoPayload
  290    311   
    #[::tokio::test]
  291    312   
    #[::tracing_test::traced_test]
  292    313   
    async fn rest_json_http_response_code_with_no_payload_response() {
  293    314   
        let expected_output = crate::operation::http_response_code::HttpResponseCodeOutput::builder()
  294    315   
            .set_status(::std::option::Option::Some(201))
  295    316   
            .build();
  296    317   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  297    318   
            ::http_1x::response::Builder::new()
  298    319   
                .status(201)
  299    320   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  300    321   
                .unwrap(),
  301    322   
        )
  302    323   
        .unwrap();
  303    324   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  304    325   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  305    326   
  306    327   
        let op = crate::operation::http_response_code::HttpResponseCode::new();
  307    328   
        let config = op.config().expect("the operation has config");
  308    329   
        let de = config
  309    330   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  310    331   
            .expect("the config must have a deserializer");
  311    332   
  312    333   
        let parsed = de.deserialize_streaming(&mut http_response);
  313    334   
        let parsed = parsed.unwrap_or_else(|| {
  314    335   
            let http_response = http_response.map(|body| {
  315    336   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  316    337   
                    body.bytes().unwrap(),
  317    338   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  318    339   
                )))
  319    340   
            });
  320         -
            de.deserialize_nonstreaming(&http_response)
         341  +
            // Build a config bag with the protocol for schema-based deserialization
         342  +
            #[allow(unused_mut)]
         343  +
            let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
         344  +
            {
         345  +
                let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
         346  +
                layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         347  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
         348  +
                ));
         349  +
                test_cfg.push_shared_layer(layer.freeze());
         350  +
            }
         351  +
            de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
  321    352   
        });
  322    353   
        let parsed = parsed
  323    354   
            .expect("should be successful response")
  324    355   
            .downcast::<crate::operation::http_response_code::HttpResponseCodeOutput>()
  325    356   
            .unwrap();
  326    357   
        ::pretty_assertions::assert_eq!(parsed.status, expected_output.status, "Unexpected value for `status`");
  327    358   
    }
  328    359   
}
  329    360   
  330    361   
/// Error type for the `HttpResponseCodeError` operation.