Client Test

Client Test

rev. ee474c7509d7728618c23068f3741e8e5b339ef9

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json_extras/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/rest_json_extras/rust-client-codegen/src/operation/case_insensitive_error_operation.rs

@@ -157,157 +223,223 @@
  177    177   
                _input: &crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput,
  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, "/error-sensitive").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::case_insensitive_error_operation::CaseInsensitiveErrorOperationInput,
  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())?;
         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 CaseInsensitiveErrorOperationEndpointParamsInterceptor;
  203    203   

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/empty_struct_with_content_on_wire_op.rs

@@ -161,161 +227,227 @@
  181    181   
                _input: &crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput,
  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, "/empty-struct-with-content-on-wire-op").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::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpInput,
  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("GET").uri(uri))
  196    196   
            }
  197         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         197  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  198    198   
            builder
  199    199   
        };
  200    200   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  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 EmptyStructWithContentOnWireOpEndpointParamsInterceptor;
  207    207   

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/enum_query.rs

@@ -160,160 +226,226 @@
  180    180   
                        "r#enum",
  181    181   
                        "cannot be empty or unset",
  182    182   
                    ));
  183    183   
                }
  184    184   
                ::std::write!(output, "/foo/{enum}", enum = r#enum).expect("formatting should succeed");
  185    185   
                ::std::result::Result::Ok(())
  186    186   
            }
  187    187   
            #[allow(clippy::unnecessary_wraps)]
  188    188   
            fn update_http_builder(
  189    189   
                input: &crate::operation::enum_query::EnumQueryInput,
  190         -
                builder: ::http::request::Builder,
  191         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         190  +
                builder: ::http_1x::request::Builder,
         191  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  192    192   
                let mut uri = ::std::string::String::new();
  193    193   
                uri_base(input, &mut uri)?;
  194    194   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  195    195   
            }
  196         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         196  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  197    197   
            builder
  198    198   
        };
  199    199   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  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 EnumQueryEndpointParamsInterceptor;
  206    206   

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/escaped_string_values.rs

@@ -157,157 +232,232 @@
  177    177   
                _input: &crate::operation::escaped_string_values::EscapedStringValuesInput,
  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, "/escaped-string-values").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::escaped_string_values::EscapedStringValuesInput,
  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/json");
         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/json");
  195    195   
            builder
  196    196   
        };
  197    197   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_escaped_string_values::ser_escaped_string_values_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 EscapedStringValuesEndpointParamsInterceptor;
  209    209   
  210    210   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EscapedStringValuesEndpointParamsInterceptor {
  211    211   
    fn name(&self) -> &'static str {
  212    212   
        "EscapedStringValuesEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/http_query_params_only_operation.rs

@@ -174,174 +241,241 @@
  194    194   
                                query.push_kv(&::aws_smithy_http::query::fmt_string(k), &::aws_smithy_http::query::fmt_string(v));
  195    195   
                            }
  196    196   
                        }
  197    197   
                    }
  198    198   
                }
  199    199   
                ::std::result::Result::Ok(())
  200    200   
            }
  201    201   
            #[allow(clippy::unnecessary_wraps)]
  202    202   
            fn update_http_builder(
  203    203   
                input: &crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationInput,
  204         -
                builder: ::http::request::Builder,
  205         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         204  +
                builder: ::http_1x::request::Builder,
         205  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  206    206   
                let mut uri = ::std::string::String::new();
  207    207   
                uri_base(input, &mut uri)?;
  208    208   
                uri_query(input, &mut uri)?;
  209    209   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  210    210   
            }
  211         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         211  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  212    212   
            builder
  213    213   
        };
  214    214   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  215    215   
  216    216   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  217    217   
    }
  218    218   
}
  219    219   
#[derive(Debug)]
  220    220   
struct HttpQueryParamsOnlyOperationEndpointParamsInterceptor;
  221    221   

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/map_with_enum_key_op.rs

@@ -157,157 +231,231 @@
  177    177   
                _input: &crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput,
  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, "/map-with-enum-key").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::map_with_enum_key_op::MapWithEnumKeyOpInput,
  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/json");
         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/json");
  195    195   
            builder
  196    196   
        };
  197    197   
        let body =
  198    198   
            ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_map_with_enum_key_op::ser_map_with_enum_key_op_input(&input)?);
  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 MapWithEnumKeyOpEndpointParamsInterceptor;
  208    208   
  209    209   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MapWithEnumKeyOpEndpointParamsInterceptor {
  210    210   
    fn name(&self) -> &'static str {
  211    211   
        "MapWithEnumKeyOpEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/null_in_non_sparse.rs

@@ -157,157 +223,223 @@
  177    177   
                _input: &crate::operation::null_in_non_sparse::NullInNonSparseInput,
  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, "/null-in-non-sparse").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::null_in_non_sparse::NullInNonSparseInput,
  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())?;
         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 NullInNonSparseEndpointParamsInterceptor;
  203    203   

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_header.rs

