Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/datetime_offsets/_datetime_offsets_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 DatetimeOffsetsInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct DatetimeOffsetsInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl DatetimeOffsetsInput {
    7         -
    /// Creates a new builder-style object to manufacture [`DatetimeOffsetsInput`](crate::operation::datetime_offsets::DatetimeOffsetsInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`DatetimeOffsetsInput`](crate::operation::datetime_offsets::DatetimeOffsetsInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::datetime_offsets::builders::DatetimeOffsetsInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::datetime_offsets::builders::DatetimeOffsetsInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`DatetimeOffsetsInput`](crate::operation::datetime_offsets::DatetimeOffsetsInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`DatetimeOffsetsInput`](crate::operation::datetime_offsets::DatetimeOffsetsInput).
          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 DatetimeOffsetsInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct DatetimeOffsetsInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl DatetimeOffsetsInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`DatetimeOffsetsInput`](crate::operation::datetime_offsets::DatetimeOffsetsInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`DatetimeOffsetsInput`](crate::operation::datetime_offsets::DatetimeOffsetsInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<crate::operation::datetime_offsets::DatetimeOffsetsInput, ::aws_smithy_types::error::operation::BuildError> {
   22         -
        ::std::result::Result::Ok(crate::operation::datetime_offsets::DatetimeOffsetsInput {})
          35  +
        /* BuilderGenerator.kt:254 */
          36  +
        ::std::result::Result::Ok(
          37  +
            /* BuilderGenerator.kt:477 */
          38  +
            crate::operation::datetime_offsets::DatetimeOffsetsInput {
          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_xml/rust-client-codegen/src/operation/datetime_offsets/_datetime_offsets_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 DatetimeOffsetsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct DatetimeOffsetsOutput {
           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 DatetimeOffsetsOutput {
          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 DatetimeOffsetsOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`DatetimeOffsetsOutput`](crate::operation::datetime_offsets::DatetimeOffsetsOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`DatetimeOffsetsOutput`](crate::operation::datetime_offsets::DatetimeOffsetsOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::datetime_offsets::builders::DatetimeOffsetsOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::datetime_offsets::builders::DatetimeOffsetsOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`DatetimeOffsetsOutput`](crate::operation::datetime_offsets::DatetimeOffsetsOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`DatetimeOffsetsOutput`](crate::operation::datetime_offsets::DatetimeOffsetsOutput).
          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 DatetimeOffsetsOutputBuilder {
   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 DatetimeOffsetsOutputBuilder {
          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 [`DatetimeOffsetsOutput`](crate::operation::datetime_offsets::DatetimeOffsetsOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`DatetimeOffsetsOutput`](crate::operation::datetime_offsets::DatetimeOffsetsOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::datetime_offsets::DatetimeOffsetsOutput {
   45         -
        crate::operation::datetime_offsets::DatetimeOffsetsOutput { datetime: self.datetime }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::datetime_offsets::DatetimeOffsetsOutput {
          82  +
            /* BuilderGenerator.kt:481 */ datetime: self.datetime,
          83  +
            /* BuilderGenerator.kt:477 */
   46     84   
        }
          85  +
        /* BuilderGenerator.kt:253 */
          86  +
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/datetime_offsets/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::datetime_offsets::_datetime_offsets_output::DatetimeOffsetsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::datetime_offsets::_datetime_offsets_input::DatetimeOffsetsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::datetime_offsets::builders::DatetimeOffsetsInputBuilder {
    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::datetime_offsets::DatetimeOffsetsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::datetime_offsets::DatetimeOffsetsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.datetime_offsets();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `DatetimeOffsets`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `DatetimeOffsets`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct DatetimeOffsetsFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::datetime_offsets::builders::DatetimeOffsetsInputBuilder,
   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::datetime_offsets::DatetimeOffsetsOutput,
   34     40   
        crate::operation::datetime_offsets::DatetimeOffsetsError,
   35     41   
    > for DatetimeOffsetsFluentBuilder
   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::datetime_offsets::DatetimeOffsetsOutput,
   43     49   
            crate::operation::datetime_offsets::DatetimeOffsetsError,
   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 DatetimeOffsetsFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `DatetimeOffsetsFluentBuilder`.
   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 DatetimeOffsets as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::datetime_offsets::builders::DatetimeOffsetsInputBuilder {
   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::datetime_offsets::DatetimeOffsetsOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::datetime_offsets::DatetimeOffsetsError,
   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::datetime_offsets::DatetimeOffsets::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::datetime_offsets::DatetimeOffsets::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::datetime_offsets::DatetimeOffsetsOutput,
   96    106   
        crate::operation::datetime_offsets::DatetimeOffsetsError,
   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_xml/rust-client-codegen/src/operation/empty_input_and_empty_output.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 `EmptyInputAndEmptyOutput`.
           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 EmptyInputAndEmptyOutput;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EmptyInputAndEmptyOutput {
    7         -
    /// Creates a new `EmptyInputAndEmptyOutput`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EmptyInputAndEmptyOutput`
          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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +394,470 @@
   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 EmptyInputAndEmptyOutput {
   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("EmptyInputAndEmptyOutput");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            EmptyInputAndEmptyOutputRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            EmptyInputAndEmptyOutputResponseDeserializer,
  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   
            "EmptyInputAndEmptyOutput",
  111    122   
            "Rest Xml 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("EmptyInputAndEmptyOutput")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(EmptyInputAndEmptyOutputEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
  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 EmptyInputAndEmptyOutputResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EmptyInputAndEmptyOutputResponseDeserializer {
  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_empty_input_and_empty_output::de_empty_input_and_empty_output_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_empty_input_and_empty_output::de_empty_input_and_empty_output_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 EmptyInputAndEmptyOutputRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EmptyInputAndEmptyOutputRequestSerializer {
  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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput>()
  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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
  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, "/EmptyInputAndEmptyOutput").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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
  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 EmptyInputAndEmptyOutputEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EmptyInputAndEmptyOutputEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "EmptyInputAndEmptyOutputEndpointParamsInterceptor"
  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::<EmptyInputAndEmptyOutputInput>()
  220    234   
            .ok_or("failed to downcast to EmptyInputAndEmptyOutputInput")?;
  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 empty_input_and_empty_output_test {
  237    254   
  238    255   
    /// Empty input serializes no payload
  239    256   
    /// Test ID: EmptyInputAndEmptyOutput
  240    257   
    #[::tokio::test]
  241    258   
    #[::tracing_test::traced_test]
  242    259   
    async fn empty_input_and_empty_output_request() {
  243    260   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  244    261   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  245    262   
  246    263   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  247    264   
        let result = client.empty_input_and_empty_output().send().await;
  248    265   
        let _ = dbg!(result);
  249    266   
        let http_request = request_receiver.expect_request();
  250    267   
        let body = http_request.body().bytes().expect("body should be strict");
  251    268   
        // No body.
  252    269   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  253    270   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  254    271   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  255    272   
        ::pretty_assertions::assert_eq!(uri.path(), "/EmptyInputAndEmptyOutput", "path was incorrect");
  256    273   
    }
  257    274   
  258    275   
    /// Empty output serializes no payload
  259    276   
    /// Test ID: EmptyInputAndEmptyOutput
  260    277   
    #[::tokio::test]
  261    278   
    #[::tracing_test::traced_test]
  262    279   
    async fn empty_input_and_empty_output_response() {
  263    280   
        let expected_output = crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput::builder().build();
  264    281   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  265    282   
            ::http::response::Builder::new()
  266    283   
                .status(200)
  267    284   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  268    285   
                .unwrap(),
  269    286   
        )
  270    287   
        .unwrap();
  271    288   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  272    289   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  273    290   
  274    291   
        let op = crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutput::new();
  275    292   
        let config = op.config().expect("the operation has config");
  276    293   
        let de = config
  277    294   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  278    295   
            .expect("the config must have a deserializer");
  279    296   
  280    297   
        let parsed = de.deserialize_streaming(&mut http_response);
  281    298   
        let parsed = parsed.unwrap_or_else(|| {
  282    299   
            let http_response = http_response.map(|body| {
  283    300   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  284    301   
                    body.bytes().unwrap(),
  285    302   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  286    303   
                )))
  287    304   
            });
  288    305   
            de.deserialize_nonstreaming(&http_response)
  289    306   
        });
  290    307   
        let parsed = parsed
  291    308   
            .expect("should be successful response")
  292    309   
            .downcast::<crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput>()
  293    310   
            .unwrap();
  294    311   
    }
         312  +
         313  +
    /* ProtocolTestGenerator.kt:98 */
  295    314   
}
  296    315   
         316  +
/* OperationErrorGenerator.kt:79 */
  297    317   
/// Error type for the `EmptyInputAndEmptyOutputError` operation.
         318  +
/* RustType.kt:516 */
  298    319   
#[non_exhaustive]
         320  +
/* RustType.kt:516 */
  299    321   
#[derive(::std::fmt::Debug)]
  300         -
pub enum EmptyInputAndEmptyOutputError {
         322  +
pub /* OperationErrorGenerator.kt:81 */ enum EmptyInputAndEmptyOutputError {
         323  +
    /* OperationErrorGenerator.kt:88 */
  301    324   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  302    325   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  303    326   
    variable wildcard pattern and check `.code()`:
  304    327   
     \
  305    328   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  306    329   
     \
  307    330   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EmptyInputAndEmptyOutputError) for what information is available for the error.")]
  308    331   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         332  +
    /* OperationErrorGenerator.kt:81 */
  309    333   
}
         334  +
/* OperationErrorGenerator.kt:218 */
  310    335   
impl EmptyInputAndEmptyOutputError {
         336  +
    /* OperationErrorGenerator.kt:219 */
  311    337   
    /// Creates the `EmptyInputAndEmptyOutputError::Unhandled` variant from any error type.
  312    338   
    pub fn unhandled(
  313    339   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  314    340   
    ) -> Self {
  315    341   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  316    342   
            source: err.into(),
  317    343   
            meta: ::std::default::Default::default(),
  318    344   
        })
  319    345   
    }
  320    346   
  321    347   
    /// Creates the `EmptyInputAndEmptyOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  322    348   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  323    349   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  324    350   
            source: err.clone().into(),
  325    351   
            meta: err,
  326    352   
        })
  327    353   
    }
  328         -
    ///
         354  +
    /// /* OperationErrorGenerator.kt:236 */
  329    355   
    /// Returns error metadata, which includes the error code, message,
  330    356   
    /// request ID, and potentially additional information.
  331    357   
    ///
         358  +
    /* OperationErrorGenerator.kt:242 */
  332    359   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         360  +
        /* OperationErrorGenerator.kt:243 */
  333    361   
        match self {
  334         -
            Self::Unhandled(e) => &e.meta,
         362  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         363  +
            /* OperationErrorGenerator.kt:243 */
  335    364   
        }
         365  +
        /* OperationErrorGenerator.kt:242 */
  336    366   
    }
         367  +
    /* OperationErrorGenerator.kt:218 */
  337    368   
}
         369  +
/* OperationErrorGenerator.kt:269 */
  338    370   
impl ::std::error::Error for EmptyInputAndEmptyOutputError {
         371  +
    /* OperationErrorGenerator.kt:270 */
  339    372   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         373  +
        /* OperationErrorGenerator.kt:318 */
  340    374   
        match self {
  341         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         375  +
            /* OperationErrorGenerator.kt:326 */
         376  +
            Self::Unhandled(_inner) => {
         377  +
                /* OperationErrorGenerator.kt:279 */
         378  +
                ::std::option::Option::Some(&*_inner.source)
         379  +
                /* OperationErrorGenerator.kt:326 */
         380  +
            } /* OperationErrorGenerator.kt:318 */
  342    381   
        }
         382  +
        /* OperationErrorGenerator.kt:270 */
  343    383   
    }
         384  +
    /* OperationErrorGenerator.kt:269 */
  344    385   
}
         386  +
/* OperationErrorGenerator.kt:133 */
  345    387   
impl ::std::fmt::Display for EmptyInputAndEmptyOutputError {
         388  +
    /* OperationErrorGenerator.kt:134 */
  346    389   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         390  +
        /* OperationErrorGenerator.kt:318 */
  347    391   
        match self {
         392  +
            /* OperationErrorGenerator.kt:326 */
  348    393   
            Self::Unhandled(_inner) => {
         394  +
                /* OperationErrorGenerator.kt:139 */
  349    395   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  350    396   
                    write!(f, "unhandled error ({code})")
  351    397   
                } else {
  352    398   
                    f.write_str("unhandled error")
  353    399   
                }
         400  +
                /* OperationErrorGenerator.kt:326 */
         401  +
            } /* OperationErrorGenerator.kt:318 */
  354    402   
        }
         403  +
        /* OperationErrorGenerator.kt:134 */
  355    404   
    }
  356         -
    }
         405  +
    /* OperationErrorGenerator.kt:133 */
  357    406   
}
         407  +
