Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/aws_query/rust-client-codegen/src/meta.rs

@@ -1,1 +4,5 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* CrateVersionCustomization.kt:23 */
    3      4   
/// Crate version number.
    4      5   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");

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

@@ -1,1 +100,100 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Types for the `DatetimeOffsets` operation.
           2  +
/* CodegenDelegator.kt:51 */
           3  +
/// /* CodegenDelegator.kt:51 */Types for the `DatetimeOffsets` operation.
    4      4   
pub mod datetime_offsets;
    5      5   
    6         -
/// Types for the `EmptyInputAndEmptyOutput` operation.
           6  +
/// /* CodegenDelegator.kt:51 */Types for the `EmptyInputAndEmptyOutput` operation.
    7      7   
pub mod empty_input_and_empty_output;
    8      8   
    9         -
/// Types for the `EndpointOperation` operation.
           9  +
/// /* CodegenDelegator.kt:51 */Types for the `EndpointOperation` operation.
   10     10   
pub mod endpoint_operation;
   11     11   
   12         -
/// Types for the `EndpointWithHostLabelOperation` operation.
          12  +
/// /* CodegenDelegator.kt:51 */Types for the `EndpointWithHostLabelOperation` operation.
   13     13   
pub mod endpoint_with_host_label_operation;
   14     14   
   15         -
/// Types for the `FlattenedXmlMap` operation.
          15  +
/// /* CodegenDelegator.kt:51 */Types for the `FlattenedXmlMap` operation.
   16     16   
pub mod flattened_xml_map;
   17     17   
   18         -
/// Types for the `FlattenedXmlMapWithXmlName` operation.
          18  +
/// /* CodegenDelegator.kt:51 */Types for the `FlattenedXmlMapWithXmlName` operation.
   19     19   
pub mod flattened_xml_map_with_xml_name;
   20     20   
   21         -
/// Types for the `FlattenedXmlMapWithXmlNamespace` operation.
          21  +
/// /* CodegenDelegator.kt:51 */Types for the `FlattenedXmlMapWithXmlNamespace` operation.
   22     22   
pub mod flattened_xml_map_with_xml_namespace;
   23     23   
   24         -
/// Types for the `FractionalSeconds` operation.
          24  +
/// /* CodegenDelegator.kt:51 */Types for the `FractionalSeconds` operation.
   25     25   
pub mod fractional_seconds;
   26     26   
   27         -
/// Types for the `GreetingWithErrors` operation.
          27  +
/// /* CodegenDelegator.kt:51 */Types for the `GreetingWithErrors` operation.
   28     28   
pub mod greeting_with_errors;
   29     29   
   30         -
/// Types for the `HostWithPathOperation` operation.
          30  +
/// /* CodegenDelegator.kt:51 */Types for the `HostWithPathOperation` operation.
   31     31   
pub mod host_with_path_operation;
   32     32   
   33         -
/// Types for the `IgnoresWrappingXmlName` operation.
          33  +
/// /* CodegenDelegator.kt:51 */Types for the `IgnoresWrappingXmlName` operation.
   34     34   
pub mod ignores_wrapping_xml_name;
   35     35   
   36         -
/// Types for the `NestedStructures` operation.
          36  +
/// /* CodegenDelegator.kt:51 */Types for the `NestedStructures` operation.
   37     37   
pub mod nested_structures;
   38     38   
   39         -
/// Types for the `NoInputAndNoOutput` operation.
          39  +
/// /* CodegenDelegator.kt:51 */Types for the `NoInputAndNoOutput` operation.
   40     40   
pub mod no_input_and_no_output;
   41     41   
   42         -
/// Types for the `NoInputAndOutput` operation.
          42  +
/// /* CodegenDelegator.kt:51 */Types for the `NoInputAndOutput` operation.
   43     43   
pub mod no_input_and_output;
   44     44   
   45         -
/// Types for the `PutWithContentEncoding` operation.
          45  +
/// /* CodegenDelegator.kt:51 */Types for the `PutWithContentEncoding` operation.
   46     46   
pub mod put_with_content_encoding;
   47     47   
   48         -
/// Types for the `QueryIdempotencyTokenAutoFill` operation.
          48  +
/// /* CodegenDelegator.kt:51 */Types for the `QueryIdempotencyTokenAutoFill` operation.
   49     49   
pub mod query_idempotency_token_auto_fill;
   50     50   
   51         -
/// Types for the `QueryLists` operation.
          51  +
/// /* CodegenDelegator.kt:51 */Types for the `QueryLists` operation.
   52     52   
pub mod query_lists;
   53     53   
   54         -
/// Types for the `QueryMaps` operation.
          54  +
/// /* CodegenDelegator.kt:51 */Types for the `QueryMaps` operation.
   55     55   
pub mod query_maps;
   56     56   
   57         -
/// Types for the `QueryTimestamps` operation.
          57  +
/// /* CodegenDelegator.kt:51 */Types for the `QueryTimestamps` operation.
   58     58   
pub mod query_timestamps;
   59     59   
   60         -
/// Types for the `RecursiveXmlShapes` operation.
          60  +
