Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

tmp-codegen-diff/codegen-client-test/json_rpc11/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/json_rpc11/rust-client-codegen/src/operation/datetime_offsets/_datetime_offsets_output.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/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/json_rpc11/rust-client-codegen/src/operation/empty_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 `EmptyOperation`.
           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 EmptyOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EmptyOperation {
    7         -
    /// Creates a new `EmptyOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EmptyOperation`
          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_operation::EmptyOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::empty_operation::EmptyOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::empty_operation::EmptyOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +265,282 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for EmptyOperation {
   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("EmptyOperation");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            EmptyOperationRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            EmptyOperationResponseDeserializer,
   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   
            "EmptyOperation",
  105    116   
            "Json Protocol",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("EmptyOperation")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(EmptyOperationEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::empty_operation::EmptyOperationError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::empty_operation::EmptyOperationError,
  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 EmptyOperationResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EmptyOperationResponseDeserializer {
  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_empty_operation::de_empty_operation_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_empty_operation::de_empty_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 EmptyOperationRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EmptyOperationRequestSerializer {
  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::empty_operation::EmptyOperationInput>()
  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::empty_operation::EmptyOperationInput,
  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::empty_operation::EmptyOperationInput,
  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-amz-json-1.1");
  187    200   
            builder = _header_serialization_settings.set_default_header(
  188    201   
                builder,
  189    202   
                ::http::header::HeaderName::from_static("x-amz-target"),
  190    203   
                "JsonProtocol.EmptyOperation",
  191    204   
            );
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_empty_operation::ser_empty_operation_input(&input)?);
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct EmptyOperationEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EmptyOperationEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "EmptyOperationEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<EmptyOperationInput>()
  220    234   
            .ok_or("failed to downcast to EmptyOperationInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* RustType.kt:516 */
  234    249   
#[allow(unreachable_code, unused_variables)]
         250  +
/* RustType.kt:516 */
  235    251   
#[cfg(test)]
         252  +
/* ProtocolTestGenerator.kt:98 */
  236    253   
mod empty_operation_test {
  237    254   
  238    255   
    /// Sends requests to /
  239    256   
    /// Test ID: sends_requests_to_slash
  240    257   
    #[::tokio::test]
  241    258   
    #[::tracing_test::traced_test]
  242    259   
    async fn sends_requests_to_slash_request() {
  243    260   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  244    261   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  245    262   
@@ -411,428 +540,616 @@
  431    448   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  432    449   
                )))
  433    450   
            });
  434    451   
            de.deserialize_nonstreaming(&http_response)
  435    452   
        });
  436    453   
        let parsed = parsed
  437    454   
            .expect("should be successful response")
  438    455   
            .downcast::<crate::operation::empty_operation::EmptyOperationOutput>()
  439    456   
            .unwrap();
  440    457   
    }
         458  +
         459  +
    /* ProtocolTestGenerator.kt:98 */
  441    460   
}
  442    461   
         462  +
/* OperationErrorGenerator.kt:79 */
  443    463   
/// Error type for the `EmptyOperationError` operation.
         464  +
/* RustType.kt:516 */
  444    465   
#[non_exhaustive]
         466  +
/* RustType.kt:516 */
  445    467   
#[derive(::std::fmt::Debug)]
  446         -
pub enum EmptyOperationError {
         468  +
pub /* OperationErrorGenerator.kt:81 */ enum EmptyOperationError {
         469  +
    /* OperationErrorGenerator.kt:88 */
  447    470   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  448    471   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  449    472   
    variable wildcard pattern and check `.code()`:
  450    473   
     \
  451    474   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  452    475   
     \
  453    476   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EmptyOperationError) for what information is available for the error.")]
  454    477   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         478  +
    /* OperationErrorGenerator.kt:81 */
  455    479   
}
         480  +
/* OperationErrorGenerator.kt:218 */
  456    481   
