Client Test

Client Test

rev. 7254d43655ed63111c94f599437f2b0d3f55446e (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/constant_query_string/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::constant_query_string::_constant_query_string_output::ConstantQueryStringOutputBuilder;
    3         -
    4      2   
pub use crate::operation::constant_query_string::_constant_query_string_input::ConstantQueryStringInputBuilder;
    5      3   
           4  +
pub use crate::operation::constant_query_string::_constant_query_string_output::ConstantQueryStringOutputBuilder;
           5  +
    6      6   
impl crate::operation::constant_query_string::builders::ConstantQueryStringInputBuilder {
    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::constant_query_string::ConstantQueryStringOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::constant_query_string::ConstantQueryStringError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -300,300 +339,339 @@
  320    320   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  321    321   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  322    322   
    ) -> Self {
  323    323   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  324    324   
            source,
  325    325   
            meta: meta.unwrap_or_default(),
  326    326   
        })
  327    327   
    }
  328    328   
}
  329    329   
  330         -
pub use crate::operation::content_type_parameters::_content_type_parameters_output::ContentTypeParametersOutput;
  331         -
  332    330   
pub use crate::operation::content_type_parameters::_content_type_parameters_input::ContentTypeParametersInput;
  333    331   
         332  +
pub use crate::operation::content_type_parameters::_content_type_parameters_output::ContentTypeParametersOutput;
         333  +
  334    334   
mod _content_type_parameters_input;
  335    335   
  336    336   
mod _content_type_parameters_output;
  337    337   
  338    338   
/// Builders
  339    339   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/content_type_parameters/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::content_type_parameters::_content_type_parameters_output::ContentTypeParametersOutputBuilder;
    3         -
    4      2   
pub use crate::operation::content_type_parameters::_content_type_parameters_input::ContentTypeParametersInputBuilder;
    5      3   
           4  +
pub use crate::operation::content_type_parameters::_content_type_parameters_output::ContentTypeParametersOutputBuilder;
           5  +
    6      6   
impl crate::operation::content_type_parameters::builders::ContentTypeParametersInputBuilder {
    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::content_type_parameters::ContentTypeParametersOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::content_type_parameters::ContentTypeParametersError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -389,389 +428,428 @@
  409    409   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  410    410   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  411    411   
    ) -> Self {
  412    412   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  413    413   
            source,
  414    414   
            meta: meta.unwrap_or_default(),
  415    415   
        })
  416    416   
    }
  417    417   
}
  418    418   
  419         -
pub use crate::operation::datetime_offsets::_datetime_offsets_output::DatetimeOffsetsOutput;
  420         -
  421    419   
pub use crate::operation::datetime_offsets::_datetime_offsets_input::DatetimeOffsetsInput;
  422    420   
         421  +
pub use crate::operation::datetime_offsets::_datetime_offsets_output::DatetimeOffsetsOutput;
         422  +
  423    423   
mod _datetime_offsets_input;
  424    424   
  425    425   
mod _datetime_offsets_output;
  426    426   
  427    427   
/// Builders
  428    428   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/datetime_offsets/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::datetime_offsets::_datetime_offsets_output::DatetimeOffsetsOutputBuilder;
    3         -
    4      2   
pub use crate::operation::datetime_offsets::_datetime_offsets_input::DatetimeOffsetsInputBuilder;
    5      3   
           4  +
pub use crate::operation::datetime_offsets::_datetime_offsets_output::DatetimeOffsetsOutputBuilder;
           5  +
    6      6   
impl crate::operation::datetime_offsets::builders::DatetimeOffsetsInputBuilder {
    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::datetime_offsets::DatetimeOffsetsOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::datetime_offsets::DatetimeOffsetsError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -782,782 +821,821 @@
  802    802   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  803    803   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  804    804   
    ) -> Self {
  805    805   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  806    806   
            source,
  807    807   
            meta: meta.unwrap_or_default(),
  808    808   
        })
  809    809   
    }
  810    810   
}
  811    811   
  812         -
pub use crate::operation::document_type::_document_type_output::DocumentTypeOutput;
  813         -
  814    812   
pub use crate::operation::document_type::_document_type_input::DocumentTypeInput;
  815    813   
         814  +
pub use crate::operation::document_type::_document_type_output::DocumentTypeOutput;
         815  +
  816    816   
mod _document_type_input;
  817    817   
  818    818   
mod _document_type_output;
  819    819   
  820    820   
/// Builders
  821    821   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_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::document_type::_document_type_output::DocumentTypeOutputBuilder;
    3         -
    4      2   
pub use crate::operation::document_type::_document_type_input::DocumentTypeInputBuilder;
    5      3   
           4  +
pub use crate::operation::document_type::_document_type_output::DocumentTypeOutputBuilder;
           5  +
    6      6   
impl crate::operation::document_type::builders::DocumentTypeInputBuilder {
    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::document_type::DocumentTypeOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::document_type::DocumentTypeError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -431,431 +470,470 @@
  451    451   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  452    452   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  453    453   
    ) -> Self {
  454    454   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  455    455   
            source,
  456    456   
            meta: meta.unwrap_or_default(),
  457    457   
        })
  458    458   
    }
  459    459   
}
  460    460   
  461         -
pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_output::DocumentTypeAsMapValueOutput;
  462         -
  463    461   
pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_input::DocumentTypeAsMapValueInput;
  464    462   
         463  +
pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_output::DocumentTypeAsMapValueOutput;
         464  +
  465    465   
mod _document_type_as_map_value_input;
  466    466   
  467    467   
mod _document_type_as_map_value_output;
  468    468   
  469    469   
/// Builders
  470    470   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type_as_map_value/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::document_type_as_map_value::_document_type_as_map_value_output::DocumentTypeAsMapValueOutputBuilder;
    3         -
    4      2   
pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_input::DocumentTypeAsMapValueInputBuilder;
    5      3   
           4  +
pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_output::DocumentTypeAsMapValueOutputBuilder;
           5  +
    6      6   