/// /* CodegenDelegator.kt:51 */Types for the `RecursiveXmlShapes` operation.
   61     61   
pub mod recursive_xml_shapes;
   62     62   
   63         -
/// Types for the `SimpleInputParams` operation.
          63  +
/// /* CodegenDelegator.kt:51 */Types for the `SimpleInputParams` operation.
   64     64   
pub mod simple_input_params;
   65     65   
   66         -
/// Types for the `SimpleScalarXmlProperties` operation.
          66  +
/// /* CodegenDelegator.kt:51 */Types for the `SimpleScalarXmlProperties` operation.
   67     67   
pub mod simple_scalar_xml_properties;
   68     68   
   69         -
/// Types for the `XmlBlobs` operation.
          69  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlBlobs` operation.
   70     70   
pub mod xml_blobs;
   71     71   
   72         -
/// Types for the `XmlEmptyBlobs` operation.
          72  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlEmptyBlobs` operation.
   73     73   
pub mod xml_empty_blobs;
   74     74   
   75         -
/// Types for the `XmlEmptyLists` operation.
          75  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlEmptyLists` operation.
   76     76   
pub mod xml_empty_lists;
   77     77   
   78         -
/// Types for the `XmlEmptyMaps` operation.
          78  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlEmptyMaps` operation.
   79     79   
pub mod xml_empty_maps;
   80     80   
   81         -
/// Types for the `XmlEnums` operation.
          81  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlEnums` operation.
   82     82   
pub mod xml_enums;
   83     83   
   84         -
/// Types for the `XmlIntEnums` operation.
          84  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlIntEnums` operation.
   85     85   
pub mod xml_int_enums;
   86     86   
   87         -
/// Types for the `XmlLists` operation.
          87  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlLists` operation.
   88     88   
pub mod xml_lists;
   89     89   
   90         -
/// Types for the `XmlMaps` operation.
          90  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlMaps` operation.
   91     91   
pub mod xml_maps;
   92     92   
   93         -
/// Types for the `XmlMapsXmlName` operation.
          93  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlMapsXmlName` operation.
   94     94   
pub mod xml_maps_xml_name;
   95     95   
   96         -
/// Types for the `XmlNamespaces` operation.
          96  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlNamespaces` operation.
   97     97   
pub mod xml_namespaces;
   98     98   
   99         -
/// Types for the `XmlTimestamps` operation.
          99  +
/// /* CodegenDelegator.kt:51 */Types for the `XmlTimestamps` operation.
  100    100   
pub mod xml_timestamps;

tmp-codegen-diff/codegen-client-test/aws_query/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 +262,279 @@
   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   
            "Query 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, "/").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 = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(
  190    203   
            crate::protocol_serde::shape_datetime_offsets_input::ser_datetime_offsets_input_input_input(&input)?,
  191    204   
        );
  192    205   
  193    206   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  194    207   
    }
  195    208   
}
         209  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  196    210   
#[derive(Debug)]
  197    211   
struct DatetimeOffsetsEndpointParamsInterceptor;
  198    212   
  199    213   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DatetimeOffsetsEndpointParamsInterceptor {
  200    214   
    fn name(&self) -> &'static str {
  201    215   
        "DatetimeOffsetsEndpointParamsInterceptor"
  202    216   
    }
  203    217   
  204    218   
    fn read_before_execution(
  205    219   
        &self,
  206    220   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  207    221   
            '_,
  208    222   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  210    224   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  211    225   
        >,
  212    226   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  213    227   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  214    228   
        let _input = context
  215    229   
            .input()
  216    230   
            .downcast_ref::<DatetimeOffsetsInput>()
  217    231   
            .ok_or("failed to downcast to DatetimeOffsetsInput")?;
  218    232   
  219    233   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  220    234   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  221    235   
        })?;
  222    236   
        cfg.interceptor_state()
  223    237   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  224    238   
        ::std::result::Result::Ok(())
  225    239   
    }
  226    240   
}
  227    241   
  228    242   
// The get_* functions below are generated from JMESPath expressions in the
  229    243   
// operationContextParams trait. They target the operation's input shape.
  230    244   
         245  +
/* RustType.kt:516 */
  231    246   
#[allow(unreachable_code, unused_variables)]
         247  +
/* RustType.kt:516 */
  232    248   
#[cfg(test)]
         249  +
/* ProtocolTestGenerator.kt:98 */
  233    250   
mod datetime_offsets_test {
  234    251   
  235    252   
    /// Ensures that clients can correctly parse datetime (timestamps) with offsets
  236    253   
    /// Test ID: AwsQueryDateTimeWithNegativeOffset
  237    254   
    #[::tokio::test]
  238    255   
    #[::tracing_test::traced_test]
  239    256   
    async fn aws_query_date_time_with_negative_offset_response() {
  240    257   
        let expected_output = crate::operation::datetime_offsets::DatetimeOffsetsOutput::builder()
  241    258   
            .set_datetime(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  242    259   
                1576540098, 0_f64,
@@ -288,305 +417,493 @@
  308    325   
                )))
  309    326   
            });
  310    327   
            de.deserialize_nonstreaming(&http_response)
  311    328   
        });
  312    329   
        let parsed = parsed
  313    330   
            .expect("should be successful response")
  314    331   
            .downcast::<crate::operation::datetime_offsets::DatetimeOffsetsOutput>()
  315    332   
            .unwrap();
  316    333   
        ::pretty_assertions::assert_eq!(parsed.datetime, expected_output.datetime, "Unexpected value for `datetime`");
  317    334   
    }
         335  +
         336  +
    /* ProtocolTestGenerator.kt:98 */
  318    337   
}
  319    338   
         339  +
