Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_header/_primitive_int_header_input.rs

@@ -1,1 +25,45 @@
    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 PrimitiveIntHeaderInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct PrimitiveIntHeaderInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl PrimitiveIntHeaderInput {
    7         -
    /// Creates a new builder-style object to manufacture [`PrimitiveIntHeaderInput`](crate::operation::primitive_int_header::PrimitiveIntHeaderInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`PrimitiveIntHeaderInput`](crate::operation::primitive_int_header::PrimitiveIntHeaderInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::primitive_int_header::builders::PrimitiveIntHeaderInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::primitive_int_header::builders::PrimitiveIntHeaderInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`PrimitiveIntHeaderInput`](crate::operation::primitive_int_header::PrimitiveIntHeaderInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`PrimitiveIntHeaderInput`](crate::operation::primitive_int_header::PrimitiveIntHeaderInput).
          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 PrimitiveIntHeaderInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct PrimitiveIntHeaderInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl PrimitiveIntHeaderInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`PrimitiveIntHeaderInput`](crate::operation::primitive_int_header::PrimitiveIntHeaderInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`PrimitiveIntHeaderInput`](crate::operation::primitive_int_header::PrimitiveIntHeaderInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<crate::operation::primitive_int_header::PrimitiveIntHeaderInput, ::aws_smithy_types::error::operation::BuildError>
   22     35   
    {
   23         -
        ::std::result::Result::Ok(crate::operation::primitive_int_header::PrimitiveIntHeaderInput {})
          36  +
        /* BuilderGenerator.kt:254 */
          37  +
        ::std::result::Result::Ok(
          38  +
            /* BuilderGenerator.kt:477 */
          39  +
            crate::operation::primitive_int_header::PrimitiveIntHeaderInput {
          40  +
            /* BuilderGenerator.kt:477 */}, /* BuilderGenerator.kt:254 */
          41  +
        )
          42  +
        /* BuilderGenerator.kt:253 */
   24     43   
    }
          44  +
    /* BuilderGenerator.kt:355 */
   25     45   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_header/_primitive_int_header_output.rs

@@ -1,1 +50,93 @@
    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 PrimitiveIntHeaderOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct PrimitiveIntHeaderOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub field: i32,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl PrimitiveIntHeaderOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn field(&self) -> i32 {
          20  +
        /* StructureGenerator.kt:168 */
   12     21   
        self.field
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl PrimitiveIntHeaderOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`PrimitiveIntHeaderOutput`](crate::operation::primitive_int_header::PrimitiveIntHeaderOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`PrimitiveIntHeaderOutput`](crate::operation::primitive_int_header::PrimitiveIntHeaderOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::primitive_int_header::builders::PrimitiveIntHeaderOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::primitive_int_header::builders::PrimitiveIntHeaderOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`PrimitiveIntHeaderOutput`](crate::operation::primitive_int_header::PrimitiveIntHeaderOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`PrimitiveIntHeaderOutput`](crate::operation::primitive_int_header::PrimitiveIntHeaderOutput).
          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 PrimitiveIntHeaderOutputBuilder {
   26         -
    pub(crate) field: ::std::option::Option<i32>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) field: ::std::option::Option<i32>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl PrimitiveIntHeaderOutputBuilder {
          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 field(mut self, input: i32) -> Self {
          55  +
        /* BuilderGenerator.kt:292 */
   32     56   
        self.field = ::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_field(mut self, input: ::std::option::Option<i32>) -> Self {
          65  +
        /* BuilderGenerator.kt:315 */
   37     66   
        self.field = 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_field(&self) -> &::std::option::Option<i32> {
          74  +
        /* BuilderGenerator.kt:337 */
   42     75   
        &self.field
          76  +
        /* BuilderGenerator.kt:336 */
   43     77   
    }
   44         -
    /// Consumes the builder and constructs a [`PrimitiveIntHeaderOutput`](crate::operation::primitive_int_header::PrimitiveIntHeaderOutput).
          78  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`PrimitiveIntHeaderOutput`](crate::operation::primitive_int_header::PrimitiveIntHeaderOutput).
          79  +
    /* BuilderGenerator.kt:253 */
   45     80   
    pub fn build(self) -> crate::operation::primitive_int_header::PrimitiveIntHeaderOutput {
          81  +
        /* BuilderGenerator.kt:477 */
   46     82   
        crate::operation::primitive_int_header::PrimitiveIntHeaderOutput {
   47         -
            field: self.field.unwrap_or_default(),
          83  +
            /* BuilderGenerator.kt:481 */
          84  +
            field: self
          85  +
                .field
          86  +
                /* BuilderGenerator.kt:487 */
          87  +
                .unwrap_or_default(),
          88  +
            /* BuilderGenerator.kt:477 */
   48     89   
        }
          90  +
        /* BuilderGenerator.kt:253 */
   49     91   
    }
          92  +
    /* BuilderGenerator.kt:355 */
   50     93   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_header/builders.rs

@@ -1,1 +110,122 @@
    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::primitive_int_header::_primitive_int_header_output::PrimitiveIntHeaderOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::primitive_int_header::_primitive_int_header_input::PrimitiveIntHeaderInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::primitive_int_header::builders::PrimitiveIntHeaderInputBuilder {
    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::primitive_int_header::PrimitiveIntHeaderOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::primitive_int_header::PrimitiveIntHeaderError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.primitive_int_header();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `PrimitiveIntHeader`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `PrimitiveIntHeader`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct PrimitiveIntHeaderFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::primitive_int_header::builders::PrimitiveIntHeaderInputBuilder,
   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::primitive_int_header::PrimitiveIntHeaderOutput,
   34     40   
        crate::operation::primitive_int_header::PrimitiveIntHeaderError,
   35     41   
    > for PrimitiveIntHeaderFluentBuilder
   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::primitive_int_header::PrimitiveIntHeaderOutput,
   43     49   
            crate::operation::primitive_int_header::PrimitiveIntHeaderError,
   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 PrimitiveIntHeaderFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `PrimitiveIntHeaderFluentBuilder`.
   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 PrimitiveIntHeader as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::primitive_int_header::builders::PrimitiveIntHeaderInputBuilder {
   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::primitive_int_header::PrimitiveIntHeaderOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::primitive_int_header::PrimitiveIntHeaderError,
   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::primitive_int_header::PrimitiveIntHeader::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::primitive_int_header::PrimitiveIntHeader::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::primitive_int_header::PrimitiveIntHeaderOutput,
   96    106   
        crate::operation::primitive_int_header::PrimitiveIntHeaderError,
   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   
    }
         121  +
    /* FluentBuilderGenerator.kt:282 */
  110    122   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_op.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 `PrimitiveIntOp`.
           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 PrimitiveIntOp;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl PrimitiveIntOp {
    7         -
    /// Creates a new `PrimitiveIntOp`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `PrimitiveIntOp`
          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::primitive_int_op::PrimitiveIntOpInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::primitive_int_op::PrimitiveIntOpOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::primitive_int_op::PrimitiveIntOpError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +263,280 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for PrimitiveIntOp {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("PrimitiveIntOp");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            PrimitiveIntOpRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            PrimitiveIntOpResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "PrimitiveIntOp",
  105    116   
            "Rest Json Protocol",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("PrimitiveIntOp")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(PrimitiveIntOpEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::primitive_int_op::PrimitiveIntOpError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::primitive_int_op::PrimitiveIntOpError,
  124    135   
            >::new());
  125    136   
  126    137   
        ::std::borrow::Cow::Owned(rcb)
  127    138   
    }
  128    139   
}
  129    140   
         141  +
/* ResponseDeserializerGenerator.kt:64 */
  130    142   
#[derive(Debug)]
  131    143   
struct PrimitiveIntOpResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PrimitiveIntOpResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_primitive_int_op::de_primitive_int_op_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_primitive_int_op::de_primitive_int_op_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct PrimitiveIntOpRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PrimitiveIntOpRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input
  161    174   
            .downcast::<crate::operation::primitive_int_op::PrimitiveIntOpInput>()
  162    175   
            .expect("correct type");
  163    176   
        let _header_serialization_settings = _cfg
  164    177   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  165    178   
            .cloned()
  166    179   
            .unwrap_or_default();
  167    180   
        let mut request_builder = {
  168    181   
            fn uri_base(
  169    182   
                _input: &crate::operation::primitive_int_op::PrimitiveIntOpInput,
  170    183   
                output: &mut ::std::string::String,
  171    184   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172    185   
                use ::std::fmt::Write as _;
  173    186   
                ::std::write!(output, "/primitive-document").expect("formatting should succeed");
  174    187   
                ::std::result::Result::Ok(())
  175    188   
            }
  176    189   
            #[allow(clippy::unnecessary_wraps)]
  177    190   
            fn update_http_builder(
  178    191   
                input: &crate::operation::primitive_int_op::PrimitiveIntOpInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_primitive_int_op::ser_primitive_int_op_input(&input)?);
  190    203   
        if let Some(content_length) = body.content_length() {
  191    204   
            let content_length = content_length.to_string();
  192    205   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  193    206   
        }
  194    207   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  195    208   
    }
  196    209   
}
         210  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  197    211   
#[derive(Debug)]
  198    212   
struct PrimitiveIntOpEndpointParamsInterceptor;
  199    213   
  200    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PrimitiveIntOpEndpointParamsInterceptor {
  201    215   
    fn name(&self) -> &'static str {
  202    216   
        "PrimitiveIntOpEndpointParamsInterceptor"
  203    217   
    }
  204    218   
  205    219   
    fn read_before_execution(
  206    220   
        &self,
  207    221   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  208    222   
            '_,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  210    224   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  212    226   
        >,
  213    227   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  214    228   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  215    229   
        let _input = context
  216    230   
            .input()
  217    231   
            .downcast_ref::<PrimitiveIntOpInput>()
  218    232   
            .ok_or("failed to downcast to PrimitiveIntOpInput")?;
  219    233   
  220    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  222    236   
        })?;
  223    237   
        cfg.interceptor_state()
  224    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  225    239   
        ::std::result::Result::Ok(())
  226    240   
    }
  227    241   
}
  228    242   
  229    243   
