Client Test

Client Test

rev. d06a46cae0f385cdae37a9f8264db3469a090ab5 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/ec2_query/rust-client-codegen/src/operation/xml_timestamps.rs

@@ -151,151 +218,219 @@
  171    171   
                _input: &crate::operation::xml_timestamps::XmlTimestampsInput,
  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, "/").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::xml_timestamps::XmlTimestampsInput,
  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/x-www-form-urlencoded");
         187  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         188  +
            builder =
         189  +
                _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
  189    190   
            builder
  190    191   
        };
  191    192   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_xml_timestamps_input::ser_xml_timestamps_input_input_input(
  192    193   
            &input,
  193    194   
        )?);
  194    195   
  195    196   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  196    197   
    }
  197    198   
}
  198    199   
#[derive(Debug)]

tmp-codegen-diff/codegen-client-test/ec2_query/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/endpoint-rules/rust-client-codegen/Cargo.toml

@@ -1,1 +43,47 @@
   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-json]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
   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.bytes]
   27     28   
version = "1.4.0"
   28     29   
[dependencies.fastrand]
   29     30   
version = "2.0.0"
   30     31   
[dependencies.http]
   31     32   
version = "0.2.9"
          33  +
[dependencies.http-1x]
          34  +
version = "1"
          35  +
package = "http"
   32     36   
[dependencies.tracing]
   33     37   
version = "0.1"
   34     38   
[features]
   35     39   
rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-types/rt-tokio"]
   36     40   
test-util = ["aws-smithy-runtime/test-util"]
   37     41   
behavior-version-latest = []
   38     42   
rustls = ["aws-smithy-runtime/tls-rustls"]
   39     43   
default-https-client = ["aws-smithy-runtime/default-https-client"]
   40     44   
gated-tests = []
   41     45   
default = ["rt-tokio", "rustls", "default-https-client"]

tmp-codegen-diff/codegen-client-test/endpoint-rules/rust-client-codegen/src/json_errors.rs

@@ -1,1 +45,45 @@
    5      5   
 */
    6      6   
    7      7   
use aws_smithy_json::deserialize::token::skip_value;
    8      8   
use aws_smithy_json::deserialize::{error::DeserializeError, json_token_iter, Token};
    9      9   
use aws_smithy_runtime_api::http::Headers;
   10     10   
use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata};
   11     11   
use std::borrow::Cow;
   12     12   
   13     13   
// currently only used by AwsJson
   14     14   
#[allow(unused)]
   15         -