impl EmptyOperationError {
         482  +
    /* OperationErrorGenerator.kt:219 */
  457    483   
    /// Creates the `EmptyOperationError::Unhandled` variant from any error type.
  458    484   
    pub fn unhandled(
  459    485   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  460    486   
    ) -> Self {
  461    487   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  462    488   
            source: err.into(),
  463    489   
            meta: ::std::default::Default::default(),
  464    490   
        })
  465    491   
    }
  466    492   
  467    493   
    /// Creates the `EmptyOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  468    494   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  469    495   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  470    496   
            source: err.clone().into(),
  471    497   
            meta: err,
  472    498   
        })
  473    499   
    }
  474         -
    ///
         500  +
    /// /* OperationErrorGenerator.kt:236 */
  475    501   
    /// Returns error metadata, which includes the error code, message,
  476    502   
    /// request ID, and potentially additional information.
  477    503   
    ///
         504  +
    /* OperationErrorGenerator.kt:242 */
  478    505   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         506  +
        /* OperationErrorGenerator.kt:243 */
  479    507   
        match self {
  480         -
            Self::Unhandled(e) => &e.meta,
         508  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         509  +
            /* OperationErrorGenerator.kt:243 */
  481    510   
        }
         511  +
        /* OperationErrorGenerator.kt:242 */
  482    512   
    }
         513  +
    /* OperationErrorGenerator.kt:218 */
  483    514   
}
         515  +
/* OperationErrorGenerator.kt:269 */
  484    516   
impl ::std::error::Error for EmptyOperationError {
         517  +
    /* OperationErrorGenerator.kt:270 */
  485    518   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         519  +
        /* OperationErrorGenerator.kt:318 */
  486    520   
        match self {
  487         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         521  +
            /* OperationErrorGenerator.kt:326 */
         522  +
            Self::Unhandled(_inner) => {
         523  +
                /* OperationErrorGenerator.kt:279 */
         524  +
                ::std::option::Option::Some(&*_inner.source)
         525  +
                /* OperationErrorGenerator.kt:326 */
         526  +
            } /* OperationErrorGenerator.kt:318 */
  488    527   
        }
         528  +
        /* OperationErrorGenerator.kt:270 */
  489    529   
    }
         530  +
    /* OperationErrorGenerator.kt:269 */
  490    531   
}
         532  +
/* OperationErrorGenerator.kt:133 */
  491    533   
impl ::std::fmt::Display for EmptyOperationError {
         534  +
    /* OperationErrorGenerator.kt:134 */
  492    535   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         536  +
        /* OperationErrorGenerator.kt:318 */
  493    537   
        match self {
         538  +
            /* OperationErrorGenerator.kt:326 */
  494    539   
            Self::Unhandled(_inner) => {
         540  +
                /* OperationErrorGenerator.kt:139 */
  495    541   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  496    542   
                    write!(f, "unhandled error ({code})")
  497    543   
                } else {
  498    544   
                    f.write_str("unhandled error")
  499    545   
                }
         546  +
                /* OperationErrorGenerator.kt:326 */
         547  +
            } /* OperationErrorGenerator.kt:318 */
  500    548   
        }
         549  +
        /* OperationErrorGenerator.kt:134 */
  501    550   
    }
  502         -
    }
         551  +
    /* OperationErrorGenerator.kt:133 */
  503    552   
}
         553  +
/* OperationErrorGenerator.kt:182 */
  504    554   
impl ::aws_smithy_types::retry::ProvideErrorKind for EmptyOperationError {
         555  +
    /* OperationErrorGenerator.kt:186 */
  505    556   
    fn code(&self) -> ::std::option::Option<&str> {
         557  +
        /* OperationErrorGenerator.kt:187 */
  506    558   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         559  +
        /* OperationErrorGenerator.kt:186 */
  507    560   
    }
         561  +
    /* OperationErrorGenerator.kt:190 */
  508    562   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         563  +
        /* OperationErrorGenerator.kt:197 */
  509    564   
        ::std::option::Option::None
         565  +
        /* OperationErrorGenerator.kt:190 */
  510    566   
    }
         567  +
    /* OperationErrorGenerator.kt:182 */
  511    568   
}
         569  +
/* OperationErrorGenerator.kt:163 */
  512    570   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EmptyOperationError {
         571  +
    /* OperationErrorGenerator.kt:164 */
  513    572   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         573  +
        /* OperationErrorGenerator.kt:318 */
  514    574   
        match self {
  515         -
            Self::Unhandled(_inner) => &_inner.meta,
         575  +
            /* OperationErrorGenerator.kt:326 */
         576  +
            Self::Unhandled(_inner) => {
         577  +
                /* OperationErrorGenerator.kt:168 */
         578  +
                &_inner.meta
         579  +
                /* OperationErrorGenerator.kt:326 */
         580  +
            } /* OperationErrorGenerator.kt:318 */
  516    581   
        }
         582  +
        /* OperationErrorGenerator.kt:164 */
  517    583   
    }
         584  +
    /* OperationErrorGenerator.kt:163 */
  518    585   
}
         586  +