// The get_* functions below are generated from JMESPath expressions in the
  230    244   
// operationContextParams trait. They target the operation's input shape.
  231    245   
         246  +
/* RustType.kt:516 */
  232    247   
#[allow(unreachable_code, unused_variables)]
         248  +
/* RustType.kt:516 */
  233    249   
#[cfg(test)]
         250  +
/* ProtocolTestGenerator.kt:98 */
  234    251   
mod primitive_int_op_test {
  235    252   
  236    253   
    /// Primitive ints should not be serialized when they are unset
  237    254   
    /// Test ID: SerPrimitiveInt
  238    255   
    #[::tokio::test]
  239    256   
    #[::tracing_test::traced_test]
  240    257   
    async fn ser_primitive_int_request() {
  241    258   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  242    259   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  243    260   
@@ -273,290 +412,512 @@
  293    310   
        });
  294    311   
        let parsed = parsed.expect_err("should be error response");
  295    312   
        let parsed: &crate::operation::primitive_int_op::PrimitiveIntOpError =
  296    313   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  297    314   
        if let crate::operation::primitive_int_op::PrimitiveIntOpError::ExtraError(parsed) = parsed {
  298    315   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  299    316   
        } else {
  300    317   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  301    318   
        }
  302    319   
    }
         320  +
         321  +
    /* ProtocolTestGenerator.kt:98 */
  303    322   
}
  304    323   
         324  +
/* OperationErrorGenerator.kt:79 */
  305    325   
/// Error type for the `PrimitiveIntOpError` operation.
         326  +
/* RustType.kt:516 */
  306    327   
#[non_exhaustive]
         328  +
/* RustType.kt:516 */
  307    329   
#[derive(::std::fmt::Debug)]
  308         -
pub enum PrimitiveIntOpError {
         330  +
pub /* OperationErrorGenerator.kt:81 */ enum PrimitiveIntOpError {
         331  +
    /* OperationErrorGenerator.kt:83 */
  309    332   
    #[allow(missing_docs)] // documentation missing in model
         333  +
    /* OperationErrorGenerator.kt:86 */
  310    334   
    ExtraError(crate::types::error::ExtraError),
         335  +
    /* OperationErrorGenerator.kt:88 */
  311    336   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  312    337   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  313    338   
    variable wildcard pattern and check `.code()`:
  314    339   
     \
  315    340   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  316    341   
     \
  317    342   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-PrimitiveIntOpError) for what information is available for the error.")]
  318    343   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         344  +
    /* OperationErrorGenerator.kt:81 */
  319    345   
}
         346  +
/* OperationErrorGenerator.kt:218 */
  320    347   
impl PrimitiveIntOpError {
         348  +
    /* OperationErrorGenerator.kt:219 */
  321    349   
    /// Creates the `PrimitiveIntOpError::Unhandled` variant from any error type.
  322    350   
    pub fn unhandled(
  323    351   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  324    352   
    ) -> Self {
  325    353   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  326    354   
            source: err.into(),
  327    355   
            meta: ::std::default::Default::default(),
  328    356   
        })
  329    357   
    }
  330    358   
  331    359   
    /// Creates the `PrimitiveIntOpError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  332    360   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  333    361   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  334    362   
            source: err.clone().into(),
  335    363   
            meta: err,
  336    364   
        })
  337    365   
    }
  338         -
    ///
         366  +
    /// /* OperationErrorGenerator.kt:236 */
  339    367   
    /// Returns error metadata, which includes the error code, message,
  340    368   
    /// request ID, and potentially additional information.
  341    369   
    ///
         370  +
    /* OperationErrorGenerator.kt:242 */
  342    371   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         372  +
        /* OperationErrorGenerator.kt:243 */
  343    373   
        match self {
  344         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  345         -
            Self::Unhandled(e) => &e.meta,
         374  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         375  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         376  +
            /* OperationErrorGenerator.kt:243 */
  346    377   
        }
         378  +
        /* OperationErrorGenerator.kt:242 */
  347    379   
    }
         380  +
    /* OperationErrorGenerator.kt:257 */
  348    381   
    /// Returns `true` if the error kind is `PrimitiveIntOpError::ExtraError`.
         382  +
    /* OperationErrorGenerator.kt:258 */
  349    383   
    pub fn is_extra_error(&self) -> bool {
         384  +
        /* OperationErrorGenerator.kt:259 */
  350    385   
        matches!(self, Self::ExtraError(_))
         386  +
        /* OperationErrorGenerator.kt:258 */
  351    387   
    }
         388  +
    /* OperationErrorGenerator.kt:218 */
  352    389   
}
         390  +
/* OperationErrorGenerator.kt:269 */
  353    391   
impl ::std::error::Error for PrimitiveIntOpError {
         392  +
    /* OperationErrorGenerator.kt:270 */
  354    393   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         394  +
        /* OperationErrorGenerator.kt:318 */
  355    395   
        match self {
  356         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  357         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         396  +
            /* OperationErrorGenerator.kt:321 */
         397  +
            Self::ExtraError(_inner) =>
         398  +
            /* OperationErrorGenerator.kt:283 */
         399  +
            {
         400  +
                ::std::option::Option::Some(_inner)
         401  +
            }
         402  +
            ,
         403  +
            /* OperationErrorGenerator.kt:326 */
         404  +
            Self::Unhandled(_inner) => {
         405  +
                /* OperationErrorGenerator.kt:279 */
         406  +
                ::std::option::Option::Some(&*_inner.source)
         407  +
                /* OperationErrorGenerator.kt:326 */
         408  +
            } /* OperationErrorGenerator.kt:318 */
  358    409   
        }
         410  +
        /* OperationErrorGenerator.kt:270 */
  359    411   
    }
         412  +
    /* OperationErrorGenerator.kt:269 */
  360    413   
}
         414  +
/* OperationErrorGenerator.kt:133 */
  361    415   
