Client Test

Client Test

rev. 7254d43655ed63111c94f599437f2b0d3f55446e

Files changed:

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

@@ -382,382 +421,421 @@
  402    402   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  403    403   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  404    404   
    ) -> Self {
  405    405   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  406    406   
            source,
  407    407   
            meta: meta.unwrap_or_default(),
  408    408   
        })
  409    409   
    }
  410    410   
}
  411    411   
  412         -
pub use crate::operation::http_enum_payload::_http_enum_payload_output::HttpEnumPayloadOutput;
  413         -
  414    412   
pub use crate::operation::http_enum_payload::_http_enum_payload_input::HttpEnumPayloadInput;
  415    413   
         414  +
pub use crate::operation::http_enum_payload::_http_enum_payload_output::HttpEnumPayloadOutput;
         415  +
  416    416   
mod _http_enum_payload_input;
  417    417   
  418    418   
mod _http_enum_payload_output;
  419    419   
  420    420   
/// Builders
  421    421   
pub mod builders;

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

@@ -1,1 +35,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::http_enum_payload::_http_enum_payload_output::HttpEnumPayloadOutputBuilder;
    3         -
    4      2   
pub use crate::operation::http_enum_payload::_http_enum_payload_input::HttpEnumPayloadInputBuilder;
    5      3   
           4  +
pub use crate::operation::http_enum_payload::_http_enum_payload_output::HttpEnumPayloadOutputBuilder;
           5  +
    6      6   
impl crate::operation::http_enum_payload::builders::HttpEnumPayloadInputBuilder {
    7      7   
    /// Sends a request with this input using the given client.
    8      8   
    pub async fn send_with(
    9      9   
        self,
   10     10   
        client: &crate::Client,
   11     11   
    ) -> ::std::result::Result<
   12     12   
        crate::operation::http_enum_payload::HttpEnumPayloadOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::http_enum_payload::HttpEnumPayloadError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -460,460 +499,499 @@
  480    480   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  481    481   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  482    482   
    ) -> Self {
  483    483   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  484    484   
            source,
  485    485   
            meta: meta.unwrap_or_default(),
  486    486   
        })
  487    487   
    }
  488    488   
}
  489    489   
  490         -
pub use crate::operation::http_payload_traits::_http_payload_traits_output::HttpPayloadTraitsOutput;
  491         -
  492    490   
pub use crate::operation::http_payload_traits::_http_payload_traits_input::HttpPayloadTraitsInput;
  493    491   
         492  +
pub use crate::operation::http_payload_traits::_http_payload_traits_output::HttpPayloadTraitsOutput;
         493  +
  494    494   
mod _http_payload_traits_input;
  495    495   
  496    496   
mod _http_payload_traits_output;
  497    497   
  498    498   
/// Builders
  499    499   
pub mod builders;

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

@@ -1,1 +35,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::http_payload_traits::_http_payload_traits_output::HttpPayloadTraitsOutputBuilder;
    3         -
    4      2   
pub use crate::operation::http_payload_traits::_http_payload_traits_input::HttpPayloadTraitsInputBuilder;
    5      3   
           4  +
pub use crate::operation::http_payload_traits::_http_payload_traits_output::HttpPayloadTraitsOutputBuilder;
           5  +
    6      6   
impl crate::operation::http_payload_traits::builders::HttpPayloadTraitsInputBuilder {
    7      7   
    /// Sends a request with this input using the given client.
    8      8   
    pub async fn send_with(
    9      9   
        self,
   10     10   
        client: &crate::Client,
   11     11   
    ) -> ::std::result::Result<
   12     12   
        crate::operation::http_payload_traits::HttpPayloadTraitsOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::http_payload_traits::HttpPayloadTraitsError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -392,392 +431,431 @@
  412    412   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  413    413   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  414    414   
    ) -> Self {
  415    415   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  416    416   
            source,
  417    417   
            meta: meta.unwrap_or_default(),
  418    418   
        })
  419    419   
    }
  420    420   
}
  421    421   
  422         -