/* OperationErrorGenerator.kt:79 */
  320    340   
/// Error type for the `DatetimeOffsetsError` operation.
         341  +
/* RustType.kt:516 */
  321    342   
#[non_exhaustive]
         343  +
/* RustType.kt:516 */
  322    344   
#[derive(::std::fmt::Debug)]
  323         -
pub enum DatetimeOffsetsError {
         345  +
pub /* OperationErrorGenerator.kt:81 */ enum DatetimeOffsetsError {
         346  +
    /* OperationErrorGenerator.kt:88 */
  324    347   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  325    348   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  326    349   
    variable wildcard pattern and check `.code()`:
  327    350   
     \
  328    351   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  329    352   
     \
  330    353   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DatetimeOffsetsError) for what information is available for the error.")]
  331    354   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         355  +
    /* OperationErrorGenerator.kt:81 */
  332    356   
}
         357  +
/* OperationErrorGenerator.kt:218 */
  333    358   
impl DatetimeOffsetsError {
         359  +
    /* OperationErrorGenerator.kt:219 */
  334    360   
    /// Creates the `DatetimeOffsetsError::Unhandled` variant from any error type.
  335    361   
    pub fn unhandled(
  336    362   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  337    363   
    ) -> Self {
  338    364   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  339    365   
            source: err.into(),
  340    366   
            meta: ::std::default::Default::default(),
  341    367   
        })
  342    368   
    }
  343    369   
  344    370   
    /// Creates the `DatetimeOffsetsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  345    371   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  346    372   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  347    373   
            source: err.clone().into(),
  348    374   
            meta: err,
  349    375   
        })
  350    376   
    }
  351         -
    ///
         377  +
    /// /* OperationErrorGenerator.kt:236 */
  352    378   
    /// Returns error metadata, which includes the error code, message,
  353    379   
    /// request ID, and potentially additional information.
  354    380   
    ///
         381  +
    /* OperationErrorGenerator.kt:242 */
  355    382   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         383  +
        /* OperationErrorGenerator.kt:243 */
  356    384   
        match self {
  357         -
            Self::Unhandled(e) => &e.meta,
         385  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         386  +
            /* OperationErrorGenerator.kt:243 */
  358    387   
        }
         388  +
        /* OperationErrorGenerator.kt:242 */
  359    389   
    }
         390  +
    /* OperationErrorGenerator.kt:218 */
  360    391   
}
         392  +
/* OperationErrorGenerator.kt:269 */
  361    393   
impl ::std::error::Error for DatetimeOffsetsError {
         394  +
    /* OperationErrorGenerator.kt:270 */
  362    395   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         396  +
        /* OperationErrorGenerator.kt:318 */
  363    397   
        match self {
  364         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         398  +
            /* OperationErrorGenerator.kt:326 */
         399  +
            Self::Unhandled(_inner) => {
         400  +
                /* OperationErrorGenerator.kt:279 */
         401  +
                ::std::option::Option::Some(&*_inner.source)
         402  +
                /* OperationErrorGenerator.kt:326 */
         403  +
            } /* OperationErrorGenerator.kt:318 */
  365    404   
        }
         405  +
        /* OperationErrorGenerator.kt:270 */
  366    406   
    }
         407  +
    /* OperationErrorGenerator.kt:269 */
  367    408   
}
         409  +
/* OperationErrorGenerator.kt:133 */
  368    410   
impl ::std::fmt::Display for DatetimeOffsetsError {
         411  +
    /* OperationErrorGenerator.kt:134 */
  369    412   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         413  +
        /* OperationErrorGenerator.kt:318 */
  370    414   
        match self {
         415  +
            /* OperationErrorGenerator.kt:326 */
  371    416   
            Self::Unhandled(_inner) => {
         417  +
                /* OperationErrorGenerator.kt:139 */
  372    418   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  373    419   
                    write!(f, "unhandled error ({code})")
  374    420   
                } else {
  375    421   
                    f.write_str("unhandled error")
  376    422   
                }
  377         -
            }
         423  +
                /* OperationErrorGenerator.kt:326 */
         424  +
            } /* OperationErrorGenerator.kt:318 */
  378    425   
        }
         426  +
        /* OperationErrorGenerator.kt:134 */
  379    427   
    }
         428  +
    /* OperationErrorGenerator.kt:133 */
  380    429   
}
         430  +
/* OperationErrorGenerator.kt:182 */
  381    431   