impl ::std::fmt::Display for PrimitiveIntOpError {
         416  +
    /* OperationErrorGenerator.kt:134 */
  362    417   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         418  +
        /* OperationErrorGenerator.kt:318 */
  363    419   
        match self {
  364         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         420  +
            /* OperationErrorGenerator.kt:321 */
         421  +
            Self::ExtraError(_inner) =>
         422  +
            /* OperationErrorGenerator.kt:151 */
         423  +
            {
         424  +
                _inner.fmt(f)
         425  +
            }
         426  +
            ,
         427  +
            /* OperationErrorGenerator.kt:326 */
  365    428   
            Self::Unhandled(_inner) => {
         429  +
                /* OperationErrorGenerator.kt:139 */
  366    430   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  367    431   
                    write!(f, "unhandled error ({code})")
  368    432   
                } else {
  369    433   
                    f.write_str("unhandled error")
  370    434   
                }
         435  +
                /* OperationErrorGenerator.kt:326 */
         436  +
            } /* OperationErrorGenerator.kt:318 */
  371    437   
        }
         438  +
        /* OperationErrorGenerator.kt:134 */
  372    439   
    }
  373         -
    }
         440  +
    /* OperationErrorGenerator.kt:133 */
  374    441   
}
         442  +
/* OperationErrorGenerator.kt:182 */
  375    443   
impl ::aws_smithy_types::retry::ProvideErrorKind for PrimitiveIntOpError {
         444  +
    /* OperationErrorGenerator.kt:186 */
  376    445   
    fn code(&self) -> ::std::option::Option<&str> {
         446  +
        /* OperationErrorGenerator.kt:187 */
  377    447   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         448  +
        /* OperationErrorGenerator.kt:186 */
  378    449   
    }
         450  +
    /* OperationErrorGenerator.kt:190 */
  379    451   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         452  +
        /* OperationErrorGenerator.kt:197 */
  380    453   
        ::std::option::Option::None
         454  +
        /* OperationErrorGenerator.kt:190 */
  381    455   
    }
         456  +
    /* OperationErrorGenerator.kt:182 */
  382    457   
}
         458  +
/* OperationErrorGenerator.kt:163 */
  383    459   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for PrimitiveIntOpError {
         460  +
    /* OperationErrorGenerator.kt:164 */
  384    461   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         462  +
        /* OperationErrorGenerator.kt:318 */
  385    463   
        match self {
  386         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  387         -
            Self::Unhandled(_inner) => &_inner.meta,
         464  +
            /* OperationErrorGenerator.kt:321 */
         465  +
            Self::ExtraError(_inner) =>
         466  +
            /* OperationErrorGenerator.kt:169 */
         467  +
            {
         468  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         469  +
            }
         470  +
            ,
         471  +
            /* OperationErrorGenerator.kt:326 */
         472  +
            Self::Unhandled(_inner) => {
         473  +
                /* OperationErrorGenerator.kt:168 */
         474  +
                &_inner.meta
         475  +
                /* OperationErrorGenerator.kt:326 */
         476  +
            } /* OperationErrorGenerator.kt:318 */
  388    477   
        }
         478  +
        /* OperationErrorGenerator.kt:164 */
  389    479   
    }
         480  +
    /* OperationErrorGenerator.kt:163 */
  390    481   
}
         482  +
/* OperationErrorGenerator.kt:109 */
  391    483   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for PrimitiveIntOpError {
         484  +
    /* OperationErrorGenerator.kt:110 */
  392    485   
    fn create_unhandled_error(
  393    486   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  394    487   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  395    488   
    ) -> Self {
         489  +
        /* OperationErrorGenerator.kt:121 */
  396    490   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  397    491   
            source,
  398    492   
            meta: meta.unwrap_or_default(),
  399    493   
        })
         494  +
        /* OperationErrorGenerator.kt:110 */
  400    495   
    }
         496  +
    /* OperationErrorGenerator.kt:109 */
  401    497   
}
  402    498   
         499  +
/* CodegenDelegator.kt:255 */
  403    500   
pub use crate::operation::primitive_int_op::_primitive_int_op_output::PrimitiveIntOpOutput;
  404    501   
         502  +
/* CodegenDelegator.kt:255 */
  405    503   
pub use crate::operation::primitive_int_op::_primitive_int_op_input::PrimitiveIntOpInput;
  406    504   
         505  +
/* RustModule.kt:172 */
  407    506   
mod _primitive_int_op_input;
  408    507   
         508  +
/* RustModule.kt:172 */
  409    509   
mod _primitive_int_op_output;
  410    510   
  411         -
/// Builders
         511  +
/// /* CodegenDelegator.kt:51 */Builders
  412    512   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_op/_primitive_int_op_input.rs

