Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_header_collection_operation/builders.rs

@@ -1,1 +148,172 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::required_header_collection_operation::_required_header_collection_operation_output::RequiredHeaderCollectionOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::required_header_collection_operation::_required_header_collection_operation_input::RequiredHeaderCollectionOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.required_header_collection_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `RequiredHeaderCollectionOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `RequiredHeaderCollectionOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct RequiredHeaderCollectionOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl
   32     38   
    crate::client::customize::internal::CustomizableSend<
   33     39   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   34     40   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   35     41   
    > for RequiredHeaderCollectionOperationFluentBuilder
   36     42   
{
   37     43   
    fn send(
   38     44   
        self,
   39     45   
        config_override: crate::config::Builder,
   40     46   
    ) -> crate::client::customize::internal::BoxFuture<
   41     47   
        crate::client::customize::internal::SendResult<
   42     48   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   43     49   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   44     50   
        >,
   45     51   
    > {
   46     52   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   47     53   
    }
   48     54   
}
          55  +
/* FluentBuilderGenerator.kt:282 */
   49     56   
impl RequiredHeaderCollectionOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `RequiredHeaderCollectionOperationFluentBuilder`.
   51     59   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   52     60   
        Self {
   53     61   
            handle,
   54     62   
            inner: ::std::default::Default::default(),
   55     63   
            config_override: ::std::option::Option::None,
   56     64   
        }
   57     65   
    }
          66  +
    /* FluentBuilderGenerator.kt:301 */
   58     67   
    /// Access the RequiredHeaderCollectionOperation as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder {
   60     69   
        &self.inner
   61     70   
    }
          71  +
    /* FluentBuilderGenerator.kt:145 */
   62     72   
    /// Sends the request and returns the response.
   63     73   
    ///
   64     74   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   65     75   
    /// can be matched against.
   66     76   
    ///
   67     77   
    /// By default, any retryable failures will be retried twice. Retry behavior
   68     78   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   69     79   
    /// set when configuring the client.
   70     80   
    pub async fn send(
   71     81   
        self,
   72     82   
    ) -> ::std::result::Result<
   73     83   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   76     86   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   77     87   
        >,
   78     88   
    > {
   79     89   
        let input = self
   80     90   
            .inner
   81     91   
            .build()
   82     92   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   83     93   
        let runtime_plugins = crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperation::operation_runtime_plugins(
   84     94   
            self.handle.runtime_plugins.clone(),
   85     95   
            &self.handle.conf,
   86     96   
            self.config_override,
   87     97   
        );
   88     98   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperation::orchestrate(&runtime_plugins, input).await
   89     99   
    }
   90    100   
   91    101   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   92    102   
    pub fn customize(
   93    103   
        self,
   94    104   
    ) -> crate::client::customize::CustomizableOperation<
   95    105   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   96    106   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
  110         -
    ///
         121  +
    /// /* FluentBuilderGenerator.kt:436 */
  111    122   
    /// Appends an item to `requiredHeaderList`.
  112    123   
    ///
  113    124   
    /// To override the contents of this collection use [`set_required_header_list`](Self::set_required_header_list).
  114    125   
    ///
         126  +
    /* FluentBuilderGenerator.kt:443 */
  115    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* FluentBuilderGenerator.kt:446 */
  116    129   
    pub fn required_header_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  117    130   
        self.inner = self.inner.required_header_list(input.into());
  118    131   
        self
  119    132   
    }
         133  +
    /* FluentBuilderGenerator.kt:498 */
  120    134   
    #[allow(missing_docs)] // documentation missing in model
         135  +
                           /* FluentBuilderGenerator.kt:500 */
  121    136   
    pub fn set_required_header_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  122    137   
        self.inner = self.inner.set_required_header_list(input);
  123    138   
        self
  124    139   
    }
         140  +
    /* FluentBuilderGenerator.kt:518 */
  125    141   
    #[allow(missing_docs)] // documentation missing in model
         142  +
                           /* FluentBuilderGenerator.kt:520 */
  126    143   
    pub fn get_required_header_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  127    144   
        self.inner.get_required_header_list()
  128    145   
    }
  129         -
    ///
         146  +
    /// /* FluentBuilderGenerator.kt:436 */
  130    147   
    /// Appends an item to `requiredHeaderSet`.
  131    148   
    ///
  132    149   
    /// To override the contents of this collection use [`set_required_header_set`](Self::set_required_header_set).
  133    150   
    ///
         151  +
    /* FluentBuilderGenerator.kt:443 */
  134    152   
    #[allow(missing_docs)] // documentation missing in model
         153  +
                           /* FluentBuilderGenerator.kt:446 */
  135    154   
    pub fn required_header_set(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  136    155   
        self.inner = self.inner.required_header_set(input.into());
  137    156   
        self
  138    157   
    }
         158  +
    /* FluentBuilderGenerator.kt:498 */
  139    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* FluentBuilderGenerator.kt:500 */
  140    161   
    pub fn set_required_header_set(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  141    162   
        self.inner = self.inner.set_required_header_set(input);
  142    163   
        self
  143    164   
    }
         165  +
    /* FluentBuilderGenerator.kt:518 */
  144    166   
    #[allow(missing_docs)] // documentation missing in model
         167  +
                           /* FluentBuilderGenerator.kt:520 */
  145    168   
    pub fn get_required_header_set(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  146    169   
        self.inner.get_required_header_set()
  147    170   
    }
         171  +
    /* FluentBuilderGenerator.kt:282 */
  148    172   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `RequiredInnerShapeOperation`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct RequiredInnerShapeOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl RequiredInnerShapeOperation {
    7         -
    /// Creates a new `RequiredInnerShapeOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `RequiredInnerShapeOperation`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +347,441 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RequiredInnerShapeOperation {
   95    106   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   96    107   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("RequiredInnerShapeOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            RequiredInnerShapeOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            RequiredInnerShapeOperationResponseDeserializer,
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  106    117   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  107    118   
        ));
  108    119   
  109    120   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  110    121   
            "RequiredInnerShapeOperation",
  111    122   
            "MiscService",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RequiredInnerShapeOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(RequiredInnerShapeOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
  130    141   
            >::new());
  131    142   
  132    143   
        ::std::borrow::Cow::Owned(rcb)
  133    144   
    }
  134    145   
}
  135    146   
         147  +
/* ResponseDeserializerGenerator.kt:64 */
  136    148   
#[derive(Debug)]
  137    149   
struct RequiredInnerShapeOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RequiredInnerShapeOperationResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 200 || force_error {
  150    162   
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct RequiredInnerShapeOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RequiredInnerShapeOperationRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/requiredInnerShapeOperation").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from(
  196    209   
            crate::protocol_serde::shape_required_inner_shape_operation::ser_required_inner_shape_operation_input(&input)?,
  197    210   
        );
  198    211   
        if let Some(content_length) = body.content_length() {
  199    212   
            let content_length = content_length.to_string();
  200    213   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  201    214   
        }
  202    215   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  203    216   
    }
  204    217   
}
         218  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  205    219   
#[derive(Debug)]
  206    220   
struct RequiredInnerShapeOperationEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RequiredInnerShapeOperationEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "RequiredInnerShapeOperationEndpointParamsInterceptor"
  211    225   
    }
  212    226   
  213    227   
    fn read_before_execution(
  214    228   
        &self,
  215    229   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  216    230   
            '_,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  218    232   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  220    234   
        >,
  221    235   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  222    236   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  223    237   
        let _input = context
  224    238   
            .input()
  225    239   
            .downcast_ref::<RequiredInnerShapeOperationInput>()
  226    240   
            .ok_or("failed to downcast to RequiredInnerShapeOperationInput")?;
  227    241   
  228    242   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  229    243   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  230    244   
        })?;
  231    245   
        cfg.interceptor_state()
  232    246   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  233    247   
        ::std::result::Result::Ok(())
  234    248   
    }
  235    249   
}
  236    250   
  237    251   
// The get_* functions below are generated from JMESPath expressions in the
  238    252   
// operationContextParams trait. They target the operation's input shape.
  239    253   
         254  +
/* OperationErrorGenerator.kt:79 */
  240    255   
/// Error type for the `RequiredInnerShapeOperationError` operation.
         256  +
/* RustType.kt:516 */
  241    257   
#[non_exhaustive]
         258  +
/* RustType.kt:516 */
  242    259   
#[derive(::std::fmt::Debug)]
  243         -
pub enum RequiredInnerShapeOperationError {
  244         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         260  +
pub /* OperationErrorGenerator.kt:81 */ enum RequiredInnerShapeOperationError {
         261  +
    /// /* OperationErrorGenerator.kt:83 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         262  +
    /* OperationErrorGenerator.kt:86 */
  245    263   
    ValidationError(crate::types::error::ValidationError),
         264  +
    /* OperationErrorGenerator.kt:88 */
  246    265   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  247    266   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  248    267   
    variable wildcard pattern and check `.code()`:
  249    268   
     \
  250    269   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  251    270   
     \
  252    271   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RequiredInnerShapeOperationError) for what information is available for the error.")]
  253    272   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         273  +
    /* OperationErrorGenerator.kt:81 */
  254    274   
}
         275  +
/* OperationErrorGenerator.kt:218 */
  255    276   