@@ -157,157 +223,223 @@
  177    177   
                _input: &crate::operation::primitive_int_header::PrimitiveIntHeaderInput,
  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").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_header::PrimitiveIntHeaderInput,
  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())?;
         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 PrimitiveIntHeaderEndpointParamsInterceptor;
  203    203   

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_op.rs

@@ -151,151 +224,224 @@
  171    171   
                _input: &crate::operation::primitive_int_op::PrimitiveIntOpInput,
  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, "/primitive-document").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::primitive_int_op::PrimitiveIntOpInput,
  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/json");
         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/json");
  189    189   
            builder
  190    190   
        };
  191    191   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_primitive_int_op::ser_primitive_int_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 PrimitiveIntOpEndpointParamsInterceptor;
  201    201   
  202    202   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PrimitiveIntOpEndpointParamsInterceptor {
  203    203   
    fn name(&self) -> &'static str {
  204    204   
        "PrimitiveIntOpEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/query_precedence.rs

@@ -179,179 +246,246 @@
  199    199   
                if let ::std::option::Option::Some(inner_2) = &_input.foo {
  200    200   
                    {
  201    201   
                        query.push_kv("bar", &::aws_smithy_http::query::fmt_string(inner_2));
  202    202   
                    }
  203    203   
                }
  204    204   
                ::std::result::Result::Ok(())
  205    205   
            }
  206    206   
            #[allow(clippy::unnecessary_wraps)]
  207    207   
            fn update_http_builder(
  208    208   
                input: &crate::operation::query_precedence::QueryPrecedenceInput,
  209         -
                builder: ::http::request::Builder,
  210         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         209  +
                builder: ::http_1x::request::Builder,
         210  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  211    211   
                let mut uri = ::std::string::String::new();
  212    212   
                uri_base(input, &mut uri)?;
  213    213   
                uri_query(input, &mut uri)?;
  214    214   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  215    215   
            }
  216         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         216  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  217    217   
            builder
  218    218   
        };
  219    219   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  220    220   
  221    221   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  222    222   
    }
  223    223   
}
  224    224   
#[derive(Debug)]
  225    225   
struct QueryPrecedenceEndpointParamsInterceptor;
  226    226   

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/status_response.rs

@@ -151,151 +217,217 @@
  171    171   
                _input: &crate::operation::status_response::StatusResponseInput,
  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::status_response::StatusResponseInput,
  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 StatusResponseEndpointParamsInterceptor;
  197    197   

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/string_payload.rs

@@ -151,151 +226,226 @@
  171    171   
                _input: &crate::operation::string_payload::StringPayloadInput,
  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, "/StringPayload").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_payload::StringPayloadInput,
  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, "text/plain");
         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, "text/plain");
  189    189   
            builder
  190    190   
        };
  191    191   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_string_payload_input::ser_payload_http_payload(
  192    192   
            input.payload,
  193    193   
        )?);
  194    194   
        if let Some(content_length) = body.content_length() {
  195    195   
            let content_length = content_length.to_string();
  196         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         196  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  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 StringPayloadEndpointParamsInterceptor;
  203    203   
  204    204   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StringPayloadEndpointParamsInterceptor {
  205    205   
    fn name(&self) -> &'static str {
  206    206   
        "StringPayloadEndpointParamsInterceptor"

tmp-codegen-diff/codegen-client-test/rest_json_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/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#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-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-runtime]
   20     19   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime"
   21     20   
features = ["client"]
   22     21   
[dependencies.aws-smithy-runtime-api]
   23     22   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
   24         -
features = ["client", "http-02x"]
          23  +
features = ["client", "http-1x"]
   25     24   
[dependencies.aws-smithy-types]
   26     25   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
   27         -
features = ["http-body-0-4-x"]
          26  +
features = ["http-body-1-x", "http-body-0-4-x"]
   28     27   
[dependencies.aws-smithy-xml]
   29     28   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-xml"
   30     29   
[dependencies.fastrand]
   31     30   
version = "2.0.0"
   32     31   
[dependencies.flate2]
   33     32   
version = "1.0.30"
   34     33   
[dependencies.http]
   35     34   
version = "0.2.9"
   36         -
[dependencies.http-body]
   37         -
version = "0.4.4"
          35  +
[dependencies.http-1x]
          36  +
version = "1"
          37  +
package = "http"
          38  +
[dependencies.http-body-1x]
          39  +
version = "1"
          40  +
package = "http-body"
          41  +
[dependencies.http-body-util]
          42  +
version = "0.1.3"
   38     43   
[dependencies.tracing]
   39     44   
version = "0.1"
   40     45   
[dev-dependencies.aws-smithy-http-client]
   41     46   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-client"
   42     47   
features = ["test-util"]
   43     48   
[dev-dependencies.aws-smithy-protocol-test]
   44     49   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
   45     50   
[dev-dependencies.aws-smithy-types]
   46     51   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          52  +
features = ["http-body-1-x"]
   47     53   
[dev-dependencies.bytes]
   48     54   
version = "1.4.0"
   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"]

tmp-codegen-diff/codegen-client-test/rest_xml/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