impl crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueInputBuilder {
    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::document_type_as_map_value::DocumentTypeAsMapValueOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -485,485 +524,524 @@
  505    505   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  506    506   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  507    507   
    ) -> Self {
  508    508   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  509    509   
            source,
  510    510   
            meta: meta.unwrap_or_default(),
  511    511   
        })
  512    512   
    }
  513    513   
}
  514    514   
  515         -
pub use crate::operation::document_type_as_payload::_document_type_as_payload_output::DocumentTypeAsPayloadOutput;
  516         -
  517    515   
pub use crate::operation::document_type_as_payload::_document_type_as_payload_input::DocumentTypeAsPayloadInput;
  518    516   
         517  +
pub use crate::operation::document_type_as_payload::_document_type_as_payload_output::DocumentTypeAsPayloadOutput;
         518  +
  519    519   
mod _document_type_as_payload_input;
  520    520   
  521    521   
mod _document_type_as_payload_output;
  522    522   
  523    523   
/// Builders
  524    524   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type_as_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::document_type_as_payload::_document_type_as_payload_output::DocumentTypeAsPayloadOutputBuilder;
    3         -
    4      2   
pub use crate::operation::document_type_as_payload::_document_type_as_payload_input::DocumentTypeAsPayloadInputBuilder;
    5      3   
           4  +
pub use crate::operation::document_type_as_payload::_document_type_as_payload_output::DocumentTypeAsPayloadOutputBuilder;
           5  +
    6      6   
impl crate::operation::document_type_as_payload::builders::DocumentTypeAsPayloadInputBuilder {
    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::document_type_as_payload::DocumentTypeAsPayloadOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     14   
            crate::operation::document_type_as_payload::DocumentTypeAsPayloadError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,

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

@@ -0,1 +0,362 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `DuplexStream`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct DuplexStream;
           6  +
impl DuplexStream {
           7  +
    /// Creates a new `DuplexStream`
           8  +
    pub fn new() -> Self {
           9  +
        Self
          10  +
    }
          11  +
    pub(crate) async fn orchestrate(
          12  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          13  +
        input: crate::operation::duplex_stream::DuplexStreamInput,
          14  +
    ) -> ::std::result::Result<
          15  +
        crate::operation::duplex_stream::DuplexStreamOutput,
          16  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          17  +
            crate::operation::duplex_stream::DuplexStreamError,
          18  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          19  +
        >,
          20  +
    > {
          21  +
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
          22  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          23  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          24  +
        >| {
          25  +
            err.map_service_error(|err| {
          26  +
                err.downcast::<crate::operation::duplex_stream::DuplexStreamError>()
          27  +
                    .expect("correct error type")
          28  +
            })
          29  +
        };
          30  +
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
          31  +
            .await
          32  +
            .map_err(map_err)?;
          33  +
        let output = context.finalize().map_err(map_err)?;
          34  +
        ::std::result::Result::Ok(
          35  +
            output
          36  +
                .downcast::<crate::operation::duplex_stream::DuplexStreamOutput>()
          37  +
                .expect("correct output type"),
          38  +
        )
          39  +
    }
          40  +
          41  +
    pub(crate) async fn orchestrate_with_stop_point(
          42  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          43  +
        input: crate::operation::duplex_stream::DuplexStreamInput,
          44  +
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
          45  +
    ) -> ::std::result::Result<
          46  +
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
          47  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          48  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          49  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          50  +
        >,
          51  +
    > {
          52  +
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
          53  +
        use ::tracing::Instrument;
          54  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Rest Json Protocol", "DuplexStream", input, runtime_plugins, stop_point)
          55  +
            // Create a parent span for the entire operation. Includes a random, internal-only,
          56  +
            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
          57  +
            .instrument(::tracing::debug_span!(
          58  +
                "Rest Json Protocol.DuplexStream",
          59  +
                "rpc.service" = "Rest Json Protocol",
          60  +
                "rpc.method" = "DuplexStream",
          61  +
                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
          62  +
            ))
          63  +
            .await
          64  +
    }
          65  +
          66  +
    pub(crate) fn operation_runtime_plugins(
          67  +
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          68  +
        client_config: &crate::config::Config,
          69  +
        config_override: ::std::option::Option<crate::config::Builder>,
          70  +
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
          71  +
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
          72  +
          73  +
        if let ::std::option::Option::Some(config_override) = config_override {
          74  +
            for plugin in config_override.runtime_plugins.iter().cloned() {
          75  +
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
          76  +
            }
          77  +
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
          78  +
                config_override,
          79  +
                client_config.config.clone(),
          80  +
                &client_config.runtime_components,
          81  +
            ));
          82  +
        }
          83  +
        runtime_plugins
          84  +
    }
          85  +
}
          86  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DuplexStream {
          87  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
          88  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DuplexStream");
          89  +
          90  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
          91  +
            DuplexStreamRequestSerializer,
          92  +
        ));
          93  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
          94  +
            DuplexStreamResponseDeserializer,
          95  +
        ));
          96  +
          97  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
          98  +
            crate::config::auth::Params::builder()
          99  +
                .operation_name("DuplexStream")
         100  +
                .build()
         101  +
                .expect("required fields set"),
         102  +
        ));
         103  +
         104  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         105  +
            "DuplexStream",
         106  +
            "Rest Json Protocol",
         107  +
        ));
         108  +
         109  +
        ::std::option::Option::Some(cfg.freeze())
         110  +
    }
         111  +
         112  +
    fn runtime_components(
         113  +
        &self,
         114  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         115  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         116  +
        #[allow(unused_mut)]
         117  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DuplexStream")
         118  +
            .with_interceptor(DuplexStreamEndpointParamsInterceptor)
         119  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         120  +
                crate::operation::duplex_stream::DuplexStreamError,
         121  +
            >::new())
         122  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         123  +
                crate::operation::duplex_stream::DuplexStreamError,
         124  +
            >::new());
         125  +
         126  +
        ::std::borrow::Cow::Owned(rcb)
         127  +
    }
         128  +
}
         129  +
         130  +
#[derive(Debug)]
         131  +