pub use crate::operation::http_payload_traits_with_media_type::_http_payload_traits_with_media_type_output::HttpPayloadTraitsWithMediaTypeOutput;
  423         -
  424    422   
pub use crate::operation::http_payload_traits_with_media_type::_http_payload_traits_with_media_type_input::HttpPayloadTraitsWithMediaTypeInput;
  425    423   
         424  +
pub use crate::operation::http_payload_traits_with_media_type::_http_payload_traits_with_media_type_output::HttpPayloadTraitsWithMediaTypeOutput;
         425  +
  426    426   
mod _http_payload_traits_with_media_type_input;
  427    427   
  428    428   
mod _http_payload_traits_with_media_type_output;
  429    429   
  430    430   
/// Builders
  431    431   
pub mod builders;

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

@@ -1,1 +35,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::http_payload_traits_with_media_type::_http_payload_traits_with_media_type_output::HttpPayloadTraitsWithMediaTypeOutputBuilder;
    3         -
    4      2   
pub use crate::operation::http_payload_traits_with_media_type::_http_payload_traits_with_media_type_input::HttpPayloadTraitsWithMediaTypeInputBuilder;
    5      3   
           4  +
pub use crate::operation::http_payload_traits_with_media_type::_http_payload_traits_with_media_type_output::HttpPayloadTraitsWithMediaTypeOutputBuilder;
           5  +
    6      6   
impl crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder {
    7      7   
    /// Sends a request with this input using the given client.
    8      8   
    pub async fn send_with(
    9      9   
        self,
   10     10   
        client: &crate::Client,
   11     11   
    ) -> ::std::result::Result<
   12     12   
        crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -436,436 +475,475 @@
  456    456   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  457    457   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  458    458   
    ) -> Self {
  459    459   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  460    460   
            source,
  461    461   
            meta: meta.unwrap_or_default(),
  462    462   
        })
  463    463   
    }
  464    464   
}
  465    465   
  466         -
pub use crate::operation::http_payload_with_structure::_http_payload_with_structure_output::HttpPayloadWithStructureOutput;
  467         -
  468    466   
pub use crate::operation::http_payload_with_structure::_http_payload_with_structure_input::HttpPayloadWithStructureInput;
  469    467   
         468  +
pub use crate::operation::http_payload_with_structure::_http_payload_with_structure_output::HttpPayloadWithStructureOutput;
         469  +
  470    470   
mod _http_payload_with_structure_input;
  471    471   
  472    472   
mod _http_payload_with_structure_output;
  473    473   
  474    474   
/// Builders
  475    475   
pub mod builders;

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

@@ -1,1 +35,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::http_payload_with_structure::_http_payload_with_structure_output::HttpPayloadWithStructureOutputBuilder;
    3         -
    4      2   
pub use crate::operation::http_payload_with_structure::_http_payload_with_structure_input::HttpPayloadWithStructureInputBuilder;
    5      3   
           4  +
pub use crate::operation::http_payload_with_structure::_http_payload_with_structure_output::HttpPayloadWithStructureOutputBuilder;
           5  +
    6      6   
impl crate::operation::http_payload_with_structure::builders::HttpPayloadWithStructureInputBuilder {
    7      7   
    /// Sends a request with this input using the given client.
    8      8   
    pub async fn send_with(
    9      9   
        self,
   10     10   
        client: &crate::Client,
   11     11   
    ) -> ::std::result::Result<
   12     12   
        crate::operation::http_payload_with_structure::HttpPayloadWithStructureOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::http_payload_with_structure::HttpPayloadWithStructureError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -448,448 +487,487 @@
  468    468   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  469    469   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  470    470   
    ) -> Self {
  471    471   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  472    472   
            source,
  473    473   
            meta: meta.unwrap_or_default(),
  474    474   
        })
  475    475   
    }
  476    476   
}
  477    477   
  478         -
pub use crate::operation::http_payload_with_union::_http_payload_with_union_output::HttpPayloadWithUnionOutput;
  479         -
  480    478   