pub fn is_error<B>(response: &http::Response<B>) -> bool {
          15  +
pub fn is_error<B>(response: &http_1x::Response<B>) -> bool {
   16     16   
    !response.status().is_success()
   17     17   
}
   18     18   
   19     19   
fn sanitize_error_code(error_code: &str) -> &str {
   20     20   
    // Trim a trailing URL from the error code, which is done by removing the longest suffix
   21     21   
    // beginning with a `:`
   22     22   
    let error_code = match error_code.find(':') {
   23     23   
        Some(idx) => &error_code[..idx],
   24     24   
        None => error_code,
   25     25   
    };
@@ -60,60 +120,120 @@
   80     80   
#[cfg(test)]
   81     81   
mod test {
   82     82   
    use crate::json_errors::{parse_error_body, parse_error_metadata, sanitize_error_code};
   83     83   
    use aws_smithy_runtime_api::client::orchestrator::HttpResponse;
   84     84   
    use aws_smithy_types::{body::SdkBody, error::ErrorMetadata};
   85     85   
    use std::borrow::Cow;
   86     86   
   87     87   
    #[test]
   88     88   
    fn error_metadata() {
   89     89   
        let response = HttpResponse::try_from(
   90         -
            http::Response::builder()
          90  +
            http_1x::Response::builder()
   91     91   
                .body(SdkBody::from(r#"{ "__type": "FooError", "message": "Go to foo" }"#))
   92     92   
                .unwrap(),
   93     93   
        )
   94     94   
        .unwrap();
   95     95   
        assert_eq!(
   96     96   
            parse_error_metadata(response.body().bytes().unwrap(), response.headers())
   97     97   
                .unwrap()
   98     98   
                .build(),
   99     99   
            ErrorMetadata::builder().code("FooError").message("Go to foo").build()
  100    100   
        )
@@ -129,129 +180,180 @@
  149    149   
  150    150   
    #[test]
  151    151   
    fn sanitize_namespace() {
  152    152   
        assert_eq!(sanitize_error_code("aws.protocoltests.restjson#FooError"), "FooError");
  153    153   
    }
  154    154   
  155    155   
    // services like lambda use an alternate `Message` instead of `message`
  156    156   
    #[test]
  157    157   
    fn alternative_error_message_names() {
  158    158   
        let response = HttpResponse::try_from(
  159         -
            http::Response::builder()
         159  +
            http_1x::Response::builder()
  160    160   
                .header("x-amzn-errortype", "ResourceNotFoundException")
  161    161   
                .body(SdkBody::from(
  162    162   
                    r#"{
  163    163   
                    "Type": "User",
  164    164   
                    "Message": "Functions from 'us-west-2' are not reachable from us-east-1"
  165    165   
                }"#,
  166    166   
                ))
  167    167   
                .unwrap(),
  168    168   
        )
  169    169   
        .unwrap();

tmp-codegen-diff/codegen-client-test/endpoint-rules/rust-client-codegen/src/operation/test_operation.rs

@@ -151,151 +229,229 @@
  171    171   
                _input: &crate::operation::test_operation::TestOperationInput,
  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, "/").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::test_operation::TestOperationInput,
  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/x-amz-json-1.1");
         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/x-amz-json-1.1");
  189    189   
            builder = _header_serialization_settings.set_default_header(
  190    190   
                builder,
  191         -
                ::http::header::HeaderName::from_static("x-amz-target"),
         191  +
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192    192   
                "TestService.TestOperation",
  193    193   
            );
  194    194   
            builder
  195    195   
        };
  196    196   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_test_operation::ser_test_operation_input(&input)?);
  197    197   
        if let Some(content_length) = body.content_length() {
  198    198   
            let content_length = content_length.to_string();
  199         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         199  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  200    200   
        }
  201    201   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  202    202   
    }
  203    203   
}
  204    204   
#[derive(Debug)]
  205    205   
struct TestOperationEndpointParamsInterceptor;
  206    206   
  207    207   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TestOperationEndpointParamsInterceptor {
  208    208   
    fn name(&self) -> &'static str {
  209    209   
        "TestOperationEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/endpoint-rules/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/json_rpc10/rust-client-codegen/Cargo.toml

@@ -1,1 +66,72 @@
    6      6   
description = "test"
    7      7   
edition = "2021"
    8      8   
    9      9   
[package.metadata.smithy]
   10     10   
codegen-version = "ci"
   11     11   
protocol = "aws.protocols#awsJson1_0"
   12     12   
[dependencies.aws-smithy-async]
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-async"
   14     14   
[dependencies.aws-smithy-compression]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-compression"
   16         -
features = ["http-body-0-4-x"]
   17     16   
[dependencies.aws-smithy-http]
   18     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   19     18   
[dependencies.aws-smithy-json]
   20     19   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
   21     20   
[dependencies.aws-smithy-runtime]
   22     21   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime"
   23     22   
features = ["client"]
   24     23   
[dependencies.aws-smithy-runtime-api]
   25     24   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
   26         -
features = ["client", "http-02x"]
          25  +
features = ["client", "http-1x"]
   27     26   
[dependencies.aws-smithy-types]
   28     27   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
   29         -
features = ["http-body-0-4-x"]
          28  +
features = ["http-body-1-x", "http-body-0-4-x"]
   30     29   
[dependencies.bytes]
   31     30   
version = "1.4.0"
   32     31   
[dependencies.fastrand]
   33     32   
version = "2.0.0"
   34     33   
[dependencies.flate2]
   35     34   
version = "1.0.30"
   36     35   
[dependencies.http]
   37     36   
version = "0.2.9"
   38         -
[dependencies.http-body]
   39         -
version = "0.4.4"
          37  +
[dependencies.http-1x]
          38  +
version = "1"
          39  +
package = "http"
          40  +
[dependencies.http-body-1x]
          41  +
version = "1"
          42  +
package = "http-body"
          43  +
[dependencies.http-body-util]
          44  +
version = "0.1.3"
   40     45   
[dependencies.tracing]
   41     46   
version = "0.1"
   42     47   
[dev-dependencies.aws-smithy-http-client]
   43     48   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-client"
   44     49   
features = ["test-util"]
   45     50   
[dev-dependencies.aws-smithy-protocol-test]
   46     51   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
   47     52   
[dev-dependencies.aws-smithy-types]
   48     53   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          54  +
features = ["http-body-1-x"]
   49     55   
[dev-dependencies.pretty_assertions]
   50     56   
version = "1.3.0"
   51     57   
[dev-dependencies.tokio]
   52     58   
version = "1.23.1"
   53     59   
features = ["macros", "test-util", "rt-multi-thread"]
   54     60   
[dev-dependencies.tracing-test]
   55     61   
version = "0.2.5"
   56     62   
features = ["no-env-filter"]
   57     63   
[features]
   58     64   
rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-types/rt-tokio"]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/client_request_compression.rs

@@ -1,1 +38,38 @@
    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   
use aws_smithy_compression::body::compress::CompressedBody;
    8         -
use aws_smithy_compression::http::http_body_0_4_x::CompressRequest;
           8  +
use aws_smithy_compression::http::CompressRequest;
    9      9   
use aws_smithy_compression::{CompressionAlgorithm, CompressionOptions};
   10     10   
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
   11     11   
use aws_smithy_runtime_api::box_error::BoxError;
   12     12   
use aws_smithy_runtime_api::client::interceptors::context::{BeforeSerializationInterceptorContextRef, BeforeTransmitInterceptorContextMut};
   13     13   
use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor};
   14     14   
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
   15     15   
use aws_smithy_runtime_api::client::runtime_components::{RuntimeComponents, RuntimeComponentsBuilder};
   16     16   
use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
   17     17   
use aws_smithy_types::body::SdkBody;
   18     18   
use aws_smithy_types::config_bag::{ConfigBag, Layer, Storable, StoreReplace};
@@ -80,80 +279,281 @@
  100    100   
        // Don't wrap a body if compression is disabled.
  101    101   
        if !options.is_enabled() {
  102    102   
            tracing::trace!("request compression is disabled and will not be applied");
  103    103   
            return Ok(());
  104    104   
        }
  105    105   
  106    106   
        // Don't wrap a body if it's below the minimum size
  107    107   
        //
  108    108   
        // Because compressing small amounts of data can actually increase its size,
  109    109   
        // we check to see if the data is big enough to make compression worthwhile.
  110         -
        let size_hint = http_body::Body::size_hint(request.body()).exact();
         110  +
        let size_hint = http_body_1x::Body::size_hint(request.body()).exact();
  111    111   
        if let Some(known_size) = size_hint {
  112    112   
            if known_size < options.min_compression_size_bytes() as u64 {
  113    113   
                tracing::trace!(
  114    114   
                    min_compression_size_bytes = options.min_compression_size_bytes(),
  115    115   
                    known_size,
  116    116   
                    "request body is below minimum size and will not be compressed"
  117    117   
                );
  118    118   
                return Ok(());
  119    119   
            }
  120    120   
            tracing::trace!("compressing sized request body...");
  121    121   
        } else {
  122    122   
            tracing::trace!("compressing unsized request body...");
  123    123   
        }
  124    124   
  125         -
        wrap_request_body_in_compressed_body(request, CompressionAlgorithm::Gzip.into_impl_http_body_0_4_x(&options))?;
         125  +
        wrap_request_body_in_compressed_body(request, CompressionAlgorithm::Gzip.into_impl_http_body_1_x(&options))?;
  126    126   
        cfg.interceptor_state()
  127    127   
            .store_append::<SmithySdkFeature>(SmithySdkFeature::GzipRequestCompression);
  128    128   
  129    129   
        Ok(())
  130    130   
    }
  131    131   
}
  132    132   
  133    133   