struct DuplexStreamResponseDeserializer;
         132  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DuplexStreamResponseDeserializer {
         133  +
    fn deserialize_streaming(
         134  +
        &self,
         135  +
        response: &mut ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         136  +
    ) -> ::std::option::Option<::aws_smithy_runtime_api::client::interceptors::context::OutputOrError> {
         137  +
        #[allow(unused_mut)]
         138  +
        let mut force_error = false;
         139  +
         140  +
        // If this is an error, defer to the non-streaming parser
         141  +
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
         142  +
            return ::std::option::Option::None;
         143  +
        }
         144  +
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
         145  +
            crate::protocol_serde::shape_duplex_stream::de_duplex_stream_http_response(response),
         146  +
        ))
         147  +
    }
         148  +
         149  +
    fn deserialize_nonstreaming(
         150  +
        &self,
         151  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         152  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         153  +
        // For streaming operations, we only hit this case if its an error
         154  +
        let body = response.body().bytes().expect("body loaded");
         155  +
        crate::protocol_serde::type_erase_result(crate::protocol_serde::shape_duplex_stream::de_duplex_stream_http_error(
         156  +
            response.status().as_u16(),
         157  +
            response.headers(),
         158  +
            body,
         159  +
        ))
         160  +
    }
         161  +
}
         162  +
#[derive(Debug)]
         163  +
struct DuplexStreamRequestSerializer;
         164  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DuplexStreamRequestSerializer {
         165  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         166  +
    fn serialize_input(
         167  +
        &self,
         168  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         169  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         170  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         171  +
        let input = input
         172  +
            .downcast::<crate::operation::duplex_stream::DuplexStreamInput>()
         173  +
            .expect("correct type");
         174  +
        let _header_serialization_settings = _cfg
         175  +
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
         176  +
            .cloned()
         177  +
            .unwrap_or_default();
         178  +
        let mut request_builder = {
         179  +
            #[allow(clippy::uninlined_format_args)]
         180  +
            fn uri_base(
         181  +
                _input: &crate::operation::duplex_stream::DuplexStreamInput,
         182  +
                output: &mut ::std::string::String,
         183  +
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
         184  +
                use ::std::fmt::Write as _;
         185  +
                ::std::write!(output, "/DuplexStream").expect("formatting should succeed");
         186  +
                ::std::result::Result::Ok(())
         187  +
            }
         188  +
            #[allow(clippy::unnecessary_wraps)]
         189  +
            fn update_http_builder(
         190  +
                input: &crate::operation::duplex_stream::DuplexStreamInput,
         191  +
                builder: ::http_1x::request::Builder,
         192  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         193  +
                let mut uri = ::std::string::String::new();
         194  +
                uri_base(input, &mut uri)?;
         195  +
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
         196  +
            }
         197  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         198  +
            builder =
         199  +
                _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/vnd.amazon.eventstream");
         200  +
            builder
         201  +
        };
         202  +
        let body = ::aws_smithy_types::body::SdkBody::from({
         203  +
            let error_marshaller = crate::event_stream_serde::EventStreamErrorMarshaller::new();
         204  +
            let marshaller = crate::event_stream_serde::EventStreamMarshaller::new();
         205  +
            let (signer, signer_sender) = ::aws_smithy_eventstream::frame::DeferredSigner::new();
         206  +
            _cfg.interceptor_state().store_put(signer_sender);
         207  +
            ::aws_smithy_types::body::SdkBody::from_body_1_x(::http_body_util::StreamBody::new(input.stream.into_body_stream(
         208  +
                marshaller,
         209  +
                error_marshaller,
         210  +
                signer,
         211  +
            )))
         212  +
        });
         213  +
        if let Some(content_length) = body.content_length() {
         214  +
            let content_length = content_length.to_string();
         215  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
         216  +
        }
         217  +
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         218  +
    }
         219  +
}
         220  +
#[derive(Debug)]
         221  +
struct DuplexStreamEndpointParamsInterceptor;
         222  +
         223  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DuplexStreamEndpointParamsInterceptor {
         224  +
    fn name(&self) -> &'static str {
         225  +
        "DuplexStreamEndpointParamsInterceptor"
         226  +
    }
         227  +
         228  +
    fn read_before_execution(
         229  +
        &self,
         230  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         231  +
            '_,
         232  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         233  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         234  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         235  +
        >,
         236  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         237  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         238  +
        let _input = context
         239  +
            .input()
         240  +
            .downcast_ref::<DuplexStreamInput>()
         241  +
            .ok_or("failed to downcast to DuplexStreamInput")?;
         242  +
         243  +
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
         244  +
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         245  +
        })?;
         246  +
        cfg.interceptor_state()
         247  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         248  +
        ::std::result::Result::Ok(())
         249  +
    }
         250  +
}
         251  +
         252  +
// The get_* functions below are generated from JMESPath expressions in the
         253  +
// operationContextParams trait. They target the operation's input shape.
         254  +
         255  +
/// Error type for the `DuplexStreamError` operation.
         256  +
#[non_exhaustive]
         257  +
#[derive(::std::fmt::Debug)]
         258  +
pub enum DuplexStreamError {
         259  +
    #[allow(missing_docs)] // documentation missing in model
         260  +
    ErrorEvent(crate::types::error::ErrorEvent),
         261  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         262  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         263  +
    variable wildcard pattern and check `.code()`:
         264  +
     \
         265  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         266  +
     \
         267  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DuplexStreamError) for what information is available for the error.")]
         268  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         269  +
}
         270  +
impl DuplexStreamError {
         271  +
    /// Creates the `DuplexStreamError::Unhandled` variant from any error type.
         272  +
    pub fn unhandled(
         273  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         274  +
    ) -> Self {
         275  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         276  +
            source: err.into(),
         277  +
            meta: ::std::default::Default::default(),
         278  +
        })
         279  +
    }
         280  +
         281  +
    /// Creates the `DuplexStreamError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         282  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         283  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         284  +
            source: err.clone().into(),
         285  +
            meta: err,
         286  +
        })
         287  +
    }
         288  +
    ///
         289  +
    /// Returns error metadata, which includes the error code, message,
         290  +
    /// request ID, and potentially additional information.
         291  +
    ///
         292  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         293  +
        match self {
         294  +
            Self::ErrorEvent(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         295  +
            Self::Unhandled(e) => &e.meta,
         296  +
        }
         297  +
    }
         298  +
    /// Returns `true` if the error kind is `DuplexStreamError::ErrorEvent`.
         299  +
    pub fn is_error_event(&self) -> bool {
         300  +
        matches!(self, Self::ErrorEvent(_))
         301  +
    }
         302  +
}
         303  +