pub use crate::operation::http_payload_with_union::_http_payload_with_union_input::HttpPayloadWithUnionInput;
  481    479   
         480  +
pub use crate::operation::http_payload_with_union::_http_payload_with_union_output::HttpPayloadWithUnionOutput;
         481  +
  482    482   
mod _http_payload_with_union_input;
  483    483   
  484    484   
mod _http_payload_with_union_output;
  485    485   
  486    486   
/// Builders
  487    487   
pub mod builders;

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

@@ -1,1 +35,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::http_payload_with_union::_http_payload_with_union_output::HttpPayloadWithUnionOutputBuilder;
    3         -
    4      2   
pub use crate::operation::http_payload_with_union::_http_payload_with_union_input::HttpPayloadWithUnionInputBuilder;
    5      3   
           4  +
pub use crate::operation::http_payload_with_union::_http_payload_with_union_output::HttpPayloadWithUnionOutputBuilder;
           5  +
    6      6   
impl crate::operation::http_payload_with_union::builders::HttpPayloadWithUnionInputBuilder {
    7      7   
    /// Sends a request with this input using the given client.
    8      8   
    pub async fn send_with(
    9      9   
        self,
   10     10   
        client: &crate::Client,
   11     11   
    ) -> ::std::result::Result<
   12     12   
        crate::operation::http_payload_with_union::HttpPayloadWithUnionOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::http_payload_with_union::HttpPayloadWithUnionError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -455,455 +494,494 @@
  475    475   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  476    476   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  477    477   
    ) -> Self {
  478    478   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  479    479   
            source,
  480    480   
            meta: meta.unwrap_or_default(),
  481    481   
        })
  482    482   
    }
  483    483   
}
  484    484   
  485         -
pub use crate::operation::http_prefix_headers::_http_prefix_headers_output::HttpPrefixHeadersOutput;
  486         -
  487    485   
pub use crate::operation::http_prefix_headers::_http_prefix_headers_input::HttpPrefixHeadersInput;
  488    486   
         487  +
pub use crate::operation::http_prefix_headers::_http_prefix_headers_output::HttpPrefixHeadersOutput;
         488  +
  489    489   
mod _http_prefix_headers_input;
  490    490   
  491    491   
mod _http_prefix_headers_output;
  492    492   
  493    493   
/// Builders
  494    494   
pub mod builders;

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

@@ -1,1 +35,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::http_prefix_headers::_http_prefix_headers_output::HttpPrefixHeadersOutputBuilder;
    3         -
    4      2   
pub use crate::operation::http_prefix_headers::_http_prefix_headers_input::HttpPrefixHeadersInputBuilder;
    5      3   
           4  +
pub use crate::operation::http_prefix_headers::_http_prefix_headers_output::HttpPrefixHeadersOutputBuilder;
           5  +
    6      6   
impl crate::operation::http_prefix_headers::builders::HttpPrefixHeadersInputBuilder {
    7      7   
    /// Sends a request with this input using the given client.
    8      8   
    pub async fn send_with(
    9      9   
        self,
   10     10   
        client: &crate::Client,
   11     11   
    ) -> ::std::result::Result<
   12     12   
        crate::operation::http_prefix_headers::HttpPrefixHeadersOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::http_prefix_headers::HttpPrefixHeadersError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -351,351 +390,390 @@
  371    371   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  372    372   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  373    373   
    ) -> Self {
  374    374   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  375    375   
            source,
  376    376   
            meta: meta.unwrap_or_default(),
  377    377   
        })
  378    378   
    }
  379    379   
}
  380    380   
  381         -
pub use crate::operation::http_prefix_headers_in_response::_http_prefix_headers_in_response_output::HttpPrefixHeadersInResponseOutput;
  382         -
  383    381   
pub use crate::operation::http_prefix_headers_in_response::_http_prefix_headers_in_response_input::HttpPrefixHeadersInResponseInput;
  384    382   
         383  +
pub use crate::operation::http_prefix_headers_in_response::_http_prefix_headers_in_response_output::HttpPrefixHeadersInResponseOutput;
         384  +
  385    385   