@@ -1,1 +49,93 @@
    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 PrimitiveIntOpInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct PrimitiveIntOpInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub value: ::std::option::Option<i32>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl PrimitiveIntOpInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn value(&self) -> ::std::option::Option<i32> {
          20  +
        /* StructureGenerator.kt:168 */
   12     21   
        self.value
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl PrimitiveIntOpInput {
   16         -
    /// Creates a new builder-style object to manufacture [`PrimitiveIntOpInput`](crate::operation::primitive_int_op::PrimitiveIntOpInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`PrimitiveIntOpInput`](crate::operation::primitive_int_op::PrimitiveIntOpInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::primitive_int_op::builders::PrimitiveIntOpInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::primitive_int_op::builders::PrimitiveIntOpInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`PrimitiveIntOpInput`](crate::operation::primitive_int_op::PrimitiveIntOpInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`PrimitiveIntOpInput`](crate::operation::primitive_int_op::PrimitiveIntOpInput).
          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 PrimitiveIntOpInputBuilder {
   26         -
    pub(crate) value: ::std::option::Option<i32>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) value: ::std::option::Option<i32>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl PrimitiveIntOpInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn value(mut self, input: i32) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.value = ::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_value(mut self, input: ::std::option::Option<i32>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.value = 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_value(&self) -> &::std::option::Option<i32> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.value
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`PrimitiveIntOpInput`](crate::operation::primitive_int_op::PrimitiveIntOpInput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`PrimitiveIntOpInput`](crate::operation::primitive_int_op::PrimitiveIntOpInput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(
   45     80   
        self,
   46     81   
    ) -> ::std::result::Result<crate::operation::primitive_int_op::PrimitiveIntOpInput, ::aws_smithy_types::error::operation::BuildError> {
   47         -
        ::std::result::Result::Ok(crate::operation::primitive_int_op::PrimitiveIntOpInput { value: self.value })
          82  +
        /* BuilderGenerator.kt:254 */
          83  +
        ::std::result::Result::Ok(
          84  +
            /* BuilderGenerator.kt:477 */
          85  +
            crate::operation::primitive_int_op::PrimitiveIntOpInput {
          86  +
                /* BuilderGenerator.kt:481 */ value: self.value,
          87  +
                /* BuilderGenerator.kt:477 */
          88  +
            }, /* BuilderGenerator.kt:254 */
          89  +
        )
          90  +
        /* BuilderGenerator.kt:253 */
   48     91   
    }
          92  +
    /* BuilderGenerator.kt:355 */
   49     93   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_op/_primitive_int_op_output.rs

@@ -1,1 +49,92 @@
    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 PrimitiveIntOpOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct PrimitiveIntOpOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub value: i32,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl PrimitiveIntOpOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn value(&self) -> i32 {
          20  +
        /* StructureGenerator.kt:168 */
   12     21   
        self.value
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl PrimitiveIntOpOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`PrimitiveIntOpOutput`](crate::operation::primitive_int_op::PrimitiveIntOpOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`PrimitiveIntOpOutput`](crate::operation::primitive_int_op::PrimitiveIntOpOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::primitive_int_op::builders::PrimitiveIntOpOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::primitive_int_op::builders::PrimitiveIntOpOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`PrimitiveIntOpOutput`](crate::operation::primitive_int_op::PrimitiveIntOpOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`PrimitiveIntOpOutput`](crate::operation::primitive_int_op::PrimitiveIntOpOutput).
          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 PrimitiveIntOpOutputBuilder {
   26         -
    pub(crate) value: ::std::option::Option<i32>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) value: ::std::option::Option<i32>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl PrimitiveIntOpOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn value(mut self, input: i32) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.value = ::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_value(mut self, input: ::std::option::Option<i32>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.value = 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_value(&self) -> &::std::option::Option<i32> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.value
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`PrimitiveIntOpOutput`](crate::operation::primitive_int_op::PrimitiveIntOpOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`PrimitiveIntOpOutput`](crate::operation::primitive_int_op::PrimitiveIntOpOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::primitive_int_op::PrimitiveIntOpOutput {
          80  +
        /* BuilderGenerator.kt:477 */
   45     81   
        crate::operation::primitive_int_op::PrimitiveIntOpOutput {
   46         -
            value: self.value.unwrap_or_default(),
          82  +
            /* BuilderGenerator.kt:481 */
          83  +
            value: self
          84  +
                .value
          85  +
                /* BuilderGenerator.kt:487 */
          86  +
                .unwrap_or_default(),
          87  +
            /* BuilderGenerator.kt:477 */
   47     88   
        }
          89  +
        /* BuilderGenerator.kt:253 */
   48     90   
    }
          91  +
    /* BuilderGenerator.kt:355 */
   49     92   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_op/builders.rs

@@ -1,1 +124,142 @@
    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::primitive_int_op::_primitive_int_op_output::PrimitiveIntOpOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::primitive_int_op::_primitive_int_op_input::PrimitiveIntOpInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::primitive_int_op::builders::PrimitiveIntOpInputBuilder {
    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::primitive_int_op::PrimitiveIntOpOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::primitive_int_op::PrimitiveIntOpError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.primitive_int_op();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `PrimitiveIntOp`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `PrimitiveIntOp`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct PrimitiveIntOpFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::primitive_int_op::builders::PrimitiveIntOpInputBuilder,
   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::primitive_int_op::PrimitiveIntOpOutput,
   34     40   
        crate::operation::primitive_int_op::PrimitiveIntOpError,
   35     41   
    > for PrimitiveIntOpFluentBuilder
   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::primitive_int_op::PrimitiveIntOpOutput,
   43     49   
            crate::operation::primitive_int_op::PrimitiveIntOpError,
   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 PrimitiveIntOpFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `PrimitiveIntOpFluentBuilder`.
   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 PrimitiveIntOp as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::primitive_int_op::builders::PrimitiveIntOpInputBuilder {
   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::primitive_int_op::PrimitiveIntOpOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::primitive_int_op::PrimitiveIntOpError,
   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::primitive_int_op::PrimitiveIntOp::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::primitive_int_op::PrimitiveIntOp::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::primitive_int_op::PrimitiveIntOpOutput,
   96    106   
        crate::operation::primitive_int_op::PrimitiveIntOpError,
   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   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn value(mut self, input: i32) -> Self {
  112    125   
        self.inner = self.inner.value(input);
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_value(mut self, input: ::std::option::Option<i32>) -> Self {
  117    132   
        self.inner = self.inner.set_value(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_value(&self) -> &::std::option::Option<i32> {
  122    139   
        self.inner.get_value()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:282 */
  124    142   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/query_precedence.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 `QueryPrecedence`.
           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 QueryPrecedence;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl QueryPrecedence {
    7         -
    /// Creates a new `QueryPrecedence`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `QueryPrecedence`
          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::query_precedence::QueryPrecedenceInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::query_precedence::QueryPrecedenceOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::query_precedence::QueryPrecedenceError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +186,199 @@
   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 QueryPrecedence {
   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("QueryPrecedence");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            QueryPrecedenceRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            QueryPrecedenceResponseDeserializer,
  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   
            "QueryPrecedence",
  111    122   
            "Rest Json Protocol",
  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("QueryPrecedence")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(QueryPrecedenceEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::query_precedence::QueryPrecedenceError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::query_precedence::QueryPrecedenceError,
  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 QueryPrecedenceResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for QueryPrecedenceResponseDeserializer {
  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_query_precedence::de_query_precedence_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_query_precedence::de_query_precedence_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 QueryPrecedenceRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for QueryPrecedenceRequestSerializer {
  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
@@ -192,205 +288,305 @@
  212    225   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  213    226   
            }
  214    227   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  215    228   
            builder
  216    229   
        };
  217    230   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  218    231   
  219    232   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  220    233   
    }
  221    234   
}
         235  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  222    236   
#[derive(Debug)]
  223    237   
struct QueryPrecedenceEndpointParamsInterceptor;
  224    238   
  225    239   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryPrecedenceEndpointParamsInterceptor {
  226    240   
    fn name(&self) -> &'static str {
  227    241   
        "QueryPrecedenceEndpointParamsInterceptor"
  228    242   
    }
  229    243   
  230    244   
    fn read_before_execution(
  231    245   
        &self,
  232    246   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  233    247   
            '_,
  234    248   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  235    249   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  236    250   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  237    251   
        >,
  238    252   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  239    253   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  240    254   
        let _input = context
  241    255   
            .input()
  242    256   
            .downcast_ref::<QueryPrecedenceInput>()
  243    257   
            .ok_or("failed to downcast to QueryPrecedenceInput")?;
  244    258   
  245    259   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  246    260   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  247    261   
        })?;
  248    262   
        cfg.interceptor_state()
  249    263   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  250    264   
        ::std::result::Result::Ok(())
  251    265   
    }
  252    266   
}
  253    267   
  254    268   
// The get_* functions below are generated from JMESPath expressions in the
  255    269   
// operationContextParams trait. They target the operation's input shape.
  256    270   
         271  +
/* RustType.kt:516 */
  257    272   
#[allow(unreachable_code, unused_variables)]
         273  +
/* RustType.kt:516 */
  258    274   
#[cfg(test)]
         275  +
/* ProtocolTestGenerator.kt:98 */
  259    276   
mod query_precedence_test {
  260    277   
  261    278   
    /// Keys and values must be url encoded
  262    279   
    /// Test ID: UrlParamsKeyEncoding
  263    280   
    #[::tokio::test]
  264    281   
    #[::tracing_test::traced_test]
  265    282   
    async fn url_params_key_encoding_request() {
  266    283   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  267    284   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  268    285   
@@ -375,392 +514,614 @@
  395    412   
        });
  396    413   
        let parsed = parsed.expect_err("should be error response");
  397    414   
        let parsed: &crate::operation::query_precedence::QueryPrecedenceError =
  398    415   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  399    416   
        if let crate::operation::query_precedence::QueryPrecedenceError::ExtraError(parsed) = parsed {
  400    417   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  401    418   
        } else {
  402    419   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  403    420   
        }
  404    421   
    }
         422  +
         423  +
    /* ProtocolTestGenerator.kt:98 */
  405    424   
}
  406    425   
         426  +
/* OperationErrorGenerator.kt:79 */
  407    427   
/// Error type for the `QueryPrecedenceError` operation.
         428  +
/* RustType.kt:516 */
  408    429   
#[non_exhaustive]
         430  +
/* RustType.kt:516 */
  409    431   
#[derive(::std::fmt::Debug)]
  410         -
pub enum QueryPrecedenceError {
         432  +
pub /* OperationErrorGenerator.kt:81 */ enum QueryPrecedenceError {
         433  +
    /* OperationErrorGenerator.kt:83 */
  411    434   
    #[allow(missing_docs)] // documentation missing in model
         435  +
    /* OperationErrorGenerator.kt:86 */
  412    436   
    ExtraError(crate::types::error::ExtraError),
         437  +
    /* OperationErrorGenerator.kt:88 */
  413    438   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  414    439   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  415    440   
    variable wildcard pattern and check `.code()`:
  416    441   
     \
  417    442   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  418    443   
     \
  419    444   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-QueryPrecedenceError) for what information is available for the error.")]
  420    445   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         446  +
    /* OperationErrorGenerator.kt:81 */
  421    447   
}
         448  +
/* OperationErrorGenerator.kt:218 */
  422    449   
impl QueryPrecedenceError {
         450  +
    /* OperationErrorGenerator.kt:219 */
  423    451   
    /// Creates the `QueryPrecedenceError::Unhandled` variant from any error type.
  424    452   
    pub fn unhandled(
  425    453   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  426    454   
    ) -> Self {
  427    455   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  428    456   
            source: err.into(),
  429    457   
            meta: ::std::default::Default::default(),
  430    458   
        })
  431    459   
    }
  432    460   
  433    461   
    /// Creates the `QueryPrecedenceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  434    462   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  435    463   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  436    464   
            source: err.clone().into(),
  437    465   
            meta: err,
  438    466   
        })
  439    467   
    }
  440         -
    ///
         468  +
    /// /* OperationErrorGenerator.kt:236 */
  441    469   
    /// Returns error metadata, which includes the error code, message,
  442    470   
    /// request ID, and potentially additional information.
  443    471   
    ///
         472  +
    /* OperationErrorGenerator.kt:242 */
  444    473   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         474  +
        /* OperationErrorGenerator.kt:243 */
  445    475   
        match self {
  446         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  447         -
            Self::Unhandled(e) => &e.meta,
         476  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         477  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         478  +
            /* OperationErrorGenerator.kt:243 */
  448    479   
        }
         480  +
        /* OperationErrorGenerator.kt:242 */
  449    481   
    }
         482  +
    /* OperationErrorGenerator.kt:257 */
  450    483   
    /// Returns `true` if the error kind is `QueryPrecedenceError::ExtraError`.
         484  +
    /* OperationErrorGenerator.kt:258 */
  451    485   
    pub fn is_extra_error(&self) -> bool {
         486  +
        /* OperationErrorGenerator.kt:259 */
  452    487   
        matches!(self, Self::ExtraError(_))
         488  +
        /* OperationErrorGenerator.kt:258 */
  453    489   
    }
         490  +
    /* OperationErrorGenerator.kt:218 */
  454    491   
}
         492  +