/* OperationErrorGenerator.kt:109 */
  519    587   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EmptyOperationError {
         588  +
    /* OperationErrorGenerator.kt:110 */
  520    589   
    fn create_unhandled_error(
  521    590   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  522    591   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  523    592   
    ) -> Self {
         593  +
        /* OperationErrorGenerator.kt:121 */
  524    594   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  525    595   
            source,
  526    596   
            meta: meta.unwrap_or_default(),
  527    597   
        })
         598  +
        /* OperationErrorGenerator.kt:110 */
  528    599   
    }
         600  +
    /* OperationErrorGenerator.kt:109 */
  529    601   
}
  530    602   
         603  +
/* CodegenDelegator.kt:255 */
  531    604   
pub use crate::operation::empty_operation::_empty_operation_output::EmptyOperationOutput;
  532    605   
         606  +
/* CodegenDelegator.kt:255 */
  533    607   
pub use crate::operation::empty_operation::_empty_operation_input::EmptyOperationInput;
  534    608   
         609  +
/* RustModule.kt:172 */
  535    610   
mod _empty_operation_input;
  536    611   
         612  +
/* RustModule.kt:172 */
  537    613   
mod _empty_operation_output;
  538    614   
  539         -
/// Builders
         615  +
/// /* CodegenDelegator.kt:51 */Builders
  540    616   
pub mod builders;

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/empty_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::empty_operation::_empty_operation_output::EmptyOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::empty_operation::_empty_operation_input::EmptyOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::empty_operation::builders::EmptyOperationInputBuilder {
    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_operation::EmptyOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::empty_operation::EmptyOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.empty_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `EmptyOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `EmptyOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct EmptyOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::empty_operation::builders::EmptyOperationInputBuilder,
   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::empty_operation::EmptyOperationOutput,
   34     40   
        crate::operation::empty_operation::EmptyOperationError,
   35     41   
    > for EmptyOperationFluentBuilder
   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::empty_operation::EmptyOperationOutput,
   43     49   
            crate::operation::empty_operation::EmptyOperationError,
   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 EmptyOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `EmptyOperationFluentBuilder`.
   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 EmptyOperation as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::empty_operation::builders::EmptyOperationInputBuilder {
   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::empty_operation::EmptyOperationOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::empty_operation::EmptyOperationError,
   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::empty_operation::EmptyOperation::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::empty_operation::EmptyOperation::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::empty_operation::EmptyOperationOutput,
   96    106   
        crate::operation::empty_operation::EmptyOperationError,
   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/json_rpc11/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 +371,447 @@
   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   
            "Json Protocol",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("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-amz-json-1.1");
  187    200   
            builder = _header_serialization_settings.set_default_header(
  188    201   
                builder,
  189    202   
                ::http::header::HeaderName::from_static("x-amz-target"),
  190    203   
                "JsonProtocol.EndpointOperation",
  191    204   
            );
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_endpoint_operation::ser_endpoint_operation_input(&input)?);
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct EndpointOperationEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EndpointOperationEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "EndpointOperationEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<EndpointOperationInput>()
  220    234   
            .ok_or("failed to downcast to EndpointOperationInput")?;
  221    235   
  222    236   
        let endpoint_prefix = ::aws_smithy_runtime_api::client::endpoint::EndpointPrefix::new("foo.").map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint prefix could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state().store_put(endpoint_prefix);
  226    240   
  227    241   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  228    242   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  229    243   
        })?;
  230    244   
        cfg.interceptor_state()
  231    245   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  232    246   
        ::std::result::Result::Ok(())
  233    247   
    }
  234    248   
}
  235    249   
  236    250   
// The get_* functions below are generated from JMESPath expressions in the
  237    251   
// operationContextParams trait. They target the operation's input shape.
  238    252   
         253  +
/* RustType.kt:516 */
  239    254   
#[allow(unreachable_code, unused_variables)]
         255  +
/* RustType.kt:516 */
  240    256   
#[cfg(test)]
         257  +
/* ProtocolTestGenerator.kt:98 */
  241    258   