mod _http_prefix_headers_in_response_input;
  386    386   
  387    387   
mod _http_prefix_headers_in_response_output;
  388    388   
  389    389   
/// Builders
  390    390   
pub mod builders;

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

@@ -1,1 +35,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::http_prefix_headers_in_response::_http_prefix_headers_in_response_output::HttpPrefixHeadersInResponseOutputBuilder;
    3         -
    4      2   
pub use crate::operation::http_prefix_headers_in_response::_http_prefix_headers_in_response_input::HttpPrefixHeadersInResponseInputBuilder;
    5      3   
           4  +
pub use crate::operation::http_prefix_headers_in_response::_http_prefix_headers_in_response_output::HttpPrefixHeadersInResponseOutputBuilder;
           5  +
    6      6   
impl crate::operation::http_prefix_headers_in_response::builders::HttpPrefixHeadersInResponseInputBuilder {
    7      7   
    /// Sends a request with this input using the given client.
    8      8   
    pub async fn send_with(
    9      9   
        self,
   10     10   
        client: &crate::Client,
   11     11   
    ) -> ::std::result::Result<
   12     12   
        crate::operation::http_prefix_headers_in_response::HttpPrefixHeadersInResponseOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::http_prefix_headers_in_response::HttpPrefixHeadersInResponseError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

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

@@ -246,246 +468,415 @@
  266    266   
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
  267    267   
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
  268    268   
            .allow_no_auth()
  269    269   
            .endpoint_url("https://example.com");
  270    270   
  271    271   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  272    272   
        let result = client
  273    273   
            .http_query_params_only_operation()
  274    274   
            .set_query_map(::std::option::Option::Some({
  275    275   
                let mut ret = ::std::collections::HashMap::new();
  276         -
                ret.insert("shouldExpandRoles".to_owned(), "true".to_owned());
  277         -
                ret.insert("shouldShowOnlyAuthForThisDocument".to_owned(), "false".to_owned());
         276  +
                ret.insert("a".to_owned(), "b".to_owned());
         277  +
                ret.insert("c".to_owned(), "d".to_owned());
  278    278   
                ret
  279    279   
            }))
  280    280   
            .send()
  281    281   
            .await;
  282    282   
        let _ = dbg!(result);
  283    283   
        let http_request = request_receiver.expect_request();
  284         -
        let expected_query_params = &["shouldExpandRoles=true", "shouldShowOnlyAuthForThisDocument=false"];
         284  +
        let expected_query_params = &["a=b", "c=d"];
  285    285   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  286    286   
        let uri: ::http_1x::Uri = http_request.uri().parse().expect("invalid URI sent");
  287    287   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  288    288   
        ::pretty_assertions::assert_eq!(uri.path(), "/http-query-params-only", "path was incorrect");
  289    289   
    }
  290    290   
  291    291   
    /// Test that empty httpQueryParams map results in no query parameters
  292    292   
    /// Test ID: HttpQueryParamsOnlyEmptyRequest
  293    293   
    #[::tokio::test]
  294    294   
    #[::tracing_test::traced_test]
  295    295   
    async fn http_query_params_only_empty_request_request() {
  296    296   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  297    297   
        let config_builder = crate::config::Config::builder()
  298    298   
            .with_test_defaults()
  299    299   
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
  300    300   
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
  301    301   
            .allow_no_auth()
  302    302   
            .endpoint_url("https://example.com");
  303    303   
  304    304   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  305    305   
        let result = client
  306    306   
            .http_query_params_only_operation()
  307    307   
            .set_query_map(::std::option::Option::Some(::std::collections::HashMap::new()))
  308    308   
            .send()
  309    309   
            .await;
  310    310   
        let _ = dbg!(result);
  311    311   
        let http_request = request_receiver.expect_request();
  312    312   
        let uri: ::http_1x::Uri = http_request.uri().parse().expect("invalid URI sent");
  313    313   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  314    314   
        ::pretty_assertions::assert_eq!(uri.path(), "/http-query-params-only", "path was incorrect");
  315    315   
    }
  316         -
  317         -
    /// Upper case error modeled lower case
  318         -
    /// Test ID: ServiceLevelErrorClient
  319         -
    #[::tokio::test]
  320         -
    #[::tracing_test::traced_test]
  321         -
    async fn service_level_error_client_response() {
  322         -
        let expected_output = crate::types::error::ExtraError::builder().build();
  323         -
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  324         -
            ::http_1x::response::Builder::new()
  325         -
                .header("X-Amzn-Errortype", "ExtraError")
  326         -
                .status(500)
  327         -
                .body(::aws_smithy_types::body::SdkBody::from(""))
  328         -
                .unwrap(),
  329         -
        )
  330         -
        .unwrap();
  331         -
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  332         -
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  333         -
  334         -
        let op = crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperation::new();
  335         -
        let config = op.config().expect("the operation has config");
  336         -
        let de = config
  337         -
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  338         -
            .expect("the config must have a deserializer");
  339         -
  340         -
        let parsed = de.deserialize_streaming(&mut http_response);
  341         -
        let parsed = parsed.unwrap_or_else(|| {
  342         -
            let http_response = http_response.map(|body| {
  343         -
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  344         -
                    body.bytes().unwrap(),
  345         -
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  346         -
                )))
  347         -
            });
  348         -
            de.deserialize_nonstreaming(&http_response)
  349         -
        });
  350         -
        let parsed = parsed.expect_err("should be error response");
  351         -
        let parsed: &crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationError =
  352         -
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  353         -
        if let crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationError::ExtraError(parsed) = parsed {
  354         -
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  355         -
        } else {
  356         -
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  357         -
        }
  358         -
    }
  359    316   
}
  360    317   
  361    318   
