Client Test

Client Test

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/enum_keys.rs

@@ -145,145 +218,218 @@
  165    165   
                _input: &crate::operation::enum_keys::EnumKeysInput,
  166    166   
                output: &mut ::std::string::String,
  167    167   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  168    168   
                use ::std::fmt::Write as _;
  169    169   
                ::std::write!(output, "/enumkeys").expect("formatting should succeed");
  170    170   
                ::std::result::Result::Ok(())
  171    171   
            }
  172    172   
            #[allow(clippy::unnecessary_wraps)]
  173    173   
            fn update_http_builder(
  174    174   
                input: &crate::operation::enum_keys::EnumKeysInput,
  175         -
                builder: ::http::request::Builder,
  176         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         175  +
                builder: ::http_1x::request::Builder,
         176  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  177    177   
                let mut uri = ::std::string::String::new();
  178    178   
                uri_base(input, &mut uri)?;
  179    179   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  180    180   
            }
  181         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  182         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
         181  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         182  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/xml");
  183    183   
            builder
  184    184   
        };
  185    185   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_enum_keys::ser_enum_keys_op_input(&input)?);
  186    186   
        if let Some(content_length) = body.content_length() {
  187    187   
            let content_length = content_length.to_string();
  188         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         188  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  189    189   
        }
  190    190   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  191    191   
    }
  192    192   
}
  193    193   
#[derive(Debug)]
  194    194   
struct EnumKeysEndpointParamsInterceptor;
  195    195   
  196    196   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EnumKeysEndpointParamsInterceptor {
  197    197   
    fn name(&self) -> &'static str {
  198    198   
        "EnumKeysEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/primitive_int_op_xml.rs

@@ -157,157 +232,232 @@
  177    177   
                _input: &crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlInput,
  178    178   
                output: &mut ::std::string::String,
  179    179   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180    180   
                use ::std::fmt::Write as _;
  181    181   
                ::std::write!(output, "/primitive-document").expect("formatting should succeed");
  182    182   
                ::std::result::Result::Ok(())
  183    183   
            }
  184    184   
            #[allow(clippy::unnecessary_wraps)]
  185    185   
            fn update_http_builder(
  186    186   
                input: &crate::operation::primitive_int_op_xml::PrimitiveIntOpXmlInput,
  187         -
                builder: ::http::request::Builder,
  188         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         187  +
                builder: ::http_1x::request::Builder,
         188  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189    189   
                let mut uri = ::std::string::String::new();
  190    190   
                uri_base(input, &mut uri)?;
  191    191   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192    192   
            }
  193         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  194         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
         193  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         194  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/xml");
  195    195   
            builder
  196    196   
        };
  197    197   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_primitive_int_op_xml::ser_primitive_int_op_xml_op_input(
  198    198   
            &input,
  199    199   
        )?);
  200    200   
        if let Some(content_length) = body.content_length() {
  201    201   
            let content_length = content_length.to_string();
  202         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         202  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  203    203   
        }
  204    204   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  205    205   
    }
  206    206   
}
  207    207   
#[derive(Debug)]
  208    208   
struct PrimitiveIntOpXmlEndpointParamsInterceptor;
  209    209   
  210    210   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PrimitiveIntOpXmlEndpointParamsInterceptor {
  211    211   
    fn name(&self) -> &'static str {
  212    212   
        "PrimitiveIntOpXmlEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/required_member.rs

@@ -151,151 +224,224 @@
  171    171   
                _input: &crate::operation::required_member::RequiredMemberInput,
  172    172   
                output: &mut ::std::string::String,
  173    173   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174    174   
                use ::std::fmt::Write as _;
  175    175   
                ::std::write!(output, "/required-member").expect("formatting should succeed");
  176    176   
                ::std::result::Result::Ok(())
  177    177   
            }
  178    178   
            #[allow(clippy::unnecessary_wraps)]
  179    179   
            fn update_http_builder(
  180    180   
                input: &crate::operation::required_member::RequiredMemberInput,
  181         -
                builder: ::http::request::Builder,
  182         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         181  +
                builder: ::http_1x::request::Builder,
         182  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  183    183   
                let mut uri = ::std::string::String::new();
  184    184   
                uri_base(input, &mut uri)?;
  185    185   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  186    186   
            }
  187         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  188         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
         187  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         188  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/xml");
  189    189   
            builder
  190    190   
        };
  191    191   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_required_member::ser_required_member_op_input(&input)?);
  192    192   
        if let Some(content_length) = body.content_length() {
  193    193   
            let content_length = content_length.to_string();
  194         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         194  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  195    195   
        }
  196    196   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    197   
    }
  198    198   
}
  199    199   