impl RequiredInnerShapeOperationError {
         277  +
    /* OperationErrorGenerator.kt:219 */
  256    278   
    /// Creates the `RequiredInnerShapeOperationError::Unhandled` variant from any error type.
  257    279   
    pub fn unhandled(
  258    280   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  259    281   
    ) -> Self {
  260    282   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  261    283   
            source: err.into(),
  262    284   
            meta: ::std::default::Default::default(),
  263    285   
        })
  264    286   
    }
  265    287   
  266    288   
    /// Creates the `RequiredInnerShapeOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  267    289   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  268    290   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  269    291   
            source: err.clone().into(),
  270    292   
            meta: err,
  271    293   
        })
  272    294   
    }
  273         -
    ///
         295  +
    /// /* OperationErrorGenerator.kt:236 */
  274    296   
    /// Returns error metadata, which includes the error code, message,
  275    297   
    /// request ID, and potentially additional information.
  276    298   
    ///
         299  +
    /* OperationErrorGenerator.kt:242 */
  277    300   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         301  +
        /* OperationErrorGenerator.kt:243 */
  278    302   
        match self {
  279         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  280         -
            Self::Unhandled(e) => &e.meta,
         303  +
            /* OperationErrorGenerator.kt:246 */ Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         304  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         305  +
            /* OperationErrorGenerator.kt:243 */
  281    306   
        }
         307  +
        /* OperationErrorGenerator.kt:242 */
  282    308   
    }
         309  +
    /* OperationErrorGenerator.kt:257 */
  283    310   
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::ValidationError`.
         311  +
    /* OperationErrorGenerator.kt:258 */
  284    312   
    pub fn is_validation_error(&self) -> bool {
         313  +
        /* OperationErrorGenerator.kt:259 */
  285    314   
        matches!(self, Self::ValidationError(_))
         315  +
        /* OperationErrorGenerator.kt:258 */
  286    316   
    }
         317  +
    /* OperationErrorGenerator.kt:218 */
  287    318   
}
         319  +
/* OperationErrorGenerator.kt:269 */
  288    320   
impl ::std::error::Error for RequiredInnerShapeOperationError {
         321  +
    /* OperationErrorGenerator.kt:270 */
  289    322   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         323  +
        /* OperationErrorGenerator.kt:318 */
  290    324   
        match self {
  291         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  292         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         325  +
            /* OperationErrorGenerator.kt:321 */
         326  +
            Self::ValidationError(_inner) =>
         327  +
            /* OperationErrorGenerator.kt:283 */
         328  +
            {
         329  +
                ::std::option::Option::Some(_inner)
         330  +
            }
         331  +
            ,
         332  +
            /* OperationErrorGenerator.kt:326 */
         333  +
            Self::Unhandled(_inner) => {
         334  +
                /* OperationErrorGenerator.kt:279 */
         335  +
                ::std::option::Option::Some(&*_inner.source)
         336  +
                /* OperationErrorGenerator.kt:326 */
         337  +
            } /* OperationErrorGenerator.kt:318 */
  293    338   
        }
         339  +
        /* OperationErrorGenerator.kt:270 */
  294    340   
    }
         341  +
    /* OperationErrorGenerator.kt:269 */
  295    342   
}
         343  +
/* OperationErrorGenerator.kt:133 */
  296    344   
impl ::std::fmt::Display for RequiredInnerShapeOperationError {
         345  +
    /* OperationErrorGenerator.kt:134 */
  297    346   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         347  +
        /* OperationErrorGenerator.kt:318 */
  298    348   
        match self {
  299         -
            Self::ValidationError(_inner) => _inner.fmt(f),
         349  +
            /* OperationErrorGenerator.kt:321 */
         350  +
            Self::ValidationError(_inner) =>
         351  +
            /* OperationErrorGenerator.kt:151 */
         352  +
            {
         353  +
                _inner.fmt(f)
         354  +
            }
         355  +
            ,
         356  +
            /* OperationErrorGenerator.kt:326 */
  300    357   
            Self::Unhandled(_inner) => {
         358  +
                /* OperationErrorGenerator.kt:139 */
  301    359   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  302    360   
                    write!(f, "unhandled error ({code})")
  303    361   
                } else {
  304    362   
                    f.write_str("unhandled error")
  305    363   
                }
         364  +
                /* OperationErrorGenerator.kt:326 */
         365  +
            } /* OperationErrorGenerator.kt:318 */
  306    366   
        }
         367  +
        /* OperationErrorGenerator.kt:134 */
  307    368   
    }
  308         -
    }
         369  +
    /* OperationErrorGenerator.kt:133 */
  309    370   
}
         371  +
/* OperationErrorGenerator.kt:182 */
  310    372   
impl ::aws_smithy_types::retry::ProvideErrorKind for RequiredInnerShapeOperationError {
         373  +
    /* OperationErrorGenerator.kt:186 */
  311    374   
    fn code(&self) -> ::std::option::Option<&str> {
         375  +
        /* OperationErrorGenerator.kt:187 */
  312    376   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         377  +
        /* OperationErrorGenerator.kt:186 */
  313    378   
    }
         379  +
    /* OperationErrorGenerator.kt:190 */
  314    380   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         381  +
        /* OperationErrorGenerator.kt:197 */
  315    382   
        ::std::option::Option::None
         383  +
        /* OperationErrorGenerator.kt:190 */
  316    384   
    }
         385  +
    /* OperationErrorGenerator.kt:182 */
  317    386   
}
         387  +
/* OperationErrorGenerator.kt:163 */
  318    388   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RequiredInnerShapeOperationError {
         389  +
    /* OperationErrorGenerator.kt:164 */
  319    390   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         391  +
        /* OperationErrorGenerator.kt:318 */
  320    392   
        match self {
  321         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  322         -
            Self::Unhandled(_inner) => &_inner.meta,
         393  +
            /* OperationErrorGenerator.kt:321 */
         394  +
            Self::ValidationError(_inner) =>
         395  +
            /* OperationErrorGenerator.kt:169 */
         396  +
            {
         397  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         398  +
            }
         399  +
            ,
         400  +
            /* OperationErrorGenerator.kt:326 */
         401  +
            Self::Unhandled(_inner) => {
         402  +
                /* OperationErrorGenerator.kt:168 */
         403  +
                &_inner.meta
         404  +
                /* OperationErrorGenerator.kt:326 */
         405  +
            } /* OperationErrorGenerator.kt:318 */
  323    406   
        }
         407  +
        /* OperationErrorGenerator.kt:164 */
  324    408   
    }
         409  +
    /* OperationErrorGenerator.kt:163 */
  325    410   
}
         411  +
/* OperationErrorGenerator.kt:109 */
  326    412   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RequiredInnerShapeOperationError {
         413  +
    /* OperationErrorGenerator.kt:110 */
  327    414   
    fn create_unhandled_error(
  328    415   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  329    416   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  330    417   
    ) -> Self {
         418  +
        /* OperationErrorGenerator.kt:121 */
  331    419   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  332    420   
            source,
  333    421   
            meta: meta.unwrap_or_default(),
  334    422   
        })
         423  +
        /* OperationErrorGenerator.kt:110 */
  335    424   
    }
         425  +
    /* OperationErrorGenerator.kt:109 */
  336    426   
}
  337    427   
         428  +
/* CodegenDelegator.kt:255 */
  338    429   
pub use crate::operation::required_inner_shape_operation::_required_inner_shape_operation_output::RequiredInnerShapeOperationOutput;
  339    430   
         431  +
/* CodegenDelegator.kt:255 */
  340    432   
pub use crate::operation::required_inner_shape_operation::_required_inner_shape_operation_input::RequiredInnerShapeOperationInput;
  341    433   
         434  +
/* RustModule.kt:172 */
  342    435   
mod _required_inner_shape_operation_input;
  343    436   
         437  +
/* RustModule.kt:172 */
  344    438   
mod _required_inner_shape_operation_output;
  345    439   
  346         -
/// Builders
         440  +
/// /* CodegenDelegator.kt:51 */Builders
  347    441   
pub mod builders;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation/_required_inner_shape_operation_input.rs

@@ -1,1 +52,96 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct RequiredInnerShapeOperationInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct RequiredInnerShapeOperationInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub inner: ::std::option::Option<crate::types::InnerShape>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl RequiredInnerShapeOperationInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn inner(&self) -> ::std::option::Option<&crate::types::InnerShape> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.inner.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl RequiredInnerShapeOperationInput {
   16         -
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct RequiredInnerShapeOperationInputBuilder {
   26         -
    pub(crate) inner: ::std::option::Option<crate::types::InnerShape>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) inner: ::std::option::Option<crate::types::InnerShape>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl RequiredInnerShapeOperationInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn inner(mut self, input: crate::types::InnerShape) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.inner = ::std::option::Option::Some(input);
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_inner(mut self, input: ::std::option::Option<crate::types::InnerShape>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.inner = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_inner(&self) -> &::std::option::Option<crate::types::InnerShape> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.inner
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(
   45     80   
        self,
   46     81   
    ) -> ::std::result::Result<
   47     82   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
   48     83   
        ::aws_smithy_types::error::operation::BuildError,
   49     84   
    > {
   50         -
        ::std::result::Result::Ok(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput { inner: self.inner })
          85  +
        /* BuilderGenerator.kt:254 */
          86  +
        ::std::result::Result::Ok(
          87  +
            /* BuilderGenerator.kt:477 */
          88  +
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput {
          89  +
                /* BuilderGenerator.kt:481 */ inner: self.inner,
          90  +
                /* BuilderGenerator.kt:477 */
          91  +
            }, /* BuilderGenerator.kt:254 */
          92  +
        )
          93  +
        /* BuilderGenerator.kt:253 */
   51     94   
    }
          95  +
    /* BuilderGenerator.kt:355 */
   52     96   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation/_required_inner_shape_operation_output.rs

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct RequiredInnerShapeOperationOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct RequiredInnerShapeOperationOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub inner: ::std::option::Option<crate::types::InnerShape>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl RequiredInnerShapeOperationOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn inner(&self) -> ::std::option::Option<&crate::types::InnerShape> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.inner.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl RequiredInnerShapeOperationOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct RequiredInnerShapeOperationOutputBuilder {
   26         -
    pub(crate) inner: ::std::option::Option<crate::types::InnerShape>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) inner: ::std::option::Option<crate::types::InnerShape>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl RequiredInnerShapeOperationOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn inner(mut self, input: crate::types::InnerShape) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.inner = ::std::option::Option::Some(input);
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_inner(mut self, input: ::std::option::Option<crate::types::InnerShape>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.inner = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_inner(&self) -> &::std::option::Option<crate::types::InnerShape> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.inner
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput {
   45         -
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput { inner: self.inner }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput {
          82  +
            /* BuilderGenerator.kt:481 */ inner: self.inner,
          83  +
            /* BuilderGenerator.kt:477 */
   46     84   
        }
          85  +
        /* BuilderGenerator.kt:253 */
          86  +
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation/builders.rs

@@ -1,1 +125,143 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::required_inner_shape_operation::_required_inner_shape_operation_output::RequiredInnerShapeOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::required_inner_shape_operation::_required_inner_shape_operation_input::RequiredInnerShapeOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.required_inner_shape_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `RequiredInnerShapeOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `RequiredInnerShapeOperation`.
   24     27   