mod endpoint_operation_test {
  242    259   
  243    260   
    /// Operations can prepend to the given host if they define the
  244    261   
    /// endpoint trait.
  245    262   
    /// Test ID: AwsJson11EndpointTrait
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn aws_json11_endpoint_trait_request() {
  249    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    267   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  251    268   
  252    269   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  253    270   
        let result = client.endpoint_operation().send().await;
  254    271   
        let _ = dbg!(result);
  255    272   
        let http_request = request_receiver.expect_request();
  256    273   
        let expected_headers = [
  257    274   
            ("Content-Type", "application/x-amz-json-1.1"),
  258    275   
            ("X-Amz-Target", "JsonProtocol.EndpointOperation"),
  259    276   
        ];
  260    277   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  261    278   
        let body = http_request.body().bytes().expect("body should be strict");
  262    279   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  263    280   
            body,
  264    281   
            "{}",
  265    282   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  266    283   
        ));
  267    284   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  268    285   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  269    286   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  270    287   
        ::pretty_assertions::assert_eq!(uri.host().expect("host should be set"), "foo.example.com");
  271    288   
    }
         289  +
         290  +
    /* ProtocolTestGenerator.kt:98 */
  272    291   
}
  273    292   
         293  +
/* OperationErrorGenerator.kt:79 */
  274    294   
/// Error type for the `EndpointOperationError` operation.
         295  +
/* RustType.kt:516 */
  275    296   
#[non_exhaustive]
         297  +
/* RustType.kt:516 */
  276    298   
#[derive(::std::fmt::Debug)]
  277         -
pub enum EndpointOperationError {
         299  +
pub /* OperationErrorGenerator.kt:81 */ enum EndpointOperationError {
         300  +
    /* OperationErrorGenerator.kt:88 */
  278    301   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  279    302   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  280    303   
    variable wildcard pattern and check `.code()`:
  281    304   
     \
  282    305   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  283    306   
     \
  284    307   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EndpointOperationError) for what information is available for the error.")]
  285    308   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         309  +
    /* OperationErrorGenerator.kt:81 */
  286    310   
}
         311  +
/* OperationErrorGenerator.kt:218 */
  287    312   
impl EndpointOperationError {
         313  +
    /* OperationErrorGenerator.kt:219 */
  288    314   
    /// Creates the `EndpointOperationError::Unhandled` variant from any error type.
  289    315   
    pub fn unhandled(
  290    316   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  291    317   
    ) -> Self {
  292    318   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  293    319   
            source: err.into(),
  294    320   
            meta: ::std::default::Default::default(),
  295    321   
        })
  296    322   
    }
  297    323   
  298    324   
    /// Creates the `EndpointOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  299    325   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  300    326   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  301    327   
            source: err.clone().into(),
  302    328   
            meta: err,
  303    329   
        })
  304    330   
    }
  305         -
    ///
         331  +
    /// /* OperationErrorGenerator.kt:236 */
  306    332   
    /// Returns error metadata, which includes the error code, message,
  307    333   
    /// request ID, and potentially additional information.
  308    334   
    ///
         335  +
    /* OperationErrorGenerator.kt:242 */
  309    336   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         337  +
        /* OperationErrorGenerator.kt:243 */
  310    338   
        match self {
  311         -
            Self::Unhandled(e) => &e.meta,
         339  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         340  +
            /* OperationErrorGenerator.kt:243 */
  312    341   
        }
         342  +
        /* OperationErrorGenerator.kt:242 */
  313    343   
    }
         344  +
    /* OperationErrorGenerator.kt:218 */
  314    345   
}
         346  +
/* OperationErrorGenerator.kt:269 */
  315    347   
impl ::std::error::Error for EndpointOperationError {
         348  +
    /* OperationErrorGenerator.kt:270 */
  316    349   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         350  +
        /* OperationErrorGenerator.kt:318 */
  317    351   
        match self {
  318         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         352  +
            /* OperationErrorGenerator.kt:326 */
         353  +
            Self::Unhandled(_inner) => {
         354  +
                /* OperationErrorGenerator.kt:279 */
         355  +
                ::std::option::Option::Some(&*_inner.source)
         356  +
                /* OperationErrorGenerator.kt:326 */
         357  +
            } /* OperationErrorGenerator.kt:318 */
  319    358   
        }
         359  +
        /* OperationErrorGenerator.kt:270 */
  320    360   
    }
         361  +
    /* OperationErrorGenerator.kt:269 */
  321    362   
}
         363  +
