Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

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

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

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `EndpointOperation`.
           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 EndpointOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EndpointOperation {
    7         -
    /// Creates a new `EndpointOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EndpointOperation`
          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::endpoint_operation::EndpointOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::endpoint_operation::EndpointOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::endpoint_operation::EndpointOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +363,439 @@
   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 EndpointOperation {
   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("EndpointOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            EndpointOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            EndpointOperationResponseDeserializer,
  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   
            "EndpointOperation",
  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("EndpointOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(EndpointOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::endpoint_operation::EndpointOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::endpoint_operation::EndpointOperationError,
  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 EndpointOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EndpointOperationResponseDeserializer {
  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_endpoint_operation::de_endpoint_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_endpoint_operation::de_endpoint_operation_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct EndpointOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EndpointOperationRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::endpoint_operation::EndpointOperationInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::endpoint_operation::EndpointOperationInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/EndpointOperation").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::endpoint_operation::EndpointOperationInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct EndpointOperationEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EndpointOperationEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "EndpointOperationEndpointParamsInterceptor"
  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::<EndpointOperationInput>()
  220    234   
            .ok_or("failed to downcast to EndpointOperationInput")?;
  221    235   
  222    236   
        let endpoint_prefix = ::aws_smithy_runtime_api::client::endpoint::EndpointPrefix::new("foo.").map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint prefix could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state().store_put(endpoint_prefix);
  226    240   
  227    241   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  228    242   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  229    243   
        })?;
  230    244   
        cfg.interceptor_state()
  231    245   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  232    246   
        ::std::result::Result::Ok(())
  233    247   
    }
  234    248   
}
  235    249   
  236    250   
// The get_* functions below are generated from JMESPath expressions in the
  237    251   
// operationContextParams trait. They target the operation's input shape.
  238    252   
         253  +
/* RustType.kt:516 */
  239    254   
#[allow(unreachable_code, unused_variables)]
         255  +
/* RustType.kt:516 */
  240    256   
#[cfg(test)]
         257  +
/* ProtocolTestGenerator.kt:98 */
  241    258   
mod endpoint_operation_test {
  242    259   
  243    260   
    /// Operations can prepend to the given host if they define the
  244    261   
    /// endpoint trait.
  245    262   
    /// Test ID: RestJsonEndpointTrait
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn rest_json_endpoint_trait_request() {
  249    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    267   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  251    268   
  252    269   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  253    270   
        let result = client.endpoint_operation().send().await;
  254    271   
        let _ = dbg!(result);
  255    272   
        let http_request = request_receiver.expect_request();
  256    273   
        let body = http_request.body().bytes().expect("body should be strict");
  257    274   
        // No body.
  258    275   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  259    276   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  260    277   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  261    278   
        ::pretty_assertions::assert_eq!(uri.path(), "/EndpointOperation", "path was incorrect");
  262    279   
        ::pretty_assertions::assert_eq!(uri.host().expect("host should be set"), "foo.example.com");
  263    280   
    }
         281  +
         282  +
    /* ProtocolTestGenerator.kt:98 */
  264    283   
}
  265    284   
         285  +
/* OperationErrorGenerator.kt:79 */
  266    286   
/// Error type for the `EndpointOperationError` operation.
         287  +
/* RustType.kt:516 */
  267    288   
#[non_exhaustive]
         289  +
/* RustType.kt:516 */
  268    290   
#[derive(::std::fmt::Debug)]
  269         -
pub enum EndpointOperationError {
         291  +
pub /* OperationErrorGenerator.kt:81 */ enum EndpointOperationError {
         292  +
    /* OperationErrorGenerator.kt:88 */
  270    293   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  271    294   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  272    295   
    variable wildcard pattern and check `.code()`:
  273    296   
     \
  274    297   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  275    298   
     \
  276    299   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EndpointOperationError) for what information is available for the error.")]
  277    300   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         301  +
    /* OperationErrorGenerator.kt:81 */
  278    302   
}
         303  +
/* OperationErrorGenerator.kt:218 */
  279    304   
impl EndpointOperationError {
         305  +
    /* OperationErrorGenerator.kt:219 */
  280    306   
    /// Creates the `EndpointOperationError::Unhandled` variant from any error type.
  281    307   
    pub fn unhandled(
  282    308   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  283    309   
    ) -> Self {
  284    310   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  285    311   
            source: err.into(),
  286    312   
            meta: ::std::default::Default::default(),
  287    313   
        })
  288    314   
    }
  289    315   
  290    316   
    /// Creates the `EndpointOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  291    317   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  292    318   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  293    319   
            source: err.clone().into(),
  294    320   
            meta: err,
  295    321   
        })
  296    322   
    }
  297         -
    ///
         323  +
    /// /* OperationErrorGenerator.kt:236 */
  298    324   
    /// Returns error metadata, which includes the error code, message,
  299    325   
    /// request ID, and potentially additional information.
  300    326   
    ///
         327  +
    /* OperationErrorGenerator.kt:242 */
  301    328   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         329  +
        /* OperationErrorGenerator.kt:243 */
  302    330   
        match self {
  303         -
            Self::Unhandled(e) => &e.meta,
         331  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         332  +
            /* OperationErrorGenerator.kt:243 */
  304    333   
        }
         334  +
        /* OperationErrorGenerator.kt:242 */
  305    335   
    }
         336  +
    /* OperationErrorGenerator.kt:218 */
  306    337   
}
         338  +
/* OperationErrorGenerator.kt:269 */
  307    339   
impl ::std::error::Error for EndpointOperationError {
         340  +
    /* OperationErrorGenerator.kt:270 */
  308    341   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         342  +
        /* OperationErrorGenerator.kt:318 */
  309    343   
        match self {
  310         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         344  +
            /* OperationErrorGenerator.kt:326 */
         345  +
            Self::Unhandled(_inner) => {
         346  +
                /* OperationErrorGenerator.kt:279 */
         347  +
                ::std::option::Option::Some(&*_inner.source)
         348  +
                /* OperationErrorGenerator.kt:326 */
         349  +
            } /* OperationErrorGenerator.kt:318 */
  311    350   
        }
         351  +
        /* OperationErrorGenerator.kt:270 */
  312    352   
    }
         353  +
    /* OperationErrorGenerator.kt:269 */
  313    354   
}
         355  +
/* OperationErrorGenerator.kt:133 */
  314    356   
impl ::std::fmt::Display for EndpointOperationError {
         357  +
    /* OperationErrorGenerator.kt:134 */
  315    358   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         359  +
        /* OperationErrorGenerator.kt:318 */
  316    360   
        match self {
         361  +
            /* OperationErrorGenerator.kt:326 */
  317    362   
            Self::Unhandled(_inner) => {
         363  +
                /* OperationErrorGenerator.kt:139 */
  318    364   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  319    365   
                    write!(f, "unhandled error ({code})")
  320    366   
                } else {
  321    367   
                    f.write_str("unhandled error")
  322    368   
                }
  323         -
            }
         369  +
                /* OperationErrorGenerator.kt:326 */
         370  +
            } /* OperationErrorGenerator.kt:318 */
  324    371   
        }
         372  +
        /* OperationErrorGenerator.kt:134 */
  325    373   
    }
         374  +
    /* OperationErrorGenerator.kt:133 */
  326    375   
}
         376  +