impl ::std::error::Error for DuplexStreamError {
         304  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         305  +
        match self {
         306  +
            Self::ErrorEvent(_inner) => ::std::option::Option::Some(_inner),
         307  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         308  +
        }
         309  +
    }
         310  +
}
         311  +
impl ::std::fmt::Display for DuplexStreamError {
         312  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         313  +
        match self {
         314  +
            Self::ErrorEvent(_inner) => _inner.fmt(f),
         315  +
            Self::Unhandled(_inner) => {
         316  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         317  +
                    write!(f, "unhandled error ({code})")
         318  +
                } else {
         319  +
                    f.write_str("unhandled error")
         320  +
                }
         321  +
            }
         322  +
        }
         323  +
    }
         324  +
}
         325  +
impl ::aws_smithy_types::retry::ProvideErrorKind for DuplexStreamError {
         326  +
    fn code(&self) -> ::std::option::Option<&str> {
         327  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         328  +
    }
         329  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         330  +
        ::std::option::Option::None
         331  +
    }
         332  +
}
         333  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DuplexStreamError {
         334  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         335  +
        match self {
         336  +
            Self::ErrorEvent(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         337  +
            Self::Unhandled(_inner) => &_inner.meta,
         338  +
        }
         339  +
    }
         340  +
}
         341  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DuplexStreamError {
         342  +
    fn create_unhandled_error(
         343  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         344  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         345  +
    ) -> Self {
         346  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         347  +
            source,
         348  +
            meta: meta.unwrap_or_default(),
         349  +
        })
         350  +
    }
         351  +
}
         352  +
         353  +
pub use crate::operation::duplex_stream::_duplex_stream_input::DuplexStreamInput;
         354  +
         355  +
pub use crate::operation::duplex_stream::_duplex_stream_output::DuplexStreamOutput;
         356  +
         357  +
mod _duplex_stream_input;
         358  +
         359  +
mod _duplex_stream_output;
         360  +
         361  +
/// Builders
         362  +
pub mod builders;

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

@@ -0,1 +0,70 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::fmt::Debug)]
           5  +
pub struct DuplexStreamInput {
           6  +
    #[allow(missing_docs)] // documentation missing in model
           7  +
    pub stream: ::aws_smithy_http::event_stream::EventStreamSender<crate::types::EventStream, crate::types::error::EventStreamError>,
           8  +
}
           9  +
impl DuplexStreamInput {
          10  +
    #[allow(missing_docs)] // documentation missing in model
          11  +
    pub fn stream(&self) -> &::aws_smithy_http::event_stream::EventStreamSender<crate::types::EventStream, crate::types::error::EventStreamError> {
          12  +
        &self.stream
          13  +
    }
          14  +
}
          15  +
impl DuplexStreamInput {
          16  +
    /// Creates a new builder-style object to manufacture [`DuplexStreamInput`](crate::operation::duplex_stream::DuplexStreamInput).
          17  +
    pub fn builder() -> crate::operation::duplex_stream::builders::DuplexStreamInputBuilder {
          18  +
        crate::operation::duplex_stream::builders::DuplexStreamInputBuilder::default()
          19  +
    }
          20  +
}
          21  +
          22  +
/// A builder for [`DuplexStreamInput`](crate::operation::duplex_stream::DuplexStreamInput).
          23  +
#[derive(::std::default::Default, ::std::fmt::Debug)]
          24  +
#[non_exhaustive]
          25  +
pub struct DuplexStreamInputBuilder {
          26  +
    pub(crate) stream:
          27  +
        ::std::option::Option<::aws_smithy_http::event_stream::EventStreamSender<crate::types::EventStream, crate::types::error::EventStreamError>>,
          28  +
}
          29  +
impl DuplexStreamInputBuilder {
          30  +
    #[allow(missing_docs)] // documentation missing in model
          31  +
    pub fn stream(
          32  +
        mut self,
          33  +
        input: ::aws_smithy_http::event_stream::EventStreamSender<crate::types::EventStream, crate::types::error::EventStreamError>,
          34  +
    ) -> Self {
          35  +
        self.stream = ::std::option::Option::Some(input);
          36  +
        self
          37  +
    }
          38  +
    #[allow(missing_docs)] // documentation missing in model
          39  +
    pub fn set_stream(
          40  +
        mut self,
          41  +
        input: ::std::option::Option<
          42  +
            ::aws_smithy_http::event_stream::EventStreamSender<crate::types::EventStream, crate::types::error::EventStreamError>,
          43  +
        >,
          44  +
    ) -> Self {
          45  +
        self.stream = input;
          46  +
        self
          47  +
    }
          48  +
    #[allow(missing_docs)] // documentation missing in model
          49  +
    pub fn get_stream(
          50  +
        &self,
          51  +
    ) -> &::std::option::Option<::aws_smithy_http::event_stream::EventStreamSender<crate::types::EventStream, crate::types::error::EventStreamError>>
          52  +
    {
          53  +
        &self.stream
          54  +
    }
          55  +
    /// Consumes the builder and constructs a [`DuplexStreamInput`](crate::operation::duplex_stream::DuplexStreamInput).
          56  +
    /// This method will fail if any of the following fields are not set:
          57  +
    /// - [`stream`](crate::operation::duplex_stream::builders::DuplexStreamInputBuilder::stream)
          58  +
    pub fn build(
          59  +
        self,
          60  +
    ) -> ::std::result::Result<crate::operation::duplex_stream::DuplexStreamInput, ::aws_smithy_types::error::operation::BuildError> {
          61  +
        ::std::result::Result::Ok(crate::operation::duplex_stream::DuplexStreamInput {
          62  +
            stream: self.stream.ok_or_else(|| {
          63  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
          64  +
                    "stream",
          65  +
                    "stream was not specified but it is required when building DuplexStreamInput",
          66  +
                )
          67  +
            })?,
          68  +
        })
          69  +
    }
          70  +
}

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