///
   25         -
/// This operation tests that (de)serializing required values from a nested shape works correctly.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation tests that (de)serializing required values from a nested shape works correctly.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct RequiredInnerShapeOperationFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder,
   30     35   
    config_override: ::std::option::Option<crate::config::Builder>,
   31     36   
}
          37  +
/* FluentBuilderGenerator.kt:381 */
   32     38   
impl
   33     39   
    crate::client::customize::internal::CustomizableSend<
   34     40   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   35     41   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   36     42   
    > for RequiredInnerShapeOperationFluentBuilder
   37     43   
{
   38     44   
    fn send(
   39     45   
        self,
   40     46   
        config_override: crate::config::Builder,
   41     47   
    ) -> crate::client::customize::internal::BoxFuture<
   42     48   
        crate::client::customize::internal::SendResult<
   43     49   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   44     50   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   45     51   
        >,
   46     52   
    > {
   47     53   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   48     54   
    }
   49     55   
}
          56  +
/* FluentBuilderGenerator.kt:282 */
   50     57   
impl RequiredInnerShapeOperationFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `RequiredInnerShapeOperationFluentBuilder`.
   52     60   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   53     61   
        Self {
   54     62   
            handle,
   55     63   
            inner: ::std::default::Default::default(),
   56     64   
            config_override: ::std::option::Option::None,
   57     65   
        }
   58     66   
    }
          67  +
    /* FluentBuilderGenerator.kt:301 */
   59     68   
    /// Access the RequiredInnerShapeOperation as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder {
   61     70   
        &self.inner
   62     71   
    }
          72  +
    /* FluentBuilderGenerator.kt:145 */
   63     73   
    /// Sends the request and returns the response.
   64     74   
    ///
   65     75   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   66     76   
    /// can be matched against.
   67     77   
    ///
   68     78   
    /// By default, any retryable failures will be retried twice. Retry behavior
   69     79   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   70     80   
    /// set when configuring the client.
   71     81   
    pub async fn send(
   72     82   
        self,
   73     83   
    ) -> ::std::result::Result<
   74     84   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   77     87   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   78     88   
        >,
   79     89   
    > {
   80     90   
        let input = self
   81     91   
            .inner
   82     92   
            .build()
   83     93   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   84     94   
        let runtime_plugins = crate::operation::required_inner_shape_operation::RequiredInnerShapeOperation::operation_runtime_plugins(
   85     95   
            self.handle.runtime_plugins.clone(),
   86     96   
            &self.handle.conf,
   87     97   
            self.config_override,
   88     98   
        );
   89     99   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperation::orchestrate(&runtime_plugins, input).await
   90    100   
    }
   91    101   
   92    102   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   93    103   
    pub fn customize(
   94    104   
        self,
   95    105   
    ) -> crate::client::customize::CustomizableOperation<
   96    106   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   97    107   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:498 */
  111    123   
    #[allow(missing_docs)] // documentation missing in model
         124  +
                           /* FluentBuilderGenerator.kt:500 */
  112    125   
    pub fn inner(mut self, input: crate::types::InnerShape) -> Self {
  113    126   
        self.inner = self.inner.inner(input);
  114    127   
        self
  115    128   
    }
         129  +
    /* FluentBuilderGenerator.kt:498 */
  116    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* FluentBuilderGenerator.kt:500 */
  117    132   
    pub fn set_inner(mut self, input: ::std::option::Option<crate::types::InnerShape>) -> Self {
  118    133   
        self.inner = self.inner.set_inner(input);
  119    134   
        self
  120    135   
    }
         136  +
    /* FluentBuilderGenerator.kt:518 */
  121    137   
    #[allow(missing_docs)] // documentation missing in model
         138  +
                           /* FluentBuilderGenerator.kt:520 */
  122    139   
    pub fn get_inner(&self) -> &::std::option::Option<crate::types::InnerShape> {
  123    140   
        self.inner.get_inner()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:282 */
  125    143   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `ResponseCodeDefaultOperation`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct ResponseCodeDefaultOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl ResponseCodeDefaultOperation {
    7         -
    /// Creates a new `ResponseCodeDefaultOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `ResponseCodeDefaultOperation`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +373,449 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ResponseCodeDefaultOperation {
   95    106   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   96    107   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ResponseCodeDefaultOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            ResponseCodeDefaultOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            ResponseCodeDefaultOperationResponseDeserializer,
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  106    117   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  107    118   
        ));
  108    119   
  109    120   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  110    121   
            "ResponseCodeDefaultOperation",
  111    122   
            "MiscService",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ResponseCodeDefaultOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(ResponseCodeDefaultOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
  130    141   
            >::new());
  131    142   
  132    143   
        ::std::borrow::Cow::Owned(rcb)
  133    144   
    }
  134    145   
}
  135    146   
         147  +
/* ResponseDeserializerGenerator.kt:64 */
  136    148   
#[derive(Debug)]
  137    149   
struct ResponseCodeDefaultOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeDefaultOperationResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 200 || force_error {
  150    162   
            crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct ResponseCodeDefaultOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeDefaultOperationRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/responseCodeDefaultOperation").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct ResponseCodeDefaultOperationEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeDefaultOperationEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "ResponseCodeDefaultOperationEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<ResponseCodeDefaultOperationInput>()
  220    234   
            .ok_or("failed to downcast to ResponseCodeDefaultOperationInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* RustType.kt:516 */
  234    249   
#[allow(unreachable_code, unused_variables)]
         250  +
/* RustType.kt:516 */
  235    251   
#[cfg(test)]
         252  +
/* ProtocolTestGenerator.kt:98 */
  236    253   
mod response_code_default_operation_test {
  237    254   
  238    255   
    /// Test ID: ResponseCodeDefaultOperation
  239    256   
    #[::tokio::test]
  240    257   
    #[::tracing_test::traced_test]
  241    258   
    async fn response_code_default_operation_response() {
  242    259   
        let expected_output = crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput::builder().build();
  243    260   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  244    261   
            ::http::response::Builder::new()
  245    262   
                .status(200)
  246    263   
                .body(::aws_smithy_types::body::SdkBody::from(vec![]))
  247    264   
                .unwrap(),
  248    265   
        )
  249    266   
        .unwrap();
  250    267   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  251    268   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  252    269   
  253    270   
        let op = crate::operation::response_code_default_operation::ResponseCodeDefaultOperation::new();
  254    271   
        let config = op.config().expect("the operation has config");
  255    272   
        let de = config
  256    273   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  257    274   
            .expect("the config must have a deserializer");
  258    275   
  259    276   
        let parsed = de.deserialize_streaming(&mut http_response);
  260    277   
        let parsed = parsed.unwrap_or_else(|| {
  261    278   
            let http_response = http_response.map(|body| {
  262    279   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  263    280   
                    body.bytes().unwrap(),
  264    281   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  265    282   
                )))
  266    283   
            });
  267    284   
            de.deserialize_nonstreaming(&http_response)
  268    285   
        });
  269    286   
        let parsed = parsed
  270    287   
            .expect("should be successful response")
  271    288   
            .downcast::<crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput>()
  272    289   
            .unwrap();
  273    290   
    }
         291  +
         292  +
    /* ProtocolTestGenerator.kt:98 */
  274    293   
}
  275    294   
         295  +
/* OperationErrorGenerator.kt:79 */
  276    296   
/// Error type for the `ResponseCodeDefaultOperationError` operation.
         297  +
/* RustType.kt:516 */
  277    298   
#[non_exhaustive]
         299  +
/* RustType.kt:516 */
  278    300   
#[derive(::std::fmt::Debug)]
  279         -