/// Error type for the `HttpQueryParamsOnlyOperationError` operation.
  362    319   
#[non_exhaustive]
  363    320   
#[derive(::std::fmt::Debug)]
  364    321   
pub enum HttpQueryParamsOnlyOperationError {
  365         -
    #[allow(missing_docs)] // documentation missing in model
  366         -
    ExtraError(crate::types::error::ExtraError),
  367    322   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  368    323   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  369    324   
    variable wildcard pattern and check `.code()`:
  370    325   
     \
  371    326   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  372    327   
     \
  373    328   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-HttpQueryParamsOnlyOperationError) for what information is available for the error.")]
  374    329   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  375    330   
}
  376    331   
impl HttpQueryParamsOnlyOperationError {
  377    332   
    /// Creates the `HttpQueryParamsOnlyOperationError::Unhandled` variant from any error type.
  378    333   
    pub fn unhandled(
  379    334   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  380    335   
    ) -> Self {
  381    336   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  382    337   
            source: err.into(),
  383    338   
            meta: ::std::default::Default::default(),
  384    339   
        })
  385    340   
    }
  386    341   
  387    342   
    /// Creates the `HttpQueryParamsOnlyOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  388    343   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  389    344   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  390    345   
            source: err.clone().into(),
  391    346   
            meta: err,
  392    347   
        })
  393    348   
    }
  394    349   
    ///
  395    350   
    /// Returns error metadata, which includes the error code, message,
  396    351   
    /// request ID, and potentially additional information.
  397    352   
    ///
  398    353   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  399    354   
        match self {
  400         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  401    355   
            Self::Unhandled(e) => &e.meta,
  402    356   
        }
  403    357   
    }
  404         -
    /// Returns `true` if the error kind is `HttpQueryParamsOnlyOperationError::ExtraError`.
  405         -
    pub fn is_extra_error(&self) -> bool {
  406         -
        matches!(self, Self::ExtraError(_))
  407         -
    }
  408    358   
}
  409    359   
impl ::std::error::Error for HttpQueryParamsOnlyOperationError {
  410    360   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  411    361   
        match self {
  412         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  413    362   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  414    363   
        }
  415    364   
    }
  416    365   
}
  417    366   