/* OperationErrorGenerator.kt:182 */
  327    377   
impl ::aws_smithy_types::retry::ProvideErrorKind for EndpointOperationError {
         378  +
    /* OperationErrorGenerator.kt:186 */
  328    379   
    fn code(&self) -> ::std::option::Option<&str> {
         380  +
        /* OperationErrorGenerator.kt:187 */
  329    381   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         382  +
        /* OperationErrorGenerator.kt:186 */
  330    383   
    }
         384  +
    /* OperationErrorGenerator.kt:190 */
  331    385   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         386  +
        /* OperationErrorGenerator.kt:197 */
  332    387   
        ::std::option::Option::None
         388  +
        /* OperationErrorGenerator.kt:190 */
  333    389   
    }
         390  +
    /* OperationErrorGenerator.kt:182 */
  334    391   
}
         392  +
/* OperationErrorGenerator.kt:163 */
  335    393   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EndpointOperationError {
         394  +
    /* OperationErrorGenerator.kt:164 */
  336    395   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         396  +
        /* OperationErrorGenerator.kt:318 */
  337    397   
        match self {
  338         -
            Self::Unhandled(_inner) => &_inner.meta,
         398  +
            /* OperationErrorGenerator.kt:326 */
         399  +
            Self::Unhandled(_inner) => {
         400  +
                /* OperationErrorGenerator.kt:168 */
         401  +
                &_inner.meta
         402  +
                /* OperationErrorGenerator.kt:326 */
         403  +
            } /* OperationErrorGenerator.kt:318 */
  339    404   
        }
         405  +
        /* OperationErrorGenerator.kt:164 */
  340    406   
    }
         407  +
    /* OperationErrorGenerator.kt:163 */
  341    408   
}
         409  +
/* OperationErrorGenerator.kt:109 */
  342    410   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EndpointOperationError {
         411  +
    /* OperationErrorGenerator.kt:110 */
  343    412   
    fn create_unhandled_error(
  344    413   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  345    414   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  346    415   
    ) -> Self {
         416  +
        /* OperationErrorGenerator.kt:121 */
  347    417   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  348    418   
            source,
  349    419   
            meta: meta.unwrap_or_default(),
  350    420   
        })
         421  +
        /* OperationErrorGenerator.kt:110 */
  351    422   
    }
         423  +
    /* OperationErrorGenerator.kt:109 */
  352    424   
}
  353    425   
         426  +
/* CodegenDelegator.kt:255 */
  354    427   
pub use crate::operation::endpoint_operation::_endpoint_operation_output::EndpointOperationOutput;
  355    428   
         429  +
/* CodegenDelegator.kt:255 */
  356    430   
pub use crate::operation::endpoint_operation::_endpoint_operation_input::EndpointOperationInput;
  357    431   
         432  +
/* RustModule.kt:172 */
  358    433   
mod _endpoint_operation_input;
  359    434   
         435  +
/* RustModule.kt:172 */
  360    436   
mod _endpoint_operation_output;
  361    437   
  362         -
/// Builders
         438  +
/// /* CodegenDelegator.kt:51 */Builders
  363    439   