@@ -0,1 +0,63 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::fmt::Debug)]
           5  +
pub struct DuplexStreamOutput {
           6  +
    #[allow(missing_docs)] // documentation missing in model
           7  +
    pub stream: crate::event_receiver::EventReceiver<crate::types::EventStream, crate::types::error::EventStreamError>,
           8  +
}
           9  +
impl DuplexStreamOutput {
          10  +
    #[allow(missing_docs)] // documentation missing in model
          11  +
    pub fn stream(&self) -> &crate::event_receiver::EventReceiver<crate::types::EventStream, crate::types::error::EventStreamError> {
          12  +
        &self.stream
          13  +
    }
          14  +
}
          15  +
impl DuplexStreamOutput {
          16  +
    /// Creates a new builder-style object to manufacture [`DuplexStreamOutput`](crate::operation::duplex_stream::DuplexStreamOutput).
          17  +
    pub fn builder() -> crate::operation::duplex_stream::builders::DuplexStreamOutputBuilder {
          18  +
        crate::operation::duplex_stream::builders::DuplexStreamOutputBuilder::default()
          19  +
    }
          20  +
}
          21  +
          22  +
/// A builder for [`DuplexStreamOutput`](crate::operation::duplex_stream::DuplexStreamOutput).
          23  +
#[derive(::std::default::Default, ::std::fmt::Debug)]
          24  +
#[non_exhaustive]
          25  +
pub struct DuplexStreamOutputBuilder {
          26  +
    pub(crate) stream: ::std::option::Option<crate::event_receiver::EventReceiver<crate::types::EventStream, crate::types::error::EventStreamError>>,
          27  +
}
          28  +
impl DuplexStreamOutputBuilder {
          29  +
    #[allow(missing_docs)] // documentation missing in model
          30  +
    pub fn stream(mut self, input: crate::event_receiver::EventReceiver<crate::types::EventStream, crate::types::error::EventStreamError>) -> Self {
          31  +
        self.stream = ::std::option::Option::Some(input);
          32  +
        self
          33  +
    }
          34  +
    #[allow(missing_docs)] // documentation missing in model
          35  +
    pub fn set_stream(
          36  +
        mut self,
          37  +
        input: ::std::option::Option<crate::event_receiver::EventReceiver<crate::types::EventStream, crate::types::error::EventStreamError>>,
          38  +
    ) -> Self {
          39  +
        self.stream = input;
          40  +
        self
          41  +
    }
          42  +
    #[allow(missing_docs)] // documentation missing in model
          43  +
    pub fn get_stream(
          44  +
        &self,
          45  +
    ) -> &::std::option::Option<crate::event_receiver::EventReceiver<crate::types::EventStream, crate::types::error::EventStreamError>> {
          46  +
        &self.stream
          47  +
    }
          48  +
    /// Consumes the builder and constructs a [`DuplexStreamOutput`](crate::operation::duplex_stream::DuplexStreamOutput).
          49  +
    /// This method will fail if any of the following fields are not set:
          50  +
    /// - [`stream`](crate::operation::duplex_stream::builders::DuplexStreamOutputBuilder::stream)
          51  +
    pub fn build(
          52  +
        self,
          53  +
    ) -> ::std::result::Result<crate::operation::duplex_stream::DuplexStreamOutput, ::aws_smithy_types::error::operation::BuildError> {
          54  +
        ::std::result::Result::Ok(crate::operation::duplex_stream::DuplexStreamOutput {
          55  +
            stream: self.stream.ok_or_else(|| {
          56  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
          57  +
                    "stream",
          58  +
                    "stream was not specified but it is required when building DuplexStreamOutput",
          59  +
                )
          60  +
            })?,
          61  +
        })
          62  +
    }
          63  +
}

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

@@ -0,1 +0,165 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::duplex_stream::_duplex_stream_input::DuplexStreamInputBuilder;
           3  +
           4  +
pub use crate::operation::duplex_stream::_duplex_stream_output::DuplexStreamOutputBuilder;
           5  +
           6  +