impl ::std::fmt::Display for HttpQueryParamsOnlyOperationError {
  418    367   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  419    368   
        match self {
  420         -
            Self::ExtraError(_inner) => _inner.fmt(f),
  421    369   
            Self::Unhandled(_inner) => {
  422    370   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  423    371   
                    write!(f, "unhandled error ({code})")
  424    372   
                } else {
  425    373   
                    f.write_str("unhandled error")
  426    374   
                }
  427    375   
            }
  428    376   
        }
  429    377   
    }
  430    378   
}
  431    379   
impl ::aws_smithy_types::retry::ProvideErrorKind for HttpQueryParamsOnlyOperationError {
  432    380   
    fn code(&self) -> ::std::option::Option<&str> {
  433    381   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  434    382   
    }
  435    383   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  436    384   
        ::std::option::Option::None
  437    385   
    }
  438    386   
}
  439    387   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for HttpQueryParamsOnlyOperationError {
  440    388   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  441    389   
        match self {
  442         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  443    390   
            Self::Unhandled(_inner) => &_inner.meta,
  444    391   
        }
  445    392   
    }
  446    393   
}
  447    394   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for HttpQueryParamsOnlyOperationError {
  448    395   
    fn create_unhandled_error(
  449    396   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  450    397   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  451    398   
    ) -> Self {
  452    399   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  453    400   
            source,
  454    401   
            meta: meta.unwrap_or_default(),
  455    402   
        })
  456    403   
    }
  457    404   
}
  458    405   
  459         -
pub use crate::operation::http_query_params_only_operation::_http_query_params_only_operation_output::HttpQueryParamsOnlyOperationOutput;
  460         -
  461    406   
pub use crate::operation::http_query_params_only_operation::_http_query_params_only_operation_input::HttpQueryParamsOnlyOperationInput;
  462    407   
         408  +
pub use crate::operation::http_query_params_only_operation::_http_query_params_only_operation_output::HttpQueryParamsOnlyOperationOutput;
         409  +
  463    410   
mod _http_query_params_only_operation_input;
  464    411   
  465    412   
mod _http_query_params_only_operation_output;
  466    413   
  467    414   
/// Builders
  468    415   
pub mod builders;

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

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

@@ -1,1 +54,55 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::http_query_params_only_operation::_http_query_params_only_operation_output::HttpQueryParamsOnlyOperationOutputBuilder;
    3         -
    4      2   
pub use crate::operation::http_query_params_only_operation::_http_query_params_only_operation_input::HttpQueryParamsOnlyOperationInputBuilder;
    5      3   
           4  +
pub use crate::operation::http_query_params_only_operation::_http_query_params_only_operation_output::HttpQueryParamsOnlyOperationOutputBuilder;
           5  +
    6      6   
impl crate::operation::http_query_params_only_operation::builders::HttpQueryParamsOnlyOperationInputBuilder {
    7      7   
    /// Sends a request with this input using the given client.
    8      8   
    pub async fn send_with(
    9      9   
        self,
   10     10   
        client: &crate::Client,
   11     11   
    ) -> ::std::result::Result<
   12     12   
        crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     16   
        >,
   17     17   
    > {
   18     18   
        let mut fluent_builder = client.http_query_params_only_operation();
   19     19   
        fluent_builder.inner = self;
   20     20   
        fluent_builder.send().await
   21     21   
    }
   22     22   
}
   23     23   
/// Fluent builder constructing a request to `HttpQueryParamsOnlyOperation`.
   24     24   
///
          25  +
/// This example tests httpQueryParams when no other query parameters exist.
   25     26   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   26     27   
pub struct HttpQueryParamsOnlyOperationFluentBuilder {
   27     28   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     29   
    inner: crate::operation::http_query_params_only_operation::builders::HttpQueryParamsOnlyOperationInputBuilder,
   29     30   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     31   
}
   31     32   
impl
   32     33   
    crate::client::customize::internal::CustomizableSend<
   33     34   
        crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationOutput,
   34     35   
        crate::operation::http_query_params_only_operation::HttpQueryParamsOnlyOperationError,