#[derive(Debug)]
  200    200   
struct RequiredMemberEndpointParamsInterceptor;
  201    201   
  202    202   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RequiredMemberEndpointParamsInterceptor {
  203    203   
    fn name(&self) -> &'static str {
  204    204   
        "RequiredMemberEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/string_header.rs

@@ -151,151 +217,217 @@
  171    171   
                _input: &crate::operation::string_header::StringHeaderInput,
  172    172   
                output: &mut ::std::string::String,
  173    173   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174    174   
                use ::std::fmt::Write as _;
  175    175   
                ::std::write!(output, "/StringHeader").expect("formatting should succeed");
  176    176   
                ::std::result::Result::Ok(())
  177    177   
            }
  178    178   
            #[allow(clippy::unnecessary_wraps)]
  179    179   
            fn update_http_builder(
  180    180   
                input: &crate::operation::string_header::StringHeaderInput,
  181         -
                builder: ::http::request::Builder,
  182         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         181  +
                builder: ::http_1x::request::Builder,
         182  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  183    183   
                let mut uri = ::std::string::String::new();
  184    184   
                uri_base(input, &mut uri)?;
  185    185   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  186    186   
            }
  187         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         187  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  188    188   
            builder
  189    189   
        };
  190    190   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  191    191   
  192    192   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  193    193   
    }
  194    194   
}
  195    195   
#[derive(Debug)]
  196    196   
struct StringHeaderEndpointParamsInterceptor;
  197    197   

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/operation/xml_maps_flattened_nested_xml_namespace.rs

@@ -161,161 +236,236 @@
  181    181   
                _input: &crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceInput,
  182    182   
                output: &mut ::std::string::String,
  183    183   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  184    184   
                use ::std::fmt::Write as _;
  185    185   
                ::std::write!(output, "/XmlMapsFlattenedNestedXmlNamespace").expect("formatting should succeed");
  186    186   
                ::std::result::Result::Ok(())
  187    187   
            }
  188    188   
            #[allow(clippy::unnecessary_wraps)]
  189    189   
            fn update_http_builder(
  190    190   
                input: &crate::operation::xml_maps_flattened_nested_xml_namespace::XmlMapsFlattenedNestedXmlNamespaceInput,
  191         -
                builder: ::http::request::Builder,
  192         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         191  +
                builder: ::http_1x::request::Builder,
         192  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  193    193   
                let mut uri = ::std::string::String::new();
  194    194   
                uri_base(input, &mut uri)?;
  195    195   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  196    196   
            }
  197         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  198         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
         197  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         198  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/xml");
  199    199   
            builder
  200    200   
        };
  201    201   
        let body = ::aws_smithy_types::body::SdkBody::from(
  202    202   
            crate::protocol_serde::shape_xml_maps_flattened_nested_xml_namespace::ser_xml_maps_flattened_nested_xml_namespace_op_input(&input)?,
  203    203   
        );
  204    204   
        if let Some(content_length) = body.content_length() {
  205    205   
            let content_length = content_length.to_string();
  206         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         206  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  207    207   
        }
  208    208   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  209    209   
    }
  210    210   
}
  211    211   
#[derive(Debug)]
  212    212   