impl crate::operation::duplex_stream::builders::DuplexStreamInputBuilder {
           7  +
    /// Sends a request with this input using the given client.
           8  +
    pub async fn send_with(
           9  +
        self,
          10  +
        client: &crate::Client,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::operation::duplex_stream::DuplexStreamOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::duplex_stream::DuplexStreamError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.duplex_stream();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `DuplexStream`.
          24  +
///
          25  +
#[derive(::std::fmt::Debug)]
          26  +
pub struct DuplexStreamFluentBuilder {
          27  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          28  +
    inner: crate::operation::duplex_stream::builders::DuplexStreamInputBuilder,
          29  +
    config_override: ::std::option::Option<crate::config::Builder>,
          30  +
}
          31  +
impl
          32  +
    crate::client::customize::internal::CustomizableSend<
          33  +
        crate::operation::duplex_stream::DuplexStreamOutput,
          34  +
        crate::operation::duplex_stream::DuplexStreamError,
          35  +
    > for DuplexStreamFluentBuilder
          36  +
{
          37  +
    fn send(
          38  +
        self,
          39  +
        config_override: crate::config::Builder,
          40  +
    ) -> crate::client::customize::internal::BoxFuture<
          41  +
        crate::client::customize::internal::SendResult<
          42  +
            crate::operation::duplex_stream::DuplexStreamOutput,
          43  +
            crate::operation::duplex_stream::DuplexStreamError,
          44  +
        >,
          45  +
    > {
          46  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          47  +
    }
          48  +
}
          49  +
impl DuplexStreamFluentBuilder {
          50  +
    /// Creates a new `DuplexStreamFluentBuilder`.
          51  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          52  +
        Self {
          53  +
            handle,
          54  +
            inner: ::std::default::Default::default(),
          55  +
            config_override: ::std::option::Option::None,
          56  +
        }
          57  +
    }
          58  +
    /// Access the DuplexStream as a reference.
          59  +
    pub fn as_input(&self) -> &crate::operation::duplex_stream::builders::DuplexStreamInputBuilder {
          60  +
        &self.inner
          61  +
    }
          62  +
    /// Sends the request and returns the response.
          63  +
    ///
          64  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          65  +
    /// can be matched against.
          66  +
    ///
          67  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          68  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          69  +
    /// set when configuring the client.
          70  +
    pub async fn send(
          71  +
        self,
          72  +
    ) -> ::std::result::Result<
          73  +
        crate::operation::duplex_stream::DuplexStreamOutput,
          74  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          75  +
            crate::operation::duplex_stream::DuplexStreamError,
          76  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          77  +
        >,
          78  +
    > {
          79  +
        let input = self
          80  +
            .inner
          81  +
            .build()
          82  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          83  +
        let runtime_plugins = crate::operation::duplex_stream::DuplexStream::operation_runtime_plugins(
          84  +
            self.handle.runtime_plugins.clone(),
          85  +
            &self.handle.conf,
          86  +
            self.config_override,
          87  +
        );
          88  +
        let mut output = crate::operation::duplex_stream::DuplexStream::orchestrate(&runtime_plugins, input).await?;
          89  +
          90  +
        // Converts any error encountered beyond this point into an `SdkError` response error
          91  +
        // with an `HttpResponse`. However, since we have already exited the `orchestrate`
          92  +
        // function, the original `HttpResponse` is no longer available and cannot be restored.
          93  +
        // This means that header information from the original response has been lost.
          94  +
        //
          95  +
        // Note that the response body would have been consumed by the deserializer
          96  +
        // regardless, even if the initial message was hypothetically processed during
          97  +
        // the orchestrator's deserialization phase but later resulted in an error.
          98  +
        fn response_error(
          99  +
            err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
         100  +
        ) -> ::aws_smithy_runtime_api::client::result::SdkError<
         101  +
            crate::operation::duplex_stream::DuplexStreamError,
         102  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         103  +
        > {
         104  +
            ::aws_smithy_runtime_api::client::result::SdkError::response_error(
         105  +
                err,
         106  +
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
         107  +
                    ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
         108  +
                    ::aws_smithy_types::body::SdkBody::empty(),
         109  +
                ),
         110  +
            )
         111  +
        }
         112  +
         113  +
        let message = output.stream.try_recv_initial_response().await.map_err(response_error)?;
         114  +
         115  +
        match message {
         116  +
            ::std::option::Option::Some(_message) => ::std::result::Result::Ok(output),
         117  +
            ::std::option::Option::None => ::std::result::Result::Ok(output),
         118  +
        }
         119  +
    }
         120  +
         121  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
         122  +
    pub fn customize(
         123  +
        self,
         124  +
    ) -> crate::client::customize::CustomizableOperation<
         125  +
        crate::operation::duplex_stream::DuplexStreamOutput,
         126  +
        crate::operation::duplex_stream::DuplexStreamError,
         127  +
        Self,
         128  +
    > {
         129  +
        crate::client::customize::CustomizableOperation::new(self)
         130  +
    }
         131  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         132  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         133  +
        self
         134  +
    }
         135  +
         136  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         137  +
        self.config_override = config_override;
         138  +
        self
         139  +
    }
         140  +
    #[allow(missing_docs)] // documentation missing in model
         141  +
    pub fn stream(
         142  +
        mut self,
         143  +
        input: ::aws_smithy_http::event_stream::EventStreamSender<crate::types::EventStream, crate::types::error::EventStreamError>,
         144  +
    ) -> Self {
         145  +
        self.inner = self.inner.stream(input);
         146  +
        self
         147  +
    }
         148  +
    #[allow(missing_docs)] // documentation missing in model
         149  +
    pub fn set_stream(
         150  +
        mut self,
         151  +
        input: ::std::option::Option<
         152  +
            ::aws_smithy_http::event_stream::EventStreamSender<crate::types::EventStream, crate::types::error::EventStreamError>,
         153  +
        >,
         154  +
    ) -> Self {
         155  +
        self.inner = self.inner.set_stream(input);
         156  +
        self
         157  +
    }
         158  +
    #[allow(missing_docs)] // documentation missing in model
         159  +
    pub fn get_stream(
         160  +
        &self,
         161  +
    ) -> &::std::option::Option<::aws_smithy_http::event_stream::EventStreamSender<crate::types::EventStream, crate::types::error::EventStreamError>>
         162  +
    {
         163  +
        self.inner.get_stream()
         164  +
    }
         165  +
}

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

@@ -0,1 +0,359 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `DuplexStreamWithDistinctStreams`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct DuplexStreamWithDistinctStreams;
           6  +