fn wrap_request_body_in_compressed_body(request: &mut HttpRequest, request_compress_impl: Box<dyn CompressRequest>) -> Result<(), BuildError> {
  134    134   
    request
  135    135   
        .headers_mut()
  136    136   
        .append(request_compress_impl.header_name(), request_compress_impl.header_value());
  137    137   
    let mut body = {
  138    138   
        let body = mem::replace(request.body_mut(), SdkBody::taken());
  139    139   
  140    140   
        if body.is_streaming() {
  141         -
            request.headers_mut().remove(http::header::CONTENT_LENGTH);
         141  +
            request.headers_mut().remove(http_1x::header::CONTENT_LENGTH);
  142    142   
            body.map(move |body| {
  143    143   
                let body = CompressedBody::new(body, request_compress_impl.clone());
  144         -
                SdkBody::from_body_0_4(body)
         144  +
                SdkBody::from_body_1_x(body)
  145    145   
            })
  146    146   
        } else {
  147    147   
            let body = CompressedBody::new(body, request_compress_impl.clone());
  148    148   
            let body = body.into_compressed_sdk_body().map_err(BuildError::other)?;
  149    149   
  150    150   
            let content_length = body.content_length().expect("this payload is in-memory");
  151         -
            request.headers_mut().insert(http::header::CONTENT_LENGTH, content_length.to_string());
         151  +
            request.headers_mut().insert(http_1x::header::CONTENT_LENGTH, content_length.to_string());
  152    152   
  153    153   
            body
  154    154   
        }
  155    155   
    };
  156    156   
    mem::swap(request.body_mut(), &mut body);
  157    157   
  158    158   
    Ok(())
  159    159   
}
  160    160   
  161    161   