impl ::aws_smithy_types::retry::ProvideErrorKind for DatetimeOffsetsError {
         432  +
    /* OperationErrorGenerator.kt:186 */
  382    433   
    fn code(&self) -> ::std::option::Option<&str> {
         434  +
        /* OperationErrorGenerator.kt:187 */
  383    435   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         436  +
        /* OperationErrorGenerator.kt:186 */
  384    437   
    }
         438  +
    /* OperationErrorGenerator.kt:190 */
  385    439   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         440  +
        /* OperationErrorGenerator.kt:197 */
  386    441   
        ::std::option::Option::None
         442  +
        /* OperationErrorGenerator.kt:190 */
  387    443   
    }
         444  +
    /* OperationErrorGenerator.kt:182 */
  388    445   
}
         446  +
/* OperationErrorGenerator.kt:163 */
  389    447   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DatetimeOffsetsError {
         448  +
    /* OperationErrorGenerator.kt:164 */
  390    449   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         450  +
        /* OperationErrorGenerator.kt:318 */
  391    451   
        match self {
  392         -
            Self::Unhandled(_inner) => &_inner.meta,
         452  +
            /* OperationErrorGenerator.kt:326 */
         453  +
            Self::Unhandled(_inner) => {
         454  +
                /* OperationErrorGenerator.kt:168 */
         455  +
                &_inner.meta
         456  +
                /* OperationErrorGenerator.kt:326 */
         457  +
            } /* OperationErrorGenerator.kt:318 */
  393    458   
        }
         459  +
        /* OperationErrorGenerator.kt:164 */
  394    460   
    }
         461  +
    /* OperationErrorGenerator.kt:163 */
  395    462   
}
         463  +
/* OperationErrorGenerator.kt:109 */
  396    464   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DatetimeOffsetsError {
         465  +
    /* OperationErrorGenerator.kt:110 */
  397    466   
    fn create_unhandled_error(
  398    467   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  399    468   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  400    469   
    ) -> Self {
         470  +
        /* OperationErrorGenerator.kt:121 */
  401    471   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  402    472   
            source,
  403    473   
            meta: meta.unwrap_or_default(),
  404    474   
        })
         475  +
        /* OperationErrorGenerator.kt:110 */
  405    476   
    }
         477  +
    /* OperationErrorGenerator.kt:109 */
  406    478   
}
  407    479   
         480  +
/* CodegenDelegator.kt:255 */
  408    481   
pub use crate::operation::datetime_offsets::_datetime_offsets_output::DatetimeOffsetsOutput;
  409    482   
         483  +
/* CodegenDelegator.kt:255 */
  410    484   
pub use crate::operation::datetime_offsets::_datetime_offsets_input::DatetimeOffsetsInput;
  411    485   
         486  +
/* RustModule.kt:172 */
  412    487   
mod _datetime_offsets_input;
  413    488   
         489  +
/* RustModule.kt:172 */
  414    490   
mod _datetime_offsets_output;
  415    491   
  416         -
/// Builders
         492  +
/// /* CodegenDelegator.kt:51 */Builders
  417    493   
pub mod builders;

tmp-codegen-diff/codegen-client-test/aws_query/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/aws_query/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 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/aws_query/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/aws_query/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 +268,285 @@
   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   
            "Query 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, "/").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 = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from(
  196    209   
            crate::protocol_serde::shape_empty_input_and_empty_output_input::ser_empty_input_and_empty_output_input_input_input(&input)?,
  197    210   
        );
  198    211   
  199    212   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  200    213   
    }
  201    214   
}
         215  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  202    216   
#[derive(Debug)]
  203    217   
struct EmptyInputAndEmptyOutputEndpointParamsInterceptor;
  204    218   
  205    219   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EmptyInputAndEmptyOutputEndpointParamsInterceptor {
  206    220   
    fn name(&self) -> &'static str {
  207    221   
        "EmptyInputAndEmptyOutputEndpointParamsInterceptor"
  208    222   
    }
  209    223   
  210    224   
    fn read_before_execution(
  211    225   
        &self,
  212    226   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  213    227   
            '_,
  214    228   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  216    230   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  217    231   
        >,
  218    232   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  219    233   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  220    234   
        let _input = context
  221    235   
            .input()
  222    236   
            .downcast_ref::<EmptyInputAndEmptyOutputInput>()
  223    237   
            .ok_or("failed to downcast to EmptyInputAndEmptyOutputInput")?;
  224    238   
  225    239   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  226    240   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  227    241   
        })?;
  228    242   
        cfg.interceptor_state()
  229    243   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  230    244   
        ::std::result::Result::Ok(())
  231    245   
    }
  232    246   
}
  233    247   
  234    248   
// The get_* functions below are generated from JMESPath expressions in the
  235    249   
// operationContextParams trait. They target the operation's input shape.
  236    250   
         251  +
/* RustType.kt:516 */
  237    252   
#[allow(unreachable_code, unused_variables)]
         253  +
/* RustType.kt:516 */
  238    254   
#[cfg(test)]
         255  +
/* ProtocolTestGenerator.kt:98 */
  239    256   