impl DuplexStreamWithDistinctStreams {
           7  +
    /// Creates a new `DuplexStreamWithDistinctStreams`
           8  +
    pub fn new() -> Self {
           9  +
        Self
          10  +
    }
          11  +
    pub(crate) async fn orchestrate(
          12  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          13  +
        input: crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsInput,
          14  +
    ) -> ::std::result::Result<
          15  +
        crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsOutput,
          16  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          17  +
            crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError,
          18  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          19  +
        >,
          20  +
    > {
          21  +
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
          22  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          23  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          24  +
        >| {
          25  +
            err.map_service_error(|err| {
          26  +
                err.downcast::<crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError>()
          27  +
                    .expect("correct error type")
          28  +
            })
          29  +
        };
          30  +
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
          31  +
            .await
          32  +
            .map_err(map_err)?;
          33  +
        let output = context.finalize().map_err(map_err)?;
          34  +
        ::std::result::Result::Ok(
          35  +
            output
          36  +
                .downcast::<crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsOutput>()
          37  +
                .expect("correct output type"),
          38  +
        )
          39  +
    }
          40  +
          41  +
    pub(crate) async fn orchestrate_with_stop_point(
          42  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          43  +
        input: crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsInput,
          44  +
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
          45  +
    ) -> ::std::result::Result<
          46  +
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
          47  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          48  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          49  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          50  +
        >,
          51  +
    > {
          52  +
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
          53  +
        use ::tracing::Instrument;
          54  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
          55  +
            "Rest Json Protocol",
          56  +
            "DuplexStreamWithDistinctStreams",
          57  +
            input,
          58  +
            runtime_plugins,
          59  +
            stop_point,
          60  +
        )
          61  +
        // Create a parent span for the entire operation. Includes a random, internal-only,
          62  +
        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
          63  +
        .instrument(::tracing::debug_span!(
          64  +
            "Rest Json Protocol.DuplexStreamWithDistinctStreams",
          65  +
            "rpc.service" = "Rest Json Protocol",
          66  +
            "rpc.method" = "DuplexStreamWithDistinctStreams",
          67  +
            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
          68  +
        ))
          69  +
        .await
          70  +
    }
          71  +
          72  +
    pub(crate) fn operation_runtime_plugins(
          73  +
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          74  +
        client_config: &crate::config::Config,
          75  +
        config_override: ::std::option::Option<crate::config::Builder>,
          76  +
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
          77  +
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
          78  +
          79  +
        if let ::std::option::Option::Some(config_override) = config_override {
          80  +
            for plugin in config_override.runtime_plugins.iter().cloned() {
          81  +
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
          82  +
            }
          83  +
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
          84  +
                config_override,
          85  +
                client_config.config.clone(),
          86  +
                &client_config.runtime_components,
          87  +
            ));
          88  +
        }
          89  +
        runtime_plugins
          90  +
    }
          91  +
}
          92  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DuplexStreamWithDistinctStreams {
          93  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
          94  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DuplexStreamWithDistinctStreams");
          95  +
          96  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
          97  +
            DuplexStreamWithDistinctStreamsRequestSerializer,
          98  +
        ));
          99  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
         100  +
            DuplexStreamWithDistinctStreamsResponseDeserializer,
         101  +
        ));
         102  +
         103  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
         104  +
            crate::config::auth::Params::builder()
         105  +
                .operation_name("DuplexStreamWithDistinctStreams")
         106  +
                .build()
         107  +
                .expect("required fields set"),
         108  +
        ));
         109  +
         110  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         111  +
            "DuplexStreamWithDistinctStreams",
         112  +
            "Rest Json Protocol",
         113  +
        ));
         114  +
         115  +
        ::std::option::Option::Some(cfg.freeze())
         116  +
    }
         117  +
         118  +
    fn runtime_components(
         119  +
        &self,
         120  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         121  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         122  +
        #[allow(unused_mut)]
         123  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DuplexStreamWithDistinctStreams")
         124  +
            .with_interceptor(DuplexStreamWithDistinctStreamsEndpointParamsInterceptor)
         125  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         126  +
                crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError,
         127  +
            >::new())
         128  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         129  +
                crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError,
         130  +
            >::new());
         131  +
         132  +
        ::std::borrow::Cow::Owned(rcb)
         133  +
    }
         134  +
}
         135  +
         136  +
#[derive(Debug)]
         137  +
struct DuplexStreamWithDistinctStreamsResponseDeserializer;
         138  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DuplexStreamWithDistinctStreamsResponseDeserializer {
         139  +
    fn deserialize_nonstreaming(
         140  +
        &self,
         141  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         142  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         143  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         144  +
        let headers = response.headers();
         145  +
        let body = response.body().bytes().expect("body loaded");
         146  +
        #[allow(unused_mut)]
         147  +
        let mut force_error = false;
         148  +
         149  +
        let parse_result = if !success && status != 200 || force_error {
         150  +
            crate::protocol_serde::shape_duplex_stream_with_distinct_streams::de_duplex_stream_with_distinct_streams_http_error(status, headers, body)
         151  +
        } else {
         152  +
            crate::protocol_serde::shape_duplex_stream_with_distinct_streams::de_duplex_stream_with_distinct_streams_http_response(
         153  +
                status, headers, body,
         154  +
            )
         155  +
        };
         156  +
        crate::protocol_serde::type_erase_result(parse_result)
         157  +
    }
         158  +
}
         159  +
#[derive(Debug)]
         160  +
struct DuplexStreamWithDistinctStreamsRequestSerializer;
         161  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DuplexStreamWithDistinctStreamsRequestSerializer {
         162  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         163  +
    fn serialize_input(
         164  +
        &self,
         165  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         166  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         167  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         168  +
        let input = input
         169  +
            .downcast::<crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsInput>()
         170  +
            .expect("correct type");
         171  +
        let _header_serialization_settings = _cfg
         172  +
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
         173  +
            .cloned()
         174  +
            .unwrap_or_default();
         175  +
        let mut request_builder = {
         176  +
            #[allow(clippy::uninlined_format_args)]
         177  +
            fn uri_base(
         178  +
                _input: &crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsInput,
         179  +
                output: &mut ::std::string::String,
         180  +
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
         181  +
                use ::std::fmt::Write as _;
         182  +
                ::std::write!(output, "/DuplexStreamWithDistinctStreams").expect("formatting should succeed");
         183  +
                ::std::result::Result::Ok(())
         184  +
            }
         185  +
            #[allow(clippy::unnecessary_wraps)]
         186  +
            fn update_http_builder(
         187  +
                input: &crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsInput,
         188  +
                builder: ::http_1x::request::Builder,
         189  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         190  +
                let mut uri = ::std::string::String::new();
         191  +
                uri_base(input, &mut uri)?;
         192  +
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
         193  +
            }
         194  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         195  +
            builder =
         196  +
                _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/vnd.amazon.eventstream");
         197  +
            builder
         198  +
        };
         199  +
        let body = ::aws_smithy_types::body::SdkBody::from({
         200  +
            let error_marshaller = crate::event_stream_serde::EventStreamErrorMarshaller::new();
         201  +
            let marshaller = crate::event_stream_serde::EventStreamMarshaller::new();
         202  +
            let (signer, signer_sender) = ::aws_smithy_eventstream::frame::DeferredSigner::new();
         203  +
            _cfg.interceptor_state().store_put(signer_sender);
         204  +
            ::aws_smithy_types::body::SdkBody::from_body_1_x(::http_body_util::StreamBody::new(input.stream.into_body_stream(
         205  +
                marshaller,
         206  +
                error_marshaller,
         207  +
                signer,
         208  +
            )))
         209  +
        });
         210  +
        if let Some(content_length) = body.content_length() {
         211  +
            let content_length = content_length.to_string();
         212  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
         213  +
        }
         214  +
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         215  +
    }
         216  +
}
         217  +