/* OperationErrorGenerator.kt:182 */
  358    408   
impl ::aws_smithy_types::retry::ProvideErrorKind for EmptyInputAndEmptyOutputError {
         409  +
    /* OperationErrorGenerator.kt:186 */
  359    410   
    fn code(&self) -> ::std::option::Option<&str> {
         411  +
        /* OperationErrorGenerator.kt:187 */
  360    412   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         413  +
        /* OperationErrorGenerator.kt:186 */
  361    414   
    }
         415  +
    /* OperationErrorGenerator.kt:190 */
  362    416   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         417  +
        /* OperationErrorGenerator.kt:197 */
  363    418   
        ::std::option::Option::None
         419  +
        /* OperationErrorGenerator.kt:190 */
  364    420   
    }
         421  +
    /* OperationErrorGenerator.kt:182 */
  365    422   
}
         423  +
/* OperationErrorGenerator.kt:163 */
  366    424   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EmptyInputAndEmptyOutputError {
         425  +
    /* OperationErrorGenerator.kt:164 */
  367    426   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         427  +
        /* OperationErrorGenerator.kt:318 */
  368    428   
        match self {
  369         -
            Self::Unhandled(_inner) => &_inner.meta,
         429  +
            /* OperationErrorGenerator.kt:326 */
         430  +
            Self::Unhandled(_inner) => {
         431  +
                /* OperationErrorGenerator.kt:168 */
         432  +
                &_inner.meta
         433  +
                /* OperationErrorGenerator.kt:326 */
         434  +
            } /* OperationErrorGenerator.kt:318 */
  370    435   
        }
         436  +
        /* OperationErrorGenerator.kt:164 */
  371    437   
    }
         438  +
    /* OperationErrorGenerator.kt:163 */
  372    439   
}
         440  +