mod empty_input_and_empty_output_test {
  240    257   
  241    258   
    /// Empty input serializes no extra query params
  242    259   
    /// Test ID: QueryEmptyInputAndEmptyOutput
  243    260   
    #[::tokio::test]
  244    261   
    #[::tracing_test::traced_test]
  245    262   
    async fn query_empty_input_and_empty_output_request() {
  246    263   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  247    264   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  248    265   
@@ -273,290 +402,478 @@
  293    310   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  294    311   
                )))
  295    312   
            });
  296    313   
            de.deserialize_nonstreaming(&http_response)
  297    314   
        });
  298    315   
        let parsed = parsed
  299    316   
            .expect("should be successful response")
  300    317   
            .downcast::<crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput>()
  301    318   
            .unwrap();
  302    319   
    }
         320  +
         321  +
    /* ProtocolTestGenerator.kt:98 */
  303    322   
}
  304    323   
         324  +
/* OperationErrorGenerator.kt:79 */
  305    325   
/// Error type for the `EmptyInputAndEmptyOutputError` operation.
         326  +
/* RustType.kt:516 */
  306    327   
#[non_exhaustive]
         328  +
/* RustType.kt:516 */
  307    329   
#[derive(::std::fmt::Debug)]
  308         -
pub enum EmptyInputAndEmptyOutputError {
         330  +
pub /* OperationErrorGenerator.kt:81 */ enum EmptyInputAndEmptyOutputError {
         331  +
    /* OperationErrorGenerator.kt:88 */
  309    332   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  310    333   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  311    334   
    variable wildcard pattern and check `.code()`:
  312    335   
     \
  313    336   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  314    337   
     \
  315    338   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EmptyInputAndEmptyOutputError) for what information is available for the error.")]
  316    339   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         340  +
    /* OperationErrorGenerator.kt:81 */
  317    341   
}
         342  +
/* OperationErrorGenerator.kt:218 */
  318    343   
impl EmptyInputAndEmptyOutputError {
         344  +
    /* OperationErrorGenerator.kt:219 */
  319    345   
    /// Creates the `EmptyInputAndEmptyOutputError::Unhandled` variant from any error type.
  320    346   
    pub fn unhandled(
  321    347   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  322    348   
    ) -> Self {
  323    349   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  324    350   
            source: err.into(),
  325    351   
            meta: ::std::default::Default::default(),
  326    352   
        })
  327    353   
    }
  328    354   
  329    355   
    /// Creates the `EmptyInputAndEmptyOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  330    356   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  331    357   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  332    358   
            source: err.clone().into(),
  333    359   
            meta: err,
  334    360   
        })
  335    361   
    }
  336         -
    ///
         362  +
    /// /* OperationErrorGenerator.kt:236 */
  337    363   
    /// Returns error metadata, which includes the error code, message,
  338    364   
    /// request ID, and potentially additional information.
  339    365   
    ///
         366  +
    /* OperationErrorGenerator.kt:242 */
  340    367   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         368  +
        /* OperationErrorGenerator.kt:243 */
  341    369   
        match self {
  342         -
            Self::Unhandled(e) => &e.meta,
         370  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         371  +
            /* OperationErrorGenerator.kt:243 */
  343    372   
        }
         373  +
        /* OperationErrorGenerator.kt:242 */
  344    374   
    }
         375  +
    /* OperationErrorGenerator.kt:218 */
  345    376   
}
         377  +
/* OperationErrorGenerator.kt:269 */
  346    378   
impl ::std::error::Error for EmptyInputAndEmptyOutputError {
         379  +
    /* OperationErrorGenerator.kt:270 */
  347    380   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         381  +
        /* OperationErrorGenerator.kt:318 */
  348    382   
        match self {
  349         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         383  +
            /* OperationErrorGenerator.kt:326 */
         384  +
            Self::Unhandled(_inner) => {
         385  +
                /* OperationErrorGenerator.kt:279 */
         386  +
                ::std::option::Option::Some(&*_inner.source)
         387  +
                /* OperationErrorGenerator.kt:326 */
         388  +
            } /* OperationErrorGenerator.kt:318 */
  350    389   
        }
         390  +
        /* OperationErrorGenerator.kt:270 */
  351    391   
    }
         392  +
    /* OperationErrorGenerator.kt:269 */
  352    393   
}
         394  +
/* OperationErrorGenerator.kt:133 */
  353    395   
impl ::std::fmt::Display for EmptyInputAndEmptyOutputError {
         396  +
    /* OperationErrorGenerator.kt:134 */
  354    397   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         398  +
        /* OperationErrorGenerator.kt:318 */
  355    399   
        match self {
         400  +
            /* OperationErrorGenerator.kt:326 */
  356    401   
            Self::Unhandled(_inner) => {
         402  +
                /* OperationErrorGenerator.kt:139 */
  357    403   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  358    404   
                    write!(f, "unhandled error ({code})")
  359    405   
                } else {
  360    406   
                    f.write_str("unhandled error")
  361    407   
                }
  362         -
            }
         408  +
                /* OperationErrorGenerator.kt:326 */
         409  +
            } /* OperationErrorGenerator.kt:318 */
  363    410   
        }
         411  +
        /* OperationErrorGenerator.kt:134 */
  364    412   
    }
         413  +
    /* OperationErrorGenerator.kt:133 */
  365    414   
}
         415  +
/* OperationErrorGenerator.kt:182 */
  366    416   