struct XmlMapsFlattenedNestedXmlNamespaceEndpointParamsInterceptor;
  213    213   
  214    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for XmlMapsFlattenedNestedXmlNamespaceEndpointParamsInterceptor {
  215    215   
    fn name(&self) -> &'static str {
  216    216   
        "XmlMapsFlattenedNestedXmlNamespaceEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/rest_xml_extras/rust-client-codegen/src/serialization_settings.rs

@@ -1,1 +78,83 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/*
    3      3   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4      4   
 * SPDX-License-Identifier: Apache-2.0
    5      5   
 */
    6      6   
    7      7   
#![allow(dead_code)]
    8      8   
    9      9   
use aws_smithy_http::header::set_request_header_if_absent;
   10     10   
use aws_smithy_types::config_bag::{Storable, StoreReplace};
   11         -
use http::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
          11  +
use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
   12     12   
   13     13   
/// Configuration for how default protocol headers are serialized
   14     14   
#[derive(Clone, Debug, Default)]
   15     15   
pub(crate) struct HeaderSerializationSettings {
   16     16   
    omit_default_content_length: bool,
   17     17   
    omit_default_content_type: bool,
   18     18   
}
   19     19   
   20     20   
impl HeaderSerializationSettings {
   21     21   
    /// Creates new [`HeaderSerializationSettings`]
   22     22   
    pub(crate) fn new() -> Self {
   23     23   
        Default::default()
   24     24   
    }
   25     25   
   26     26   
    /// Omit the default `Content-Length` header during serialization
   27     27   
    pub(crate) fn omit_default_content_length(self) -> Self {
   28     28   
        Self {
   29     29   
            omit_default_content_length: true,
   30     30   
            ..self
   31     31   
        }
   32     32   
    }
   33     33   
   34     34   
    /// Omit the default `Content-Type` header during serialization
   35     35   
    pub(crate) fn omit_default_content_type(self) -> Self {
   36     36   
        Self {
   37     37   
            omit_default_content_type: true,
   38     38   
            ..self
   39     39   
        }
   40     40   
    }
   41     41   
   42     42   
    /// Returns true if the given default header name should be serialized
   43     43   
    fn include_header(&self, header: &HeaderName) -> bool {
   44     44   
        (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE)
   45     45   
    }
   46     46   
   47     47   
    /// Sets a default header on the given request builder if it should be serialized
   48         -
    pub(crate) fn set_default_header(&self, mut request: http::request::Builder, header_name: HeaderName, value: &str) -> http::request::Builder {
          48  +
    pub(crate) fn set_default_header(
          49  +
        &self,
          50  +
        mut request: http_1x::request::Builder,
          51  +
        header_name: HeaderName,
          52  +
        value: &str,
          53  +
    ) -> http_1x::request::Builder {
   49     54   
        if self.include_header(&header_name) {
   50     55   
            request = set_request_header_if_absent(request, header_name, value);
   51     56   
        }
   52     57   
        request
   53     58   
    }
   54     59   
}
   55     60   
   56     61   
impl Storable for HeaderSerializationSettings {
   57     62   
    type Storer = StoreReplace<Self>;
   58     63   
}

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/Cargo.toml

@@ -1,1 +53,57 @@
   11     11   
protocol = "aws.protocols#restXml"
   12     12   
[dependencies.aws-smithy-async]
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-async"
   14     14   
[dependencies.aws-smithy-http]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   16     16   
[dependencies.aws-smithy-runtime]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime"
   18     18   
features = ["client"]
   19     19   
[dependencies.aws-smithy-runtime-api]
   20     20   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
   21         -
features = ["client", "http-02x"]
          21  +
features = ["client", "http-1x"]
   22     22   
[dependencies.aws-smithy-types]
   23     23   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          24  +
features = ["http-body-1-x"]
   24     25   
[dependencies.aws-smithy-xml]
   25     26   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-xml"
   26     27   
[dependencies.fastrand]
   27     28   
version = "2.0.0"
   28     29   
[dependencies.http]
   29     30   
version = "0.2.9"
          31  +
[dependencies.http-1x]
          32  +
version = "1"
          33  +
package = "http"
   30     34   
[dependencies.tracing]
   31     35   
version = "0.1"
   32     36   
[dev-dependencies.aws-smithy-protocol-test]
   33     37   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
   34     38   
[dev-dependencies.bytes]
   35     39   
version = "1.4.0"
   36     40   
[dev-dependencies.pretty_assertions]
   37     41   
version = "1.3.0"
   38     42   
[dev-dependencies.tokio]
   39     43   
version = "1.23.1"

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/operation/greeting_with_unwrapped_errors.rs

@@ -157,157 +223,223 @@
  177    177   
                _input: &crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput,
  178    178   
                output: &mut ::std::string::String,
  179    179   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180    180   
                use ::std::fmt::Write as _;
  181    181   
                ::std::write!(output, "/GreetingWithErrors").expect("formatting should succeed");
  182    182   
                ::std::result::Result::Ok(())
  183    183   
            }
  184    184   
            #[allow(clippy::unnecessary_wraps)]
  185    185   
            fn update_http_builder(
  186    186   
                input: &crate::operation::greeting_with_unwrapped_errors::GreetingWithUnwrappedErrorsInput,
  187         -
                builder: ::http::request::Builder,
  188         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         187  +
                builder: ::http_1x::request::Builder,
         188  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189    189   
                let mut uri = ::std::string::String::new();
  190    190   
                uri_base(input, &mut uri)?;
  191    191   
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  192    192   
            }
  193         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         193  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  194    194   
            builder
  195    195   
        };
  196    196   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  197    197   
  198    198   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  199    199   
    }
  200    200   
}
  201    201   