/* OperationErrorGenerator.kt:109 */
  373    441   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EmptyInputAndEmptyOutputError {
         442  +
    /* OperationErrorGenerator.kt:110 */
  374    443   
    fn create_unhandled_error(
  375    444   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  376    445   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  377    446   
    ) -> Self {
         447  +
        /* OperationErrorGenerator.kt:121 */
  378    448   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  379    449   
            source,
  380    450   
            meta: meta.unwrap_or_default(),
  381    451   
        })
         452  +
        /* OperationErrorGenerator.kt:110 */
  382    453   
    }
         454  +
    /* OperationErrorGenerator.kt:109 */
  383    455   
}
  384    456   
         457  +
/* CodegenDelegator.kt:255 */
  385    458   
pub use crate::operation::empty_input_and_empty_output::_empty_input_and_empty_output_output::EmptyInputAndEmptyOutputOutput;
  386    459   
         460  +
/* CodegenDelegator.kt:255 */
  387    461   
pub use crate::operation::empty_input_and_empty_output::_empty_input_and_empty_output_input::EmptyInputAndEmptyOutputInput;
  388    462   
         463  +
/* RustModule.kt:172 */
  389    464   
mod _empty_input_and_empty_output_input;
  390    465   
         466  +
/* RustModule.kt:172 */
  391    467   