#[derive(Debug, Copy, Clone, Default)]
  162    162   
pub(crate) struct DisableRequestCompression(pub(crate) bool);
  163    163   
  164    164   
impl From<bool> for DisableRequestCompression {
  165    165   
    fn from(value: bool) -> Self {
  166    166   
        DisableRequestCompression(value)
  167    167   
    }
  168    168   
}
  169    169   
  170    170   
impl Storable for DisableRequestCompression {
  171    171   
    type Storer = StoreReplace<Self>;
  172    172   
}
  173    173   
  174    174   
#[derive(Debug, Copy, Clone)]
  175    175   
pub(crate) struct RequestMinCompressionSizeBytes(pub(crate) u32);
  176    176   
  177    177   
impl Default for RequestMinCompressionSizeBytes {
  178    178   
    fn default() -> Self {
  179    179   
        RequestMinCompressionSizeBytes(10240)
  180    180   
    }
  181    181   
}
  182    182   
  183    183   
impl From<u32> for RequestMinCompressionSizeBytes {
  184    184   
    fn from(value: u32) -> Self {
  185    185   
        RequestMinCompressionSizeBytes(value)
  186    186   
    }
  187    187   
}
  188    188   
  189    189   
impl Storable for RequestMinCompressionSizeBytes {
  190    190   
    type Storer = StoreReplace<Self>;
  191    191   
}
  192    192   
  193    193   
#[cfg(test)]
  194    194   