pub mod builders;

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/endpoint_operation/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::endpoint_operation::_endpoint_operation_output::EndpointOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::endpoint_operation::_endpoint_operation_input::EndpointOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::endpoint_operation::builders::EndpointOperationInputBuilder {
    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::endpoint_operation::EndpointOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::endpoint_operation::EndpointOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.endpoint_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `EndpointOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `EndpointOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct EndpointOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::endpoint_operation::builders::EndpointOperationInputBuilder,
   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::endpoint_operation::EndpointOperationOutput,
   34     40   
        crate::operation::endpoint_operation::EndpointOperationError,
   35     41   
    > for EndpointOperationFluentBuilder
   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::endpoint_operation::EndpointOperationOutput,
   43     49   
            crate::operation::endpoint_operation::EndpointOperationError,
   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 EndpointOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `EndpointOperationFluentBuilder`.
   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 EndpointOperation as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::endpoint_operation::builders::EndpointOperationInputBuilder {
   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::endpoint_operation::EndpointOperationOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::endpoint_operation::EndpointOperationError,
   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::endpoint_operation::EndpointOperation::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::endpoint_operation::EndpointOperation::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::endpoint_operation::EndpointOperationOutput,
   96    106   
        crate::operation::endpoint_operation::EndpointOperationError,
   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/rust-client-codegen/src/operation/endpoint_with_host_label_operation.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `EndpointWithHostLabelOperation`.
           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 EndpointWithHostLabelOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EndpointWithHostLabelOperation {
    7         -
    /// Creates a new `EndpointWithHostLabelOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EndpointWithHostLabelOperation`
          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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +389,465 @@
   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 EndpointWithHostLabelOperation {
   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("EndpointWithHostLabelOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            EndpointWithHostLabelOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            EndpointWithHostLabelOperationResponseDeserializer,
  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   
            "EndpointWithHostLabelOperation",
  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("EndpointWithHostLabelOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(EndpointWithHostLabelOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
  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 EndpointWithHostLabelOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EndpointWithHostLabelOperationResponseDeserializer {
  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_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_response(
  153    165   
                status, headers, body,
  154    166   
            )
  155    167   
        };
  156    168   
        crate::protocol_serde::type_erase_result(parse_result)
  157    169   
    }
  158    170   
}
         171  +
/* RequestSerializerGenerator.kt:67 */
  159    172   
#[derive(Debug)]
  160    173   
struct EndpointWithHostLabelOperationRequestSerializer;
  161    174   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EndpointWithHostLabelOperationRequestSerializer {
  162    175   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  163    176   
    fn serialize_input(
  164    177   
        &self,
  165    178   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  166    179   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  167    180   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  168    181   
        let input = input
  169    182   
            .downcast::<crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput>()
  170    183   
            .expect("correct type");
  171    184   
        let _header_serialization_settings = _cfg
  172    185   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  173    186   
            .cloned()
  174    187   
            .unwrap_or_default();
  175    188   
        let mut request_builder = {
  176    189   
            fn uri_base(
  177    190   
                _input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
  178    191   
                output: &mut ::std::string::String,
  179    192   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  180    193   
                use ::std::fmt::Write as _;
  181    194   
                ::std::write!(output, "/EndpointWithHostLabelOperation").expect("formatting should succeed");
  182    195   
                ::std::result::Result::Ok(())
  183    196   
            }
  184    197   
            #[allow(clippy::unnecessary_wraps)]
  185    198   
            fn update_http_builder(
  186    199   
                input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
  187    200   
                builder: ::http::request::Builder,
  188    201   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  189    202   
                let mut uri = ::std::string::String::new();
  190    203   
                uri_base(input, &mut uri)?;
  191    204   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  192    205   
            }
  193    206   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  194    207   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  195    208   
            builder
  196    209   
        };
  197    210   
        let body = ::aws_smithy_types::body::SdkBody::from(
  198    211   
            crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_input(&input)?,
  199    212   
        );
  200    213   
        if let Some(content_length) = body.content_length() {
  201    214   
            let content_length = content_length.to_string();
  202    215   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  203    216   
        }
  204    217   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  205    218   
    }
  206    219   
}
         220  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  207    221   
#[derive(Debug)]
  208    222   
struct EndpointWithHostLabelOperationEndpointParamsInterceptor;
  209    223   
  210    224   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EndpointWithHostLabelOperationEndpointParamsInterceptor {
  211    225   
    fn name(&self) -> &'static str {
  212    226   
        "EndpointWithHostLabelOperationEndpointParamsInterceptor"
  213    227   
    }
  214    228   
  215    229   
    fn read_before_execution(
  216    230   
        &self,
  217    231   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  218    232   
            '_,
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  220    234   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  222    236   
        >,
  223    237   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  224    238   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  225    239   
        let _input = context
  226    240   
            .input()
  227    241   
            .downcast_ref::<EndpointWithHostLabelOperationInput>()
  228    242   
            .ok_or("failed to downcast to EndpointWithHostLabelOperationInput")?;
  229    243   
  230    244   
        let endpoint_prefix = {
  231    245   
            let label = _input.label.as_deref().unwrap_or_default();
  232    246   
            if label.is_empty() {
  233    247   
                return Err(
  234    248   
                    ::aws_smithy_runtime_api::client::endpoint::error::InvalidEndpointError::failed_to_construct_uri(
  235    249   
                        "label was unset or empty but must be set as part of the endpoint prefix",
  236    250   
                    )
  237    251   
                    .into(),
  238    252   
                );
  239    253   
            }
  240    254   
            ::aws_smithy_runtime_api::client::endpoint::EndpointPrefix::new(format!("foo.{label}.", label = label))
  241    255   
        }
  242    256   
        .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint prefix could not be built", err))?;
  243    257   
        cfg.interceptor_state().store_put(endpoint_prefix);
  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 endpoint_with_host_label_operation_test {
  260    277   
  261    278   
    /// Operations can prepend to the given host if they define the
  262    279   
    /// endpoint trait, and can use the host label trait to define
  263    280   
    /// further customization based on user input.
  264    281   
    /// Test ID: RestJsonEndpointTraitWithHostLabel
  265    282   
    #[::tokio::test]
  266    283   
    #[::tracing_test::traced_test]
  267    284   
    async fn rest_json_endpoint_trait_with_host_label_request() {
  268    285   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  269    286   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  270    287   
  271    288   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  272    289   
        let result = client
  273    290   
            .endpoint_with_host_label_operation()
  274    291   
            .set_label(::std::option::Option::Some("bar".to_owned()))
  275    292   
            .send()
  276    293   
            .await;
  277    294   
        let _ = dbg!(result);
  278    295   
        let http_request = request_receiver.expect_request();
  279    296   
        let body = http_request.body().bytes().expect("body should be strict");
  280    297   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  281    298   
            body,
  282    299   
            "{\"label\": \"bar\"}",
  283    300   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  284    301   
        ));
  285    302   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  286    303   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  287    304   
        ::pretty_assertions::assert_eq!(uri.path(), "/EndpointWithHostLabelOperation", "path was incorrect");
  288    305   
        ::pretty_assertions::assert_eq!(uri.host().expect("host should be set"), "foo.bar.example.com");
  289    306   
    }
         307  +
         308  +
    /* ProtocolTestGenerator.kt:98 */
  290    309   
}
  291    310   
         311  +
/* OperationErrorGenerator.kt:79 */
  292    312   
/// Error type for the `EndpointWithHostLabelOperationError` operation.
         313  +
/* RustType.kt:516 */
  293    314   
#[non_exhaustive]
         315  +
/* RustType.kt:516 */
  294    316   
#[derive(::std::fmt::Debug)]
  295         -
pub enum EndpointWithHostLabelOperationError {
         317  +
pub /* OperationErrorGenerator.kt:81 */ enum EndpointWithHostLabelOperationError {
         318  +
    /* OperationErrorGenerator.kt:88 */
  296    319   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  297    320   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  298    321   
    variable wildcard pattern and check `.code()`:
  299    322   
     \
  300    323   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  301    324   
     \
  302    325   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EndpointWithHostLabelOperationError) for what information is available for the error.")]
  303    326   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         327  +
    /* OperationErrorGenerator.kt:81 */
  304    328   
}
         329  +
/* OperationErrorGenerator.kt:218 */
  305    330   
impl EndpointWithHostLabelOperationError {
         331  +
    /* OperationErrorGenerator.kt:219 */
  306    332   
    /// Creates the `EndpointWithHostLabelOperationError::Unhandled` variant from any error type.
  307    333   
    pub fn unhandled(
  308    334   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  309    335   
    ) -> Self {
  310    336   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  311    337   
            source: err.into(),
  312    338   
            meta: ::std::default::Default::default(),
  313    339   
        })
  314    340   
    }
  315    341   
  316    342   
    /// Creates the `EndpointWithHostLabelOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  317    343   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  318    344   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  319    345   
            source: err.clone().into(),
  320    346   
            meta: err,
  321    347   
        })
  322    348   
    }
  323         -
    ///
         349  +
    /// /* OperationErrorGenerator.kt:236 */
  324    350   
    /// Returns error metadata, which includes the error code, message,
  325    351   
    /// request ID, and potentially additional information.
  326    352   
    ///
         353  +
    /* OperationErrorGenerator.kt:242 */
  327    354   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         355  +
        /* OperationErrorGenerator.kt:243 */
  328    356   
        match self {
  329         -
            Self::Unhandled(e) => &e.meta,
         357  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         358  +
            /* OperationErrorGenerator.kt:243 */
  330    359   
        }
         360  +
        /* OperationErrorGenerator.kt:242 */
  331    361   
    }
         362  +
    /* OperationErrorGenerator.kt:218 */
  332    363   
}
         364  +
/* OperationErrorGenerator.kt:269 */
  333    365   
impl ::std::error::Error for EndpointWithHostLabelOperationError {
         366  +
    /* OperationErrorGenerator.kt:270 */
  334    367   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         368  +
        /* OperationErrorGenerator.kt:318 */
  335    369   
        match self {
  336         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         370  +
            /* OperationErrorGenerator.kt:326 */
         371  +
            Self::Unhandled(_inner) => {
         372  +
                /* OperationErrorGenerator.kt:279 */
         373  +
                ::std::option::Option::Some(&*_inner.source)
         374  +
                /* OperationErrorGenerator.kt:326 */
         375  +
            } /* OperationErrorGenerator.kt:318 */
  337    376   
        }
         377  +
        /* OperationErrorGenerator.kt:270 */
  338    378   
    }
         379  +
    /* OperationErrorGenerator.kt:269 */
  339    380   
}
         381  +