#[derive(Debug)]
         218  +
struct DuplexStreamWithDistinctStreamsEndpointParamsInterceptor;
         219  +
         220  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DuplexStreamWithDistinctStreamsEndpointParamsInterceptor {
         221  +
    fn name(&self) -> &'static str {
         222  +
        "DuplexStreamWithDistinctStreamsEndpointParamsInterceptor"
         223  +
    }
         224  +
         225  +
    fn read_before_execution(
         226  +
        &self,
         227  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         228  +
            '_,
         229  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         230  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         231  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         232  +
        >,
         233  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         234  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         235  +
        let _input = context
         236  +
            .input()
         237  +
            .downcast_ref::<DuplexStreamWithDistinctStreamsInput>()
         238  +
            .ok_or("failed to downcast to DuplexStreamWithDistinctStreamsInput")?;
         239  +
         240  +
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
         241  +
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         242  +
        })?;
         243  +
        cfg.interceptor_state()
         244  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         245  +
        ::std::result::Result::Ok(())
         246  +
    }
         247  +
}
         248  +
         249  +
// The get_* functions below are generated from JMESPath expressions in the
         250  +
// operationContextParams trait. They target the operation's input shape.
         251  +
         252  +
/// Error type for the `DuplexStreamWithDistinctStreamsError` operation.
         253  +
#[non_exhaustive]
         254  +
#[derive(::std::fmt::Debug)]
         255  +
pub enum DuplexStreamWithDistinctStreamsError {
         256  +
    #[allow(missing_docs)] // documentation missing in model
         257  +
    ErrorEvent(crate::types::error::ErrorEvent),
         258  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         259  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         260  +
    variable wildcard pattern and check `.code()`:
         261  +
     \
         262  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         263  +
     \
         264  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DuplexStreamWithDistinctStreamsError) for what information is available for the error.")]
         265  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         266  +
}
         267  +
impl DuplexStreamWithDistinctStreamsError {
         268  +
    /// Creates the `DuplexStreamWithDistinctStreamsError::Unhandled` variant from any error type.
         269  +
    pub fn unhandled(
         270  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         271  +
    ) -> Self {
         272  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         273  +
            source: err.into(),
         274  +
            meta: ::std::default::Default::default(),
         275  +
        })
         276  +
    }
         277  +
         278  +
    /// Creates the `DuplexStreamWithDistinctStreamsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         279  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         280  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         281  +
            source: err.clone().into(),
         282  +
            meta: err,
         283  +
        })
         284  +
    }
         285  +
    ///
         286  +
    /// Returns error metadata, which includes the error code, message,
         287  +
    /// request ID, and potentially additional information.
         288  +
    ///
         289  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         290  +
        match self {
         291  +
            Self::ErrorEvent(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         292  +
            Self::Unhandled(e) => &e.meta,
         293  +
        }
         294  +
    }
         295  +
    /// Returns `true` if the error kind is `DuplexStreamWithDistinctStreamsError::ErrorEvent`.
         296  +
    pub fn is_error_event(&self) -> bool {
         297  +
        matches!(self, Self::ErrorEvent(_))
         298  +
    }
         299  +
}
         300  +
impl ::std::error::Error for DuplexStreamWithDistinctStreamsError {
         301  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         302  +
        match self {
         303  +
            Self::ErrorEvent(_inner) => ::std::option::Option::Some(_inner),
         304  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         305  +
        }
         306  +
    }
         307  +
}
         308  +
impl ::std::fmt::Display for DuplexStreamWithDistinctStreamsError {
         309  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         310  +
        match self {
         311  +
            Self::ErrorEvent(_inner) => _inner.fmt(f),
         312  +
            Self::Unhandled(_inner) => {
         313  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         314  +
                    write!(f, "unhandled error ({code})")
         315  +
                } else {
         316  +
                    f.write_str("unhandled error")
         317  +
                }
         318  +
            }
         319  +
        }
         320  +
    }
         321  +
}
         322  +
impl ::aws_smithy_types::retry::ProvideErrorKind for DuplexStreamWithDistinctStreamsError {
         323  +
    fn code(&self) -> ::std::option::Option<&str> {
         324  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         325  +
    }
         326  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         327  +
        ::std::option::Option::None
         328  +
    }
         329  +
}
         330  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DuplexStreamWithDistinctStreamsError {
         331  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         332  +
        match self {
         333  +
            Self::ErrorEvent(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         334  +
            Self::Unhandled(_inner) => &_inner.meta,
         335  +
        }
         336  +
    }
         337  +
}
         338  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DuplexStreamWithDistinctStreamsError {
         339  +
    fn create_unhandled_error(
         340  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         341  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         342  +
    ) -> Self {
         343  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         344  +
            source,
         345  +
            meta: meta.unwrap_or_default(),
         346  +
        })
         347  +
    }
         348  +
}
         349  +
         350  +
pub use crate::operation::duplex_stream_with_distinct_streams::_duplex_stream_with_distinct_streams_input::DuplexStreamWithDistinctStreamsInput;
         351  +
         352  +
pub use crate::operation::duplex_stream_with_distinct_streams::_duplex_stream_with_distinct_streams_output::DuplexStreamWithDistinctStreamsOutput;
         353  +
         354  +
mod _duplex_stream_with_distinct_streams_input;
         355  +
         356  +
mod _duplex_stream_with_distinct_streams_output;
         357  +
         358  +
/// Builders
         359  +
pub mod builders;