impl ::aws_smithy_types::retry::ProvideErrorKind for EmptyInputAndEmptyOutputError {
         417  +
    /* OperationErrorGenerator.kt:186 */
  367    418   
    fn code(&self) -> ::std::option::Option<&str> {
         419  +
        /* OperationErrorGenerator.kt:187 */
  368    420   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         421  +
        /* OperationErrorGenerator.kt:186 */
  369    422   
    }
         423  +
    /* OperationErrorGenerator.kt:190 */
  370    424   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         425  +
        /* OperationErrorGenerator.kt:197 */
  371    426   
        ::std::option::Option::None
         427  +
        /* OperationErrorGenerator.kt:190 */
  372    428   
    }
         429  +
    /* OperationErrorGenerator.kt:182 */
  373    430   
}
         431  +
/* OperationErrorGenerator.kt:163 */
  374    432   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EmptyInputAndEmptyOutputError {
         433  +
    /* OperationErrorGenerator.kt:164 */
  375    434   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         435  +
        /* OperationErrorGenerator.kt:318 */
  376    436   
        match self {
  377         -
            Self::Unhandled(_inner) => &_inner.meta,
         437  +
            /* OperationErrorGenerator.kt:326 */
         438  +
            Self::Unhandled(_inner) => {
         439  +
                /* OperationErrorGenerator.kt:168 */
         440  +
                &_inner.meta
         441  +
                /* OperationErrorGenerator.kt:326 */
         442  +
            } /* OperationErrorGenerator.kt:318 */
  378    443   
        }
         444  +
        /* OperationErrorGenerator.kt:164 */
  379    445   
    }
         446  +
    /* OperationErrorGenerator.kt:163 */
  380    447   
}
         448  +
/* OperationErrorGenerator.kt:109 */
  381    449   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EmptyInputAndEmptyOutputError {
         450  +
    /* OperationErrorGenerator.kt:110 */
  382    451   
    fn create_unhandled_error(
  383    452   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  384    453   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  385    454   
    ) -> Self {
         455  +
        /* OperationErrorGenerator.kt:121 */
  386    456   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  387    457   
            source,
  388    458   
            meta: meta.unwrap_or_default(),
  389    459   
        })
         460  +
        /* OperationErrorGenerator.kt:110 */
  390    461   
    }
         462  +
    /* OperationErrorGenerator.kt:109 */
  391    463   
}
  392    464   
         465  +
/* CodegenDelegator.kt:255 */
  393    466   
pub use crate::operation::empty_input_and_empty_output::_empty_input_and_empty_output_output::EmptyInputAndEmptyOutputOutput;
  394    467   
         468  +
/* CodegenDelegator.kt:255 */
  395    469   
pub use crate::operation::empty_input_and_empty_output::_empty_input_and_empty_output_input::EmptyInputAndEmptyOutputInput;
  396    470   
         471  +
/* RustModule.kt:172 */
  397    472   
mod _empty_input_and_empty_output_input;
  398    473   
         474  +
/* RustModule.kt:172 */
  399    475   
mod _empty_input_and_empty_output_output;
  400    476   
  401         -
/// Builders
         477  +
/// /* CodegenDelegator.kt:51 */Builders
  402    478   
pub mod builders;

tmp-codegen-diff/codegen-client-test/aws_query/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/aws_query/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/aws_query/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 members. 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 members. 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/aws_query/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   
    > {
@@ -57,66 +365,441 @@
   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 EndpointOperation {
   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("EndpointOperation");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            EndpointOperationRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            EndpointOperationResponseDeserializer,
   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   
            "EndpointOperation",
  105    116   
            "Query 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("EndpointOperation")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(EndpointOperationEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::endpoint_operation::EndpointOperationError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::endpoint_operation::EndpointOperationError,
  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 EndpointOperationResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EndpointOperationResponseDeserializer {
  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_endpoint_operation::de_endpoint_operation_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_endpoint_operation::de_endpoint_operation_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 EndpointOperationRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EndpointOperationRequestSerializer {
  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::endpoint_operation::EndpointOperationInput>()
  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::endpoint_operation::EndpointOperationInput,
  170    183   
                output: &mut ::std::string::String,
  171    184   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172    185   
                use ::std::fmt::Write as _;
  173    186   
                ::std::write!(output, "/").expect("formatting should succeed");
  174    187   
                ::std::result::Result::Ok(())
  175    188   
            }
  176    189   
            #[allow(clippy::unnecessary_wraps)]
  177    190   
            fn update_http_builder(
  178    191   
                input: &crate::operation::endpoint_operation::EndpointOperationInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(
  190    203   
            crate::protocol_serde::shape_endpoint_operation_input::ser_endpoint_operation_input_input_input(&input)?,
  191    204   
        );
  192    205   
  193    206   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  194    207   
    }
  195    208   
}
         209  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  196    210   
#[derive(Debug)]
  197    211   
struct EndpointOperationEndpointParamsInterceptor;
  198    212   
  199    213   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EndpointOperationEndpointParamsInterceptor {
  200    214   
    fn name(&self) -> &'static str {
  201    215   
        "EndpointOperationEndpointParamsInterceptor"
  202    216   
    }
  203    217   
  204    218   
    fn read_before_execution(
  205    219   
        &self,
  206    220   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  207    221   
            '_,
  208    222   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  210    224   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  211    225   
        >,
  212    226   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  213    227   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  214    228   
        let _input = context
  215    229   
            .input()
  216    230   
            .downcast_ref::<EndpointOperationInput>()
  217    231   
            .ok_or("failed to downcast to EndpointOperationInput")?;
  218    232   
  219    233   
        let endpoint_prefix = ::aws_smithy_runtime_api::client::endpoint::EndpointPrefix::new("foo.").map_err(|err| {
  220    234   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint prefix could not be built", err)
  221    235   
        })?;
  222    236   
        cfg.interceptor_state().store_put(endpoint_prefix);
  223    237   
  224    238   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  225    239   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  226    240   
        })?;
  227    241   
        cfg.interceptor_state()
  228    242   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  229    243   
        ::std::result::Result::Ok(())
  230    244   
    }
  231    245   
}
  232    246   
  233    247   
