Client Test

Client Test

rev. b089fac03cba5061dd86d9628e74511b55f01c68

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_empty_prefix_headers.rs

@@ -220,220 +280,282 @@
  240    240   
  241    241   
    /// Serializes all request headers, using specific when present
  242    242   
    /// Test ID: HttpEmptyPrefixHeadersRequestClient
  243    243   
    #[::tokio::test]
  244    244   
    #[::tracing_test::traced_test]
  245    245   
    #[should_panic]
  246    246   
    async fn http_empty_prefix_headers_request_client_request() {
  247    247   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  248    248   
        let config_builder = crate::config::Config::builder()
  249    249   
            .with_test_defaults()
  250         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         250  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         251  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         252  +
            .allow_no_auth()
  251    253   
            .endpoint_url("https://example.com");
  252    254   
  253    255   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  254    256   
        let result = client
  255    257   
            .http_empty_prefix_headers()
  256    258   
            .set_prefix_headers(::std::option::Option::Some({
  257    259   
                let mut ret = ::std::collections::HashMap::new();
  258    260   
                ret.insert("x-foo".to_owned().to_ascii_lowercase(), "Foo".to_owned());
  259    261   
                ret.insert("hello".to_owned().to_ascii_lowercase(), "Hello".to_owned());
  260    262   
                ret

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_enum_payload.rs

@@ -217,217 +277,279 @@
  237    237   
#[cfg(test)]
  238    238   
mod http_enum_payload_test {
  239    239   
  240    240   
    /// Test ID: RestXmlEnumPayloadRequest
  241    241   
    #[::tokio::test]
  242    242   
    #[::tracing_test::traced_test]
  243    243   
    async fn rest_xml_enum_payload_request_request() {
  244    244   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  245    245   
        let config_builder = crate::config::Config::builder()
  246    246   
            .with_test_defaults()
  247         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         247  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         248  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         249  +
            .allow_no_auth()
  248    250   
            .endpoint_url("https://example.com");
  249    251   
  250    252   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  251    253   
        let result = client
  252    254   
            .http_enum_payload()
  253    255   
            .set_payload(::std::option::Option::Some(
  254    256   
                "enumvalue".parse::<crate::types::StringEnum>().expect("static value validated to member"),
  255    257   
            ))
  256    258   
            .send()
  257    259   
            .await;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_traits.rs

@@ -224,224 +319,323 @@
  244    244   
mod http_payload_traits_test {
  245    245   
  246    246   
    /// Serializes a blob in the HTTP payload
  247    247   
    /// Test ID: HttpPayloadTraitsWithBlob
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn http_payload_traits_with_blob_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_payload_traits()
  260    262   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  261    263   
            .set_blob(::std::option::Option::Some(::aws_smithy_types::Blob::new("blobby blob blob")))
  262    264   
            .send()
  263    265   
            .await;
  264    266   
        let _ = dbg!(result);
  265    267   
        let http_request = request_receiver.expect_request();
  266    268   
        let expected_headers = [("X-Foo", "Foo")];
  267    269   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  268    270   
        let required_headers = &["Content-Length"];
  269    271   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
  270    272   
        let body = http_request.body().bytes().expect("body should be strict");
  271    273   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  272    274   
            body,
  273    275   
            "blobby blob blob",
  274    276   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  275    277   
        ));
  276    278   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  277    279   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  278    280   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPayloadTraits", "path was incorrect");
  279    281   
    }
  280    282   
  281    283   
    /// Serializes an empty blob in the HTTP payload
  282    284   
    /// Test ID: HttpPayloadTraitsWithNoBlobBody
  283    285   
    #[::tokio::test]
  284    286   
    #[::tracing_test::traced_test]
  285    287   
    async fn http_payload_traits_with_no_blob_body_request() {
  286    288   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  287    289   
        let config_builder = crate::config::Config::builder()
  288    290   
            .with_test_defaults()
  289         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         291  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         292  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         293  +
            .allow_no_auth()
  290    294   
            .endpoint_url("https://example.com");
  291    295   
  292    296   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  293    297   
        let result = client
  294    298   
            .http_payload_traits()
  295    299   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  296    300   
            .send()
  297    301   
            .await;
  298    302   
        let _ = dbg!(result);
  299    303   
        let http_request = request_receiver.expect_request();

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_traits_with_media_type.rs

@@ -229,229 +289,291 @@
  249    249   
mod http_payload_traits_with_media_type_test {
  250    250   
  251    251   
    /// Serializes a blob in the HTTP payload with a content-type
  252    252   
    /// Test ID: HttpPayloadTraitsWithMediaTypeWithBlob
  253    253   
    #[::tokio::test]
  254    254   
    #[::tracing_test::traced_test]
  255    255   
    async fn http_payload_traits_with_media_type_with_blob_request() {
  256    256   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  257    257   
        let config_builder = crate::config::Config::builder()
  258    258   
            .with_test_defaults()
  259         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         259  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         260  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         261  +
            .allow_no_auth()
  260    262   
            .endpoint_url("https://example.com");
  261    263   
  262    264   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  263    265   
        let result = client
  264    266   
            .http_payload_traits_with_media_type()
  265    267   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  266    268   
            .set_blob(::std::option::Option::Some(::aws_smithy_types::Blob::new("blobby blob blob")))
  267    269   
            .send()
  268    270   
            .await;
  269    271   
        let _ = dbg!(result);

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_member_xml_name.rs

@@ -224,224 +284,286 @@
  244    244   
mod http_payload_with_member_xml_name_test {
  245    245   
  246    246   
    /// Serializes a structure in the payload using a wrapper name based on member xmlName
  247    247   
    /// Test ID: HttpPayloadWithMemberXmlName
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn http_payload_with_member_xml_name_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_payload_with_member_xml_name()
  260    262   
            .set_nested(::std::option::Option::Some(
  261    263   
                crate::types::PayloadWithXmlName::builder()
  262    264   
                    .set_name(::std::option::Option::Some("Phreddy".to_owned()))
  263    265   
                    .build(),
  264    266   
            ))

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_structure.rs

@@ -224,224 +284,286 @@
  244    244   
mod http_payload_with_structure_test {
  245    245   
  246    246   
    /// Serializes a structure in the payload
  247    247   
    /// Test ID: HttpPayloadWithStructure
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn http_payload_with_structure_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_payload_with_structure()
  260    262   
            .set_nested(::std::option::Option::Some(
  261    263   
                crate::types::NestedPayload::builder()
  262    264   
                    .set_greeting(::std::option::Option::Some("hello".to_owned()))
  263    265   
                    .set_name(::std::option::Option::Some("Phreddy".to_owned()))
  264    266   
                    .build(),

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_union.rs

@@ -224,224 +318,322 @@
  244    244   
mod http_payload_with_union_test {
  245    245   
  246    246   
    /// Serializes a union in the payload.
  247    247   
    /// Test ID: RestXmlHttpPayloadWithUnion
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn rest_xml_http_payload_with_union_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_payload_with_union()
  260    262   
            .set_nested(::std::option::Option::Some(crate::types::UnionPayload::Greeting("hello".to_owned())))
  261    263   
            .send()
  262    264   
            .await;
  263    265   
        let _ = dbg!(result);
  264    266   
        let http_request = request_receiver.expect_request();
  265    267   
        let expected_headers = [("Content-Type", "application/xml")];
  266    268   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  267    269   
        let required_headers = &["Content-Length"];
  268    270   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
  269    271   
        let body = http_request.body().bytes().expect("body should be strict");
  270    272   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  271    273   
            body,
  272    274   
            "<UnionPayload>\n    <greeting>hello</greeting>\n</UnionPayload>",
  273    275   
            ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  274    276   
        ));
  275    277   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  276    278   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  277    279   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPayloadWithUnion", "path was incorrect");
  278    280   
    }
  279    281   
  280    282   
    /// No payload is sent if the union has no value.
  281    283   
    /// Test ID: RestXmlHttpPayloadWithUnsetUnion
  282    284   
    #[::tokio::test]
  283    285   
    #[::tracing_test::traced_test]
  284    286   
    async fn rest_xml_http_payload_with_unset_union_request() {
  285    287   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  286    288   
        let config_builder = crate::config::Config::builder()
  287    289   
            .with_test_defaults()
  288         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         290  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         291  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         292  +
            .allow_no_auth()
  289    293   
            .endpoint_url("https://example.com");
  290    294   
  291    295   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  292    296   
        let result = client.http_payload_with_union().send().await;
  293    297   
        let _ = dbg!(result);
  294    298   
        let http_request = request_receiver.expect_request();
  295    299   
        let body = http_request.body().bytes().expect("body should be strict");
  296    300   
        // No body.
  297    301   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  298    302   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_name.rs

@@ -224,224 +284,286 @@
  244    244   
mod http_payload_with_xml_name_test {
  245    245   
  246    246   
    /// Serializes a structure in the payload using a wrapper name based on xmlName
  247    247   
    /// Test ID: HttpPayloadWithXmlName
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn http_payload_with_xml_name_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_payload_with_xml_name()
  260    262   
            .set_nested(::std::option::Option::Some(
  261    263   
                crate::types::PayloadWithXmlName::builder()
  262    264   
                    .set_name(::std::option::Option::Some("Phreddy".to_owned()))
  263    265   
                    .build(),
  264    266   
            ))

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_namespace.rs

@@ -224,224 +284,286 @@
  244    244   
mod http_payload_with_xml_namespace_test {
  245    245   
  246    246   
    /// Serializes a structure in the payload using a wrapper with an XML namespace
  247    247   
    /// Test ID: HttpPayloadWithXmlNamespace
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn http_payload_with_xml_namespace_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_payload_with_xml_namespace()
  260    262   
            .set_nested(::std::option::Option::Some(
  261    263   
                crate::types::PayloadWithXmlNamespace::builder()
  262    264   
                    .set_name(::std::option::Option::Some("Phreddy".to_owned()))
  263    265   
                    .build(),
  264    266   
            ))

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_payload_with_xml_namespace_and_prefix.rs

@@ -228,228 +288,290 @@
  248    248   
mod http_payload_with_xml_namespace_and_prefix_test {
  249    249   
  250    250   
    /// Serializes a structure in the payload using a wrapper with an XML namespace
  251    251   
    /// Test ID: HttpPayloadWithXmlNamespaceAndPrefix
  252    252   
    #[::tokio::test]
  253    253   
    #[::tracing_test::traced_test]
  254    254   
    async fn http_payload_with_xml_namespace_and_prefix_request() {
  255    255   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  256    256   
        let config_builder = crate::config::Config::builder()
  257    257   
            .with_test_defaults()
  258         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         258  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         259  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         260  +
            .allow_no_auth()
  259    261   
            .endpoint_url("https://example.com");
  260    262   
  261    263   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  262    264   
        let result = client
  263    265   
            .http_payload_with_xml_namespace_and_prefix()
  264    266   
            .set_nested(::std::option::Option::Some(
  265    267   
                crate::types::PayloadWithXmlNamespaceAndPrefix::builder()
  266    268   
                    .set_name(::std::option::Option::Some("Phreddy".to_owned()))
  267    269   
                    .build(),
  268    270   
            ))

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_prefix_headers.rs

@@ -219,219 +344,350 @@
  239    239   
mod http_prefix_headers_test {
  240    240   
  241    241   
    /// Adds headers by prefix
  242    242   
    /// Test ID: HttpPrefixHeadersArePresent
  243    243   
    #[::tokio::test]
  244    244   
    #[::tracing_test::traced_test]
  245    245   
    async fn http_prefix_headers_are_present_request() {
  246    246   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  247    247   
        let config_builder = crate::config::Config::builder()
  248    248   
            .with_test_defaults()
  249         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         249  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         250  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         251  +
            .allow_no_auth()
  250    252   
            .endpoint_url("https://example.com");
  251    253   
  252    254   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  253    255   
        let result = client
  254    256   
            .http_prefix_headers()
  255    257   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  256    258   
            .set_foo_map(::std::option::Option::Some({
  257    259   
                let mut ret = ::std::collections::HashMap::new();
  258    260   
                ret.insert("abc".to_owned().to_ascii_lowercase(), "Abc value".to_owned());
  259    261   
                ret.insert("def".to_owned().to_ascii_lowercase(), "Def value".to_owned());
  260    262   
                ret
  261    263   
            }))
  262    264   
            .send()
  263    265   
            .await;
  264    266   
        let _ = dbg!(result);
  265    267   
        let http_request = request_receiver.expect_request();
  266    268   
        let expected_headers = [("x-foo", "Foo"), ("x-foo-abc", "Abc value"), ("x-foo-def", "Def value")];
  267    269   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  268    270   
        let body = http_request.body().bytes().expect("body should be strict");
  269    271   
        // No body.
  270    272   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  271    273   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  272    274   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  273    275   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPrefixHeaders", "path was incorrect");
  274    276   
    }
  275    277   
  276    278   
    /// No prefix headers are serialized because the value is not present
  277    279   
    /// Test ID: HttpPrefixHeadersAreNotPresent
  278    280   
    #[::tokio::test]
  279    281   
    #[::tracing_test::traced_test]
  280    282   
    async fn http_prefix_headers_are_not_present_request() {
  281    283   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  282    284   
        let config_builder = crate::config::Config::builder()
  283    285   
            .with_test_defaults()
  284         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         286  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         287  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         288  +
            .allow_no_auth()
  285    289   
            .endpoint_url("https://example.com");
  286    290   
  287    291   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  288    292   
        let result = client
  289    293   
            .http_prefix_headers()
  290    294   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  291    295   
            .set_foo_map(::std::option::Option::Some(::std::collections::HashMap::new()))
  292    296   
            .send()
  293    297   
            .await;
  294    298   
        let _ = dbg!(result);
  295    299   
        let http_request = request_receiver.expect_request();
  296    300   
        let expected_headers = [("x-foo", "Foo")];
  297    301   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  298    302   
        let body = http_request.body().bytes().expect("body should be strict");
  299    303   
        // No body.
  300    304   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  301    305   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  302    306   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  303    307   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPrefixHeaders", "path was incorrect");
  304    308   
    }
  305    309   
  306    310   
    /// Serialize prefix headers were the value is present but empty
  307    311   
    /// Test ID: HttpPrefixEmptyHeaders
  308    312   
    #[::tokio::test]
  309    313   
    #[::tracing_test::traced_test]
  310    314   
    async fn http_prefix_empty_headers_request() {
  311    315   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  312    316   
        let config_builder = crate::config::Config::builder()
  313    317   
            .with_test_defaults()
  314         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         318  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         319  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         320  +
            .allow_no_auth()
  315    321   
            .endpoint_url("https://example.com");
  316    322   
  317    323   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  318    324   
        let result = client
  319    325   
            .http_prefix_headers()
  320    326   
            .set_foo_map(::std::option::Option::Some({
  321    327   
                let mut ret = ::std::collections::HashMap::new();
  322    328   
                ret.insert("abc".to_owned().to_ascii_lowercase(), "".to_owned());
  323    329   
                ret
  324    330   
            }))

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_request_with_float_labels.rs

@@ -242,242 +366,372 @@
  262    262   
mod http_request_with_float_labels_test {
  263    263   
  264    264   
    /// Supports handling NaN float label values.
  265    265   
    /// Test ID: RestXmlSupportsNaNFloatLabels
  266    266   
    #[::tokio::test]
  267    267   
    #[::tracing_test::traced_test]
  268    268   
    async fn rest_xml_supports_na_n_float_labels_request() {
  269    269   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  270    270   
        let config_builder = crate::config::Config::builder()
  271    271   
            .with_test_defaults()
  272         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         272  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         273  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         274  +
            .allow_no_auth()
  273    275   
            .endpoint_url("https://example.com");
  274    276   
  275    277   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  276    278   
        let result = client
  277    279   
            .http_request_with_float_labels()
  278    280   
            .set_float(::std::option::Option::Some(
  279    281   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  280    282   
            ))
  281    283   
            .set_double(::std::option::Option::Some(
  282    284   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  283    285   
            ))
  284    286   
            .send()
  285    287   
            .await;
  286    288   
        let _ = dbg!(result);
  287    289   
        let http_request = request_receiver.expect_request();
  288    290   
        let body = http_request.body().bytes().expect("body should be strict");
  289    291   
        // No body.
  290    292   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  291    293   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  292    294   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  293    295   
        ::pretty_assertions::assert_eq!(uri.path(), "/FloatHttpLabels/NaN/NaN", "path was incorrect");
  294    296   
    }
  295    297   
  296    298   
    /// Supports handling Infinity float label values.
  297    299   
    /// Test ID: RestXmlSupportsInfinityFloatLabels
  298    300   
    #[::tokio::test]
  299    301   
    #[::tracing_test::traced_test]
  300    302   
    async fn rest_xml_supports_infinity_float_labels_request() {
  301    303   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  302    304   
        let config_builder = crate::config::Config::builder()
  303    305   
            .with_test_defaults()
  304         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         306  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         307  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         308  +
            .allow_no_auth()
  305    309   
            .endpoint_url("https://example.com");
  306    310   
  307    311   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  308    312   
        let result = client
  309    313   
            .http_request_with_float_labels()
  310    314   
            .set_float(::std::option::Option::Some(
  311    315   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  312    316   
            ))
  313    317   
            .set_double(::std::option::Option::Some(
  314    318   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  315    319   
            ))
  316    320   
            .send()
  317    321   
            .await;
  318    322   
        let _ = dbg!(result);
  319    323   
        let http_request = request_receiver.expect_request();
  320    324   
        let body = http_request.body().bytes().expect("body should be strict");
  321    325   
        // No body.
  322    326   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  323    327   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  324    328   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  325    329   
        ::pretty_assertions::assert_eq!(uri.path(), "/FloatHttpLabels/Infinity/Infinity", "path was incorrect");
  326    330   
    }
  327    331   
  328    332   
    /// Supports handling -Infinity float label values.
  329    333   
    /// Test ID: RestXmlSupportsNegativeInfinityFloatLabels
  330    334   
    #[::tokio::test]
  331    335   
    #[::tracing_test::traced_test]
  332    336   
    async fn rest_xml_supports_negative_infinity_float_labels_request() {
  333    337   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  334    338   
        let config_builder = crate::config::Config::builder()
  335    339   
            .with_test_defaults()
  336         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         340  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         341  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         342  +
            .allow_no_auth()
  337    343   
            .endpoint_url("https://example.com");
  338    344   
  339    345   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  340    346   
        let result = client
  341    347   
            .http_request_with_float_labels()
  342    348   
            .set_float(::std::option::Option::Some(
  343    349   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  344    350   
            ))
  345    351   
            .set_double(::std::option::Option::Some(
  346    352   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),

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

@@ -245,245 +305,307 @@
  265    265   
mod http_request_with_greedy_label_in_path_test {
  266    266   
  267    267   
    /// Serializes greedy labels and normal labels
  268    268   
    /// Test ID: HttpRequestWithGreedyLabelInPath
  269    269   
    #[::tokio::test]
  270    270   
    #[::tracing_test::traced_test]
  271    271   
    async fn http_request_with_greedy_label_in_path_request() {
  272    272   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  273    273   
        let config_builder = crate::config::Config::builder()
  274    274   
            .with_test_defaults()
  275         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         275  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         276  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         277  +
            .allow_no_auth()
  276    278   
            .endpoint_url("https://example.com");
  277    279   
  278    280   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  279    281   
        let result = client
  280    282   
            .http_request_with_greedy_label_in_path()
  281    283   
            .set_foo(::std::option::Option::Some("hello".to_owned()))
  282    284   
            .set_baz(::std::option::Option::Some("there/guy".to_owned()))
  283    285   
            .send()
  284    286   
            .await;
  285    287   
        let _ = dbg!(result);

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

@@ -324,324 +424,428 @@
  344    344   
mod http_request_with_labels_test {
  345    345   
  346    346   
    /// Sends a GET request that uses URI label bindings
  347    347   
    /// Test ID: InputWithHeadersAndAllParams
  348    348   
    #[::tokio::test]
  349    349   
    #[::tracing_test::traced_test]
  350    350   
    async fn input_with_headers_and_all_params_request() {
  351    351   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  352    352   
        let config_builder = crate::config::Config::builder()
  353    353   
            .with_test_defaults()
  354         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         354  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         355  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         356  +
            .allow_no_auth()
  355    357   
            .endpoint_url("https://example.com");
  356    358   
  357    359   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  358    360   
        let result = client
  359    361   
            .http_request_with_labels()
  360    362   
            .set_string(::std::option::Option::Some("string".to_owned()))
  361    363   
            .set_short(::std::option::Option::Some(1))
  362    364   
            .set_integer(::std::option::Option::Some(2))
  363    365   
            .set_long(::std::option::Option::Some(3))
  364    366   
            .set_float(::std::option::Option::Some(4.1_f32))
  365    367   
            .set_double(::std::option::Option::Some(5.1_f64))
  366    368   
            .set_boolean(::std::option::Option::Some(true))
  367    369   
            .set_timestamp(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  368    370   
                1576540098, 0_f64,
  369    371   
            )))
  370    372   
            .send()
  371    373   
            .await;
  372    374   
        let _ = dbg!(result);
  373    375   
        let http_request = request_receiver.expect_request();
  374    376   
        let body = http_request.body().bytes().expect("body should be strict");
  375    377   
        // No body.
  376    378   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  377    379   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  378    380   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  379    381   
        ::pretty_assertions::assert_eq!(
  380    382   
            uri.path(),
  381    383   
            "/HttpRequestWithLabels/string/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z",
  382    384   
            "path was incorrect"
  383    385   
        );
  384    386   
    }
  385    387   
  386    388   
    /// Sends a GET request that uses URI label bindings
  387    389   
    /// Test ID: HttpRequestLabelEscaping
  388    390   
    #[::tokio::test]
  389    391   
    #[::tracing_test::traced_test]
  390    392   
    async fn http_request_label_escaping_request() {
  391    393   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  392    394   
        let config_builder = crate::config::Config::builder()
  393    395   
            .with_test_defaults()
  394         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         396  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         397  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         398  +
            .allow_no_auth()
  395    399   
            .endpoint_url("https://example.com");
  396    400   
  397    401   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  398    402   
        let result = client
  399    403   
            .http_request_with_labels()
  400    404   
            .set_string(::std::option::Option::Some(" %:/?#[]@!$&'()*+,;=😹".to_owned()))
  401    405   
            .set_short(::std::option::Option::Some(1))
  402    406   
            .set_integer(::std::option::Option::Some(2))
  403    407   
            .set_long(::std::option::Option::Some(3))
  404    408   
            .set_float(::std::option::Option::Some(4.1_f32))

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

@@ -299,299 +359,361 @@
  319    319   
mod http_request_with_labels_and_timestamp_format_test {
  320    320   
  321    321   
    /// Serializes different timestamp formats in URI labels
  322    322   
    /// Test ID: HttpRequestWithLabelsAndTimestampFormat
  323    323   
    #[::tokio::test]
  324    324   
    #[::tracing_test::traced_test]
  325    325   
    async fn http_request_with_labels_and_timestamp_format_request() {
  326    326   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  327    327   
        let config_builder = crate::config::Config::builder()
  328    328   
            .with_test_defaults()
  329         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         329  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         330  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         331  +
            .allow_no_auth()
  330    332   
            .endpoint_url("https://example.com");
  331    333   
  332    334   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  333    335   
        let result = client
  334    336   
            .http_request_with_labels_and_timestamp_format()
  335    337   
            .set_member_epoch_seconds(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  336    338   
                1576540098, 0_f64,
  337    339   
            )))
  338    340   
            .set_member_http_date(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  339    341   
                1576540098, 0_f64,

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/http_string_payload.rs

@@ -223,223 +283,285 @@
  243    243   
#[cfg(test)]
  244    244   
mod http_string_payload_test {
  245    245   
  246    246   
    /// Test ID: RestXmlStringPayloadRequest
  247    247   
    #[::tokio::test]
  248    248   
    #[::tracing_test::traced_test]
  249    249   
    async fn rest_xml_string_payload_request_request() {
  250    250   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  251    251   
        let config_builder = crate::config::Config::builder()
  252    252   
            .with_test_defaults()
  253         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         253  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         254  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         255  +
            .allow_no_auth()
  254    256   
            .endpoint_url("https://example.com");
  255    257   
  256    258   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  257    259   
        let result = client
  258    260   
            .http_string_payload()
  259    261   
            .set_payload(::std::option::Option::Some("rawstring".to_owned()))
  260    262   
            .send()
  261    263   
            .await;
  262    264   
        let _ = dbg!(result);
  263    265   
        let http_request = request_receiver.expect_request();