pub enum ResponseCodeDefaultOperationError {
         301  +
pub /* OperationErrorGenerator.kt:81 */ enum ResponseCodeDefaultOperationError {
         302  +
    /* OperationErrorGenerator.kt:88 */
  280    303   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  281    304   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  282    305   
    variable wildcard pattern and check `.code()`:
  283    306   
     \
  284    307   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  285    308   
     \
  286    309   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseCodeDefaultOperationError) for what information is available for the error.")]
  287    310   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         311  +
    /* OperationErrorGenerator.kt:81 */
  288    312   
}
         313  +
/* OperationErrorGenerator.kt:218 */
  289    314   
impl ResponseCodeDefaultOperationError {
         315  +
    /* OperationErrorGenerator.kt:219 */
  290    316   
    /// Creates the `ResponseCodeDefaultOperationError::Unhandled` variant from any error type.
  291    317   
    pub fn unhandled(
  292    318   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  293    319   
    ) -> Self {
  294    320   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  295    321   
            source: err.into(),
  296    322   
            meta: ::std::default::Default::default(),
  297    323   
        })
  298    324   
    }
  299    325   
  300    326   
    /// Creates the `ResponseCodeDefaultOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  301    327   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  302    328   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  303    329   
            source: err.clone().into(),
  304    330   
            meta: err,
  305    331   
        })
  306    332   
    }
  307         -
    ///
         333  +
    /// /* OperationErrorGenerator.kt:236 */
  308    334   
    /// Returns error metadata, which includes the error code, message,
  309    335   
    /// request ID, and potentially additional information.
  310    336   
    ///
         337  +
    /* OperationErrorGenerator.kt:242 */
  311    338   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         339  +
        /* OperationErrorGenerator.kt:243 */
  312    340   
        match self {
  313         -
            Self::Unhandled(e) => &e.meta,
         341  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         342  +
            /* OperationErrorGenerator.kt:243 */
  314    343   
        }
         344  +
        /* OperationErrorGenerator.kt:242 */
  315    345   
    }
         346  +
    /* OperationErrorGenerator.kt:218 */
  316    347   
}
         348  +
/* OperationErrorGenerator.kt:269 */
  317    349   
impl ::std::error::Error for ResponseCodeDefaultOperationError {
         350  +
    /* OperationErrorGenerator.kt:270 */
  318    351   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         352  +
        /* OperationErrorGenerator.kt:318 */
  319    353   
        match self {
  320         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         354  +
            /* OperationErrorGenerator.kt:326 */
         355  +
            Self::Unhandled(_inner) => {
         356  +
                /* OperationErrorGenerator.kt:279 */
         357  +
                ::std::option::Option::Some(&*_inner.source)
         358  +
                /* OperationErrorGenerator.kt:326 */
         359  +
            } /* OperationErrorGenerator.kt:318 */
  321    360   
        }
         361  +
        /* OperationErrorGenerator.kt:270 */
  322    362   
    }
         363  +
    /* OperationErrorGenerator.kt:269 */
  323    364   
}
         365  +
/* OperationErrorGenerator.kt:133 */
  324    366   
impl ::std::fmt::Display for ResponseCodeDefaultOperationError {
         367  +
    /* OperationErrorGenerator.kt:134 */
  325    368   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         369  +
        /* OperationErrorGenerator.kt:318 */
  326    370   
        match self {
         371  +
            /* OperationErrorGenerator.kt:326 */
  327    372   
            Self::Unhandled(_inner) => {
         373  +
                /* OperationErrorGenerator.kt:139 */
  328    374   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  329    375   
                    write!(f, "unhandled error ({code})")
  330    376   
                } else {
  331    377   
                    f.write_str("unhandled error")
  332    378   
                }
         379  +
                /* OperationErrorGenerator.kt:326 */
         380  +
            } /* OperationErrorGenerator.kt:318 */
  333    381   
        }
         382  +
        /* OperationErrorGenerator.kt:134 */
  334    383   
    }
  335         -
    }
         384  +
    /* OperationErrorGenerator.kt:133 */
  336    385   
}
         386  +
/* OperationErrorGenerator.kt:182 */
  337    387   
impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseCodeDefaultOperationError {
         388  +
    /* OperationErrorGenerator.kt:186 */
  338    389   
    fn code(&self) -> ::std::option::Option<&str> {
         390  +
        /* OperationErrorGenerator.kt:187 */
  339    391   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         392  +
        /* OperationErrorGenerator.kt:186 */
  340    393   
    }
         394  +
    /* OperationErrorGenerator.kt:190 */
  341    395   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         396  +
        /* OperationErrorGenerator.kt:197 */
  342    397   
        ::std::option::Option::None
         398  +
        /* OperationErrorGenerator.kt:190 */
  343    399   
    }
         400  +
    /* OperationErrorGenerator.kt:182 */
  344    401   
}
         402  +
/* OperationErrorGenerator.kt:163 */
  345    403   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseCodeDefaultOperationError {
         404  +
    /* OperationErrorGenerator.kt:164 */
  346    405   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         406  +
        /* OperationErrorGenerator.kt:318 */
  347    407   
        match self {
  348         -
            Self::Unhandled(_inner) => &_inner.meta,
         408  +
            /* OperationErrorGenerator.kt:326 */
         409  +
            Self::Unhandled(_inner) => {
         410  +
                /* OperationErrorGenerator.kt:168 */
         411  +
                &_inner.meta
         412  +
                /* OperationErrorGenerator.kt:326 */
         413  +
            } /* OperationErrorGenerator.kt:318 */
  349    414   
        }
         415  +
        /* OperationErrorGenerator.kt:164 */
  350    416   
    }
         417  +
    /* OperationErrorGenerator.kt:163 */
  351    418   
}
         419  +
/* OperationErrorGenerator.kt:109 */
  352    420   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseCodeDefaultOperationError {
         421  +
    /* OperationErrorGenerator.kt:110 */
  353    422   
    fn create_unhandled_error(
  354    423   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  355    424   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  356    425   
    ) -> Self {
         426  +
        /* OperationErrorGenerator.kt:121 */
  357    427   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  358    428   
            source,
  359    429   
            meta: meta.unwrap_or_default(),
  360    430   
        })
         431  +
        /* OperationErrorGenerator.kt:110 */
  361    432   
    }
         433  +
    /* OperationErrorGenerator.kt:109 */
  362    434   
}
  363    435   
         436  +
/* CodegenDelegator.kt:255 */
  364    437   
pub use crate::operation::response_code_default_operation::_response_code_default_operation_output::ResponseCodeDefaultOperationOutput;
  365    438   
         439  +
/* CodegenDelegator.kt:255 */
  366    440   
pub use crate::operation::response_code_default_operation::_response_code_default_operation_input::ResponseCodeDefaultOperationInput;
  367    441   
         442  +
/* RustModule.kt:172 */
  368    443   
mod _response_code_default_operation_input;
  369    444   
         445  +
/* RustModule.kt:172 */
  370    446   
mod _response_code_default_operation_output;
  371    447   
  372         -
/// Builders
         448  +
/// /* CodegenDelegator.kt:51 */Builders
  373    449   
pub mod builders;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation/_response_code_default_operation_input.rs

@@ -1,1 +27,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ResponseCodeDefaultOperationInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct ResponseCodeDefaultOperationInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl ResponseCodeDefaultOperationInput {
    7         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationInput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationInput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`ResponseCodeDefaultOperationInput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`ResponseCodeDefaultOperationInput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct ResponseCodeDefaultOperationInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct ResponseCodeDefaultOperationInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl ResponseCodeDefaultOperationInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`ResponseCodeDefaultOperationInput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ResponseCodeDefaultOperationInput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<
   22     35   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput,
   23     36   
        ::aws_smithy_types::error::operation::BuildError,
   24     37   
    > {
   25         -
        ::std::result::Result::Ok(crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput {})
          38  +
        /* BuilderGenerator.kt:254 */
          39  +
        ::std::result::Result::Ok(
          40  +
            /* BuilderGenerator.kt:477 */
          41  +
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationInput {
          42  +
            /* BuilderGenerator.kt:477 */}, /* BuilderGenerator.kt:254 */
          43  +
        )
          44  +
        /* BuilderGenerator.kt:253 */
   26     45   
    }
          46  +
    /* BuilderGenerator.kt:355 */
   27     47   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation/_response_code_default_operation_output.rs

@@ -1,1 +22,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ResponseCodeDefaultOperationOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct ResponseCodeDefaultOperationOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl ResponseCodeDefaultOperationOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationOutput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationOutput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`ResponseCodeDefaultOperationOutput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`ResponseCodeDefaultOperationOutput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct ResponseCodeDefaultOperationOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct ResponseCodeDefaultOperationOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl ResponseCodeDefaultOperationOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`ResponseCodeDefaultOperationOutput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ResponseCodeDefaultOperationOutput`](crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput {
   20         -
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation/builders.rs

@@ -1,1 +111,123 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::response_code_default_operation::_response_code_default_operation_output::ResponseCodeDefaultOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::response_code_default_operation::_response_code_default_operation_input::ResponseCodeDefaultOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.response_code_default_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `ResponseCodeDefaultOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `ResponseCodeDefaultOperation`.
   24     27   
///
   25         -
/// This operation tests that the response code defaults to 200 when no other code is set.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation tests that the response code defaults to 200 when no other code is set.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct ResponseCodeDefaultOperationFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder,
   30     35   
    config_override: ::std::option::Option<crate::config::Builder>,
   31     36   
}
          37  +