/* OperationErrorGenerator.kt:133 */
  340    382   
impl ::std::fmt::Display for EndpointWithHostLabelOperationError {
         383  +
    /* OperationErrorGenerator.kt:134 */
  341    384   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         385  +
        /* OperationErrorGenerator.kt:318 */
  342    386   
        match self {
         387  +
            /* OperationErrorGenerator.kt:326 */
  343    388   
            Self::Unhandled(_inner) => {
         389  +
                /* OperationErrorGenerator.kt:139 */
  344    390   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  345    391   
                    write!(f, "unhandled error ({code})")
  346    392   
                } else {
  347    393   
                    f.write_str("unhandled error")
  348    394   
                }
  349         -
            }
         395  +
                /* OperationErrorGenerator.kt:326 */
         396  +
            } /* OperationErrorGenerator.kt:318 */
  350    397   
        }
         398  +
        /* OperationErrorGenerator.kt:134 */
  351    399   
    }
         400  +
    /* OperationErrorGenerator.kt:133 */
  352    401   
}
         402  +
/* OperationErrorGenerator.kt:182 */
  353    403   
impl ::aws_smithy_types::retry::ProvideErrorKind for EndpointWithHostLabelOperationError {
         404  +
    /* OperationErrorGenerator.kt:186 */
  354    405   
    fn code(&self) -> ::std::option::Option<&str> {
         406  +
        /* OperationErrorGenerator.kt:187 */
  355    407   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         408  +
        /* OperationErrorGenerator.kt:186 */
  356    409   
    }
         410  +
    /* OperationErrorGenerator.kt:190 */
  357    411   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         412  +
        /* OperationErrorGenerator.kt:197 */
  358    413   
        ::std::option::Option::None
         414  +
        /* OperationErrorGenerator.kt:190 */
  359    415   
    }
         416  +
    /* OperationErrorGenerator.kt:182 */
  360    417   
}
         418  +
/* OperationErrorGenerator.kt:163 */
  361    419   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EndpointWithHostLabelOperationError {
         420  +
    /* OperationErrorGenerator.kt:164 */
  362    421   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         422  +
        /* OperationErrorGenerator.kt:318 */
  363    423   
        match self {
  364         -
            Self::Unhandled(_inner) => &_inner.meta,
         424  +
            /* OperationErrorGenerator.kt:326 */
         425  +
            Self::Unhandled(_inner) => {
         426  +
                /* OperationErrorGenerator.kt:168 */
         427  +
                &_inner.meta
         428  +
                /* OperationErrorGenerator.kt:326 */
         429  +
            } /* OperationErrorGenerator.kt:318 */
  365    430   
        }
         431  +
        /* OperationErrorGenerator.kt:164 */
  366    432   
    }
         433  +
    /* OperationErrorGenerator.kt:163 */
  367    434   
}
         435  +
/* OperationErrorGenerator.kt:109 */
  368    436   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EndpointWithHostLabelOperationError {
         437  +
    /* OperationErrorGenerator.kt:110 */
  369    438   
    fn create_unhandled_error(
  370    439   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  371    440   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  372    441   
    ) -> Self {
         442  +
        /* OperationErrorGenerator.kt:121 */
  373    443   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  374    444   
            source,
  375    445   
            meta: meta.unwrap_or_default(),
  376    446   
        })
         447  +
        /* OperationErrorGenerator.kt:110 */
  377    448   
    }
         449  +
    /* OperationErrorGenerator.kt:109 */
  378    450   
}
  379    451   
         452  +
/* CodegenDelegator.kt:255 */
  380    453   
pub use crate::operation::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_output::EndpointWithHostLabelOperationOutput;
  381    454   
         455  +
/* CodegenDelegator.kt:255 */
  382    456   
pub use crate::operation::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_input::EndpointWithHostLabelOperationInput;
  383    457   
         458  +
/* RustModule.kt:172 */
  384    459   
mod _endpoint_with_host_label_operation_input;
  385    460   
         461  +
/* RustModule.kt:172 */
  386    462   
mod _endpoint_with_host_label_operation_output;
  387    463   
  388         -
/// Builders
         464  +
/// /* CodegenDelegator.kt:51 */Builders
  389    465   