/* OperationErrorGenerator.kt:269 */
  455    493   
impl ::std::error::Error for QueryPrecedenceError {
         494  +
    /* OperationErrorGenerator.kt:270 */
  456    495   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         496  +
        /* OperationErrorGenerator.kt:318 */
  457    497   
        match self {
  458         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  459         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         498  +
            /* OperationErrorGenerator.kt:321 */
         499  +
            Self::ExtraError(_inner) =>
         500  +
            /* OperationErrorGenerator.kt:283 */
         501  +
            {
         502  +
                ::std::option::Option::Some(_inner)
  460    503   
            }
         504  +
            ,
         505  +
            /* OperationErrorGenerator.kt:326 */
         506  +
            Self::Unhandled(_inner) => {
         507  +
                /* OperationErrorGenerator.kt:279 */
         508  +
                ::std::option::Option::Some(&*_inner.source)
         509  +
                /* OperationErrorGenerator.kt:326 */
         510  +
            } /* OperationErrorGenerator.kt:318 */
         511  +
        }
         512  +
        /* OperationErrorGenerator.kt:270 */
  461    513   
    }
         514  +
    /* OperationErrorGenerator.kt:269 */
  462    515   
}
         516  +
/* OperationErrorGenerator.kt:133 */
  463    517   
impl ::std::fmt::Display for QueryPrecedenceError {
         518  +
    /* OperationErrorGenerator.kt:134 */
  464    519   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         520  +
        /* OperationErrorGenerator.kt:318 */
  465    521   
        match self {
  466         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         522  +
            /* OperationErrorGenerator.kt:321 */
         523  +
            Self::ExtraError(_inner) =>
         524  +
            /* OperationErrorGenerator.kt:151 */
         525  +
            {
         526  +
                _inner.fmt(f)
         527  +
            }
         528  +
            ,
         529  +
            /* OperationErrorGenerator.kt:326 */
  467    530   
            Self::Unhandled(_inner) => {
         531  +
                /* OperationErrorGenerator.kt:139 */
  468    532   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  469    533   
                    write!(f, "unhandled error ({code})")
  470    534   
                } else {
  471    535   
                    f.write_str("unhandled error")
  472    536   
                }
         537  +
                /* OperationErrorGenerator.kt:326 */
         538  +
            } /* OperationErrorGenerator.kt:318 */
  473    539   
        }
         540  +
        /* OperationErrorGenerator.kt:134 */
  474    541   
    }
  475         -
    }
         542  +
    /* OperationErrorGenerator.kt:133 */
  476    543   
}
         544  +
/* OperationErrorGenerator.kt:182 */
  477    545   
impl ::aws_smithy_types::retry::ProvideErrorKind for QueryPrecedenceError {
         546  +
    /* OperationErrorGenerator.kt:186 */
  478    547   
    fn code(&self) -> ::std::option::Option<&str> {
         548  +
        /* OperationErrorGenerator.kt:187 */
  479    549   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         550  +
        /* OperationErrorGenerator.kt:186 */
  480    551   
    }
         552  +
    /* OperationErrorGenerator.kt:190 */
  481    553   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         554  +
        /* OperationErrorGenerator.kt:197 */
  482    555   
        ::std::option::Option::None
         556  +
        /* OperationErrorGenerator.kt:190 */
  483    557   
    }
         558  +
    /* OperationErrorGenerator.kt:182 */
  484    559   
}
         560  +
/* OperationErrorGenerator.kt:163 */
  485    561   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for QueryPrecedenceError {
         562  +
    /* OperationErrorGenerator.kt:164 */
  486    563   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         564  +
        /* OperationErrorGenerator.kt:318 */
  487    565   
        match self {
  488         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  489         -
            Self::Unhandled(_inner) => &_inner.meta,
         566  +
            /* OperationErrorGenerator.kt:321 */
         567  +
            Self::ExtraError(_inner) =>
         568  +
            /* OperationErrorGenerator.kt:169 */
         569  +
            {
         570  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         571  +
            }
         572  +
            ,
         573  +
            /* OperationErrorGenerator.kt:326 */
         574  +
            Self::Unhandled(_inner) => {
         575  +
                /* OperationErrorGenerator.kt:168 */
         576  +
                &_inner.meta
         577  +
                /* OperationErrorGenerator.kt:326 */
         578  +
            } /* OperationErrorGenerator.kt:318 */
  490    579   
        }
         580  +
        /* OperationErrorGenerator.kt:164 */
  491    581   
    }
         582  +
    /* OperationErrorGenerator.kt:163 */
  492    583   
}
         584  +
/* OperationErrorGenerator.kt:109 */
  493    585   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for QueryPrecedenceError {
         586  +
    /* OperationErrorGenerator.kt:110 */
  494    587   
    fn create_unhandled_error(
  495    588   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  496    589   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  497    590   
    ) -> Self {
         591  +
        /* OperationErrorGenerator.kt:121 */
  498    592   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  499    593   
            source,
  500    594   
            meta: meta.unwrap_or_default(),
  501    595   
        })
         596  +
        /* OperationErrorGenerator.kt:110 */
  502    597   
    }
         598  +
    /* OperationErrorGenerator.kt:109 */
  503    599   
}
  504    600   
         601  +
/* CodegenDelegator.kt:255 */
  505    602   
pub use crate::operation::query_precedence::_query_precedence_output::QueryPrecedenceOutput;
  506    603   
         604  +
/* CodegenDelegator.kt:255 */
  507    605   
pub use crate::operation::query_precedence::_query_precedence_input::QueryPrecedenceInput;
  508    606   
         607  +
/* RustModule.kt:172 */
  509    608   
mod _query_precedence_input;
  510    609   
         610  +
/* RustModule.kt:172 */
  511    611   
mod _query_precedence_output;
  512    612   
  513         -
/// Builders
         613  +
/// /* CodegenDelegator.kt:51 */Builders
  514    614   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/query_precedence/_query_precedence_input.rs