mod tests {
  195    195   
    use super::wrap_request_body_in_compressed_body;
  196    196   
    use crate::client_request_compression::{RequestCompressionInterceptor, RequestMinCompressionSizeBytes};
  197    197   
    use aws_smithy_compression::{CompressionAlgorithm, CompressionOptions};
  198    198   
    use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
  199    199   
    use aws_smithy_runtime_api::client::interceptors::context::{Input, InterceptorContext};
  200    200   
    use aws_smithy_runtime_api::client::interceptors::Intercept;
  201    201   
    use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
  202    202   
    use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
  203    203   
    use aws_smithy_types::body::SdkBody;
  204    204   
    use aws_smithy_types::config_bag::{ConfigBag, Layer};
  205         -
    use http_body::Body;
         205  +
    use http_body_util::BodyExt;
  206    206   
  207    207   
    const UNCOMPRESSED_INPUT: &[u8] = b"hello world";
  208    208   
    const COMPRESSED_OUTPUT: &[u8] = &[
  209    209   
        31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 203, 72, 205, 201, 201, 87, 40, 207, 47, 202, 73, 1, 0, 133, 17, 74, 13, 11, 0, 0, 0,
  210    210   
    ];
  211    211   
  212    212   
    #[tokio::test]
  213    213   
    async fn test_compressed_body_is_retryable() {
  214         -
        let mut request: HttpRequest = http::Request::builder()
         214  +
        let mut request: HttpRequest = http_1x::Request::builder()
  215    215   
            .body(SdkBody::retryable(move || SdkBody::from(UNCOMPRESSED_INPUT)))
  216    216   
            .unwrap()
  217    217   
            .try_into()
  218    218   
            .unwrap();
  219    219   
  220    220   
        // ensure original SdkBody is retryable
  221    221   
        let mut body = request.body().try_clone().unwrap();
  222    222   
        let mut body_data = Vec::new();
  223         -
        while let Some(data) = body.data().await {
  224         -
            body_data.extend_from_slice(&data.unwrap())
         223  +
        while let Some(Ok(frame)) = body.frame().await {
         224  +
            let data = frame.into_data().expect("Data frame");
         225  +
            body_data.extend_from_slice(&data)
  225    226   
        }
  226    227   
        // Not yet wrapped, should still be the same as UNCOMPRESSED_INPUT.
  227    228   
        assert_eq!(UNCOMPRESSED_INPUT, body_data);
  228    229   
  229    230   
        let compression_algorithm = CompressionAlgorithm::Gzip;
  230    231   
        let compression_options = CompressionOptions::default().with_min_compression_size_bytes(0).unwrap();
  231    232   
  232         -
        wrap_request_body_in_compressed_body(&mut request, compression_algorithm.into_impl_http_body_0_4_x(&compression_options)).unwrap();
         233  +
        wrap_request_body_in_compressed_body(&mut request, compression_algorithm.into_impl_http_body_1_x(&compression_options)).unwrap();
  233    234   
  234    235   
        // ensure again that wrapped SdkBody is retryable
  235    236   
        let mut body = request.body().try_clone().expect("body is retryable");
  236    237   
        let mut body_data = Vec::new();
  237         -
        while let Some(data) = body.data().await {
  238         -
            body_data.extend_from_slice(&data.unwrap())
         238  +
        while let Some(Ok(frame)) = body.frame().await {
         239  +
            let data = frame.into_data().expect("Data frame");
         240  +
            body_data.extend_from_slice(&data)
  239    241   
        }
  240    242   
  241    243   
        // Since this body was wrapped, the output should be compressed data
  242    244   
        assert_ne!(UNCOMPRESSED_INPUT, body_data.as_slice());
  243    245   
        assert_eq!(COMPRESSED_OUTPUT, body_data.as_slice());
  244    246   
    }
  245    247   
  246    248   
    fn context() -> InterceptorContext {
  247    249   
        let mut context = InterceptorContext::new(Input::doesnt_matter());
  248    250   
        context.enter_serialization_phase();
  249    251   
        context.set_request(
  250         -
            http::Request::builder()
         252  +
            http_1x::Request::builder()
  251    253   
                .body(SdkBody::from(UNCOMPRESSED_INPUT))
  252    254   
                .unwrap()
  253    255   
                .try_into()
  254    256   
                .unwrap(),
  255    257   
        );
  256    258   
        let _ = context.take_input();
  257    259   
        context.enter_before_transmit_phase();
  258    260   
        context
  259    261   
    }
  260    262   

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/json_errors.rs

@@ -1,1 +45,45 @@
    5      5   
 */
    6      6   
    7      7   
use aws_smithy_json::deserialize::token::skip_value;
    8      8   
use aws_smithy_json::deserialize::{error::DeserializeError, json_token_iter, Token};
    9      9   
use aws_smithy_runtime_api::http::Headers;
   10     10   
use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata};
   11     11   
use std::borrow::Cow;
   12     12   
   13     13   
// currently only used by AwsJson
   14     14   
#[allow(unused)]
   15         -
pub fn is_error<B>(response: &http::Response<B>) -> bool {
          15  +
pub fn is_error<B>(response: &http_1x::Response<B>) -> bool {
   16     16   
    !response.status().is_success()
   17     17   
}
   18     18   
   19     19   
fn sanitize_error_code(error_code: &str) -> &str {
   20     20   
    // Trim a trailing URL from the error code, which is done by removing the longest suffix
   21     21   
    // beginning with a `:`
   22     22   
    let error_code = match error_code.find(':') {
   23     23   
        Some(idx) => &error_code[..idx],
   24     24   
        None => error_code,
   25     25   
    };
@@ -60,60 +120,120 @@
   80     80   
#[cfg(test)]
   81     81   
mod test {
   82     82   
    use crate::json_errors::{parse_error_body, parse_error_metadata, sanitize_error_code};
   83     83   
    use aws_smithy_runtime_api::client::orchestrator::HttpResponse;
   84     84   
    use aws_smithy_types::{body::SdkBody, error::ErrorMetadata};
   85     85   
    use std::borrow::Cow;
   86     86   
   87     87   
    #[test]
   88     88   
    fn error_metadata() {
   89     89   
        let response = HttpResponse::try_from(
   90         -
            http::Response::builder()
          90  +
            http_1x::Response::builder()
   91     91   
                .body(SdkBody::from(r#"{ "__type": "FooError", "message": "Go to foo" }"#))
   92     92   
                .unwrap(),
   93     93   
        )
   94     94   
        .unwrap();
   95     95   
        assert_eq!(
   96     96   
            parse_error_metadata(response.body().bytes().unwrap(), response.headers())
   97     97   
                .unwrap()
   98     98   
                .build(),
   99     99   
            ErrorMetadata::builder().code("FooError").message("Go to foo").build()
  100    100   
        )
@@ -129,129 +180,180 @@
  149    149   
  150    150   
    #[test]
  151    151   
    fn sanitize_namespace() {
  152    152   
        assert_eq!(sanitize_error_code("aws.protocoltests.restjson#FooError"), "FooError");
  153    153   
    }
  154    154   
  155    155   
    // services like lambda use an alternate `Message` instead of `message`
  156    156   
    #[test]
  157    157   
    fn alternative_error_message_names() {
  158    158   
        let response = HttpResponse::try_from(
  159         -
            http::Response::builder()
         159  +
            http_1x::Response::builder()
  160    160   
                .header("x-amzn-errortype", "ResourceNotFoundException")
  161    161   
                .body(SdkBody::from(
  162    162   
                    r#"{
  163    163   
                    "Type": "User",
  164    164   
                    "Message": "Functions from 'us-west-2' are not reachable from us-east-1"
  165    165   
                }"#,
  166    166   
                ))
  167    167   
                .unwrap(),
  168    168   
        )
  169    169   
        .unwrap();

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/content_type_parameters.rs

@@ -151,151 +231,231 @@
  171    171   
                _input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
  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, "/").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::content_type_parameters::ContentTypeParametersInput,
  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/x-amz-json-1.0");
         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/x-amz-json-1.0");
  189    189   
            builder = _header_serialization_settings.set_default_header(
  190    190   
                builder,
  191         -
                ::http::header::HeaderName::from_static("x-amz-target"),
         191  +
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192    192   
                "JsonRpc10.ContentTypeParameters",
  193    193   
            );
  194    194   
            builder
  195    195   
        };
  196    196   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_content_type_parameters::ser_content_type_parameters_input(
  197    197   
            &input,
  198    198   
        )?);
  199    199   
        if let Some(content_length) = body.content_length() {
  200    200   
            let content_length = content_length.to_string();
  201         -
            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);
  202    202   
        }
  203    203   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  204    204   
    }
  205    205   
}
  206    206   
#[derive(Debug)]
  207    207   
struct ContentTypeParametersEndpointParamsInterceptor;
  208    208   
  209    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ContentTypeParametersEndpointParamsInterceptor {
  210    210   
    fn name(&self) -> &'static str {
  211    211   
        "ContentTypeParametersEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/empty_input_and_empty_output.rs

@@ -157,157 +227,227 @@
  177    177   
                _input: &crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
  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, "/").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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
  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/x-amz-json-1.0");
         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/x-amz-json-1.0");
  195    195   
            builder = _header_serialization_settings.set_default_header(
  196    196   
                builder,
  197         -
                ::http::header::HeaderName::from_static("x-amz-target"),
         197  +
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  198    198   
                "JsonRpc10.EmptyInputAndEmptyOutput",
  199    199   
            );
  200    200   
            builder
  201    201   
        };
  202    202   
        let body = ::aws_smithy_types::body::SdkBody::from(
  203    203   
            crate::protocol_serde::shape_empty_input_and_empty_output::ser_empty_input_and_empty_output_input(&input)?,
  204    204   
        );
  205    205   
  206    206   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  207    207   
    }

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/endpoint_operation.rs