pub mod builders;

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

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

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/endpoint_with_host_label_operation/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::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_output::EndpointWithHostLabelOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_input::EndpointWithHostLabelOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder {
    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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.endpoint_with_host_label_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `EndpointWithHostLabelOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `EndpointWithHostLabelOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct EndpointWithHostLabelOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder,
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   34     40   
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   35     41   
    > for EndpointWithHostLabelOperationFluentBuilder
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   43     49   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   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 EndpointWithHostLabelOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `EndpointWithHostLabelOperationFluentBuilder`.
   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 EndpointWithHostLabelOperation as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationInputBuilder {
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   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::endpoint_with_host_label_operation::EndpointWithHostLabelOperation::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::endpoint_with_host_label_operation::EndpointWithHostLabelOperation::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::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   96    106   
        crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   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 label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  112    125   
        self.inner = self.inner.label(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_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  117    132   
        self.inner = self.inner.set_label(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_label(&self) -> &::std::option::Option<::std::string::String> {
  122    139   
        self.inner.get_label()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:282 */
  124    142   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/fractional_seconds.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 `FractionalSeconds`.
           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 FractionalSeconds;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl FractionalSeconds {
    7         -
    /// Creates a new `FractionalSeconds`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `FractionalSeconds`
          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::fractional_seconds::FractionalSecondsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::fractional_seconds::FractionalSecondsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::fractional_seconds::FractionalSecondsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +381,457 @@
   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 FractionalSeconds {
   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("FractionalSeconds");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            FractionalSecondsRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            FractionalSecondsResponseDeserializer,
  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   
            "FractionalSeconds",
  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("FractionalSeconds")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(FractionalSecondsEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::fractional_seconds::FractionalSecondsError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::fractional_seconds::FractionalSecondsError,
  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 FractionalSecondsResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FractionalSecondsResponseDeserializer {
  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_fractional_seconds::de_fractional_seconds_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds_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 FractionalSecondsRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for FractionalSecondsRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::fractional_seconds::FractionalSecondsInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::fractional_seconds::FractionalSecondsInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/FractionalSeconds").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::fractional_seconds::FractionalSecondsInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct FractionalSecondsEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for FractionalSecondsEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "FractionalSecondsEndpointParamsInterceptor"
  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::<FractionalSecondsInput>()
  220    234   
            .ok_or("failed to downcast to FractionalSecondsInput")?;
  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 fractional_seconds_test {
  237    254   
  238    255   
    /// Ensures that clients can correctly parse datetime timestamps with fractional seconds
  239    256   
    /// Test ID: RestJsonDateTimeWithFractionalSeconds
  240    257   
    #[::tokio::test]
  241    258   
    #[::tracing_test::traced_test]
  242    259   
    async fn rest_json_date_time_with_fractional_seconds_response() {
  243    260   
        let expected_output = crate::operation::fractional_seconds::FractionalSecondsOutput::builder()
  244    261   
            .set_datetime(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  245    262   
                946845296, 0.123_f64,
  246    263   
            )))
  247    264   
            .build();
  248    265   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  249    266   
            ::http::response::Builder::new()
  250    267   
                .status(200)
  251    268   
                .body(::aws_smithy_types::body::SdkBody::from(
  252    269   
                    "      {\n          \"datetime\": \"2000-01-02T20:34:56.123Z\"\n      }\n",
  253    270   
                ))
  254    271   
                .unwrap(),
  255    272   
        )
  256    273   
        .unwrap();
  257    274   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  258    275   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  259    276   
  260    277   
        let op = crate::operation::fractional_seconds::FractionalSeconds::new();
  261    278   
        let config = op.config().expect("the operation has config");
  262    279   
        let de = config
  263    280   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  264    281   
            .expect("the config must have a deserializer");
  265    282   
  266    283   
        let parsed = de.deserialize_streaming(&mut http_response);
  267    284   
        let parsed = parsed.unwrap_or_else(|| {
  268    285   
            let http_response = http_response.map(|body| {
  269    286   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  270    287   
                    body.bytes().unwrap(),
  271    288   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  272    289   
                )))
  273    290   
            });
  274    291   
            de.deserialize_nonstreaming(&http_response)
  275    292   
        });
  276    293   
        let parsed = parsed
  277    294   
            .expect("should be successful response")
  278    295   
            .downcast::<crate::operation::fractional_seconds::FractionalSecondsOutput>()
  279    296   
            .unwrap();
  280    297   
        ::pretty_assertions::assert_eq!(parsed.datetime, expected_output.datetime, "Unexpected value for `datetime`");
  281    298   
    }
         299  +
         300  +
    /* ProtocolTestGenerator.kt:98 */
  282    301   
}
  283    302   
         303  +
/* OperationErrorGenerator.kt:79 */
  284    304   
/// Error type for the `FractionalSecondsError` operation.
         305  +
/* RustType.kt:516 */
  285    306   
#[non_exhaustive]
         307  +
/* RustType.kt:516 */
  286    308   
#[derive(::std::fmt::Debug)]
  287         -
pub enum FractionalSecondsError {
         309  +
pub /* OperationErrorGenerator.kt:81 */ enum FractionalSecondsError {
         310  +
    /* OperationErrorGenerator.kt:88 */
  288    311   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  289    312   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  290    313   
    variable wildcard pattern and check `.code()`:
  291    314   
     \
  292    315   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  293    316   
     \
  294    317   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-FractionalSecondsError) for what information is available for the error.")]
  295    318   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         319  +
    /* OperationErrorGenerator.kt:81 */
  296    320   
}
         321  +
/* OperationErrorGenerator.kt:218 */
  297    322   
impl FractionalSecondsError {
         323  +
    /* OperationErrorGenerator.kt:219 */
  298    324   
    /// Creates the `FractionalSecondsError::Unhandled` variant from any error type.
  299    325   
    pub fn unhandled(
  300    326   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  301    327   
    ) -> Self {
  302    328   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  303    329   
            source: err.into(),
  304    330   
            meta: ::std::default::Default::default(),
  305    331   
        })
  306    332   
    }
  307    333   
  308    334   
    /// Creates the `FractionalSecondsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  309    335   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  310    336   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  311    337   
            source: err.clone().into(),
  312    338   
            meta: err,
  313    339   
        })
  314    340   
    }
  315         -
    ///
         341  +
    /// /* OperationErrorGenerator.kt:236 */
  316    342   
    /// Returns error metadata, which includes the error code, message,
  317    343   
    /// request ID, and potentially additional information.
  318    344   
    ///
         345  +
    /* OperationErrorGenerator.kt:242 */
  319    346   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         347  +
        /* OperationErrorGenerator.kt:243 */
  320    348   
        match self {
  321         -
            Self::Unhandled(e) => &e.meta,
         349  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         350  +
            /* OperationErrorGenerator.kt:243 */
  322    351   
        }
         352  +
        /* OperationErrorGenerator.kt:242 */
  323    353   
    }
         354  +
    /* OperationErrorGenerator.kt:218 */
  324    355   
}
         356  +
/* OperationErrorGenerator.kt:269 */
  325    357   
impl ::std::error::Error for FractionalSecondsError {
         358  +
    /* OperationErrorGenerator.kt:270 */
  326    359   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         360  +
        /* OperationErrorGenerator.kt:318 */
  327    361   
        match self {
  328         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         362  +
            /* OperationErrorGenerator.kt:326 */
         363  +
            Self::Unhandled(_inner) => {
         364  +
                /* OperationErrorGenerator.kt:279 */
         365  +
                ::std::option::Option::Some(&*_inner.source)
         366  +
                /* OperationErrorGenerator.kt:326 */
         367  +
            } /* OperationErrorGenerator.kt:318 */
  329    368   
        }
         369  +
        /* OperationErrorGenerator.kt:270 */
  330    370   
    }
         371  +
    /* OperationErrorGenerator.kt:269 */
  331    372   
}
         373  +
/* OperationErrorGenerator.kt:133 */
  332    374   
impl ::std::fmt::Display for FractionalSecondsError {
         375  +
    /* OperationErrorGenerator.kt:134 */
  333    376   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         377  +
        /* OperationErrorGenerator.kt:318 */
  334    378   
        match self {
         379  +
            /* OperationErrorGenerator.kt:326 */
  335    380   
            Self::Unhandled(_inner) => {
         381  +
                /* OperationErrorGenerator.kt:139 */
  336    382   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  337    383   
                    write!(f, "unhandled error ({code})")
  338    384   
                } else {
  339    385   
                    f.write_str("unhandled error")
  340    386   
                }
  341         -
            }
         387  +
                /* OperationErrorGenerator.kt:326 */
         388  +
            } /* OperationErrorGenerator.kt:318 */
  342    389   
        }
         390  +
        /* OperationErrorGenerator.kt:134 */
  343    391   
    }
         392  +
    /* OperationErrorGenerator.kt:133 */
  344    393   
}
         394  +
/* OperationErrorGenerator.kt:182 */
  345    395   
impl ::aws_smithy_types::retry::ProvideErrorKind for FractionalSecondsError {
         396  +
    /* OperationErrorGenerator.kt:186 */
  346    397   
    fn code(&self) -> ::std::option::Option<&str> {
         398  +
        /* OperationErrorGenerator.kt:187 */
  347    399   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         400  +
        /* OperationErrorGenerator.kt:186 */
  348    401   
    }
         402  +
    /* OperationErrorGenerator.kt:190 */
  349    403   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         404  +
        /* OperationErrorGenerator.kt:197 */
  350    405   
        ::std::option::Option::None
         406  +
        /* OperationErrorGenerator.kt:190 */
  351    407   
    }
         408  +
    /* OperationErrorGenerator.kt:182 */
  352    409   
}
         410  +