#[derive(Debug)]
  202    202   
struct GreetingWithUnwrappedErrorsEndpointParamsInterceptor;
  203    203   

tmp-codegen-diff/codegen-client-test/rest_xml_extras_unwrapped/rust-client-codegen/src/serialization_settings.rs

@@ -1,1 +78,83 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/*
    3      3   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4      4   
 * SPDX-License-Identifier: Apache-2.0
    5      5   
 */
    6      6   
    7      7   
#![allow(dead_code)]
    8      8   
    9      9   
use aws_smithy_http::header::set_request_header_if_absent;
   10     10   
use aws_smithy_types::config_bag::{Storable, StoreReplace};
   11         -
use http::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
          11  +
use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
   12     12   
   13     13   
/// Configuration for how default protocol headers are serialized
   14     14   
#[derive(Clone, Debug, Default)]
   15     15   
pub(crate) struct HeaderSerializationSettings {
   16     16   
    omit_default_content_length: bool,
   17     17   
    omit_default_content_type: bool,
   18     18   
}
   19     19   
   20     20   
impl HeaderSerializationSettings {
   21     21   
    /// Creates new [`HeaderSerializationSettings`]
   22     22   
    pub(crate) fn new() -> Self {
   23     23   
        Default::default()
   24     24   
    }
   25     25   
   26     26   
    /// Omit the default `Content-Length` header during serialization
   27     27   
    pub(crate) fn omit_default_content_length(self) -> Self {
   28     28   
        Self {
   29     29   
            omit_default_content_length: true,
   30     30   
            ..self
   31     31   
        }
   32     32   
    }
   33     33   
   34     34   
    /// Omit the default `Content-Type` header during serialization
   35     35   
    pub(crate) fn omit_default_content_type(self) -> Self {
   36     36   
        Self {
   37     37   
            omit_default_content_type: true,
   38     38   
            ..self
   39     39   
        }
   40     40   
    }
   41     41   
   42     42   
    /// Returns true if the given default header name should be serialized
   43     43   
    fn include_header(&self, header: &HeaderName) -> bool {
   44     44   
        (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE)
   45     45   
    }
   46     46   
   47     47   
    /// Sets a default header on the given request builder if it should be serialized
   48         -
    pub(crate) fn set_default_header(&self, mut request: http::request::Builder, header_name: HeaderName, value: &str) -> http::request::Builder {
          48  +
    pub(crate) fn set_default_header(
          49  +
        &self,
          50  +
        mut request: http_1x::request::Builder,
          51  +
        header_name: HeaderName,
          52  +
        value: &str,
          53  +
    ) -> http_1x::request::Builder {
   49     54   
        if self.include_header(&header_name) {
   50     55   
            request = set_request_header_if_absent(request, header_name, value);
   51     56   
        }
   52     57   
        request
   53     58   
    }
   54     59   
}
   55     60   
   56     61   
impl Storable for HeaderSerializationSettings {
   57     62   
    type Storer = StoreReplace<Self>;
   58     63   
}

tmp-codegen-diff/codegen-client-test/rest_xml_namespace/rust-client-codegen/Cargo.toml

@@ -1,1 +56,60 @@
   11     11   
protocol = "aws.protocols#restXml"
   12     12   
[dependencies.aws-smithy-async]
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-async"
   14     14   
[dependencies.aws-smithy-http]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   16     16   
[dependencies.aws-smithy-runtime]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime"
   18     18   
features = ["client"]
   19     19   
[dependencies.aws-smithy-runtime-api]
   20     20   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
   21         -
features = ["client", "http-02x"]
          21  +
features = ["client", "http-1x"]
   22     22   
[dependencies.aws-smithy-types]
   23     23   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          24  +
features = ["http-body-1-x"]
   24     25   
[dependencies.aws-smithy-xml]
   25     26   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-xml"
   26     27   
[dependencies.fastrand]
   27     28   
version = "2.0.0"
   28     29   
[dependencies.http]
   29     30   
version = "0.2.9"
          31  +
[dependencies.http-1x]
          32  +
version = "1"
          33  +
package = "http"
   30     34   
[dependencies.tracing]
   31     35   
version = "0.1"
   32     36   
[dev-dependencies.aws-smithy-http-client]
   33     37   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-client"
   34     38   
features = ["test-util"]
   35     39   
[dev-dependencies.aws-smithy-protocol-test]
   36     40   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
   37     41   
[dev-dependencies.bytes]
   38     42   
version = "1.4.0"
   39     43   
[dev-dependencies.pretty_assertions]

tmp-codegen-diff/codegen-client-test/rest_xml_namespace/rust-client-codegen/src/operation/simple_scalar_properties.rs

@@ -157,157 +233,233 @@
  177    177   
                _input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  178    178   
                output: &mut ::std::string::String,
  179    179   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180    180   
                use ::std::fmt::Write as _;
  181    181   
                ::std::write!(output, "/SimpleScalarProperties").expect("formatting should succeed");
  182    182   
                ::std::result::Result::Ok(())
  183    183   
            }
  184    184   
            #[allow(clippy::unnecessary_wraps)]
  185    185   
            fn update_http_builder(
  186    186   
                input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
  187         -
                builder: ::http::request::Builder,
  188         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         187  +
                builder: ::http_1x::request::Builder,
         188  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189    189   
                let mut uri = ::std::string::String::new();
  190    190   
                uri_base(input, &mut uri)?;
  191    191   
                let builder = crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_headers(input, builder)?;
  192    192   
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  193    193   
            }
  194         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  195         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/xml");
         194  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         195  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/xml");
  196    196   
            builder
  197    197   
        };
  198    198   
        let body = ::aws_smithy_types::body::SdkBody::from(
  199    199   
            crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_op_input(&input)?,
  200    200   
        );
  201    201   
        if let Some(content_length) = body.content_length() {
  202    202   
            let content_length = content_length.to_string();
  203         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         203  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  204    204   
        }
  205    205   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  206    206   
    }
  207    207   
}
  208    208   