@@ -151,151 +221,221 @@
  171    171   
                _input: &crate::operation::endpoint_operation::EndpointOperationInput,
  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, "/").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::endpoint_operation::EndpointOperationInput,
  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/x-amz-json-1.0");
         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/x-amz-json-1.0");
  189    189   
            builder = _header_serialization_settings.set_default_header(
  190    190   
                builder,
  191         -
                ::http::header::HeaderName::from_static("x-amz-target"),
         191  +
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192    192   
                "JsonRpc10.EndpointOperation",
  193    193   
            );
  194    194   
            builder
  195    195   
        };
  196    196   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_endpoint_operation::ser_endpoint_operation_input(&input)?);
  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)]

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/endpoint_with_host_label_operation.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/greeting_with_errors.rs

@@ -151,151 +230,230 @@
  171    171   
                _input: &crate::operation::greeting_with_errors::GreetingWithErrorsInput,
  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, "/").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::greeting_with_errors::GreetingWithErrorsInput,
  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/x-amz-json-1.0");
         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/x-amz-json-1.0");
  189    189   
            builder = _header_serialization_settings.set_default_header(
  190    190   
                builder,
  191         -
                ::http::header::HeaderName::from_static("x-amz-target"),
         191  +
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192    192   
                "JsonRpc10.GreetingWithErrors",
  193    193   
            );
  194    194   
            builder
  195    195   
        };
  196    196   
        let body =
  197    197   
            ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_input(&input)?);
  198    198   
        if let Some(content_length) = body.content_length() {
  199    199   
            let content_length = content_length.to_string();
  200         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         200  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  201    201   
        }
  202    202   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  203    203   
    }
  204    204   
}
  205    205   