/* FluentBuilderGenerator.kt:381 */
   32     38   
impl
   33     39   
    crate::client::customize::internal::CustomizableSend<
   34     40   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   35     41   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   36     42   
    > for ResponseCodeDefaultOperationFluentBuilder
   37     43   
{
   38     44   
    fn send(
   39     45   
        self,
   40     46   
        config_override: crate::config::Builder,
   41     47   
    ) -> crate::client::customize::internal::BoxFuture<
   42     48   
        crate::client::customize::internal::SendResult<
   43     49   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   44     50   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   45     51   
        >,
   46     52   
    > {
   47     53   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   48     54   
    }
   49     55   
}
          56  +
/* FluentBuilderGenerator.kt:282 */
   50     57   
impl ResponseCodeDefaultOperationFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `ResponseCodeDefaultOperationFluentBuilder`.
   52     60   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   53     61   
        Self {
   54     62   
            handle,
   55     63   
            inner: ::std::default::Default::default(),
   56     64   
            config_override: ::std::option::Option::None,
   57     65   
        }
   58     66   
    }
          67  +
    /* FluentBuilderGenerator.kt:301 */
   59     68   
    /// Access the ResponseCodeDefaultOperation as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder {
   61     70   
        &self.inner
   62     71   
    }
          72  +
    /* FluentBuilderGenerator.kt:145 */
   63     73   
    /// Sends the request and returns the response.
   64     74   
    ///
   65     75   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   66     76   
    /// can be matched against.
   67     77   
    ///
   68     78   
    /// By default, any retryable failures will be retried twice. Retry behavior
   69     79   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   70     80   
    /// set when configuring the client.
   71     81   
    pub async fn send(
   72     82   
        self,
   73     83   
    ) -> ::std::result::Result<
   74     84   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   77     87   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   78     88   
        >,
   79     89   
    > {
   80     90   
        let input = self
   81     91   
            .inner
   82     92   
            .build()
   83     93   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   84     94   
        let runtime_plugins = crate::operation::response_code_default_operation::ResponseCodeDefaultOperation::operation_runtime_plugins(
   85     95   
            self.handle.runtime_plugins.clone(),
   86     96   
            &self.handle.conf,
   87     97   
            self.config_override,
   88     98   
        );
   89     99   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperation::orchestrate(&runtime_plugins, input).await
   90    100   
    }
   91    101   
   92    102   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   93    103   
    pub fn customize(
   94    104   
        self,
   95    105   
    ) -> crate::client::customize::CustomizableOperation<
   96    106   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   97    107   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:282 */
  111    123   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `ResponseCodeHttpFallbackOperation`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct ResponseCodeHttpFallbackOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl ResponseCodeHttpFallbackOperation {
    7         -
    /// Creates a new `ResponseCodeHttpFallbackOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `ResponseCodeHttpFallbackOperation`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +378,454 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ResponseCodeHttpFallbackOperation {
   95    106   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   96    107   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ResponseCodeHttpFallbackOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            ResponseCodeHttpFallbackOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            ResponseCodeHttpFallbackOperationResponseDeserializer,
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  106    117   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  107    118   
        ));
  108    119   
  109    120   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  110    121   
            "ResponseCodeHttpFallbackOperation",
  111    122   
            "MiscService",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ResponseCodeHttpFallbackOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(ResponseCodeHttpFallbackOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
  130    141   
            >::new());
  131    142   
  132    143   
        ::std::borrow::Cow::Owned(rcb)
  133    144   
    }
  134    145   
}
  135    146   
         147  +
/* ResponseDeserializerGenerator.kt:64 */
  136    148   
#[derive(Debug)]
  137    149   
struct ResponseCodeHttpFallbackOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeHttpFallbackOperationResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 201 || force_error {
  150    162   
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_error(
  151    163   
                status, headers, body,
  152    164   
            )
  153    165   
        } else {
  154    166   
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_response(
  155    167   
                status, headers, body,
  156    168   
            )
  157    169   
        };
  158    170   
        crate::protocol_serde::type_erase_result(parse_result)
  159    171   
    }
  160    172   
}
         173  +
/* RequestSerializerGenerator.kt:67 */
  161    174   
#[derive(Debug)]
  162    175   
struct ResponseCodeHttpFallbackOperationRequestSerializer;
  163    176   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeHttpFallbackOperationRequestSerializer {
  164    177   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  165    178   
    fn serialize_input(
  166    179   
        &self,
  167    180   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  168    181   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  169    182   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  170    183   
        let input = input
  171    184   
            .downcast::<crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput>()
  172    185   
            .expect("correct type");
  173    186   
        let _header_serialization_settings = _cfg
  174    187   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  175    188   
            .cloned()
  176    189   
            .unwrap_or_default();
  177    190   
        let mut request_builder = {
  178    191   
            fn uri_base(
  179    192   
                _input: &crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
  180    193   
                output: &mut ::std::string::String,
  181    194   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  182    195   
                use ::std::fmt::Write as _;
  183    196   
                ::std::write!(output, "/responseCodeHttpFallbackOperation").expect("formatting should succeed");
  184    197   
                ::std::result::Result::Ok(())
  185    198   
            }
  186    199   
            #[allow(clippy::unnecessary_wraps)]
  187    200   
            fn update_http_builder(
  188    201   
                input: &crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
  189    202   
                builder: ::http::request::Builder,
  190    203   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  191    204   
                let mut uri = ::std::string::String::new();
  192    205   
                uri_base(input, &mut uri)?;
  193    206   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  194    207   
            }
  195    208   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  196    209   
            builder
  197    210   
        };
  198    211   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  199    212   
  200    213   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  201    214   
    }
  202    215   
}
         216  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  203    217   
#[derive(Debug)]
  204    218   
struct ResponseCodeHttpFallbackOperationEndpointParamsInterceptor;
  205    219   
  206    220   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeHttpFallbackOperationEndpointParamsInterceptor {
  207    221   
    fn name(&self) -> &'static str {
  208    222   
        "ResponseCodeHttpFallbackOperationEndpointParamsInterceptor"
  209    223   
    }
  210    224   
  211    225   
    fn read_before_execution(
  212    226   
        &self,
  213    227   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  214    228   
            '_,
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  216    230   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  218    232   
        >,
  219    233   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  220    234   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  221    235   
        let _input = context
  222    236   
            .input()
  223    237   
            .downcast_ref::<ResponseCodeHttpFallbackOperationInput>()
  224    238   
            .ok_or("failed to downcast to ResponseCodeHttpFallbackOperationInput")?;
  225    239   
  226    240   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  227    241   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  228    242   
        })?;
  229    243   
        cfg.interceptor_state()
  230    244   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  231    245   
        ::std::result::Result::Ok(())
  232    246   
    }
  233    247   
}
  234    248   
  235    249   
// The get_* functions below are generated from JMESPath expressions in the
  236    250   
// operationContextParams trait. They target the operation's input shape.
  237    251   
         252  +
/* RustType.kt:516 */
  238    253   
#[allow(unreachable_code, unused_variables)]
         254  +
/* RustType.kt:516 */
  239    255   
#[cfg(test)]
         256  +
/* ProtocolTestGenerator.kt:98 */
  240    257   
mod response_code_http_fallback_operation_test {
  241    258   
  242    259   
    /// Test ID: ResponseCodeHttpFallbackOperation
  243    260   
    #[::tokio::test]
  244    261   
    #[::tracing_test::traced_test]
  245    262   
    async fn response_code_http_fallback_operation_response() {
  246    263   
        let expected_output = crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput::builder().build();
  247    264   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  248    265   
            ::http::response::Builder::new()
  249    266   
                .header("Content-Length", "2")
  250    267   
                .status(201)
  251    268   
                .body(::aws_smithy_types::body::SdkBody::from(vec![]))
  252    269   
                .unwrap(),
  253    270   
        )
  254    271   
        .unwrap();
  255    272   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  256    273   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  257    274   
  258    275   
        let op = crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperation::new();
  259    276   
        let config = op.config().expect("the operation has config");
  260    277   
        let de = config
  261    278   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  262    279   
            .expect("the config must have a deserializer");
  263    280   
  264    281   
        let parsed = de.deserialize_streaming(&mut http_response);
  265    282   
        let parsed = parsed.unwrap_or_else(|| {
  266    283   
            let http_response = http_response.map(|body| {
  267    284   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  268    285   
                    body.bytes().unwrap(),
  269    286   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  270    287   
                )))
  271    288   
            });
  272    289   
            de.deserialize_nonstreaming(&http_response)
  273    290   
        });
  274    291   
        let parsed = parsed
  275    292   
            .expect("should be successful response")
  276    293   
            .downcast::<crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput>()
  277    294   
            .unwrap();
  278    295   
    }
         296  +
         297  +
    /* ProtocolTestGenerator.kt:98 */
  279    298   
}
  280    299   
         300  +
/* OperationErrorGenerator.kt:79 */
  281    301   
/// Error type for the `ResponseCodeHttpFallbackOperationError` operation.
         302  +
/* RustType.kt:516 */
  282    303   
#[non_exhaustive]
         304  +
/* RustType.kt:516 */
  283    305   
#[derive(::std::fmt::Debug)]
  284         -