#[derive(Debug)]
  209    209   
struct SimpleScalarPropertiesEndpointParamsInterceptor;
  210    210   
  211    211   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SimpleScalarPropertiesEndpointParamsInterceptor {
  212    212   
    fn name(&self) -> &'static str {
  213    213   
        "SimpleScalarPropertiesEndpointParamsInterceptor"

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

@@ -13,13 +78,78 @@
   33     33   
            crate::protocol_serde::shape_simple_scalar_properties_output::de_foo_header(_response_headers).map_err(|_| {
   34     34   
                crate::operation::simple_scalar_properties::SimpleScalarPropertiesError::unhandled("Failed to parse foo from header `X-Foo")
   35     35   
            })?,
   36     36   
        );
   37     37   
        output.build()
   38     38   
    })
   39     39   
}
   40     40   
   41     41   
pub fn ser_simple_scalar_properties_headers(
   42     42   
    input: &crate::operation::simple_scalar_properties::SimpleScalarPropertiesInput,
   43         -
    mut builder: ::http::request::Builder,
   44         -
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          43  +
    mut builder: ::http_1x::request::Builder,
          44  +
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   45     45   
    if let ::std::option::Option::Some(inner_1) = &input.foo {
   46     46   
        let formatted_2 = inner_1.as_str();
   47     47   
        let header_value = formatted_2;
   48         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          48  +
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   49     49   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   50     50   
                "foo",
   51     51   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   52     52   
            )
   53     53   
        })?;
   54     54   
        builder = builder.header("X-Foo", header_value);
   55     55   
    }
   56     56   
    Ok(builder)
   57     57   
}
   58     58   

tmp-codegen-diff/codegen-client-test/rest_xml_namespace/rust-client-codegen/src/serialization_settings.rs

@@ -1,1 +78,83 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/*
    3      3   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4      4   
 * SPDX-License-Identifier: Apache-2.0
    5      5   
 */
    6      6   
    7      7   