@@ -1,1 +78,140 @@
    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 QueryPrecedenceInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct QueryPrecedenceInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub baz: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl QueryPrecedenceInput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn foo(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.foo.as_deref()
          25  +
        /* StructureGenerator.kt:166 */
   15     26   
    }
          27  +
    /* StructureGenerator.kt:231 */
   16     28   
    #[allow(missing_docs)] // documentation missing in model
          29  +
                           /* StructureGenerator.kt:166 */
   17     30   
    pub fn baz(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
          31  +
        /* StructureGenerator.kt:170 */
   18     32   
        self.baz.as_ref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl QueryPrecedenceInput {
   22         -
    /// Creates a new builder-style object to manufacture [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct QueryPrecedenceInputBuilder {
   32         -
    pub(crate) foo: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */
   33     58   
    pub(crate) baz: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
          59  +
    /* BuilderGenerator.kt:345 */
   34     60   
}
          61  +
/* BuilderGenerator.kt:355 */
   35     62   
impl QueryPrecedenceInputBuilder {
          63  +
    /* BuilderGenerator.kt:286 */
   36     64   
    #[allow(missing_docs)] // documentation missing in model
          65  +
                           /* BuilderGenerator.kt:291 */
   37     66   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          67  +
        /* BuilderGenerator.kt:292 */
   38     68   
        self.foo = ::std::option::Option::Some(input.into());
          69  +
        /* BuilderGenerator.kt:293 */
   39     70   
        self
          71  +
        /* BuilderGenerator.kt:291 */
   40     72   
    }
          73  +
    /* BuilderGenerator.kt:312 */
   41     74   
    #[allow(missing_docs)] // documentation missing in model
          75  +
                           /* BuilderGenerator.kt:314 */
   42     76   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          77  +
        /* BuilderGenerator.kt:315 */
   43     78   
        self.foo = input;
   44     79   
        self
          80  +
        /* BuilderGenerator.kt:314 */
   45     81   
    }
          82  +
    /* BuilderGenerator.kt:334 */
   46     83   
    #[allow(missing_docs)] // documentation missing in model
          84  +
                           /* BuilderGenerator.kt:336 */
   47     85   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
          86  +
        /* BuilderGenerator.kt:337 */
   48     87   
        &self.foo
          88  +
        /* BuilderGenerator.kt:336 */
   49     89   
    }
   50         -
    /// Adds a key-value pair to `baz`.
          90  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `baz`.
          91  +
    /* BuilderGenerator.kt:437 */
   51     92   
    ///
   52         -
    /// To override the contents of this collection use [`set_baz`](Self::set_baz).
          93  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_baz`](Self::set_baz).
          94  +
    /* BuilderGenerator.kt:439 */
   53     95   
    ///
          96  +
    /* BuilderGenerator.kt:445 */
   54     97   
    pub fn baz(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
          98  +
        /* BuilderGenerator.kt:448 */
   55     99   
        let mut hash_map = self.baz.unwrap_or_default();
   56    100   
        hash_map.insert(k.into(), v.into());
   57    101   
        self.baz = ::std::option::Option::Some(hash_map);
   58    102   
        self
         103  +
        /* BuilderGenerator.kt:445 */
   59    104   
    }
         105  +
    /* BuilderGenerator.kt:312 */
   60    106   
    #[allow(missing_docs)] // documentation missing in model
         107  +
                           /* BuilderGenerator.kt:314 */
   61    108   
    pub fn set_baz(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
         109  +
        /* BuilderGenerator.kt:315 */
   62    110   
        self.baz = input;
   63    111   
        self
         112  +
        /* BuilderGenerator.kt:314 */
   64    113   
    }
         114  +
    /* BuilderGenerator.kt:334 */
   65    115   
    #[allow(missing_docs)] // documentation missing in model
         116  +
                           /* BuilderGenerator.kt:336 */
   66    117   
    pub fn get_baz(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
         118  +
        /* BuilderGenerator.kt:337 */
   67    119   
        &self.baz
         120  +
        /* BuilderGenerator.kt:336 */
   68    121   
    }
   69         -
    /// Consumes the builder and constructs a [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
         122  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`QueryPrecedenceInput`](crate::operation::query_precedence::QueryPrecedenceInput).
         123  +
    /* BuilderGenerator.kt:253 */
   70    124   
    pub fn build(
   71    125   
        self,
   72    126   
    ) -> ::std::result::Result<crate::operation::query_precedence::QueryPrecedenceInput, ::aws_smithy_types::error::operation::BuildError> {
   73         -
        ::std::result::Result::Ok(crate::operation::query_precedence::QueryPrecedenceInput {
   74         -
            foo: self.foo,
         127  +
        /* BuilderGenerator.kt:254 */
         128  +
        ::std::result::Result::Ok(
         129  +
            /* BuilderGenerator.kt:477 */
         130  +
            crate::operation::query_precedence::QueryPrecedenceInput {
         131  +
                /* BuilderGenerator.kt:481 */ foo: self.foo,
         132  +
                /* BuilderGenerator.kt:481 */
   75    133   
                baz: self.baz,
   76         -
        })
         134  +
                /* BuilderGenerator.kt:477 */
         135  +
            }, /* BuilderGenerator.kt:254 */
         136  +
        )
         137  +
        /* BuilderGenerator.kt:253 */
   77    138   
    }
         139  +
    /* BuilderGenerator.kt:355 */
   78    140   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/query_precedence/_query_precedence_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 QueryPrecedenceOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct QueryPrecedenceOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl QueryPrecedenceOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`QueryPrecedenceOutput`](crate::operation::query_precedence::QueryPrecedenceOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`QueryPrecedenceOutput`](crate::operation::query_precedence::QueryPrecedenceOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::query_precedence::builders::QueryPrecedenceOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::query_precedence::builders::QueryPrecedenceOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`QueryPrecedenceOutput`](crate::operation::query_precedence::QueryPrecedenceOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`QueryPrecedenceOutput`](crate::operation::query_precedence::QueryPrecedenceOutput).
          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 QueryPrecedenceOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct QueryPrecedenceOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl QueryPrecedenceOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`QueryPrecedenceOutput`](crate::operation::query_precedence::QueryPrecedenceOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`QueryPrecedenceOutput`](crate::operation::query_precedence::QueryPrecedenceOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::query_precedence::QueryPrecedenceOutput {
   20         -
        crate::operation::query_precedence::QueryPrecedenceOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::query_precedence::QueryPrecedenceOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/query_precedence/builders.rs

@@ -1,1 +143,167 @@
    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::query_precedence::_query_precedence_output::QueryPrecedenceOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::query_precedence::_query_precedence_input::QueryPrecedenceInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder {
    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::query_precedence::QueryPrecedenceOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::query_precedence::QueryPrecedenceError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.query_precedence();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `QueryPrecedence`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `QueryPrecedence`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct QueryPrecedenceFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder,
   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::query_precedence::QueryPrecedenceOutput,
   34     40   
        crate::operation::query_precedence::QueryPrecedenceError,
   35     41   
    > for QueryPrecedenceFluentBuilder
   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::query_precedence::QueryPrecedenceOutput,
   43     49   
            crate::operation::query_precedence::QueryPrecedenceError,
   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 QueryPrecedenceFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `QueryPrecedenceFluentBuilder`.
   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 QueryPrecedence as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::query_precedence::builders::QueryPrecedenceInputBuilder {
   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::query_precedence::QueryPrecedenceOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::query_precedence::QueryPrecedenceError,
   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::query_precedence::QueryPrecedence::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::query_precedence::QueryPrecedence::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::query_precedence::QueryPrecedenceOutput,
   96    106   
        crate::operation::query_precedence::QueryPrecedenceError,
   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   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  112    125   
        self.inner = self.inner.foo(input.into());
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  117    132   
        self.inner = self.inner.set_foo(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
  122    139   
        self.inner.get_foo()
  123    140   
    }
  124         -
    ///
         141  +
    /// /* FluentBuilderGenerator.kt:466 */
  125    142   
    /// Adds a key-value pair to `baz`.
  126    143   
    ///
  127    144   
    /// To override the contents of this collection use [`set_baz`](Self::set_baz).
  128    145   
    ///
         146  +
    /* FluentBuilderGenerator.kt:473 */
  129    147   
    #[allow(missing_docs)] // documentation missing in model
         148  +
                           /* FluentBuilderGenerator.kt:475 */
  130    149   
    pub fn baz(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
  131    150   
        self.inner = self.inner.baz(k.into(), v.into());
  132    151   
        self
  133    152   
    }
         153  +
    /* FluentBuilderGenerator.kt:498 */
  134    154   
    #[allow(missing_docs)] // documentation missing in model
         155  +
                           /* FluentBuilderGenerator.kt:500 */
  135    156   
    pub fn set_baz(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
  136    157   
        self.inner = self.inner.set_baz(input);
  137    158   
        self
  138    159   
    }
         160  +
    /* FluentBuilderGenerator.kt:518 */
  139    161   
    #[allow(missing_docs)] // documentation missing in model
         162  +
                           /* FluentBuilderGenerator.kt:520 */
  140    163   
    pub fn get_baz(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
  141    164   
        self.inner.get_baz()
  142    165   
    }
         166  +
    /* FluentBuilderGenerator.kt:282 */
  143    167   
}

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

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/status_response/_status_response_input.rs

@@ -1,1 +24,44 @@
    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 StatusResponseInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct StatusResponseInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl StatusResponseInput {
    7         -
    /// Creates a new builder-style object to manufacture [`StatusResponseInput`](crate::operation::status_response::StatusResponseInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StatusResponseInput`](crate::operation::status_response::StatusResponseInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::status_response::builders::StatusResponseInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::status_response::builders::StatusResponseInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`StatusResponseInput`](crate::operation::status_response::StatusResponseInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`StatusResponseInput`](crate::operation::status_response::StatusResponseInput).
          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 StatusResponseInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct StatusResponseInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl StatusResponseInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`StatusResponseInput`](crate::operation::status_response::StatusResponseInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StatusResponseInput`](crate::operation::status_response::StatusResponseInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<crate::operation::status_response::StatusResponseInput, ::aws_smithy_types::error::operation::BuildError> {
   22         -
        ::std::result::Result::Ok(crate::operation::status_response::StatusResponseInput {})
          35  +
        /* BuilderGenerator.kt:254 */
          36  +
        ::std::result::Result::Ok(
          37  +
            /* BuilderGenerator.kt:477 */
          38  +
            crate::operation::status_response::StatusResponseInput {
          39  +
            /* BuilderGenerator.kt:477 */}, /* BuilderGenerator.kt:254 */
          40  +
        )
          41  +
        /* BuilderGenerator.kt:253 */
   23     42   
    }
          43  +
    /* BuilderGenerator.kt:355 */
   24     44   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/status_response/_status_response_output.rs

@@ -1,1 +49,92 @@
    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 StatusResponseOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StatusResponseOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub field: i32,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl StatusResponseOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn field(&self) -> i32 {
          20  +
        /* StructureGenerator.kt:168 */
   12     21   
        self.field
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl StatusResponseOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`StatusResponseOutput`](crate::operation::status_response::StatusResponseOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StatusResponseOutput`](crate::operation::status_response::StatusResponseOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::status_response::builders::StatusResponseOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::status_response::builders::StatusResponseOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`StatusResponseOutput`](crate::operation::status_response::StatusResponseOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`StatusResponseOutput`](crate::operation::status_response::StatusResponseOutput).
          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 StatusResponseOutputBuilder {
   26         -
    pub(crate) field: ::std::option::Option<i32>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) field: ::std::option::Option<i32>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl StatusResponseOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn field(mut self, input: i32) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.field = ::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_field(mut self, input: ::std::option::Option<i32>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.field = 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_field(&self) -> &::std::option::Option<i32> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.field
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`StatusResponseOutput`](crate::operation::status_response::StatusResponseOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StatusResponseOutput`](crate::operation::status_response::StatusResponseOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::status_response::StatusResponseOutput {
          80  +
        /* BuilderGenerator.kt:477 */
   45     81   
        crate::operation::status_response::StatusResponseOutput {
   46         -
            field: self.field.unwrap_or_default(),
          82  +
            /* BuilderGenerator.kt:481 */
          83  +
            field: self
          84  +
                .field
          85  +
                /* BuilderGenerator.kt:487 */
          86  +
                .unwrap_or_default(),
          87  +
            /* BuilderGenerator.kt:477 */
   47     88   
        }
          89  +
        /* BuilderGenerator.kt:253 */
   48     90   
    }
          91  +
    /* BuilderGenerator.kt:355 */
   49     92   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/status_response/builders.rs

@@ -1,1 +110,122 @@
    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::status_response::_status_response_output::StatusResponseOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::status_response::_status_response_input::StatusResponseInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::status_response::builders::StatusResponseInputBuilder {
    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::status_response::StatusResponseOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::status_response::StatusResponseError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.status_response();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `StatusResponse`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `StatusResponse`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct StatusResponseFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::status_response::builders::StatusResponseInputBuilder,
   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::status_response::StatusResponseOutput,
   34     40   
        crate::operation::status_response::StatusResponseError,
   35     41   
    > for StatusResponseFluentBuilder
   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::status_response::StatusResponseOutput,
   43     49   
            crate::operation::status_response::StatusResponseError,
   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 StatusResponseFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `StatusResponseFluentBuilder`.
   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 StatusResponse as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::status_response::builders::StatusResponseInputBuilder {
   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::status_response::StatusResponseOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::status_response::StatusResponseError,
   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::status_response::StatusResponse::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::status_response::StatusResponse::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::status_response::StatusResponseOutput,
   96    106   
        crate::operation::status_response::StatusResponseError,
   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   
    }
         121  +
    /* FluentBuilderGenerator.kt:282 */
  110    122   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/string_payload.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 `StringPayload`.
           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 StringPayload;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl StringPayload {
    7         -
    /// Creates a new `StringPayload`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `StringPayload`
          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::string_payload::StringPayloadInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::string_payload::StringPayloadOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::string_payload::StringPayloadError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +265,282 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StringPayload {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StringPayload");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            StringPayloadRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            StringPayloadResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "StringPayload",
  105    116   
            "Rest Json Protocol",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StringPayload")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(StringPayloadEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::string_payload::StringPayloadError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::string_payload::StringPayloadError,
  124    135   
            >::new());
  125    136   
  126    137   
        ::std::borrow::Cow::Owned(rcb)
  127    138   
    }
  128    139   
}
  129    140   
         141  +
/* ResponseDeserializerGenerator.kt:64 */
  130    142   
#[derive(Debug)]
  131    143   
struct StringPayloadResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StringPayloadResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_string_payload::de_string_payload_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_string_payload::de_string_payload_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct StringPayloadRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StringPayloadRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input
  161    174   
            .downcast::<crate::operation::string_payload::StringPayloadInput>()
  162    175   
            .expect("correct type");
  163    176   
        let _header_serialization_settings = _cfg
  164    177   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  165    178   
            .cloned()
  166    179   
            .unwrap_or_default();
  167    180   
        let mut request_builder = {
  168    181   
            fn uri_base(
  169    182   
                _input: &crate::operation::string_payload::StringPayloadInput,
  170    183   
                output: &mut ::std::string::String,
  171    184   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172    185   
                use ::std::fmt::Write as _;
  173    186   
                ::std::write!(output, "/StringPayload").expect("formatting should succeed");
  174    187   
                ::std::result::Result::Ok(())
  175    188   
            }
  176    189   
            #[allow(clippy::unnecessary_wraps)]
  177    190   
            fn update_http_builder(
  178    191   
                input: &crate::operation::string_payload::StringPayloadInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "text/plain");
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_string_payload_input::ser_payload_http_payload(
  190    203   
            input.payload,
  191    204   
        )?);
  192    205   
        if let Some(content_length) = body.content_length() {
  193    206   
            let content_length = content_length.to_string();
  194    207   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  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 StringPayloadEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StringPayloadEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "StringPayloadEndpointParamsInterceptor"
  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::<StringPayloadInput>()
  220    234   
            .ok_or("failed to downcast to StringPayloadInput")?;
  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 string_payload_test {
  237    254   
  238    255   
    /// Test ID: StringPayload
  239    256   
    #[::tokio::test]
  240    257   
    #[::tracing_test::traced_test]
  241    258   
    async fn string_payload_request() {
  242    259   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  243    260   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  244    261   
  245    262   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
@@ -278,295 +417,517 @@
  298    315   
        });
  299    316   
        let parsed = parsed.expect_err("should be error response");
  300    317   
        let parsed: &crate::operation::string_payload::StringPayloadError =
  301    318   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  302    319   
        if let crate::operation::string_payload::StringPayloadError::ExtraError(parsed) = parsed {
  303    320   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  304    321   
        } else {
  305    322   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  306    323   
        }
  307    324   
    }
         325  +
         326  +
    /* ProtocolTestGenerator.kt:98 */
  308    327   
}
  309    328   
         329  +
/* OperationErrorGenerator.kt:79 */
  310    330   
/// Error type for the `StringPayloadError` operation.
         331  +
/* RustType.kt:516 */
  311    332   
#[non_exhaustive]
         333  +
/* RustType.kt:516 */
  312    334   
#[derive(::std::fmt::Debug)]
  313         -
pub enum StringPayloadError {
         335  +
pub /* OperationErrorGenerator.kt:81 */ enum StringPayloadError {
         336  +
    /* OperationErrorGenerator.kt:83 */
  314    337   
    #[allow(missing_docs)] // documentation missing in model
         338  +
    /* OperationErrorGenerator.kt:86 */
  315    339   
    ExtraError(crate::types::error::ExtraError),
         340  +
    /* OperationErrorGenerator.kt:88 */
  316    341   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  317    342   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  318    343   
    variable wildcard pattern and check `.code()`:
  319    344   
     \
  320    345   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  321    346   
     \
  322    347   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StringPayloadError) for what information is available for the error.")]
  323    348   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         349  +
    /* OperationErrorGenerator.kt:81 */
  324    350   
}
         351  +
/* OperationErrorGenerator.kt:218 */
  325    352   
impl StringPayloadError {
         353  +
    /* OperationErrorGenerator.kt:219 */
  326    354   
    /// Creates the `StringPayloadError::Unhandled` variant from any error type.
  327    355   
    pub fn unhandled(
  328    356   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  329    357   
    ) -> Self {
  330    358   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  331    359   
            source: err.into(),
  332    360   
            meta: ::std::default::Default::default(),
  333    361   
        })
  334    362   
    }
  335    363   
  336    364   
    /// Creates the `StringPayloadError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  337    365   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  338    366   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  339    367   
            source: err.clone().into(),
  340    368   
            meta: err,
  341    369   
        })
  342    370   
    }
  343         -
    ///
         371  +
    /// /* OperationErrorGenerator.kt:236 */
  344    372   
    /// Returns error metadata, which includes the error code, message,
  345    373   
    /// request ID, and potentially additional information.
  346    374   
    ///
         375  +
    /* OperationErrorGenerator.kt:242 */
  347    376   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         377  +
        /* OperationErrorGenerator.kt:243 */
  348    378   
        match self {
  349         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  350         -
            Self::Unhandled(e) => &e.meta,
         379  +
            /* OperationErrorGenerator.kt:246 */ Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         380  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         381  +
            /* OperationErrorGenerator.kt:243 */
  351    382   
        }
         383  +
        /* OperationErrorGenerator.kt:242 */
  352    384   
    }
         385  +
    /* OperationErrorGenerator.kt:257 */
  353    386   
    /// Returns `true` if the error kind is `StringPayloadError::ExtraError`.
         387  +
    /* OperationErrorGenerator.kt:258 */
  354    388   
    pub fn is_extra_error(&self) -> bool {
         389  +
        /* OperationErrorGenerator.kt:259 */
  355    390   
        matches!(self, Self::ExtraError(_))
         391  +
        /* OperationErrorGenerator.kt:258 */
  356    392   
    }
         393  +
    /* OperationErrorGenerator.kt:218 */
  357    394   
}
         395  +