pub enum ResponseCodeHttpFallbackOperationError {
         306  +
pub /* OperationErrorGenerator.kt:81 */ enum ResponseCodeHttpFallbackOperationError {
         307  +
    /* OperationErrorGenerator.kt:88 */
  285    308   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  286    309   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  287    310   
    variable wildcard pattern and check `.code()`:
  288    311   
     \
  289    312   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  290    313   
     \
  291    314   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseCodeHttpFallbackOperationError) for what information is available for the error.")]
  292    315   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         316  +
    /* OperationErrorGenerator.kt:81 */
  293    317   
}
         318  +
/* OperationErrorGenerator.kt:218 */
  294    319   
impl ResponseCodeHttpFallbackOperationError {
         320  +
    /* OperationErrorGenerator.kt:219 */
  295    321   
    /// Creates the `ResponseCodeHttpFallbackOperationError::Unhandled` variant from any error type.
  296    322   
    pub fn unhandled(
  297    323   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  298    324   
    ) -> Self {
  299    325   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  300    326   
            source: err.into(),
  301    327   
            meta: ::std::default::Default::default(),
  302    328   
        })
  303    329   
    }
  304    330   
  305    331   
    /// Creates the `ResponseCodeHttpFallbackOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  306    332   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  307    333   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  308    334   
            source: err.clone().into(),
  309    335   
            meta: err,
  310    336   
        })
  311    337   
    }
  312         -
    ///
         338  +
    /// /* OperationErrorGenerator.kt:236 */
  313    339   
    /// Returns error metadata, which includes the error code, message,
  314    340   
    /// request ID, and potentially additional information.
  315    341   
    ///
         342  +
    /* OperationErrorGenerator.kt:242 */
  316    343   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         344  +
        /* OperationErrorGenerator.kt:243 */
  317    345   
        match self {
  318         -
            Self::Unhandled(e) => &e.meta,
         346  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         347  +
            /* OperationErrorGenerator.kt:243 */
  319    348   
        }
         349  +
        /* OperationErrorGenerator.kt:242 */
  320    350   
    }
         351  +
    /* OperationErrorGenerator.kt:218 */
  321    352   
}
         353  +
/* OperationErrorGenerator.kt:269 */
  322    354   
impl ::std::error::Error for ResponseCodeHttpFallbackOperationError {
         355  +
    /* OperationErrorGenerator.kt:270 */
  323    356   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         357  +
        /* OperationErrorGenerator.kt:318 */
  324    358   
        match self {
  325         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         359  +
            /* OperationErrorGenerator.kt:326 */
         360  +
            Self::Unhandled(_inner) => {
         361  +
                /* OperationErrorGenerator.kt:279 */
         362  +
                ::std::option::Option::Some(&*_inner.source)
         363  +
                /* OperationErrorGenerator.kt:326 */
         364  +
            } /* OperationErrorGenerator.kt:318 */
  326    365   
        }
         366  +
        /* OperationErrorGenerator.kt:270 */
  327    367   
    }
         368  +
    /* OperationErrorGenerator.kt:269 */
  328    369   
}
         370  +
/* OperationErrorGenerator.kt:133 */
  329    371   
impl ::std::fmt::Display for ResponseCodeHttpFallbackOperationError {
         372  +
    /* OperationErrorGenerator.kt:134 */
  330    373   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         374  +
        /* OperationErrorGenerator.kt:318 */
  331    375   
        match self {
         376  +
            /* OperationErrorGenerator.kt:326 */
  332    377   
            Self::Unhandled(_inner) => {
         378  +
                /* OperationErrorGenerator.kt:139 */
  333    379   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  334    380   
                    write!(f, "unhandled error ({code})")
  335    381   
                } else {
  336    382   
                    f.write_str("unhandled error")
  337    383   
                }
         384  +
                /* OperationErrorGenerator.kt:326 */
         385  +
            } /* OperationErrorGenerator.kt:318 */
  338    386   
        }
         387  +
        /* OperationErrorGenerator.kt:134 */
  339    388   
    }
  340         -
    }
         389  +
    /* OperationErrorGenerator.kt:133 */
  341    390   
}
         391  +
/* OperationErrorGenerator.kt:182 */
  342    392   
impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseCodeHttpFallbackOperationError {
         393  +
    /* OperationErrorGenerator.kt:186 */
  343    394   
    fn code(&self) -> ::std::option::Option<&str> {
         395  +
        /* OperationErrorGenerator.kt:187 */
  344    396   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         397  +
        /* OperationErrorGenerator.kt:186 */
  345    398   
    }
         399  +
    /* OperationErrorGenerator.kt:190 */
  346    400   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         401  +
        /* OperationErrorGenerator.kt:197 */
  347    402   
        ::std::option::Option::None
         403  +
        /* OperationErrorGenerator.kt:190 */
  348    404   
    }
         405  +
    /* OperationErrorGenerator.kt:182 */
  349    406   
}
         407  +
/* OperationErrorGenerator.kt:163 */
  350    408   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseCodeHttpFallbackOperationError {
         409  +
    /* OperationErrorGenerator.kt:164 */
  351    410   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         411  +
        /* OperationErrorGenerator.kt:318 */
  352    412   
        match self {
  353         -
            Self::Unhandled(_inner) => &_inner.meta,
         413  +
            /* OperationErrorGenerator.kt:326 */
         414  +
            Self::Unhandled(_inner) => {
         415  +
                /* OperationErrorGenerator.kt:168 */
         416  +
                &_inner.meta
         417  +
                /* OperationErrorGenerator.kt:326 */
         418  +
            } /* OperationErrorGenerator.kt:318 */
  354    419   
        }
         420  +
        /* OperationErrorGenerator.kt:164 */
  355    421   
    }
         422  +
    /* OperationErrorGenerator.kt:163 */
  356    423   
}
         424  +
/* OperationErrorGenerator.kt:109 */
  357    425   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseCodeHttpFallbackOperationError {
         426  +
    /* OperationErrorGenerator.kt:110 */
  358    427   
    fn create_unhandled_error(
  359    428   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  360    429   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  361    430   
    ) -> Self {
         431  +
        /* OperationErrorGenerator.kt:121 */
  362    432   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  363    433   
            source,
  364    434   
            meta: meta.unwrap_or_default(),
  365    435   
        })
         436  +
        /* OperationErrorGenerator.kt:110 */
  366    437   
    }
         438  +
    /* OperationErrorGenerator.kt:109 */
  367    439   
}
  368    440   
         441  +
/* CodegenDelegator.kt:255 */
  369    442   
pub use crate::operation::response_code_http_fallback_operation::_response_code_http_fallback_operation_output::ResponseCodeHttpFallbackOperationOutput;
  370    443   
         444  +
/* CodegenDelegator.kt:255 */
  371    445   
pub use crate::operation::response_code_http_fallback_operation::_response_code_http_fallback_operation_input::ResponseCodeHttpFallbackOperationInput;
  372    446   
         447  +
/* RustModule.kt:172 */
  373    448   
mod _response_code_http_fallback_operation_input;
  374    449   
         450  +
/* RustModule.kt:172 */
  375    451   
mod _response_code_http_fallback_operation_output;
  376    452   
  377         -
/// Builders
         453  +
/// /* CodegenDelegator.kt:51 */Builders
  378    454   
pub mod builders;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation/_response_code_http_fallback_operation_input.rs

@@ -1,1 +27,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ResponseCodeHttpFallbackOperationInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct ResponseCodeHttpFallbackOperationInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl ResponseCodeHttpFallbackOperationInput {
    7         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationInput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationInput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`ResponseCodeHttpFallbackOperationInput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`ResponseCodeHttpFallbackOperationInput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct ResponseCodeHttpFallbackOperationInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct ResponseCodeHttpFallbackOperationInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl ResponseCodeHttpFallbackOperationInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationInput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationInput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<
   22     35   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
   23     36   
        ::aws_smithy_types::error::operation::BuildError,
   24     37   
    > {
   25         -
        ::std::result::Result::Ok(crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput {})
          38  +
        /* BuilderGenerator.kt:254 */
          39  +
        ::std::result::Result::Ok(
          40  +
            /* BuilderGenerator.kt:477 */
          41  +
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput {
          42  +
            /* BuilderGenerator.kt:477 */}, /* BuilderGenerator.kt:254 */
          43  +
        )
          44  +
        /* BuilderGenerator.kt:253 */
   26     45   
    }
          46  +
    /* BuilderGenerator.kt:355 */
   27     47   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation/_response_code_http_fallback_operation_output.rs

@@ -1,1 +22,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ResponseCodeHttpFallbackOperationOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct ResponseCodeHttpFallbackOperationOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl ResponseCodeHttpFallbackOperationOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationOutput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationOutput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`ResponseCodeHttpFallbackOperationOutput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`ResponseCodeHttpFallbackOperationOutput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct ResponseCodeHttpFallbackOperationOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct ResponseCodeHttpFallbackOperationOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl ResponseCodeHttpFallbackOperationOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationOutput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationOutput`](crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput {
   20         -
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation/builders.rs

@@ -1,1 +111,123 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::response_code_http_fallback_operation::_response_code_http_fallback_operation_output::ResponseCodeHttpFallbackOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::response_code_http_fallback_operation::_response_code_http_fallback_operation_input::ResponseCodeHttpFallbackOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.response_code_http_fallback_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `ResponseCodeHttpFallbackOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `ResponseCodeHttpFallbackOperation`.
   24     27   
///
   25         -
/// This operation tests that the response code defaults to `@http`'s code.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation tests that the response code defaults to `@http`'s code.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct ResponseCodeHttpFallbackOperationFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder,
   30     35   
    config_override: ::std::option::Option<crate::config::Builder>,
   31     36   
}
          37  +