/* OperationErrorGenerator.kt:133 */
  322    364   
impl ::std::fmt::Display for EndpointOperationError {
         365  +
    /* OperationErrorGenerator.kt:134 */
  323    366   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         367  +
        /* OperationErrorGenerator.kt:318 */
  324    368   
        match self {
         369  +
            /* OperationErrorGenerator.kt:326 */
  325    370   
            Self::Unhandled(_inner) => {
         371  +
                /* OperationErrorGenerator.kt:139 */
  326    372   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  327    373   
                    write!(f, "unhandled error ({code})")
  328    374   
                } else {
  329    375   
                    f.write_str("unhandled error")
  330    376   
                }
         377  +
                /* OperationErrorGenerator.kt:326 */
         378  +
            } /* OperationErrorGenerator.kt:318 */
  331    379   
        }
         380  +
        /* OperationErrorGenerator.kt:134 */
  332    381   
    }
  333         -
    }
         382  +
    /* OperationErrorGenerator.kt:133 */
  334    383   
}
         384  +
/* OperationErrorGenerator.kt:182 */
  335    385   
impl ::aws_smithy_types::retry::ProvideErrorKind for EndpointOperationError {
         386  +
    /* OperationErrorGenerator.kt:186 */
  336    387   
    fn code(&self) -> ::std::option::Option<&str> {
         388  +
        /* OperationErrorGenerator.kt:187 */
  337    389   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         390  +
        /* OperationErrorGenerator.kt:186 */
  338    391   
    }
         392  +
    /* OperationErrorGenerator.kt:190 */
  339    393   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         394  +
        /* OperationErrorGenerator.kt:197 */
  340    395   
        ::std::option::Option::None
         396  +
        /* OperationErrorGenerator.kt:190 */
  341    397   
    }
         398  +
    /* OperationErrorGenerator.kt:182 */
  342    399   
}
         400  +
/* OperationErrorGenerator.kt:163 */
  343    401   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EndpointOperationError {
         402  +
    /* OperationErrorGenerator.kt:164 */
  344    403   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         404  +
        /* OperationErrorGenerator.kt:318 */
  345    405   
        match self {
  346         -
            Self::Unhandled(_inner) => &_inner.meta,
         406  +
            /* OperationErrorGenerator.kt:326 */
         407  +
            Self::Unhandled(_inner) => {
         408  +
                /* OperationErrorGenerator.kt:168 */
         409  +
                &_inner.meta
         410  +
                /* OperationErrorGenerator.kt:326 */
         411  +
            } /* OperationErrorGenerator.kt:318 */
  347    412   
        }
         413  +
        /* OperationErrorGenerator.kt:164 */
  348    414   
    }
         415  +
    /* OperationErrorGenerator.kt:163 */
  349    416   
}
         417  +
/* OperationErrorGenerator.kt:109 */
  350    418   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EndpointOperationError {
         419  +
    /* OperationErrorGenerator.kt:110 */
  351    420   
    fn create_unhandled_error(
  352    421   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  353    422   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  354    423   
    ) -> Self {
         424  +
        /* OperationErrorGenerator.kt:121 */
  355    425   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  356    426   
            source,
  357    427   
            meta: meta.unwrap_or_default(),
  358    428   
        })
         429  +
        /* OperationErrorGenerator.kt:110 */
  359    430   
    }
         431  +
    /* OperationErrorGenerator.kt:109 */
  360    432   
}
  361    433   
         434  +
/* CodegenDelegator.kt:255 */
  362    435   
pub use crate::operation::endpoint_operation::_endpoint_operation_output::EndpointOperationOutput;
  363    436   
         437  +
/* CodegenDelegator.kt:255 */
  364    438   
pub use crate::operation::endpoint_operation::_endpoint_operation_input::EndpointOperationInput;
  365    439   
         440  +
/* RustModule.kt:172 */
  366    441   
mod _endpoint_operation_input;
  367    442   
         443  +
/* RustModule.kt:172 */
  368    444   
mod _endpoint_operation_output;
  369    445   
  370         -
/// Builders
         446  +
/// /* CodegenDelegator.kt:51 */Builders
  371    447   
pub mod builders;

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

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

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

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

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/endpoint_with_host_label_operation/builders.rs

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