// The get_* functions below are generated from JMESPath expressions in the
  234    248   
// operationContextParams trait. They target the operation's input shape.
  235    249   
         250  +
/* RustType.kt:516 */
  236    251   
#[allow(unreachable_code, unused_variables)]
         252  +
/* RustType.kt:516 */
  237    253   
#[cfg(test)]
         254  +
/* ProtocolTestGenerator.kt:98 */
  238    255   
mod endpoint_operation_test {
  239    256   
  240    257   
    /// Operations can prepend to the given host if they define the
  241    258   
    /// endpoint trait.
  242    259   
    /// Test ID: AwsQueryEndpointTrait
  243    260   
    #[::tokio::test]
  244    261   
    #[::tracing_test::traced_test]
  245    262   
    async fn aws_query_endpoint_trait_request() {
  246    263   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  247    264   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  248    265   
  249    266   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  250    267   
        let result = client.endpoint_operation().send().await;
  251    268   
        let _ = dbg!(result);
  252    269   
        let http_request = request_receiver.expect_request();
  253    270   
        let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
  254    271   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  255    272   
        let body = http_request.body().bytes().expect("body should be strict");
  256    273   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  257    274   
            body,
  258    275   
            "Action=EndpointOperation&Version=2020-01-08",
  259    276   
            ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
  260    277   
        ));
  261    278   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  262    279   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  263    280   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  264    281   
        ::pretty_assertions::assert_eq!(uri.host().expect("host should be set"), "foo.example.com");
  265    282   
    }
         283  +
         284  +
    /* ProtocolTestGenerator.kt:98 */
  266    285   
}
  267    286   
         287  +
/* OperationErrorGenerator.kt:79 */
  268    288   
/// Error type for the `EndpointOperationError` operation.
         289  +
/* RustType.kt:516 */
  269    290   
#[non_exhaustive]
         291  +
/* RustType.kt:516 */
  270    292   
#[derive(::std::fmt::Debug)]
  271         -
pub enum EndpointOperationError {
         293  +
pub /* OperationErrorGenerator.kt:81 */ enum EndpointOperationError {
         294  +
    /* OperationErrorGenerator.kt:88 */
  272    295   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  273    296   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  274    297   
    variable wildcard pattern and check `.code()`:
  275    298   
     \
  276    299   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  277    300   
     \
  278    301   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EndpointOperationError) for what information is available for the error.")]
  279    302   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         303  +
    /* OperationErrorGenerator.kt:81 */
  280    304   
}
         305  +
/* OperationErrorGenerator.kt:218 */
  281    306   
impl EndpointOperationError {
         307  +
    /* OperationErrorGenerator.kt:219 */
  282    308   
    /// Creates the `EndpointOperationError::Unhandled` variant from any error type.
  283    309   
    pub fn unhandled(
  284    310   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  285    311   
    ) -> Self {
  286    312   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  287    313   
            source: err.into(),
  288    314   
            meta: ::std::default::Default::default(),
  289    315   
        })
  290    316   
    }
  291    317   
  292    318   
    /// Creates the `EndpointOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  293    319   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  294    320   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  295    321   
            source: err.clone().into(),
  296    322   
            meta: err,
  297    323   
        })
  298    324   
    }
  299         -
    ///
         325  +
    /// /* OperationErrorGenerator.kt:236 */
  300    326   
    /// Returns error metadata, which includes the error code, message,
  301    327   
    /// request ID, and potentially additional information.
  302    328   
    ///
         329  +
    /* OperationErrorGenerator.kt:242 */
  303    330   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         331  +
        /* OperationErrorGenerator.kt:243 */
  304    332   
        match self {
  305         -
            Self::Unhandled(e) => &e.meta,
         333  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         334  +
            /* OperationErrorGenerator.kt:243 */
  306    335   
        }
         336  +
        /* OperationErrorGenerator.kt:242 */
  307    337   
    }
         338  +
    /* OperationErrorGenerator.kt:218 */
  308    339   
}
         340  +
/* OperationErrorGenerator.kt:269 */
  309    341   