/* OperationErrorGenerator.kt:269 */
  358    396   
impl ::std::error::Error for StringPayloadError {
         397  +
    /* OperationErrorGenerator.kt:270 */
  359    398   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         399  +
        /* OperationErrorGenerator.kt:318 */
  360    400   
        match self {
  361         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  362         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         401  +
            /* OperationErrorGenerator.kt:321 */
         402  +
            Self::ExtraError(_inner) =>
         403  +
            /* OperationErrorGenerator.kt:283 */
         404  +
            {
         405  +
                ::std::option::Option::Some(_inner)
         406  +
            }
         407  +
            ,
         408  +
            /* OperationErrorGenerator.kt:326 */
         409  +
            Self::Unhandled(_inner) => {
         410  +
                /* OperationErrorGenerator.kt:279 */
         411  +
                ::std::option::Option::Some(&*_inner.source)
         412  +
                /* OperationErrorGenerator.kt:326 */
         413  +
            } /* OperationErrorGenerator.kt:318 */
  363    414   
        }
         415  +
        /* OperationErrorGenerator.kt:270 */
  364    416   
    }
         417  +
    /* OperationErrorGenerator.kt:269 */
  365    418   
}
         419  +
/* OperationErrorGenerator.kt:133 */
  366    420   
impl ::std::fmt::Display for StringPayloadError {
         421  +
    /* OperationErrorGenerator.kt:134 */
  367    422   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         423  +
        /* OperationErrorGenerator.kt:318 */
  368    424   
        match self {
  369         -
            Self::ExtraError(_inner) => _inner.fmt(f),
         425  +
            /* OperationErrorGenerator.kt:321 */
         426  +
            Self::ExtraError(_inner) =>
         427  +
            /* OperationErrorGenerator.kt:151 */
         428  +
            {
         429  +
                _inner.fmt(f)
         430  +
            }
         431  +
            ,
         432  +
            /* OperationErrorGenerator.kt:326 */
  370    433   
            Self::Unhandled(_inner) => {
         434  +
                /* OperationErrorGenerator.kt:139 */
  371    435   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  372    436   
                    write!(f, "unhandled error ({code})")
  373    437   
                } else {
  374    438   
                    f.write_str("unhandled error")
  375    439   
                }
         440  +
                /* OperationErrorGenerator.kt:326 */
         441  +
            } /* OperationErrorGenerator.kt:318 */
  376    442   
        }
         443  +
        /* OperationErrorGenerator.kt:134 */
  377    444   
    }
  378         -
    }
         445  +
    /* OperationErrorGenerator.kt:133 */
  379    446   
}
         447  +