#[derive(Debug)]
  206    206   
struct GreetingWithErrorsEndpointParamsInterceptor;
  207    207   
  208    208   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GreetingWithErrorsEndpointParamsInterceptor {
  209    209   
    fn name(&self) -> &'static str {
  210    210   
        "GreetingWithErrorsEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/host_with_path_operation.rs

@@ -151,151 +221,221 @@
  171    171   
                _input: &crate::operation::host_with_path_operation::HostWithPathOperationInput,
  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, "/").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::host_with_path_operation::HostWithPathOperationInput,
  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/x-amz-json-1.0");
         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/x-amz-json-1.0");
  189    189   
            builder = _header_serialization_settings.set_default_header(
  190    190   
                builder,
  191         -
                ::http::header::HeaderName::from_static("x-amz-target"),
         191  +
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  192    192   
                "JsonRpc10.HostWithPathOperation",
  193    193   
            );
  194    194   
            builder
  195    195   
        };
  196    196   
        let body = ::aws_smithy_types::body::SdkBody::from(
  197    197   
            crate::protocol_serde::shape_host_with_path_operation::ser_host_with_path_operation_input(&input)?,
  198    198   
        );
  199    199   
  200    200   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  201    201   
    }

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/json_unions.rs

@@ -146,146 +224,224 @@
  166    166   
                _input: &crate::operation::json_unions::JsonUnionsInput,
  167    167   
                output: &mut ::std::string::String,
  168    168   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  169    169   
                use ::std::fmt::Write as _;
  170    170   
                ::std::write!(output, "/").expect("formatting should succeed");
  171    171   
                ::std::result::Result::Ok(())
  172    172   
            }
  173    173   
            #[allow(clippy::unnecessary_wraps)]
  174    174   
            fn update_http_builder(
  175    175   
                input: &crate::operation::json_unions::JsonUnionsInput,
  176         -
                builder: ::http::request::Builder,
  177         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         176  +
                builder: ::http_1x::request::Builder,
         177  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  178    178   
                let mut uri = ::std::string::String::new();
  179    179   
                uri_base(input, &mut uri)?;
  180    180   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  181    181   
            }
  182         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  183         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
         182  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         183  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  184    184   
            builder = _header_serialization_settings.set_default_header(
  185    185   
                builder,
  186         -
                ::http::header::HeaderName::from_static("x-amz-target"),
         186  +
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  187    187   
                "JsonRpc10.JsonUnions",
  188    188   
            );
  189    189   
            builder
  190    190   
        };
  191    191   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_unions::ser_json_unions_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 JsonUnionsEndpointParamsInterceptor;
  201    201   
  202    202   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonUnionsEndpointParamsInterceptor {
  203    203   
    fn name(&self) -> &'static str {
  204    204   
        "JsonUnionsEndpointParamsInterceptor"