/* FluentBuilderGenerator.kt:381 */
   32     38   
impl
   33     39   
    crate::client::customize::internal::CustomizableSend<
   34     40   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   35     41   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   36     42   
    > for ResponseCodeHttpFallbackOperationFluentBuilder
   37     43   
{
   38     44   
    fn send(
   39     45   
        self,
   40     46   
        config_override: crate::config::Builder,
   41     47   
    ) -> crate::client::customize::internal::BoxFuture<
   42     48   
        crate::client::customize::internal::SendResult<
   43     49   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   44     50   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   45     51   
        >,
   46     52   
    > {
   47     53   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   48     54   
    }
   49     55   
}
          56  +
/* FluentBuilderGenerator.kt:282 */
   50     57   
impl ResponseCodeHttpFallbackOperationFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `ResponseCodeHttpFallbackOperationFluentBuilder`.
   52     60   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   53     61   
        Self {
   54     62   
            handle,
   55     63   
            inner: ::std::default::Default::default(),
   56     64   
            config_override: ::std::option::Option::None,
   57     65   
        }
   58     66   
    }
          67  +
    /* FluentBuilderGenerator.kt:301 */
   59     68   
    /// Access the ResponseCodeHttpFallbackOperation as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder {
   61     70   
        &self.inner
   62     71   
    }
          72  +
    /* FluentBuilderGenerator.kt:145 */
   63     73   
    /// Sends the request and returns the response.
   64     74   
    ///
   65     75   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   66     76   
    /// can be matched against.
   67     77   
    ///
   68     78   
    /// By default, any retryable failures will be retried twice. Retry behavior
   69     79   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   70     80   
    /// set when configuring the client.
   71     81   
    pub async fn send(
   72     82   
        self,
   73     83   
    ) -> ::std::result::Result<
   74     84   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   77     87   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   78     88   
        >,
   79     89   
    > {
   80     90   
        let input = self
   81     91   
            .inner
   82     92   
            .build()
   83     93   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   84     94   
        let runtime_plugins = crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperation::operation_runtime_plugins(
   85     95   
            self.handle.runtime_plugins.clone(),
   86     96   
            &self.handle.conf,
   87     97   
            self.config_override,
   88     98   
        );
   89     99   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperation::orchestrate(&runtime_plugins, input).await
   90    100   
    }
   91    101   
   92    102   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   93    103   
    pub fn customize(
   94    104   
        self,
   95    105   
    ) -> crate::client::customize::CustomizableOperation<
   96    106   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   97    107   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:282 */
  111    123   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_required_operation.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `ResponseCodeRequiredOperation`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct ResponseCodeRequiredOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl ResponseCodeRequiredOperation {
    7         -
    /// Creates a new `ResponseCodeRequiredOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `ResponseCodeRequiredOperation`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +382,458 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ResponseCodeRequiredOperation {
   95    106   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   96    107   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ResponseCodeRequiredOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            ResponseCodeRequiredOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            ResponseCodeRequiredOperationResponseDeserializer,
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  106    117   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  107    118   
        ));
  108    119   
  109    120   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  110    121   
            "ResponseCodeRequiredOperation",
  111    122   
            "MiscService",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ResponseCodeRequiredOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(ResponseCodeRequiredOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
  130    141   
            >::new());
  131    142   
  132    143   
        ::std::borrow::Cow::Owned(rcb)
  133    144   
    }
  134    145   
}
  135    146   
         147  +
/* ResponseDeserializerGenerator.kt:64 */
  136    148   
#[derive(Debug)]
  137    149   
struct ResponseCodeRequiredOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeRequiredOperationResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 200 || force_error {
  150    162   
            crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct ResponseCodeRequiredOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeRequiredOperationRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/responseCodeRequiredOperation").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct ResponseCodeRequiredOperationEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeRequiredOperationEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "ResponseCodeRequiredOperationEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<ResponseCodeRequiredOperationInput>()
  220    234   
            .ok_or("failed to downcast to ResponseCodeRequiredOperationInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* RustType.kt:516 */
  234    249   
#[allow(unreachable_code, unused_variables)]
         250  +
/* RustType.kt:516 */
  235    251   
#[cfg(test)]
         252  +
/* ProtocolTestGenerator.kt:98 */
  236    253   
mod response_code_required_operation_test {
  237    254   
  238    255   
    /// Test ID: ResponseCodeRequiredOperation
  239    256   
    #[::tokio::test]
  240    257   
    #[::tracing_test::traced_test]
  241    258   
    async fn response_code_required_operation_response() {
  242    259   
        let expected_output = crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput::builder()
  243    260   
            .set_response_code(::std::option::Option::Some(201))
  244    261   
            .build()
  245    262   
            .unwrap();
  246    263   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  247    264   
            ::http::response::Builder::new()
  248    265   
                .header("Content-Length", "2")
  249    266   
                .status(201)
  250    267   
                .body(::aws_smithy_types::body::SdkBody::from(vec![]))
  251    268   
                .unwrap(),
  252    269   
        )
  253    270   
        .unwrap();
  254    271   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  255    272   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  256    273   
  257    274   
        let op = crate::operation::response_code_required_operation::ResponseCodeRequiredOperation::new();
  258    275   
        let config = op.config().expect("the operation has config");
  259    276   
        let de = config
  260    277   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  261    278   
            .expect("the config must have a deserializer");
  262    279   
  263    280   
        let parsed = de.deserialize_streaming(&mut http_response);
  264    281   
        let parsed = parsed.unwrap_or_else(|| {
  265    282   
            let http_response = http_response.map(|body| {
  266    283   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  267    284   
                    body.bytes().unwrap(),
  268    285   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  269    286   
                )))
  270    287   
            });
  271    288   
            de.deserialize_nonstreaming(&http_response)
  272    289   
        });
  273    290   
        let parsed = parsed
  274    291   
            .expect("should be successful response")
  275    292   
            .downcast::<crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput>()
  276    293   
            .unwrap();
  277    294   
        ::pretty_assertions::assert_eq!(
  278    295   
            parsed.response_code,
  279    296   
            expected_output.response_code,
  280    297   
            "Unexpected value for `response_code`"
  281    298   
        );
  282    299   
    }
         300  +
         301  +
    /* ProtocolTestGenerator.kt:98 */
  283    302   
}
  284    303   
         304  +
/* OperationErrorGenerator.kt:79 */
  285    305   
/// Error type for the `ResponseCodeRequiredOperationError` operation.
         306  +
/* RustType.kt:516 */
  286    307   
#[non_exhaustive]
         308  +
/* RustType.kt:516 */
  287    309   
#[derive(::std::fmt::Debug)]
  288         -
pub enum ResponseCodeRequiredOperationError {
         310  +
pub /* OperationErrorGenerator.kt:81 */ enum ResponseCodeRequiredOperationError {
         311  +
    /* OperationErrorGenerator.kt:88 */
  289    312   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  290    313   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  291    314   
    variable wildcard pattern and check `.code()`:
  292    315   
     \
  293    316   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  294    317   
     \
  295    318   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseCodeRequiredOperationError) for what information is available for the error.")]
  296    319   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         320  +
    /* OperationErrorGenerator.kt:81 */
  297    321   
}
         322  +
/* OperationErrorGenerator.kt:218 */
  298    323   
impl ResponseCodeRequiredOperationError {
         324  +
    /* OperationErrorGenerator.kt:219 */
  299    325   
    /// Creates the `ResponseCodeRequiredOperationError::Unhandled` variant from any error type.
  300    326   
    pub fn unhandled(
  301    327   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  302    328   
    ) -> Self {
  303    329   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  304    330   
            source: err.into(),
  305    331   
            meta: ::std::default::Default::default(),
  306    332   
        })
  307    333   
    }
  308    334   
  309    335   
    /// Creates the `ResponseCodeRequiredOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  310    336   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  311    337   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  312    338   
            source: err.clone().into(),
  313    339   
            meta: err,
  314    340   
        })
  315    341   
    }
  316         -
    ///
         342  +
    /// /* OperationErrorGenerator.kt:236 */
  317    343   
    /// Returns error metadata, which includes the error code, message,
  318    344   
    /// request ID, and potentially additional information.
  319    345   
    ///
         346  +
    /* OperationErrorGenerator.kt:242 */
  320    347   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         348  +
        /* OperationErrorGenerator.kt:243 */
  321    349   
        match self {
  322         -
            Self::Unhandled(e) => &e.meta,
         350  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         351  +
            /* OperationErrorGenerator.kt:243 */
  323    352   
        }
         353  +
        /* OperationErrorGenerator.kt:242 */
  324    354   
    }
         355  +
    /* OperationErrorGenerator.kt:218 */
  325    356   
}
         357  +
/* OperationErrorGenerator.kt:269 */
  326    358   
impl ::std::error::Error for ResponseCodeRequiredOperationError {
         359  +
    /* OperationErrorGenerator.kt:270 */
  327    360   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         361  +
        /* OperationErrorGenerator.kt:318 */
  328    362   
        match self {
  329         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         363  +
            /* OperationErrorGenerator.kt:326 */
         364  +
            Self::Unhandled(_inner) => {
         365  +
                /* OperationErrorGenerator.kt:279 */
         366  +
                ::std::option::Option::Some(&*_inner.source)
         367  +
                /* OperationErrorGenerator.kt:326 */
         368  +
            } /* OperationErrorGenerator.kt:318 */
  330    369   
        }
         370  +
        /* OperationErrorGenerator.kt:270 */
  331    371   
    }
         372  +
    /* OperationErrorGenerator.kt:269 */
  332    373   
}
         374  +