#![allow(dead_code)]
    8      8   
    9      9   
use aws_smithy_http::header::set_request_header_if_absent;
   10     10   
use aws_smithy_types::config_bag::{Storable, StoreReplace};
   11         -
use http::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
          11  +
use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
   12     12   
   13     13   
/// Configuration for how default protocol headers are serialized
   14     14   
#[derive(Clone, Debug, Default)]
   15     15   
pub(crate) struct HeaderSerializationSettings {
   16     16   
    omit_default_content_length: bool,
   17     17   
    omit_default_content_type: bool,
   18     18   
}
   19     19   
   20     20   
impl HeaderSerializationSettings {
   21     21   
    /// Creates new [`HeaderSerializationSettings`]
   22     22   
    pub(crate) fn new() -> Self {
   23     23   
        Default::default()
   24     24   
    }
   25     25   
   26     26   
    /// Omit the default `Content-Length` header during serialization
   27     27   
    pub(crate) fn omit_default_content_length(self) -> Self {
   28     28   
        Self {
   29     29   
            omit_default_content_length: true,
   30     30   
            ..self
   31     31   
        }
   32     32   
    }
   33     33   
   34     34   
    /// Omit the default `Content-Type` header during serialization
   35     35   
    pub(crate) fn omit_default_content_type(self) -> Self {
   36     36   
        Self {
   37     37   
            omit_default_content_type: true,
   38     38   
            ..self
   39     39   
        }
   40     40   
    }
   41     41   
   42     42   
    /// Returns true if the given default header name should be serialized
   43     43   
    fn include_header(&self, header: &HeaderName) -> bool {
   44     44   
        (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE)
   45     45   
    }
   46     46   
   47     47   
    /// Sets a default header on the given request builder if it should be serialized
   48         -
    pub(crate) fn set_default_header(&self, mut request: http::request::Builder, header_name: HeaderName, value: &str) -> http::request::Builder {
          48  +
    pub(crate) fn set_default_header(
          49  +
        &self,
          50  +
        mut request: http_1x::request::Builder,
          51  +
        header_name: HeaderName,
          52  +
        value: &str,
          53  +
    ) -> http_1x::request::Builder {
   49     54   
        if self.include_header(&header_name) {
   50     55   
            request = set_request_header_if_absent(request, header_name, value);
   51     56   
        }
   52     57   
        request
   53     58   
    }
   54     59   
}
   55     60   
   56     61   
impl Storable for HeaderSerializationSettings {
   57     62   
    type Storer = StoreReplace<Self>;
   58     63   
}

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/Cargo.toml

@@ -1,1 +56,60 @@
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-async"
   14     14   
[dependencies.aws-smithy-cbor]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-cbor"
   16     16   
[dependencies.aws-smithy-http]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   18     18   
[dependencies.aws-smithy-runtime]
   19     19   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime"
   20     20   
features = ["client"]
   21     21   
[dependencies.aws-smithy-runtime-api]
   22     22   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
   23         -
features = ["client", "http-02x"]
          23  +
features = ["client", "http-1x"]
   24     24   
[dependencies.aws-smithy-types]
   25     25   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          26  +
features = ["http-body-1-x"]
   26     27   
[dependencies.fastrand]
   27     28   
version = "2.0.0"
   28     29   
[dependencies.http]
   29     30   
version = "0.2.9"
          31  +
[dependencies.http-1x]
          32  +
version = "1"
          33  +
package = "http"
   30     34   
[dependencies.tracing]
   31     35   
version = "0.1"
   32     36   
[dev-dependencies.aws-smithy-http-client]
   33     37   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-client"
   34     38   
features = ["test-util"]
   35     39   
[dev-dependencies.aws-smithy-protocol-test]
   36     40   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
   37     41   
[dev-dependencies.bytes]
   38     42   
version = "1.4.0"
   39     43   
[dev-dependencies.pretty_assertions]

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/empty_input_output.rs

@@ -151,151 +228,231 @@
  171    171   
                _input: &crate::operation::empty_input_output::EmptyInputOutputInput,
  172    172   
                output: &mut ::std::string::String,
  173    173   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  174    174   
                use ::std::fmt::Write as _;
  175    175   
                ::std::write!(output, "/service/RpcV2Protocol/operation/EmptyInputOutput").expect("formatting should succeed");
  176    176   
                ::std::result::Result::Ok(())
  177    177   
            }
  178    178   
            #[allow(clippy::unnecessary_wraps)]
  179    179   
            fn update_http_builder(
  180    180   
                input: &crate::operation::empty_input_output::EmptyInputOutputInput,
  181         -
                builder: ::http::request::Builder,
  182         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         181  +
                builder: ::http_1x::request::Builder,
         182  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  183    183   
                let mut uri = ::std::string::String::new();
  184    184   
                uri_base(input, &mut uri)?;
  185    185   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  186    186   
            }
  187         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  188         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/cbor");
         187  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         188  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/cbor");
         189  +
            builder = _header_serialization_settings.set_default_header(
         190  +
                builder,
         191  +
                ::http_1x::header::HeaderName::from_static("smithy-protocol"),
         192  +
                "rpc-v2-cbor",
         193  +
            );
  189    194   
            builder =
  190         -
                _header_serialization_settings.set_default_header(builder, ::http::header::HeaderName::from_static("smithy-protocol"), "rpc-v2-cbor");
  191         -
            builder =
  192         -
                _header_serialization_settings.set_default_header(builder, ::http::header::HeaderName::from_static("accept"), "application/cbor");
         195  +
                _header_serialization_settings.set_default_header(builder, ::http_1x::header::HeaderName::from_static("accept"), "application/cbor");
  193    196   
            builder
  194    197   
        };
  195    198   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_empty_input_output::ser_empty_input_output_input(&input)?);
  196    199   
        if let Some(content_length) = body.content_length() {
  197    200   
            let content_length = content_length.to_string();
  198         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         201  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  199    202   
        }
  200    203   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  201    204   
    }
  202    205   
}
  203    206   