/* OperationErrorGenerator.kt:163 */
  353    411   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for FractionalSecondsError {
         412  +
    /* OperationErrorGenerator.kt:164 */
  354    413   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         414  +
        /* OperationErrorGenerator.kt:318 */
  355    415   
        match self {
  356         -
            Self::Unhandled(_inner) => &_inner.meta,
         416  +
            /* OperationErrorGenerator.kt:326 */
         417  +
            Self::Unhandled(_inner) => {
         418  +
                /* OperationErrorGenerator.kt:168 */
         419  +
                &_inner.meta
         420  +
                /* OperationErrorGenerator.kt:326 */
         421  +
            } /* OperationErrorGenerator.kt:318 */
  357    422   
        }
         423  +
        /* OperationErrorGenerator.kt:164 */
  358    424   
    }
         425  +
    /* OperationErrorGenerator.kt:163 */
  359    426   
}
         427  +
/* OperationErrorGenerator.kt:109 */
  360    428   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for FractionalSecondsError {
         429  +
    /* OperationErrorGenerator.kt:110 */
  361    430   
    fn create_unhandled_error(
  362    431   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  363    432   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  364    433   
    ) -> Self {
         434  +
        /* OperationErrorGenerator.kt:121 */
  365    435   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  366    436   
            source,
  367    437   
            meta: meta.unwrap_or_default(),
  368    438   
        })
         439  +
        /* OperationErrorGenerator.kt:110 */
  369    440   
    }
         441  +
    /* OperationErrorGenerator.kt:109 */
  370    442   
}
  371    443   
         444  +
/* CodegenDelegator.kt:255 */
  372    445   
pub use crate::operation::fractional_seconds::_fractional_seconds_output::FractionalSecondsOutput;
  373    446   
         447  +
/* CodegenDelegator.kt:255 */
  374    448   
pub use crate::operation::fractional_seconds::_fractional_seconds_input::FractionalSecondsInput;
  375    449   
         450  +
/* RustModule.kt:172 */
  376    451   
mod _fractional_seconds_input;
  377    452   
         453  +
/* RustModule.kt:172 */
  378    454   
mod _fractional_seconds_output;
  379    455   
  380         -
/// Builders
         456  +
/// /* CodegenDelegator.kt:51 */Builders
  381    457   