/* OperationErrorGenerator.kt:133 */
  333    375   
impl ::std::fmt::Display for ResponseCodeRequiredOperationError {
         376  +
    /* OperationErrorGenerator.kt:134 */
  334    377   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         378  +
        /* OperationErrorGenerator.kt:318 */
  335    379   
        match self {
         380  +
            /* OperationErrorGenerator.kt:326 */
  336    381   
            Self::Unhandled(_inner) => {
         382  +
                /* OperationErrorGenerator.kt:139 */
  337    383   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  338    384   
                    write!(f, "unhandled error ({code})")
  339    385   
                } else {
  340    386   
                    f.write_str("unhandled error")
  341    387   
                }
         388  +
                /* OperationErrorGenerator.kt:326 */
         389  +
            } /* OperationErrorGenerator.kt:318 */
  342    390   
        }
         391  +
        /* OperationErrorGenerator.kt:134 */
  343    392   
    }
  344         -
    }
         393  +
    /* OperationErrorGenerator.kt:133 */
  345    394   
}
         395  +
/* OperationErrorGenerator.kt:182 */
  346    396   
impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseCodeRequiredOperationError {
         397  +
    /* OperationErrorGenerator.kt:186 */
  347    398   
    fn code(&self) -> ::std::option::Option<&str> {
         399  +
        /* OperationErrorGenerator.kt:187 */
  348    400   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         401  +
        /* OperationErrorGenerator.kt:186 */
  349    402   
    }
         403  +
    /* OperationErrorGenerator.kt:190 */
  350    404   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         405  +
        /* OperationErrorGenerator.kt:197 */
  351    406   
        ::std::option::Option::None
         407  +
        /* OperationErrorGenerator.kt:190 */
  352    408   
    }
         409  +
    /* OperationErrorGenerator.kt:182 */
  353    410   
}
         411  +
/* OperationErrorGenerator.kt:163 */
  354    412   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseCodeRequiredOperationError {
         413  +
    /* OperationErrorGenerator.kt:164 */
  355    414   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         415  +
        /* OperationErrorGenerator.kt:318 */
  356    416   
        match self {
  357         -
            Self::Unhandled(_inner) => &_inner.meta,
         417  +
            /* OperationErrorGenerator.kt:326 */
         418  +
            Self::Unhandled(_inner) => {
         419  +
                /* OperationErrorGenerator.kt:168 */
         420  +
                &_inner.meta
         421  +
                /* OperationErrorGenerator.kt:326 */
         422  +
            } /* OperationErrorGenerator.kt:318 */
  358    423   
        }
         424  +
        /* OperationErrorGenerator.kt:164 */
  359    425   
    }
         426  +
    /* OperationErrorGenerator.kt:163 */
  360    427   
}
         428  +
/* OperationErrorGenerator.kt:109 */
  361    429   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseCodeRequiredOperationError {
         430  +
    /* OperationErrorGenerator.kt:110 */
  362    431   
    fn create_unhandled_error(
  363    432   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  364    433   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  365    434   
    ) -> Self {
         435  +
        /* OperationErrorGenerator.kt:121 */
  366    436   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  367    437   
            source,
  368    438   
            meta: meta.unwrap_or_default(),
  369    439   
        })
         440  +
        /* OperationErrorGenerator.kt:110 */
  370    441   
    }
         442  +
    /* OperationErrorGenerator.kt:109 */
  371    443   
}
  372    444   
         445  +
/* CodegenDelegator.kt:255 */
  373    446   
pub use crate::operation::response_code_required_operation::_response_code_required_operation_output::ResponseCodeRequiredOperationOutput;
  374    447   
         448  +
/* CodegenDelegator.kt:255 */
  375    449   
pub use crate::operation::response_code_required_operation::_response_code_required_operation_input::ResponseCodeRequiredOperationInput;
  376    450   
         451  +
/* RustModule.kt:172 */
  377    452   
mod _response_code_required_operation_input;
  378    453   
         454  +
/* RustModule.kt:172 */
  379    455   
mod _response_code_required_operation_output;
  380    456   
  381         -
/// Builders
         457  +
/// /* CodegenDelegator.kt:51 */Builders
  382    458   
pub mod builders;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_required_operation/_response_code_required_operation_input.rs

@@ -1,1 +27,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ResponseCodeRequiredOperationInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct ResponseCodeRequiredOperationInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl ResponseCodeRequiredOperationInput {
    7         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationInput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationInput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`ResponseCodeRequiredOperationInput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`ResponseCodeRequiredOperationInput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct ResponseCodeRequiredOperationInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct ResponseCodeRequiredOperationInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl ResponseCodeRequiredOperationInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationInput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ResponseCodeRequiredOperationInput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<
   22     35   
        crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput,
   23     36   
        ::aws_smithy_types::error::operation::BuildError,
   24     37   
    > {
   25         -
        ::std::result::Result::Ok(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput {})
          38  +
        /* BuilderGenerator.kt:254 */
          39  +
        ::std::result::Result::Ok(
          40  +
            /* BuilderGenerator.kt:477 */
          41  +
            crate::operation::response_code_required_operation::ResponseCodeRequiredOperationInput {
          42  +
            /* BuilderGenerator.kt:477 */}, /* BuilderGenerator.kt:254 */
          43  +
        )
          44  +
        /* BuilderGenerator.kt:253 */
   26     45   
    }
          46  +
    /* BuilderGenerator.kt:355 */
   27     47   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_required_operation/_response_code_required_operation_output.rs

@@ -1,1 +62,101 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct ResponseCodeRequiredOperationOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct ResponseCodeRequiredOperationOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub response_code: i32,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl ResponseCodeRequiredOperationOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn response_code(&self) -> i32 {
          20  +
        /* StructureGenerator.kt:168 */
   12     21   
        self.response_code
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl ResponseCodeRequiredOperationOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct ResponseCodeRequiredOperationOutputBuilder {
   26         -
    pub(crate) response_code: ::std::option::Option<i32>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) response_code: ::std::option::Option<i32>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl ResponseCodeRequiredOperationOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
   30         -
    /// This field is required.
          52  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          53  +
    /* BuilderGenerator.kt:291 */
   31     54   
    pub fn response_code(mut self, input: i32) -> Self {
          55  +
        /* BuilderGenerator.kt:292 */
   32     56   
        self.response_code = ::std::option::Option::Some(input);
          57  +
        /* BuilderGenerator.kt:293 */
   33     58   
        self
          59  +
        /* BuilderGenerator.kt:291 */
   34     60   
    }
          61  +
    /* BuilderGenerator.kt:312 */
   35     62   
    #[allow(missing_docs)] // documentation missing in model
          63  +
                           /* BuilderGenerator.kt:314 */
   36     64   
    pub fn set_response_code(mut self, input: ::std::option::Option<i32>) -> Self {
          65  +
        /* BuilderGenerator.kt:315 */
   37     66   
        self.response_code = input;
   38     67   
        self
          68  +
        /* BuilderGenerator.kt:314 */
   39     69   
    }
          70  +
    /* BuilderGenerator.kt:334 */
   40     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* BuilderGenerator.kt:336 */
   41     73   
    pub fn get_response_code(&self) -> &::std::option::Option<i32> {
          74  +
        /* BuilderGenerator.kt:337 */
   42     75   
        &self.response_code
          76  +
        /* BuilderGenerator.kt:336 */
   43     77   
    }
   44         -
    /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
   45         -
    /// This method will fail if any of the following fields are not set:
   46         -
    /// - [`response_code`](crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::response_code)
          78  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          79  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
          80  +
    /// /* BuilderGenerator.kt:246 */- [`response_code`](crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::response_code)
          81  +
    /* BuilderGenerator.kt:253 */
   47     82   
    pub fn build(
   48     83   
        self,
   49     84   
    ) -> ::std::result::Result<
   50     85   
        crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput,
   51     86   
        ::aws_smithy_types::error::operation::BuildError,
   52     87   
    > {
   53         -
        ::std::result::Result::Ok(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput {
   54         -
            response_code: self.response_code.ok_or_else(|| {
   55         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   56         -
                    "response_code",
   57         -
                    "response_code was not specified but it is required when building ResponseCodeRequiredOperationOutput",
   58         -
                )
   59         -
            })?,
   60         -
        })
          88  +
        /* BuilderGenerator.kt:254 */
          89  +
        ::std::result::Result::Ok(
          90  +
            /* BuilderGenerator.kt:477 */crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput {
          91  +
                /* BuilderGenerator.kt:481 */response_code: self.response_code
          92  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
          93  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("response_code", "response_code was not specified but it is required when building ResponseCodeRequiredOperationOutput")
          94  +
                    /* BuilderGenerator.kt:494 */)?
          95  +
                ,
          96  +
            /* BuilderGenerator.kt:477 */}
          97  +
        /* BuilderGenerator.kt:254 */)
          98  +
        /* BuilderGenerator.kt:253 */
   61     99   
    }
         100  +
    /* BuilderGenerator.kt:355 */
   62    101   
}