/* OperationErrorGenerator.kt:182 */
  380    448   
impl ::aws_smithy_types::retry::ProvideErrorKind for StringPayloadError {
         449  +
    /* OperationErrorGenerator.kt:186 */
  381    450   
    fn code(&self) -> ::std::option::Option<&str> {
         451  +
        /* OperationErrorGenerator.kt:187 */
  382    452   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         453  +
        /* OperationErrorGenerator.kt:186 */
  383    454   
    }
         455  +
    /* OperationErrorGenerator.kt:190 */
  384    456   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         457  +
        /* OperationErrorGenerator.kt:197 */
  385    458   
        ::std::option::Option::None
         459  +
        /* OperationErrorGenerator.kt:190 */
  386    460   
    }
         461  +
    /* OperationErrorGenerator.kt:182 */
  387    462   
}
         463  +
/* OperationErrorGenerator.kt:163 */
  388    464   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StringPayloadError {
         465  +
    /* OperationErrorGenerator.kt:164 */
  389    466   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         467  +
        /* OperationErrorGenerator.kt:318 */
  390    468   
        match self {
  391         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  392         -
            Self::Unhandled(_inner) => &_inner.meta,
         469  +
            /* OperationErrorGenerator.kt:321 */
         470  +
            Self::ExtraError(_inner) =>
         471  +
            /* OperationErrorGenerator.kt:169 */
         472  +
            {
         473  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         474  +
            }
         475  +
            ,
         476  +
            /* OperationErrorGenerator.kt:326 */
         477  +
            Self::Unhandled(_inner) => {
         478  +
                /* OperationErrorGenerator.kt:168 */
         479  +
                &_inner.meta
         480  +
                /* OperationErrorGenerator.kt:326 */
         481  +
            } /* OperationErrorGenerator.kt:318 */
  393    482   
        }
         483  +
        /* OperationErrorGenerator.kt:164 */
  394    484   
    }
         485  +
    /* OperationErrorGenerator.kt:163 */
  395    486   
}
         487  +
/* OperationErrorGenerator.kt:109 */
  396    488   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StringPayloadError {
         489  +
    /* OperationErrorGenerator.kt:110 */
  397    490   
    fn create_unhandled_error(
  398    491   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  399    492   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  400    493   
    ) -> Self {
         494  +
        /* OperationErrorGenerator.kt:121 */
  401    495   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  402    496   
            source,
  403    497   
            meta: meta.unwrap_or_default(),
  404    498   
        })
         499  +
        /* OperationErrorGenerator.kt:110 */
  405    500   
    }
         501  +
    /* OperationErrorGenerator.kt:109 */
  406    502   
}
  407    503   
         504  +
/* CodegenDelegator.kt:255 */
  408    505   
pub use crate::operation::string_payload::_string_payload_output::StringPayloadOutput;
  409    506   
         507  +
/* CodegenDelegator.kt:255 */
  410    508   
pub use crate::operation::string_payload::_string_payload_input::StringPayloadInput;
  411    509   
         510  +
/* RustModule.kt:172 */
  412    511   
mod _string_payload_input;
  413    512   
         513  +
/* RustModule.kt:172 */
  414    514   
mod _string_payload_output;
  415    515   
  416         -
/// Builders
         516  +
/// /* CodegenDelegator.kt:51 */Builders
  417    517   
pub mod builders;