pub mod builders;

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/fractional_seconds/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::fractional_seconds::_fractional_seconds_output::FractionalSecondsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::fractional_seconds::_fractional_seconds_input::FractionalSecondsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::fractional_seconds::builders::FractionalSecondsInputBuilder {
    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::fractional_seconds::FractionalSecondsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::fractional_seconds::FractionalSecondsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.fractional_seconds();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `FractionalSeconds`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `FractionalSeconds`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct FractionalSecondsFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::fractional_seconds::builders::FractionalSecondsInputBuilder,
   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::fractional_seconds::FractionalSecondsOutput,
   34     40   
        crate::operation::fractional_seconds::FractionalSecondsError,
   35     41   
    > for FractionalSecondsFluentBuilder
   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::fractional_seconds::FractionalSecondsOutput,
   43     49   
            crate::operation::fractional_seconds::FractionalSecondsError,
   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 FractionalSecondsFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `FractionalSecondsFluentBuilder`.
   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 FractionalSeconds as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::fractional_seconds::builders::FractionalSecondsInputBuilder {
   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::fractional_seconds::FractionalSecondsOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::fractional_seconds::FractionalSecondsError,
   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::fractional_seconds::FractionalSeconds::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::fractional_seconds::FractionalSeconds::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::fractional_seconds::FractionalSecondsOutput,
   96    106   
        crate::operation::fractional_seconds::FractionalSecondsError,
   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/rust-client-codegen/src/operation/greeting_with_errors.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 `GreetingWithErrors`.
           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 GreetingWithErrors;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl GreetingWithErrors {
    7         -
    /// Creates a new `GreetingWithErrors`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `GreetingWithErrors`
          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::greeting_with_errors::GreetingWithErrorsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::greeting_with_errors::GreetingWithErrorsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +265,282 @@
   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 GreetingWithErrors {
   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("GreetingWithErrors");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            GreetingWithErrorsRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            GreetingWithErrorsResponseDeserializer,
  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   
            "GreetingWithErrors",
  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("GreetingWithErrors")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(GreetingWithErrorsEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::greeting_with_errors::GreetingWithErrorsError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::greeting_with_errors::GreetingWithErrorsError,
  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 GreetingWithErrorsResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GreetingWithErrorsResponseDeserializer {
  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_greeting_with_errors::de_greeting_with_errors_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_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 GreetingWithErrorsRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GreetingWithErrorsRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::greeting_with_errors::GreetingWithErrorsInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::greeting_with_errors::GreetingWithErrorsInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/GreetingWithErrors").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::greeting_with_errors::GreetingWithErrorsInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct GreetingWithErrorsEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GreetingWithErrorsEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "GreetingWithErrorsEndpointParamsInterceptor"
  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::<GreetingWithErrorsInput>()
  220    234   
            .ok_or("failed to downcast to GreetingWithErrorsInput")?;
  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 greeting_with_errors_test {
  237    254   
  238    255   
    /// Ensures that operations with errors successfully know how
  239    256   
    /// to deserialize a successful response. As of January 2021,
  240    257   
    /// server implementations are expected to respond with a
  241    258   
    /// JSON object regardless of if the output parameters are
  242    259   
    /// empty.
  243    260   
    /// Test ID: RestJsonGreetingWithErrors
  244    261   
    #[::tokio::test]
  245    262   
    #[::tracing_test::traced_test]
@@ -849,866 +1008,1153 @@
  869    886   
        });
  870    887   
        let parsed = parsed.expect_err("should be error response");
  871    888   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  872    889   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  873    890   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  874    891   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  875    892   
        } else {
  876    893   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  877    894   
        }
  878    895   
    }
         896  +
         897  +
    /* ProtocolTestGenerator.kt:98 */
  879    898   
}
  880    899   
         900  +
/* OperationErrorGenerator.kt:79 */
  881    901   
/// Error type for the `GreetingWithErrorsError` operation.
         902  +
/* RustType.kt:516 */
  882    903   
#[non_exhaustive]
         904  +
/* RustType.kt:516 */
  883    905   
#[derive(::std::fmt::Debug)]
  884         -
pub enum GreetingWithErrorsError {
  885         -
    /// This error is thrown when an invalid greeting value is provided.
         906  +
pub /* OperationErrorGenerator.kt:81 */ enum GreetingWithErrorsError {
         907  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when an invalid greeting value is provided.
         908  +
    /* OperationErrorGenerator.kt:86 */
  886    909   
    InvalidGreeting(crate::types::error::InvalidGreeting),
  887         -
    /// This error is thrown when a request is invalid.
         910  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when a request is invalid.
         911  +
    /* OperationErrorGenerator.kt:86 */
  888    912   
    ComplexError(crate::types::error::ComplexError),
  889         -
    /// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         913  +
    /// /* OperationErrorGenerator.kt:83 */This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         914  +
    /* OperationErrorGenerator.kt:86 */
  890    915   
    FooError(crate::types::error::FooError),
         916  +
    /* OperationErrorGenerator.kt:88 */
  891    917   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  892    918   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  893    919   
    variable wildcard pattern and check `.code()`:
  894    920   
     \
  895    921   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  896    922   
     \
  897    923   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GreetingWithErrorsError) for what information is available for the error.")]
  898    924   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         925  +
    /* OperationErrorGenerator.kt:81 */
  899    926   
}
         927  +
/* OperationErrorGenerator.kt:218 */
  900    928   
impl GreetingWithErrorsError {
         929  +
    /* OperationErrorGenerator.kt:219 */
  901    930   
    /// Creates the `GreetingWithErrorsError::Unhandled` variant from any error type.
  902    931   
    pub fn unhandled(
  903    932   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  904    933   
    ) -> Self {
  905    934   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  906    935   
            source: err.into(),
  907    936   
            meta: ::std::default::Default::default(),
  908    937   
        })
  909    938   
    }
  910    939   
  911    940   
    /// Creates the `GreetingWithErrorsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  912    941   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  913    942   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  914    943   
            source: err.clone().into(),
  915    944   
            meta: err,
  916    945   
        })
  917    946   
    }
  918         -
    ///
         947  +
    /// /* OperationErrorGenerator.kt:236 */
  919    948   
    /// Returns error metadata, which includes the error code, message,
  920    949   
    /// request ID, and potentially additional information.
  921    950   
    ///
         951  +
    /* OperationErrorGenerator.kt:242 */
  922    952   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         953  +
        /* OperationErrorGenerator.kt:243 */
  923    954   
        match self {
  924         -
            Self::InvalidGreeting(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  925         -
            Self::ComplexError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  926         -
            Self::FooError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  927         -
            Self::Unhandled(e) => &e.meta,
         955  +
            /* OperationErrorGenerator.kt:246 */ Self::InvalidGreeting(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         956  +
            /* OperationErrorGenerator.kt:246 */ Self::ComplexError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         957  +
            /* OperationErrorGenerator.kt:246 */ Self::FooError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         958  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         959  +
            /* OperationErrorGenerator.kt:243 */
  928    960   
        }
         961  +
        /* OperationErrorGenerator.kt:242 */
  929    962   
    }
         963  +
    /* OperationErrorGenerator.kt:257 */
  930    964   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::InvalidGreeting`.
         965  +
    /* OperationErrorGenerator.kt:258 */
  931    966   
    pub fn is_invalid_greeting(&self) -> bool {
         967  +
        /* OperationErrorGenerator.kt:259 */
  932    968   
        matches!(self, Self::InvalidGreeting(_))
         969  +
        /* OperationErrorGenerator.kt:258 */
  933    970   
    }
         971  +
    /* OperationErrorGenerator.kt:257 */
  934    972   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::ComplexError`.
         973  +
    /* OperationErrorGenerator.kt:258 */
  935    974   
    pub fn is_complex_error(&self) -> bool {
         975  +
        /* OperationErrorGenerator.kt:259 */
  936    976   
        matches!(self, Self::ComplexError(_))
         977  +
        /* OperationErrorGenerator.kt:258 */
  937    978   
    }
         979  +
    /* OperationErrorGenerator.kt:257 */
  938    980   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::FooError`.
         981  +
    /* OperationErrorGenerator.kt:258 */
  939    982   
    pub fn is_foo_error(&self) -> bool {
         983  +
        /* OperationErrorGenerator.kt:259 */
  940    984   
        matches!(self, Self::FooError(_))
         985  +
        /* OperationErrorGenerator.kt:258 */
  941    986   
    }
         987  +
    /* OperationErrorGenerator.kt:218 */
  942    988   
}
         989  +
/* OperationErrorGenerator.kt:269 */
  943    990   
impl ::std::error::Error for GreetingWithErrorsError {
         991  +
    /* OperationErrorGenerator.kt:270 */
  944    992   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         993  +
        /* OperationErrorGenerator.kt:318 */
  945    994   
        match self {
  946         -
            Self::InvalidGreeting(_inner) => ::std::option::Option::Some(_inner),
  947         -
            Self::ComplexError(_inner) => ::std::option::Option::Some(_inner),
  948         -
            Self::FooError(_inner) => ::std::option::Option::Some(_inner),
  949         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         995  +
            /* OperationErrorGenerator.kt:321 */
         996  +
            Self::InvalidGreeting(_inner) =>
         997  +
            /* OperationErrorGenerator.kt:283 */
         998  +
            {
         999  +
                ::std::option::Option::Some(_inner)
        1000  +
            }
        1001  +
            ,
        1002  +
            /* OperationErrorGenerator.kt:321 */
        1003  +
            Self::ComplexError(_inner) =>
        1004  +
            /* OperationErrorGenerator.kt:283 */
        1005  +
            {
        1006  +
                ::std::option::Option::Some(_inner)
        1007  +
            }
        1008  +
            ,
        1009  +
            /* OperationErrorGenerator.kt:321 */
        1010  +
            Self::FooError(_inner) =>
        1011  +
            /* OperationErrorGenerator.kt:283 */
        1012  +
            {
        1013  +
                ::std::option::Option::Some(_inner)
        1014  +
            }
        1015  +
            ,
        1016  +
            /* OperationErrorGenerator.kt:326 */
        1017  +
            Self::Unhandled(_inner) => {
        1018  +
                /* OperationErrorGenerator.kt:279 */
        1019  +
                ::std::option::Option::Some(&*_inner.source)
        1020  +
                /* OperationErrorGenerator.kt:326 */
        1021  +
            } /* OperationErrorGenerator.kt:318 */
  950   1022   
        }
        1023  +
        /* OperationErrorGenerator.kt:270 */
  951   1024   
    }
        1025  +
    /* OperationErrorGenerator.kt:269 */
  952   1026   
}
        1027  +
/* OperationErrorGenerator.kt:133 */
  953   1028   
impl ::std::fmt::Display for GreetingWithErrorsError {
        1029  +
    /* OperationErrorGenerator.kt:134 */
  954   1030   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        1031  +
        /* OperationErrorGenerator.kt:318 */
  955   1032   
        match self {
  956         -
            Self::InvalidGreeting(_inner) => _inner.fmt(f),
  957         -
            Self::ComplexError(_inner) => _inner.fmt(f),
  958         -
            Self::FooError(_inner) => _inner.fmt(f),
        1033  +
            /* OperationErrorGenerator.kt:321 */
        1034  +
            Self::InvalidGreeting(_inner) =>
        1035  +
            /* OperationErrorGenerator.kt:151 */
        1036  +
            {
        1037  +
                _inner.fmt(f)
        1038  +
            }
        1039  +
            ,
        1040  +
            /* OperationErrorGenerator.kt:321 */
        1041  +
            Self::ComplexError(_inner) =>
        1042  +
            /* OperationErrorGenerator.kt:151 */
        1043  +
            {
        1044  +
                _inner.fmt(f)
        1045  +
            }
        1046  +
            ,
        1047  +
            /* OperationErrorGenerator.kt:321 */
        1048  +
            Self::FooError(_inner) =>
        1049  +
            /* OperationErrorGenerator.kt:151 */
        1050  +
            {
        1051  +
                _inner.fmt(f)
        1052  +
            }
        1053  +
            ,
        1054  +
            /* OperationErrorGenerator.kt:326 */
  959   1055   
            Self::Unhandled(_inner) => {
        1056  +
                /* OperationErrorGenerator.kt:139 */
  960   1057   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  961   1058   
                    write!(f, "unhandled error ({code})")
  962   1059   
                } else {
  963   1060   
                    f.write_str("unhandled error")
  964   1061   
                }
  965         -
            }
        1062  +
                /* OperationErrorGenerator.kt:326 */
        1063  +
            } /* OperationErrorGenerator.kt:318 */
  966   1064   
        }
        1065  +
        /* OperationErrorGenerator.kt:134 */
  967   1066   
    }
        1067  +
    /* OperationErrorGenerator.kt:133 */
  968   1068   
}
        1069  +
/* OperationErrorGenerator.kt:182 */
  969   1070   
impl ::aws_smithy_types::retry::ProvideErrorKind for GreetingWithErrorsError {
        1071  +
    /* OperationErrorGenerator.kt:186 */
  970   1072   
    fn code(&self) -> ::std::option::Option<&str> {
        1073  +
        /* OperationErrorGenerator.kt:187 */
  971   1074   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
        1075  +
        /* OperationErrorGenerator.kt:186 */
  972   1076   
    }
        1077  +
    /* OperationErrorGenerator.kt:190 */
  973   1078   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
        1079  +
        /* OperationErrorGenerator.kt:197 */
  974   1080   
        ::std::option::Option::None
        1081  +
        /* OperationErrorGenerator.kt:190 */
  975   1082   
    }
        1083  +
    /* OperationErrorGenerator.kt:182 */
  976   1084   
}
        1085  +
/* OperationErrorGenerator.kt:163 */
  977   1086   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GreetingWithErrorsError {
        1087  +
    /* OperationErrorGenerator.kt:164 */
  978   1088   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
        1089  +
        /* OperationErrorGenerator.kt:318 */
  979   1090   
        match self {
  980         -
            Self::InvalidGreeting(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  981         -
            Self::ComplexError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  982         -
            Self::FooError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  983         -
            Self::Unhandled(_inner) => &_inner.meta,
        1091  +
            /* OperationErrorGenerator.kt:321 */
        1092  +
            Self::InvalidGreeting(_inner) =>
        1093  +
            /* OperationErrorGenerator.kt:169 */
        1094  +
            {
        1095  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
        1096  +
            }
        1097  +
            ,
        1098  +
            /* OperationErrorGenerator.kt:321 */
        1099  +
            Self::ComplexError(_inner) =>
        1100  +
            /* OperationErrorGenerator.kt:169 */
        1101  +
            {
        1102  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
        1103  +
            }
        1104  +
            ,
        1105  +
            /* OperationErrorGenerator.kt:321 */
        1106  +
            Self::FooError(_inner) =>
        1107  +
            /* OperationErrorGenerator.kt:169 */
        1108  +
            {
        1109  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
        1110  +
            }
        1111  +
            ,
        1112  +
            /* OperationErrorGenerator.kt:326 */
        1113  +
            Self::Unhandled(_inner) => {
        1114  +
                /* OperationErrorGenerator.kt:168 */
        1115  +
                &_inner.meta
        1116  +
                /* OperationErrorGenerator.kt:326 */
        1117  +
            } /* OperationErrorGenerator.kt:318 */
  984   1118   
        }
        1119  +
        /* OperationErrorGenerator.kt:164 */
  985   1120   
    }
        1121  +
    /* OperationErrorGenerator.kt:163 */
  986   1122   
}
        1123  +
/* OperationErrorGenerator.kt:109 */
  987   1124   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GreetingWithErrorsError {
        1125  +
    /* OperationErrorGenerator.kt:110 */
  988   1126   
    fn create_unhandled_error(
  989   1127   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  990   1128   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  991   1129   
    ) -> Self {
        1130  +
        /* OperationErrorGenerator.kt:121 */
  992   1131   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  993   1132   
            source,
  994   1133   
            meta: meta.unwrap_or_default(),
  995   1134   
        })
        1135  +
        /* OperationErrorGenerator.kt:110 */
  996   1136   
    }
        1137  +
    /* OperationErrorGenerator.kt:109 */
  997   1138   
}
  998   1139   
        1140  +
/* CodegenDelegator.kt:255 */
  999   1141   
pub use crate::operation::greeting_with_errors::_greeting_with_errors_output::GreetingWithErrorsOutput;
 1000   1142   
        1143  +
/* CodegenDelegator.kt:255 */
 1001   1144   
pub use crate::operation::greeting_with_errors::_greeting_with_errors_input::GreetingWithErrorsInput;
 1002   1145   
        1146  +
/* RustModule.kt:172 */
 1003   1147   
mod _greeting_with_errors_input;
 1004   1148   
        1149  +
/* RustModule.kt:172 */
 1005   1150   
mod _greeting_with_errors_output;
 1006   1151   
 1007         -
/// Builders
        1152  +
/// /* CodegenDelegator.kt:51 */Builders
 1008   1153   
pub mod builders;

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

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct GreetingWithErrorsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct GreetingWithErrorsOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub greeting: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl GreetingWithErrorsOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn greeting(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.greeting.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl GreetingWithErrorsOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`GreetingWithErrorsOutput`](crate::operation::greeting_with_errors::GreetingWithErrorsOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`GreetingWithErrorsOutput`](crate::operation::greeting_with_errors::GreetingWithErrorsOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::greeting_with_errors::builders::GreetingWithErrorsOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`GreetingWithErrorsOutput`](crate::operation::greeting_with_errors::GreetingWithErrorsOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`GreetingWithErrorsOutput`](crate::operation::greeting_with_errors::GreetingWithErrorsOutput).
          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 GreetingWithErrorsOutputBuilder {
   26         -
    pub(crate) greeting: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) greeting: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl GreetingWithErrorsOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn greeting(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.greeting = ::std::option::Option::Some(input.into());
          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_greeting(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.greeting = 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_greeting(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.greeting
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`GreetingWithErrorsOutput`](crate::operation::greeting_with_errors::GreetingWithErrorsOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`GreetingWithErrorsOutput`](crate::operation::greeting_with_errors::GreetingWithErrorsOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::greeting_with_errors::GreetingWithErrorsOutput {
   45         -
        crate::operation::greeting_with_errors::GreetingWithErrorsOutput { greeting: self.greeting }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::greeting_with_errors::GreetingWithErrorsOutput {
          82  +
            /* BuilderGenerator.kt:481 */ greeting: self.greeting,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}