Client Test

Client Test

rev. 52a747aa19d8f7ff1fb936dafeb9929959f2f20f (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/capture_pokemon/builders.rs

@@ -65,65 +155,127 @@
   85     85   
    > {
   86     86   
        let input = self
   87     87   
            .inner
   88     88   
            .build()
   89     89   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   90     90   
        let runtime_plugins = crate::operation::capture_pokemon::CapturePokemon::operation_runtime_plugins(
   91     91   
            self.handle.runtime_plugins.clone(),
   92     92   
            &self.handle.conf,
   93     93   
            self.config_override,
   94     94   
        );
   95         -
        let mut output = crate::operation::capture_pokemon::CapturePokemon::orchestrate(&runtime_plugins, input).await?;
          95  +
        let output = crate::operation::capture_pokemon::CapturePokemon::orchestrate(&runtime_plugins, input).await?;
   96     96   
   97         -
        // Converts any error encountered beyond this point into an `SdkError` response error
   98         -
        // with an `HttpResponse`. However, since we have already exited the `orchestrate`
   99         -
        // function, the original `HttpResponse` is no longer available and cannot be restored.
  100         -
        // This means that header information from the original response has been lost.
  101         -
        //
  102         -
        // Note that the response body would have been consumed by the deserializer
  103         -
        // regardless, even if the initial message was hypothetically processed during
  104         -
        // the orchestrator's deserialization phase but later resulted in an error.
  105         -
        fn response_error(
  106         -
            err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
  107         -
        ) -> ::aws_smithy_runtime_api::client::result::SdkError<
  108         -
            crate::operation::capture_pokemon::CapturePokemonError,
  109         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  110         -
        > {
  111         -
            ::aws_smithy_runtime_api::client::result::SdkError::response_error(
  112         -
                err,
  113         -
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
  114         -
                    ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
  115         -
                    ::aws_smithy_types::body::SdkBody::empty(),
  116         -
                ),
  117         -
            )
  118         -
        }
  119         -
  120         -
        let message = output.events.try_recv_initial_response().await.map_err(response_error)?;
  121         -
  122         -
        match message {
  123         -
            ::std::option::Option::Some(_message) => ::std::result::Result::Ok(output),
  124         -
            ::std::option::Option::None => ::std::result::Result::Ok(output),
  125         -
        }
          97  +
        ::std::result::Result::Ok(output)
  126     98   
    }
  127     99   
  128    100   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
  129    101   
    pub fn customize(
  130    102   
        self,
  131    103   
    ) -> crate::client::customize::CustomizableOperation<
  132    104   
        crate::operation::capture_pokemon::CapturePokemonOutput,
  133    105   
        crate::operation::capture_pokemon::CapturePokemonError,
  134    106   
        Self,
  135    107   
    > {

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/operation/capture_pokemon/builders.rs

@@ -59,59 +149,121 @@
   79     79   
    > {
   80     80   
        let input = self
   81     81   
            .inner
   82     82   
            .build()
   83     83   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   84     84   
        let runtime_plugins = crate::operation::capture_pokemon::CapturePokemon::operation_runtime_plugins(
   85     85   
            self.handle.runtime_plugins.clone(),
   86     86   
            &self.handle.conf,
   87     87   
            self.config_override,
   88     88   
        );
   89         -
        let mut output = crate::operation::capture_pokemon::CapturePokemon::orchestrate(&runtime_plugins, input).await?;
          89  +
        let output = crate::operation::capture_pokemon::CapturePokemon::orchestrate(&runtime_plugins, input).await?;
   90     90   
   91         -
        // Converts any error encountered beyond this point into an `SdkError` response error
   92         -
        // with an `HttpResponse`. However, since we have already exited the `orchestrate`
   93         -
        // function, the original `HttpResponse` is no longer available and cannot be restored.
   94         -
        // This means that header information from the original response has been lost.
   95         -
        //
   96         -
        // Note that the response body would have been consumed by the deserializer
   97         -
        // regardless, even if the initial message was hypothetically processed during
   98         -
        // the orchestrator's deserialization phase but later resulted in an error.
   99         -
        fn response_error(
  100         -
            err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
  101         -
        ) -> ::aws_smithy_runtime_api::client::result::SdkError<
  102         -
            crate::operation::capture_pokemon::CapturePokemonError,
  103         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  104         -
        > {
  105         -
            ::aws_smithy_runtime_api::client::result::SdkError::response_error(
  106         -
                err,
  107         -
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
  108         -
                    ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
  109         -
                    ::aws_smithy_types::body::SdkBody::empty(),
  110         -
                ),
  111         -
            )
  112         -
        }
  113         -
  114         -
        let message = output.events.try_recv_initial_response().await.map_err(response_error)?;
  115         -
  116         -
        match message {
  117         -
            ::std::option::Option::Some(_message) => ::std::result::Result::Ok(output),
  118         -
            ::std::option::Option::None => ::std::result::Result::Ok(output),
  119         -
        }
          91  +
        ::std::result::Result::Ok(output)
  120     92   
    }
  121     93   
  122     94   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
  123     95   
    pub fn customize(
  124     96   
        self,
  125     97   
    ) -> crate::client::customize::CustomizableOperation<
  126     98   
        crate::operation::capture_pokemon::CapturePokemonOutput,
  127     99   
        crate::operation::capture_pokemon::CapturePokemonError,
  128    100   
        Self,
  129    101   
    > {

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation/builders.rs

@@ -64,64 +154,126 @@
   84     84   
    > {
   85     85   
        let input = self
   86     86   
            .inner
   87     87   
            .build()
   88     88   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   89     89   
        let runtime_plugins = crate::operation::streaming_operation::StreamingOperation::operation_runtime_plugins(
   90     90   
            self.handle.runtime_plugins.clone(),
   91     91   
            &self.handle.conf,
   92     92   
            self.config_override,
   93     93   
        );
   94         -
        let mut output = crate::operation::streaming_operation::StreamingOperation::orchestrate(&runtime_plugins, input).await?;
          94  +
        let output = crate::operation::streaming_operation::StreamingOperation::orchestrate(&runtime_plugins, input).await?;
   95     95   
   96         -
        // Converts any error encountered beyond this point into an `SdkError` response error
   97         -
        // with an `HttpResponse`. However, since we have already exited the `orchestrate`
   98         -
        // function, the original `HttpResponse` is no longer available and cannot be restored.
   99         -
        // This means that header information from the original response has been lost.
  100         -
        //
  101         -
        // Note that the response body would have been consumed by the deserializer
  102         -
        // regardless, even if the initial message was hypothetically processed during
  103         -
        // the orchestrator's deserialization phase but later resulted in an error.
  104         -
        fn response_error(
  105         -
            err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
  106         -
        ) -> ::aws_smithy_runtime_api::client::result::SdkError<
  107         -
            crate::operation::streaming_operation::StreamingOperationError,
  108         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  109         -
        > {
  110         -
            ::aws_smithy_runtime_api::client::result::SdkError::response_error(
  111         -
                err,
  112         -
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
  113         -
                    ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
  114         -
                    ::aws_smithy_types::body::SdkBody::empty(),
  115         -
                ),
  116         -
            )
  117         -
        }
  118         -
  119         -
        let message = output.events.try_recv_initial_response().await.map_err(response_error)?;
  120         -
  121         -
        match message {
  122         -
            ::std::option::Option::Some(_message) => ::std::result::Result::Ok(output),
  123         -
            ::std::option::Option::None => ::std::result::Result::Ok(output),
  124         -
        }
          96  +
        ::std::result::Result::Ok(output)
  125     97   
    }
  126     98   
  127     99   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
  128    100   
    pub fn customize(
  129    101   
        self,
  130    102   
    ) -> crate::client::customize::CustomizableOperation<
  131    103   
        crate::operation::streaming_operation::StreamingOperationOutput,
  132    104   
        crate::operation::streaming_operation::StreamingOperationError,
  133    105   
        Self,
  134    106   
    > {

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_initial_data/builders.rs

@@ -64,64 +155,127 @@
   84     84   
    > {
   85     85   
        let input = self
   86     86   
            .inner
   87     87   
            .build()
   88     88   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   89     89   
        let runtime_plugins = crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialData::operation_runtime_plugins(
   90     90   
            self.handle.runtime_plugins.clone(),
   91     91   
            &self.handle.conf,
   92     92   
            self.config_override,
   93     93   
        );
   94         -
        let mut output =
          94  +
        let output =
   95     95   
            crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialData::orchestrate(&runtime_plugins, input).await?;
   96     96   
   97         -
        // Converts any error encountered beyond this point into an `SdkError` response error
   98         -
        // with an `HttpResponse`. However, since we have already exited the `orchestrate`
   99         -
        // function, the original `HttpResponse` is no longer available and cannot be restored.
  100         -
        // This means that header information from the original response has been lost.
  101         -
        //
  102         -
        // Note that the response body would have been consumed by the deserializer
  103         -
        // regardless, even if the initial message was hypothetically processed during
  104         -
        // the orchestrator's deserialization phase but later resulted in an error.
  105         -
        fn response_error(
  106         -
            err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
  107         -
        ) -> ::aws_smithy_runtime_api::client::result::SdkError<
  108         -
            crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialDataError,
  109         -
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  110         -
        > {
  111         -
            ::aws_smithy_runtime_api::client::result::SdkError::response_error(
  112         -
                err,
  113         -
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
  114         -
                    ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
  115         -
                    ::aws_smithy_types::body::SdkBody::empty(),
  116         -
                ),
  117         -
            )
  118         -
        }
  119         -
  120         -
        let message = output.events.try_recv_initial_response().await.map_err(response_error)?;
  121         -
  122         -
        match message {
  123         -
            ::std::option::Option::Some(_message) => ::std::result::Result::Ok(output),
  124         -
            ::std::option::Option::None => ::std::result::Result::Ok(output),
  125         -
        }
          97  +
        ::std::result::Result::Ok(output)
  126     98   
    }
  127     99   
  128    100   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
  129    101   
    pub fn customize(
  130    102   
        self,
  131    103   
    ) -> crate::client::customize::CustomizableOperation<
  132    104   
        crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialDataOutput,
  133    105   
        crate::operation::streaming_operation_with_initial_data::StreamingOperationWithInitialDataError,
  134    106   
        Self,
  135    107   
    > {

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_initial_response/builders.rs

@@ -67,67 +168,166 @@
   87     87   
        let input = self
   88     88   
            .inner
   89     89   
            .build()
   90     90   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   91     91   
        let runtime_plugins =
   92     92   
            crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponse::operation_runtime_plugins(
   93     93   
                self.handle.runtime_plugins.clone(),
   94     94   
                &self.handle.conf,
   95     95   
                self.config_override,
   96     96   
            );
   97         -
        let mut output =
          97  +
        let output =
   98     98   
            crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponse::orchestrate(&runtime_plugins, input)
   99     99   
                .await?;
  100    100   
  101    101   
        // Converts any error encountered beyond this point into an `SdkError` response error
  102    102   
        // with an `HttpResponse`. However, since we have already exited the `orchestrate`
  103    103   
        // function, the original `HttpResponse` is no longer available and cannot be restored.
  104    104   
        // This means that header information from the original response has been lost.
  105    105   
        //
  106    106   
        // Note that the response body would have been consumed by the deserializer
  107    107   
        // regardless, even if the initial message was hypothetically processed during
  108    108   
        // the orchestrator's deserialization phase but later resulted in an error.
  109    109   
        fn response_error(
  110    110   
            err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
  111    111   
        ) -> ::aws_smithy_runtime_api::client::result::SdkError<
  112    112   
            crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponseError,
  113    113   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  114    114   
        > {
  115    115   
            ::aws_smithy_runtime_api::client::result::SdkError::response_error(
  116    116   
                err,
  117    117   
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
  118    118   
                    ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
  119    119   
                    ::aws_smithy_types::body::SdkBody::empty(),
  120    120   
                ),
  121    121   
            )
  122    122   
        }
         123  +
        let mut output = output;
  123    124   
  124    125   
        let message = output.events.try_recv_initial_response().await.map_err(response_error)?;
  125    126   
  126         -
        match message {
  127         -
            ::std::option::Option::Some(_message) => {
         127  +
        if let ::std::option::Option::Some(_message) = message {
  128    128   
            let mut builder = output.into_builder();
  129    129   
            builder = crate::protocol_serde::shape_streaming_operation_with_initial_response::de_streaming_operation_with_initial_response(
  130    130   
                _message.payload(),
  131    131   
                builder,
  132    132   
            )
  133    133   
            .map_err(response_error)?;
  134         -
                let output = builder.build().map_err(response_error)?;
  135         -
                ::std::result::Result::Ok(output)
  136         -
            }
  137         -
            ::std::option::Option::None => ::std::result::Result::Ok(output),
         134  +
            output = builder.build().map_err(response_error)?;
  138    135   
        }
         136  +
        ::std::result::Result::Ok(output)
  139    137   
    }
  140    138   
  141    139   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
  142    140   
    pub fn customize(
  143    141   
        self,
  144    142   
    ) -> crate::client::customize::CustomizableOperation<
  145    143   
        crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponseOutput,
  146    144   
        crate::operation::streaming_operation_with_initial_response::StreamingOperationWithInitialResponseError,
  147    145   
        Self,
  148    146   
    > {

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/operation/streaming_operation_with_optional_data/builders.rs

@@ -64,64 +165,163 @@
   84     84   
    > {
   85     85   
        let input = self
   86     86   
            .inner
   87     87   
            .build()
   88     88   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   89     89   
        let runtime_plugins = crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalData::operation_runtime_plugins(
   90     90   
            self.handle.runtime_plugins.clone(),
   91     91   
            &self.handle.conf,
   92     92   
            self.config_override,
   93     93   
        );
   94         -
        let mut output =
          94  +
        let output =
   95     95   
            crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalData::orchestrate(&runtime_plugins, input)
   96     96   
                .await?;
   97     97   
   98     98   
        // Converts any error encountered beyond this point into an `SdkError` response error
   99     99   
        // with an `HttpResponse`. However, since we have already exited the `orchestrate`
  100    100   
        // function, the original `HttpResponse` is no longer available and cannot be restored.
  101    101   
        // This means that header information from the original response has been lost.
  102    102   
        //
  103    103   
        // Note that the response body would have been consumed by the deserializer
  104    104   
        // regardless, even if the initial message was hypothetically processed during
  105    105   
        // the orchestrator's deserialization phase but later resulted in an error.
  106    106   
        fn response_error(
  107    107   
            err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
  108    108   
        ) -> ::aws_smithy_runtime_api::client::result::SdkError<
  109    109   
            crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataError,
  110    110   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  111    111   
        > {
  112    112   
            ::aws_smithy_runtime_api::client::result::SdkError::response_error(
  113    113   
                err,
  114    114   
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
  115    115   
                    ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
  116    116   
                    ::aws_smithy_types::body::SdkBody::empty(),
  117    117   
                ),
  118    118   
            )
  119    119   
        }
         120  +
        let mut output = output;
  120    121   
  121    122   
        let message = output.events.try_recv_initial_response().await.map_err(response_error)?;
  122    123   
  123         -
        match message {
  124         -
            ::std::option::Option::Some(_message) => {
         124  +
        if let ::std::option::Option::Some(_message) = message {
  125    125   
            let mut builder = output.into_builder();
  126    126   
            builder = crate::protocol_serde::shape_streaming_operation_with_optional_data::de_streaming_operation_with_optional_data(
  127    127   
                _message.payload(),
  128    128   
                builder,
  129    129   
            )
  130    130   
            .map_err(response_error)?;
  131         -
                let output = builder.build().map_err(response_error)?;
  132         -
                ::std::result::Result::Ok(output)
  133         -
            }
  134         -
            ::std::option::Option::None => ::std::result::Result::Ok(output),
         131  +
            output = builder.build().map_err(response_error)?;
  135    132   
        }
         133  +
        ::std::result::Result::Ok(output)
  136    134   
    }
  137    135   
  138    136   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
  139    137   
    pub fn customize(
  140    138   
        self,
  141    139   
    ) -> crate::client::customize::CustomizableOperation<
  142    140   
        crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataOutput,
  143    141   
        crate::operation::streaming_operation_with_optional_data::StreamingOperationWithOptionalDataError,
  144    142   
        Self,
  145    143   
    > {