mod _empty_input_and_empty_output_output;
  392    468   
  393         -
/// Builders
         469  +
/// /* CodegenDelegator.kt:51 */Builders
  394    470   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/empty_input_and_empty_output/_empty_input_and_empty_output_input.rs

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

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

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_header_operation/_endpoint_with_host_label_header_operation_input.rs

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

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_header_operation/builders.rs

@@ -1,1 +127,145 @@
    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_header_operation::_endpoint_with_host_label_header_operation_output::EndpointWithHostLabelHeaderOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::endpoint_with_host_label_header_operation::_endpoint_with_host_label_header_operation_input::EndpointWithHostLabelHeaderOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::endpoint_with_host_label_header_operation::builders::EndpointWithHostLabelHeaderOperationInputBuilder {
    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_header_operation::EndpointWithHostLabelHeaderOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.endpoint_with_host_label_header_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `EndpointWithHostLabelHeaderOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `EndpointWithHostLabelHeaderOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct EndpointWithHostLabelHeaderOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::endpoint_with_host_label_header_operation::builders::EndpointWithHostLabelHeaderOperationInputBuilder,
   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_header_operation::EndpointWithHostLabelHeaderOperationOutput,
   34     40   
        crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationError,
   35     41   
    > for EndpointWithHostLabelHeaderOperationFluentBuilder
   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_header_operation::EndpointWithHostLabelHeaderOperationOutput,
   43     49   
            crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationError,
   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 EndpointWithHostLabelHeaderOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `EndpointWithHostLabelHeaderOperationFluentBuilder`.
   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 EndpointWithHostLabelHeaderOperation as a reference.
   59     68   
    pub fn as_input(
   60     69   
        &self,
   61     70   
    ) -> &crate::operation::endpoint_with_host_label_header_operation::builders::EndpointWithHostLabelHeaderOperationInputBuilder {
   62     71   
        &self.inner
   63     72   
    }
          73  +
    /* FluentBuilderGenerator.kt:145 */
   64     74   
    /// Sends the request and returns the response.
   65     75   
    ///
   66     76   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   67     77   
    /// can be matched against.
   68     78   
    ///
   69     79   
    /// By default, any retryable failures will be retried twice. Retry behavior
   70     80   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   71     81   
    /// set when configuring the client.
   72     82   
    pub async fn send(
   73     83   
        self,
   74     84   
    ) -> ::std::result::Result<
   75     85   
        crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationOutput,
   76     86   
        ::aws_smithy_runtime_api::client::result::SdkError<
   77     87   
            crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationError,
   78     88   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   79     89   
        >,
   80     90   
    > {
   81     91   
        let input = self
   82     92   
            .inner
   83     93   
            .build()
   84     94   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   85     95   
        let runtime_plugins =
   86     96   
            crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperation::operation_runtime_plugins(
   87     97   
                self.handle.runtime_plugins.clone(),
   88     98   
                &self.handle.conf,
   89     99   
                self.config_override,
   90    100   
            );
   91    101   
        crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperation::orchestrate(&runtime_plugins, input).await
   92    102   
    }
   93    103   
   94    104   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   95    105   
    pub fn customize(
   96    106   
        self,
   97    107   
    ) -> crate::client::customize::CustomizableOperation<
   98    108   
        crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationOutput,
   99    109   
        crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationError,
  100    110   
        Self,
  101    111   
    > {
  102    112   
        crate::client::customize::CustomizableOperation::new(self)
  103    113   
    }
         114  +
    /* FluentBuilderGenerator.kt:315 */
  104    115   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  105    116   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  106    117   
        self
  107    118   
    }
  108    119   
  109    120   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  110    121   
        self.config_override = config_override;
  111    122   
        self
  112    123   
    }
         124  +
    /* FluentBuilderGenerator.kt:498 */
  113    125   
    #[allow(missing_docs)] // documentation missing in model
         126  +
                           /* FluentBuilderGenerator.kt:500 */
  114    127   
    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  115    128   
        self.inner = self.inner.account_id(input.into());
  116    129   
        self
  117    130   
    }
         131  +
    /* FluentBuilderGenerator.kt:498 */
  118    132   
    #[allow(missing_docs)] // documentation missing in model
         133  +
                           /* FluentBuilderGenerator.kt:500 */
  119    134   
    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  120    135   
        self.inner = self.inner.set_account_id(input);
  121    136   
        self
  122    137   
    }
         138  +
    /* FluentBuilderGenerator.kt:518 */
  123    139   
    #[allow(missing_docs)] // documentation missing in model
         140  +
                           /* FluentBuilderGenerator.kt:520 */
  124    141   
    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
  125    142   
        self.inner.get_account_id()
  126    143   
    }
         144  +
    /* FluentBuilderGenerator.kt:282 */
  127    145   
}