#[derive(Debug)]
  204    207   
struct EmptyInputOutputEndpointParamsInterceptor;
  205    208   
  206    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EmptyInputOutputEndpointParamsInterceptor {
  207    210   
    fn name(&self) -> &'static str {
  208    211   
        "EmptyInputOutputEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/rpcv2Cbor/rust-client-codegen/src/operation/float16.rs

@@ -142,142 +218,221 @@
  162    162   
                _input: &crate::operation::float16::Float16Input,
  163    163   
                output: &mut ::std::string::String,
  164    164   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  165    165   
                use ::std::fmt::Write as _;
  166    166   
                ::std::write!(output, "/service/RpcV2Protocol/operation/Float16").expect("formatting should succeed");
  167    167   
                ::std::result::Result::Ok(())
  168    168   
            }
  169    169   
            #[allow(clippy::unnecessary_wraps)]
  170    170   
            fn update_http_builder(
  171    171   
                input: &crate::operation::float16::Float16Input,
  172         -
                builder: ::http::request::Builder,
  173         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         172  +
                builder: ::http_1x::request::Builder,
         173  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  174    174   
                let mut uri = ::std::string::String::new();
  175    175   
                uri_base(input, &mut uri)?;
  176    176   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  177    177   
            }
  178         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         178  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         179  +
            builder = _header_serialization_settings.set_default_header(
         180  +
                builder,
         181  +
                ::http_1x::header::HeaderName::from_static("smithy-protocol"),
         182  +
                "rpc-v2-cbor",
         183  +
            );
  179    184   
            builder =
  180         -
                _header_serialization_settings.set_default_header(builder, ::http::header::HeaderName::from_static("smithy-protocol"), "rpc-v2-cbor");
  181         -
            builder =
  182         -
                _header_serialization_settings.set_default_header(builder, ::http::header::HeaderName::from_static("accept"), "application/cbor");
         185  +
                _header_serialization_settings.set_default_header(builder, ::http_1x::header::HeaderName::from_static("accept"), "application/cbor");
  183    186   
            builder
  184    187   
        };
  185    188   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  186    189   
        if let Some(content_length) = body.content_length() {
  187    190   
            let content_length = content_length.to_string();
  188         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         191  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  189    192   
        }
  190    193   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  191    194   
    }
  192    195   
}
  193    196   
#[derive(Debug)]
  194    197   
struct Float16EndpointParamsInterceptor;
  195    198   
  196    199   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for Float16EndpointParamsInterceptor {
  197    200   
    fn name(&self) -> &'static str {
  198    201   
        "Float16EndpointParamsInterceptor"