impl ::std::error::Error for EndpointOperationError {
         342  +
    /* OperationErrorGenerator.kt:270 */
  310    343   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         344  +
        /* OperationErrorGenerator.kt:318 */
  311    345   
        match self {
  312         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         346  +
            /* OperationErrorGenerator.kt:326 */
         347  +
            Self::Unhandled(_inner) => {
         348  +
                /* OperationErrorGenerator.kt:279 */
         349  +
                ::std::option::Option::Some(&*_inner.source)
         350  +
                /* OperationErrorGenerator.kt:326 */
         351  +
            } /* OperationErrorGenerator.kt:318 */
  313    352   
        }
         353  +
        /* OperationErrorGenerator.kt:270 */
  314    354   
    }
         355  +
    /* OperationErrorGenerator.kt:269 */
  315    356   
}
         357  +
/* OperationErrorGenerator.kt:133 */
  316    358   
impl ::std::fmt::Display for EndpointOperationError {
         359  +
    /* OperationErrorGenerator.kt:134 */
  317    360   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         361  +
        /* OperationErrorGenerator.kt:318 */
  318    362   
        match self {
         363  +
            /* OperationErrorGenerator.kt:326 */
  319    364   
            Self::Unhandled(_inner) => {
         365  +
                /* OperationErrorGenerator.kt:139 */
  320    366   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  321    367   
                    write!(f, "unhandled error ({code})")
  322    368   
                } else {
  323    369   
                    f.write_str("unhandled error")
  324    370   
                }
  325         -
            }
         371  +
                /* OperationErrorGenerator.kt:326 */
         372  +
            } /* OperationErrorGenerator.kt:318 */
  326    373   
        }
         374  +
        /* OperationErrorGenerator.kt:134 */
  327    375   
    }
         376  +
    /* OperationErrorGenerator.kt:133 */
  328    377   
}
         378  +
/* OperationErrorGenerator.kt:182 */
  329    379   
impl ::aws_smithy_types::retry::ProvideErrorKind for EndpointOperationError {
         380  +
    /* OperationErrorGenerator.kt:186 */
  330    381   
    fn code(&self) -> ::std::option::Option<&str> {
         382  +
        /* OperationErrorGenerator.kt:187 */
  331    383   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         384  +
        /* OperationErrorGenerator.kt:186 */
  332    385   
    }
         386  +
    /* OperationErrorGenerator.kt:190 */
  333    387   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         388  +
        /* OperationErrorGenerator.kt:197 */
  334    389   
        ::std::option::Option::None
         390  +
        /* OperationErrorGenerator.kt:190 */
  335    391   
    }
         392  +
    /* OperationErrorGenerator.kt:182 */
  336    393   
}
         394  +
/* OperationErrorGenerator.kt:163 */
  337    395   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EndpointOperationError {
         396  +
    /* OperationErrorGenerator.kt:164 */
  338    397   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         398  +
        /* OperationErrorGenerator.kt:318 */
  339    399   
        match self {
  340         -
            Self::Unhandled(_inner) => &_inner.meta,
         400  +
            /* OperationErrorGenerator.kt:326 */
         401  +
            Self::Unhandled(_inner) => {
         402  +
                /* OperationErrorGenerator.kt:168 */
         403  +
                &_inner.meta
         404  +
                /* OperationErrorGenerator.kt:326 */
         405  +
            } /* OperationErrorGenerator.kt:318 */
  341    406   
        }
         407  +
        /* OperationErrorGenerator.kt:164 */
  342    408   
    }
         409  +
    /* OperationErrorGenerator.kt:163 */
  343    410   
}
         411  +
/* OperationErrorGenerator.kt:109 */
  344    412   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EndpointOperationError {
         413  +
    /* OperationErrorGenerator.kt:110 */
  345    414   
    fn create_unhandled_error(
  346    415   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  347    416   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  348    417   
    ) -> Self {
         418  +
        /* OperationErrorGenerator.kt:121 */
  349    419   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  350    420   
            source,
  351    421   
            meta: meta.unwrap_or_default(),
  352    422   
        })
         423  +
        /* OperationErrorGenerator.kt:110 */
  353    424   
    }
         425  +
    /* OperationErrorGenerator.kt:109 */
  354    426   
}
  355    427   
         428  +
/* CodegenDelegator.kt:255 */
  356    429   
pub use crate::operation::endpoint_operation::_endpoint_operation_output::EndpointOperationOutput;
  357    430   
         431  +
/* CodegenDelegator.kt:255 */
  358    432   
pub use crate::operation::endpoint_operation::_endpoint_operation_input::EndpointOperationInput;
  359    433   
         434  +
/* RustModule.kt:172 */
  360    435   
mod _endpoint_operation_input;
  361    436   
         437  +
/* RustModule.kt:172 */
  362    438   
mod _endpoint_operation_output;
  363    439   
  364         -
/// Builders
         440  +
/// /* CodegenDelegator.kt:51 */Builders
  365    441   
pub mod builders;

tmp-codegen-diff/codegen-client-test/aws_query/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/aws_query/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/aws_query/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/aws_query/rust-client-codegen/src/operation/endpoint_with_host_label_operation.rs

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

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

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