Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

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

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

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/empty_input_and_empty_output/_empty_input_and_empty_output_output.rs

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

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

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

tmp-codegen-diff/codegen-client-test/json_rpc10/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 +366,442 @@
   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 RPC 10",
  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.0");
  187    200   
            builder = _header_serialization_settings.set_default_header(
  188    201   
                builder,
  189    202   
                ::http::header::HeaderName::from_static("x-amz-target"),
  190    203   
                "JsonRpc10.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: AwsJson10EndpointTrait
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn aws_json10_endpoint_trait_request() {
  249    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    267   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  251    268   
  252    269   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  253    270   
        let result = client.endpoint_operation().send().await;
  254    271   
        let _ = dbg!(result);
  255    272   
        let http_request = request_receiver.expect_request();
  256    273   
        let body = http_request.body().bytes().expect("body should be strict");
  257    274   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  258    275   
            body,
  259    276   
            "{}",
  260    277   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  261    278   
        ));
  262    279   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  263    280   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  264    281   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  265    282   
        ::pretty_assertions::assert_eq!(uri.host().expect("host should be set"), "foo.example.com");
  266    283   
    }
         284  +
         285  +
    /* ProtocolTestGenerator.kt:98 */
  267    286   
}
  268    287   
         288  +
/* OperationErrorGenerator.kt:79 */
  269    289   
/// Error type for the `EndpointOperationError` operation.
         290  +
/* RustType.kt:516 */
  270    291   
#[non_exhaustive]
         292  +
/* RustType.kt:516 */
  271    293   
#[derive(::std::fmt::Debug)]
  272         -
pub enum EndpointOperationError {
         294  +
pub /* OperationErrorGenerator.kt:81 */ enum EndpointOperationError {
         295  +
    /* OperationErrorGenerator.kt:88 */
  273    296   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  274    297   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  275    298   
    variable wildcard pattern and check `.code()`:
  276    299   
     \
  277    300   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  278    301   
     \
  279    302   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EndpointOperationError) for what information is available for the error.")]
  280    303   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         304  +
    /* OperationErrorGenerator.kt:81 */
  281    305   
}
         306  +
/* OperationErrorGenerator.kt:218 */
  282    307   
impl EndpointOperationError {
         308  +
    /* OperationErrorGenerator.kt:219 */
  283    309   
    /// Creates the `EndpointOperationError::Unhandled` variant from any error type.
  284    310   
    pub fn unhandled(
  285    311   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  286    312   
    ) -> Self {
  287    313   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  288    314   
            source: err.into(),
  289    315   
            meta: ::std::default::Default::default(),
  290    316   
        })
  291    317   
    }
  292    318   
  293    319   
    /// Creates the `EndpointOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  294    320   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  295    321   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  296    322   
            source: err.clone().into(),
  297    323   
            meta: err,
  298    324   
        })
  299    325   
    }
  300         -
    ///
         326  +
    /// /* OperationErrorGenerator.kt:236 */
  301    327   
    /// Returns error metadata, which includes the error code, message,
  302    328   
    /// request ID, and potentially additional information.
  303    329   
    ///
         330  +
    /* OperationErrorGenerator.kt:242 */
  304    331   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         332  +
        /* OperationErrorGenerator.kt:243 */
  305    333   
        match self {
  306         -
            Self::Unhandled(e) => &e.meta,
         334  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         335  +
            /* OperationErrorGenerator.kt:243 */
  307    336   
        }
         337  +
        /* OperationErrorGenerator.kt:242 */
  308    338   
    }
         339  +
    /* OperationErrorGenerator.kt:218 */
  309    340   
}
         341  +
/* OperationErrorGenerator.kt:269 */
  310    342   
impl ::std::error::Error for EndpointOperationError {
         343  +
    /* OperationErrorGenerator.kt:270 */
  311    344   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         345  +
        /* OperationErrorGenerator.kt:318 */
  312    346   
        match self {
  313         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         347  +
            /* OperationErrorGenerator.kt:326 */
         348  +
            Self::Unhandled(_inner) => {
         349  +
                /* OperationErrorGenerator.kt:279 */
         350  +
                ::std::option::Option::Some(&*_inner.source)
         351  +
                /* OperationErrorGenerator.kt:326 */
         352  +
            } /* OperationErrorGenerator.kt:318 */
  314    353   
        }
         354  +
        /* OperationErrorGenerator.kt:270 */
  315    355   
    }
         356  +
    /* OperationErrorGenerator.kt:269 */
  316    357   
}
         358  +
/* OperationErrorGenerator.kt:133 */
  317    359   
impl ::std::fmt::Display for EndpointOperationError {
         360  +
    /* OperationErrorGenerator.kt:134 */
  318    361   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         362  +
        /* OperationErrorGenerator.kt:318 */
  319    363   
        match self {
         364  +
            /* OperationErrorGenerator.kt:326 */
  320    365   
            Self::Unhandled(_inner) => {
         366  +
                /* OperationErrorGenerator.kt:139 */
  321    367   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  322    368   
                    write!(f, "unhandled error ({code})")
  323    369   
                } else {
  324    370   
                    f.write_str("unhandled error")
  325    371   
                }
  326         -
            }
         372  +
                /* OperationErrorGenerator.kt:326 */
         373  +
            } /* OperationErrorGenerator.kt:318 */
  327    374   
        }
         375  +
        /* OperationErrorGenerator.kt:134 */
  328    376   
    }
         377  +
    /* OperationErrorGenerator.kt:133 */
  329    378   
}
         379  +
/* OperationErrorGenerator.kt:182 */
  330    380   
impl ::aws_smithy_types::retry::ProvideErrorKind for EndpointOperationError {
         381  +
    /* OperationErrorGenerator.kt:186 */
  331    382   
    fn code(&self) -> ::std::option::Option<&str> {
         383  +
        /* OperationErrorGenerator.kt:187 */
  332    384   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         385  +
        /* OperationErrorGenerator.kt:186 */
  333    386   
    }
         387  +
    /* OperationErrorGenerator.kt:190 */
  334    388   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         389  +
        /* OperationErrorGenerator.kt:197 */
  335    390   
        ::std::option::Option::None
         391  +
        /* OperationErrorGenerator.kt:190 */
  336    392   
    }
         393  +
    /* OperationErrorGenerator.kt:182 */
  337    394   
}
         395  +
/* OperationErrorGenerator.kt:163 */
  338    396   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EndpointOperationError {
         397  +
    /* OperationErrorGenerator.kt:164 */
  339    398   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         399  +
        /* OperationErrorGenerator.kt:318 */
  340    400   
        match self {
  341         -
            Self::Unhandled(_inner) => &_inner.meta,
         401  +
            /* OperationErrorGenerator.kt:326 */
         402  +
            Self::Unhandled(_inner) => {
         403  +
                /* OperationErrorGenerator.kt:168 */
         404  +
                &_inner.meta
         405  +
                /* OperationErrorGenerator.kt:326 */
         406  +
            } /* OperationErrorGenerator.kt:318 */
  342    407   
        }
         408  +
        /* OperationErrorGenerator.kt:164 */
  343    409   
    }
         410  +
    /* OperationErrorGenerator.kt:163 */
  344    411   
}
         412  +
/* OperationErrorGenerator.kt:109 */
  345    413   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EndpointOperationError {
         414  +
    /* OperationErrorGenerator.kt:110 */
  346    415   
    fn create_unhandled_error(
  347    416   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  348    417   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  349    418   
    ) -> Self {
         419  +
        /* OperationErrorGenerator.kt:121 */
  350    420   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  351    421   
            source,
  352    422   
            meta: meta.unwrap_or_default(),
  353    423   
        })
         424  +
        /* OperationErrorGenerator.kt:110 */
  354    425   
    }
         426  +
    /* OperationErrorGenerator.kt:109 */
  355    427   
}
  356    428   
         429  +
/* CodegenDelegator.kt:255 */
  357    430   
pub use crate::operation::endpoint_operation::_endpoint_operation_output::EndpointOperationOutput;
  358    431   
         432  +
/* CodegenDelegator.kt:255 */
  359    433   
pub use crate::operation::endpoint_operation::_endpoint_operation_input::EndpointOperationInput;
  360    434   
         435  +
/* RustModule.kt:172 */
  361    436   
mod _endpoint_operation_input;
  362    437   
         438  +
/* RustModule.kt:172 */
  363    439   
mod _endpoint_operation_output;
  364    440   
  365         -
/// Builders
         441  +
/// /* CodegenDelegator.kt:51 */Builders
  366    442   
pub mod builders;

tmp-codegen-diff/codegen-client-test/json_rpc10/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_rpc10/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_rpc10/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_rpc10/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 +394,470 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for 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 RPC 10",
  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.0");
  195    208   
            builder = _header_serialization_settings.set_default_header(
  196    209   
                builder,
  197    210   
                ::http::header::HeaderName::from_static("x-amz-target"),
  198    211   
                "JsonRpc10.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: AwsJson10EndpointTraitWithHostLabel
  270    287   
    #[::tokio::test]
  271    288   
    #[::tracing_test::traced_test]
  272    289   
    async fn aws_json10_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 body = http_request.body().bytes().expect("body should be strict");
  285    302   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  286    303   
            body,
  287    304   
            "{\"label\": \"bar\"}",
  288    305   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  289    306   
        ));
  290    307   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  291    308   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  292    309   
        ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
  293    310   
        ::pretty_assertions::assert_eq!(uri.host().expect("host should be set"), "foo.bar.example.com");
  294    311   
    }
         312  +
         313  +
    /* ProtocolTestGenerator.kt:98 */
  295    314   
}
  296    315   
         316  +
/* OperationErrorGenerator.kt:79 */
  297    317   
/// Error type for the `EndpointWithHostLabelOperationError` operation.
         318  +
/* RustType.kt:516 */
  298    319   
#[non_exhaustive]
         320  +
/* RustType.kt:516 */
  299    321   
#[derive(::std::fmt::Debug)]
  300         -
pub enum EndpointWithHostLabelOperationError {
         322  +
pub /* OperationErrorGenerator.kt:81 */ enum EndpointWithHostLabelOperationError {
         323  +
    /* OperationErrorGenerator.kt:88 */
  301    324   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  302    325   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  303    326   
    variable wildcard pattern and check `.code()`:
  304    327   
     \
  305    328   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  306    329   
     \
  307    330   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EndpointWithHostLabelOperationError) for what information is available for the error.")]
  308    331   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         332  +
    /* OperationErrorGenerator.kt:81 */
  309    333   
}
         334  +
/* OperationErrorGenerator.kt:218 */
  310    335   
impl EndpointWithHostLabelOperationError {
         336  +
    /* OperationErrorGenerator.kt:219 */
  311    337   
    /// Creates the `EndpointWithHostLabelOperationError::Unhandled` variant from any error type.
  312    338   
    pub fn unhandled(
  313    339   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  314    340   
    ) -> Self {
  315    341   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  316    342   
            source: err.into(),
  317    343   
            meta: ::std::default::Default::default(),
  318    344   
        })
  319    345   
    }
  320    346   
  321    347   
    /// Creates the `EndpointWithHostLabelOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  322    348   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  323    349   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  324    350   
            source: err.clone().into(),
  325    351   
            meta: err,
  326    352   
        })
  327    353   
    }
  328         -
    ///
         354  +
    /// /* OperationErrorGenerator.kt:236 */
  329    355   
    /// Returns error metadata, which includes the error code, message,
  330    356   
    /// request ID, and potentially additional information.
  331    357   
    ///
         358  +
    /* OperationErrorGenerator.kt:242 */
  332    359   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         360  +
        /* OperationErrorGenerator.kt:243 */
  333    361   
        match self {
  334         -
            Self::Unhandled(e) => &e.meta,
         362  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         363  +
            /* OperationErrorGenerator.kt:243 */
  335    364   
        }
         365  +
        /* OperationErrorGenerator.kt:242 */
  336    366   
    }
         367  +
    /* OperationErrorGenerator.kt:218 */
  337    368   
}
         369  +
/* OperationErrorGenerator.kt:269 */
  338    370   
impl ::std::error::Error for EndpointWithHostLabelOperationError {
         371  +
    /* OperationErrorGenerator.kt:270 */
  339    372   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         373  +
        /* OperationErrorGenerator.kt:318 */
  340    374   
        match self {
  341         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         375  +
            /* OperationErrorGenerator.kt:326 */
         376  +
            Self::Unhandled(_inner) => {
         377  +
                /* OperationErrorGenerator.kt:279 */
         378  +
                ::std::option::Option::Some(&*_inner.source)
         379  +
                /* OperationErrorGenerator.kt:326 */
         380  +
            } /* OperationErrorGenerator.kt:318 */
  342    381   
        }
         382  +
        /* OperationErrorGenerator.kt:270 */
  343    383   
    }
         384  +
    /* OperationErrorGenerator.kt:269 */
  344    385   
}
         386  +
/* OperationErrorGenerator.kt:133 */
  345    387   
impl ::std::fmt::Display for EndpointWithHostLabelOperationError {
         388  +
    /* OperationErrorGenerator.kt:134 */
  346    389   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         390  +
        /* OperationErrorGenerator.kt:318 */
  347    391   
        match self {
         392  +
            /* OperationErrorGenerator.kt:326 */
  348    393   
            Self::Unhandled(_inner) => {
         394  +
                /* OperationErrorGenerator.kt:139 */
  349    395   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  350    396   
                    write!(f, "unhandled error ({code})")
  351    397   
                } else {
  352    398   
                    f.write_str("unhandled error")
  353    399   
                }
  354         -
            }
         400  +
                /* OperationErrorGenerator.kt:326 */
         401  +
            } /* OperationErrorGenerator.kt:318 */
  355    402   
        }
         403  +
        /* OperationErrorGenerator.kt:134 */
  356    404   
    }
         405  +
    /* OperationErrorGenerator.kt:133 */
  357    406   
}
         407  +
/* OperationErrorGenerator.kt:182 */
  358    408   
impl ::aws_smithy_types::retry::ProvideErrorKind for EndpointWithHostLabelOperationError {
         409  +
    /* OperationErrorGenerator.kt:186 */
  359    410   
    fn code(&self) -> ::std::option::Option<&str> {
         411  +
        /* OperationErrorGenerator.kt:187 */
  360    412   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         413  +
        /* OperationErrorGenerator.kt:186 */
  361    414   
    }
         415  +
    /* OperationErrorGenerator.kt:190 */
  362    416   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         417  +
        /* OperationErrorGenerator.kt:197 */
  363    418   
        ::std::option::Option::None
         419  +
        /* OperationErrorGenerator.kt:190 */
  364    420   
    }
         421  +
    /* OperationErrorGenerator.kt:182 */
  365    422   
}
         423  +
/* OperationErrorGenerator.kt:163 */
  366    424   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EndpointWithHostLabelOperationError {
         425  +
    /* OperationErrorGenerator.kt:164 */
  367    426   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         427  +
        /* OperationErrorGenerator.kt:318 */
  368    428   
        match self {
  369         -
            Self::Unhandled(_inner) => &_inner.meta,
         429  +
            /* OperationErrorGenerator.kt:326 */
         430  +
            Self::Unhandled(_inner) => {
         431  +
                /* OperationErrorGenerator.kt:168 */
         432  +
                &_inner.meta
         433  +
                /* OperationErrorGenerator.kt:326 */
         434  +
            } /* OperationErrorGenerator.kt:318 */
  370    435   
        }
         436  +
        /* OperationErrorGenerator.kt:164 */
  371    437   
    }
         438  +
    /* OperationErrorGenerator.kt:163 */
  372    439   
}
         440  +
/* OperationErrorGenerator.kt:109 */
  373    441   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EndpointWithHostLabelOperationError {
         442  +
    /* OperationErrorGenerator.kt:110 */
  374    443   
    fn create_unhandled_error(
  375    444   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  376    445   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  377    446   
    ) -> Self {
         447  +
        /* OperationErrorGenerator.kt:121 */
  378    448   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  379    449   
            source,
  380    450   
            meta: meta.unwrap_or_default(),
  381    451   
        })
         452  +
        /* OperationErrorGenerator.kt:110 */
  382    453   
    }
         454  +
    /* OperationErrorGenerator.kt:109 */
  383    455   
}
  384    456   
         457  +
/* CodegenDelegator.kt:255 */
  385    458   
pub use crate::operation::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_output::EndpointWithHostLabelOperationOutput;
  386    459   
         460  +
/* CodegenDelegator.kt:255 */
  387    461   
pub use crate::operation::endpoint_with_host_label_operation::_endpoint_with_host_label_operation_input::EndpointWithHostLabelOperationInput;
  388    462   
         463  +
/* RustModule.kt:172 */
  389    464   
mod _endpoint_with_host_label_operation_input;
  390    465   
         466  +
/* RustModule.kt:172 */
  391    467   
mod _endpoint_with_host_label_operation_output;
  392    468   
  393         -
/// Builders
         469  +
/// /* CodegenDelegator.kt:51 */Builders
  394    470   
pub mod builders;

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

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

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

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `GreetingWithErrors`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct GreetingWithErrors;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl GreetingWithErrors {
    7         -
    /// Creates a new `GreetingWithErrors`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `GreetingWithErrors`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::greeting_with_errors::GreetingWithErrorsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::greeting_with_errors::GreetingWithErrorsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +269,286 @@
   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 GreetingWithErrors {
   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("GreetingWithErrors");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            GreetingWithErrorsRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            GreetingWithErrorsResponseDeserializer,
   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   
            "GreetingWithErrors",
  105    116   
            "JSON RPC 10",
  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("GreetingWithErrors")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(GreetingWithErrorsEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::greeting_with_errors::GreetingWithErrorsError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::greeting_with_errors::GreetingWithErrorsError,
  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 GreetingWithErrorsResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GreetingWithErrorsResponseDeserializer {
  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_greeting_with_errors::de_greeting_with_errors_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_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 GreetingWithErrorsRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GreetingWithErrorsRequestSerializer {
  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::greeting_with_errors::GreetingWithErrorsInput>()
  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::greeting_with_errors::GreetingWithErrorsInput,
  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::greeting_with_errors::GreetingWithErrorsInput,
  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.0");
  187    200   
            builder = _header_serialization_settings.set_default_header(
  188    201   
                builder,
  189    202   
                ::http::header::HeaderName::from_static("x-amz-target"),
  190    203   
                "JsonRpc10.GreetingWithErrors",
  191    204   
            );
  192    205   
            builder
  193    206   
        };
  194    207   
        let body =
  195    208   
            ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_input(&input)?);
  196    209   
        if let Some(content_length) = body.content_length() {
  197    210   
            let content_length = content_length.to_string();
  198    211   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  199    212   
        }
  200    213   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  201    214   
    }
  202    215   
}
         216  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  203    217   
#[derive(Debug)]
  204    218   
struct GreetingWithErrorsEndpointParamsInterceptor;
  205    219   
  206    220   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GreetingWithErrorsEndpointParamsInterceptor {
  207    221   
    fn name(&self) -> &'static str {
  208    222   
        "GreetingWithErrorsEndpointParamsInterceptor"
  209    223   
    }
  210    224   
  211    225   
    fn read_before_execution(
  212    226   
        &self,
  213    227   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  214    228   
            '_,
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  216    230   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  218    232   
        >,
  219    233   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  220    234   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  221    235   
        let _input = context
  222    236   
            .input()
  223    237   
            .downcast_ref::<GreetingWithErrorsInput>()
  224    238   
            .ok_or("failed to downcast to GreetingWithErrorsInput")?;
  225    239   
  226    240   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  227    241   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  228    242   
        })?;
  229    243   
        cfg.interceptor_state()
  230    244   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  231    245   
        ::std::result::Result::Ok(())
  232    246   
    }
  233    247   
}
  234    248   
  235    249   
// The get_* functions below are generated from JMESPath expressions in the
  236    250   
// operationContextParams trait. They target the operation's input shape.
  237    251   
         252  +
/* RustType.kt:516 */
  238    253   
#[allow(unreachable_code, unused_variables)]
         254  +
/* RustType.kt:516 */
  239    255   
#[cfg(test)]
         256  +
/* ProtocolTestGenerator.kt:98 */
  240    257   
mod greeting_with_errors_test {
  241    258   
  242    259   
    /// Parses simple JSON errors
  243    260   
    /// Test ID: AwsJson10InvalidGreetingError
  244    261   
    #[::tokio::test]
  245    262   
    #[::tracing_test::traced_test]
  246    263   
    async fn aws_json10_invalid_greeting_error_response() {
  247    264   
        let expected_output = crate::types::error::InvalidGreeting::builder()
  248    265   
            .set_message(::std::option::Option::Some("Hi".to_owned()))
  249    266   
            .build();
@@ -758,775 +917,1062 @@
  778    795   
        });
  779    796   
        let parsed = parsed.expect_err("should be error response");
  780    797   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  781    798   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  782    799   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  783    800   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  784    801   
        } else {
  785    802   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  786    803   
        }
  787    804   
    }
         805  +
         806  +
    /* ProtocolTestGenerator.kt:98 */
  788    807   
}
  789    808   
         809  +
/* OperationErrorGenerator.kt:79 */
  790    810   
/// Error type for the `GreetingWithErrorsError` operation.
         811  +
/* RustType.kt:516 */
  791    812   
#[non_exhaustive]
         813  +
/* RustType.kt:516 */
  792    814   
#[derive(::std::fmt::Debug)]
  793         -
pub enum GreetingWithErrorsError {
  794         -
    /// This error is thrown when an invalid greeting value is provided.
         815  +
pub /* OperationErrorGenerator.kt:81 */ enum GreetingWithErrorsError {
         816  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when an invalid greeting value is provided.
         817  +
    /* OperationErrorGenerator.kt:86 */
  795    818   
    InvalidGreeting(crate::types::error::InvalidGreeting),
  796         -
    /// This error is thrown when a request is invalid.
         819  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when a request is invalid.
         820  +
    /* OperationErrorGenerator.kt:86 */
  797    821   
    ComplexError(crate::types::error::ComplexError),
  798         -
    /// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         822  +
    /// /* OperationErrorGenerator.kt:83 */This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         823  +
    /* OperationErrorGenerator.kt:86 */
  799    824   
    FooError(crate::types::error::FooError),
         825  +
    /* OperationErrorGenerator.kt:88 */
  800    826   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  801    827   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  802    828   
    variable wildcard pattern and check `.code()`:
  803    829   
     \
  804    830   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  805    831   
     \
  806    832   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GreetingWithErrorsError) for what information is available for the error.")]
  807    833   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         834  +
    /* OperationErrorGenerator.kt:81 */
  808    835   
}
         836  +
/* OperationErrorGenerator.kt:218 */
  809    837   
impl GreetingWithErrorsError {
         838  +
    /* OperationErrorGenerator.kt:219 */
  810    839   
    /// Creates the `GreetingWithErrorsError::Unhandled` variant from any error type.
  811    840   
    pub fn unhandled(
  812    841   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  813    842   
    ) -> Self {
  814    843   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  815    844   
            source: err.into(),
  816    845   
            meta: ::std::default::Default::default(),
  817    846   
        })
  818    847   
    }
  819    848   
  820    849   
    /// Creates the `GreetingWithErrorsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  821    850   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  822    851   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  823    852   
            source: err.clone().into(),
  824    853   
            meta: err,
  825    854   
        })
  826    855   
    }
  827         -
    ///
         856  +
    /// /* OperationErrorGenerator.kt:236 */
  828    857   
    /// Returns error metadata, which includes the error code, message,
  829    858   
    /// request ID, and potentially additional information.
  830    859   
    ///
         860  +
    /* OperationErrorGenerator.kt:242 */
  831    861   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         862  +
        /* OperationErrorGenerator.kt:243 */
  832    863   
        match self {
  833         -
            Self::InvalidGreeting(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  834         -
            Self::ComplexError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  835         -
            Self::FooError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  836         -
            Self::Unhandled(e) => &e.meta,
         864  +
            /* OperationErrorGenerator.kt:246 */ Self::InvalidGreeting(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         865  +
            /* OperationErrorGenerator.kt:246 */ Self::ComplexError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         866  +
            /* OperationErrorGenerator.kt:246 */ Self::FooError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         867  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         868  +
            /* OperationErrorGenerator.kt:243 */
  837    869   
        }
         870  +
        /* OperationErrorGenerator.kt:242 */
  838    871   
    }
         872  +
    /* OperationErrorGenerator.kt:257 */
  839    873   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::InvalidGreeting`.
         874  +
    /* OperationErrorGenerator.kt:258 */
  840    875   
    pub fn is_invalid_greeting(&self) -> bool {
         876  +
        /* OperationErrorGenerator.kt:259 */
  841    877   
        matches!(self, Self::InvalidGreeting(_))
         878  +
        /* OperationErrorGenerator.kt:258 */
  842    879   
    }
         880  +
    /* OperationErrorGenerator.kt:257 */
  843    881   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::ComplexError`.
         882  +
    /* OperationErrorGenerator.kt:258 */
  844    883   
    pub fn is_complex_error(&self) -> bool {
         884  +
        /* OperationErrorGenerator.kt:259 */
  845    885   
        matches!(self, Self::ComplexError(_))
         886  +
        /* OperationErrorGenerator.kt:258 */
  846    887   
    }
         888  +
    /* OperationErrorGenerator.kt:257 */
  847    889   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::FooError`.
         890  +
    /* OperationErrorGenerator.kt:258 */
  848    891   
    pub fn is_foo_error(&self) -> bool {
         892  +
        /* OperationErrorGenerator.kt:259 */
  849    893   
        matches!(self, Self::FooError(_))
         894  +
        /* OperationErrorGenerator.kt:258 */
  850    895   
    }
         896  +
    /* OperationErrorGenerator.kt:218 */
  851    897   
}
         898  +
/* OperationErrorGenerator.kt:269 */
  852    899   
impl ::std::error::Error for GreetingWithErrorsError {
         900  +
    /* OperationErrorGenerator.kt:270 */
  853    901   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         902  +
        /* OperationErrorGenerator.kt:318 */
  854    903   
        match self {
  855         -
            Self::InvalidGreeting(_inner) => ::std::option::Option::Some(_inner),
  856         -
            Self::ComplexError(_inner) => ::std::option::Option::Some(_inner),
  857         -
            Self::FooError(_inner) => ::std::option::Option::Some(_inner),
  858         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         904  +
            /* OperationErrorGenerator.kt:321 */
         905  +
            Self::InvalidGreeting(_inner) =>
         906  +
            /* OperationErrorGenerator.kt:283 */
         907  +
            {
         908  +
                ::std::option::Option::Some(_inner)
         909  +
            }
         910  +
            ,
         911  +
            /* OperationErrorGenerator.kt:321 */
         912  +
            Self::ComplexError(_inner) =>
         913  +
            /* OperationErrorGenerator.kt:283 */
         914  +
            {
         915  +
                ::std::option::Option::Some(_inner)
         916  +
            }
         917  +
            ,
         918  +
            /* OperationErrorGenerator.kt:321 */
         919  +
            Self::FooError(_inner) =>
         920  +
            /* OperationErrorGenerator.kt:283 */
         921  +
            {
         922  +
                ::std::option::Option::Some(_inner)
         923  +
            }
         924  +
            ,
         925  +
            /* OperationErrorGenerator.kt:326 */
         926  +
            Self::Unhandled(_inner) => {
         927  +
                /* OperationErrorGenerator.kt:279 */
         928  +
                ::std::option::Option::Some(&*_inner.source)
         929  +
                /* OperationErrorGenerator.kt:326 */
         930  +
            } /* OperationErrorGenerator.kt:318 */
  859    931   
        }
         932  +
        /* OperationErrorGenerator.kt:270 */
  860    933   
    }
         934  +
    /* OperationErrorGenerator.kt:269 */
  861    935   
}
         936  +
/* OperationErrorGenerator.kt:133 */
  862    937   
impl ::std::fmt::Display for GreetingWithErrorsError {
         938  +
    /* OperationErrorGenerator.kt:134 */
  863    939   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         940  +
        /* OperationErrorGenerator.kt:318 */
  864    941   
        match self {
  865         -
            Self::InvalidGreeting(_inner) => _inner.fmt(f),
  866         -
            Self::ComplexError(_inner) => _inner.fmt(f),
  867         -
            Self::FooError(_inner) => _inner.fmt(f),
         942  +
            /* OperationErrorGenerator.kt:321 */
         943  +
            Self::InvalidGreeting(_inner) =>
         944  +
            /* OperationErrorGenerator.kt:151 */
         945  +
            {
         946  +
                _inner.fmt(f)
         947  +
            }
         948  +
            ,
         949  +
            /* OperationErrorGenerator.kt:321 */
         950  +
            Self::ComplexError(_inner) =>
         951  +
            /* OperationErrorGenerator.kt:151 */
         952  +
            {
         953  +
                _inner.fmt(f)
         954  +
            }
         955  +
            ,
         956  +
            /* OperationErrorGenerator.kt:321 */
         957  +
            Self::FooError(_inner) =>
         958  +
            /* OperationErrorGenerator.kt:151 */
         959  +
            {
         960  +
                _inner.fmt(f)
         961  +
            }
         962  +
            ,
         963  +
            /* OperationErrorGenerator.kt:326 */
  868    964   
            Self::Unhandled(_inner) => {
         965  +
                /* OperationErrorGenerator.kt:139 */
  869    966   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  870    967   
                    write!(f, "unhandled error ({code})")
  871    968   
                } else {
  872    969   
                    f.write_str("unhandled error")
  873    970   
                }
  874         -
            }
         971  +
                /* OperationErrorGenerator.kt:326 */
         972  +
            } /* OperationErrorGenerator.kt:318 */
  875    973   
        }
         974  +
        /* OperationErrorGenerator.kt:134 */
  876    975   
    }
         976  +
    /* OperationErrorGenerator.kt:133 */
  877    977   
}
         978  +
/* OperationErrorGenerator.kt:182 */
  878    979   
impl ::aws_smithy_types::retry::ProvideErrorKind for GreetingWithErrorsError {
         980  +
    /* OperationErrorGenerator.kt:186 */
  879    981   
    fn code(&self) -> ::std::option::Option<&str> {
         982  +
        /* OperationErrorGenerator.kt:187 */
  880    983   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         984  +
        /* OperationErrorGenerator.kt:186 */
  881    985   
    }
         986  +
    /* OperationErrorGenerator.kt:190 */
  882    987   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         988  +
        /* OperationErrorGenerator.kt:197 */
  883    989   
        ::std::option::Option::None
         990  +
        /* OperationErrorGenerator.kt:190 */
  884    991   
    }
         992  +
    /* OperationErrorGenerator.kt:182 */
  885    993   
}
         994  +
/* OperationErrorGenerator.kt:163 */
  886    995   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GreetingWithErrorsError {
         996  +
    /* OperationErrorGenerator.kt:164 */
  887    997   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         998  +
        /* OperationErrorGenerator.kt:318 */
  888    999   
        match self {
  889         -
            Self::InvalidGreeting(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  890         -
            Self::ComplexError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  891         -
            Self::FooError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  892         -
            Self::Unhandled(_inner) => &_inner.meta,
        1000  +
            /* OperationErrorGenerator.kt:321 */
        1001  +
            Self::InvalidGreeting(_inner) =>
        1002  +
            /* OperationErrorGenerator.kt:169 */
        1003  +
            {
        1004  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
        1005  +
            }
        1006  +
            ,
        1007  +
            /* OperationErrorGenerator.kt:321 */
        1008  +
            Self::ComplexError(_inner) =>
        1009  +
            /* OperationErrorGenerator.kt:169 */
        1010  +
            {
        1011  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
        1012  +
            }
        1013  +
            ,
        1014  +
            /* OperationErrorGenerator.kt:321 */
        1015  +
            Self::FooError(_inner) =>
        1016  +
            /* OperationErrorGenerator.kt:169 */
        1017  +
            {
        1018  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
        1019  +
            }
        1020  +
            ,
        1021  +
            /* OperationErrorGenerator.kt:326 */
        1022  +
            Self::Unhandled(_inner) => {
        1023  +
                /* OperationErrorGenerator.kt:168 */
        1024  +
                &_inner.meta
        1025  +
                /* OperationErrorGenerator.kt:326 */
        1026  +
            } /* OperationErrorGenerator.kt:318 */
  893   1027   
        }
        1028  +
        /* OperationErrorGenerator.kt:164 */
  894   1029   
    }
        1030  +
    /* OperationErrorGenerator.kt:163 */
  895   1031   
}
        1032  +
/* OperationErrorGenerator.kt:109 */
  896   1033   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GreetingWithErrorsError {
        1034  +
    /* OperationErrorGenerator.kt:110 */
  897   1035   
    fn create_unhandled_error(
  898   1036   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  899   1037   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  900   1038   
    ) -> Self {
        1039  +
        /* OperationErrorGenerator.kt:121 */
  901   1040   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  902   1041   
            source,
  903   1042   
            meta: meta.unwrap_or_default(),
  904   1043   
        })
        1044  +
        /* OperationErrorGenerator.kt:110 */
  905   1045   
    }
        1046  +
    /* OperationErrorGenerator.kt:109 */
  906   1047   
}
  907   1048   
        1049  +
/* CodegenDelegator.kt:255 */
  908   1050   
pub use crate::operation::greeting_with_errors::_greeting_with_errors_output::GreetingWithErrorsOutput;
  909   1051   
        1052  +
/* CodegenDelegator.kt:255 */
  910   1053   
pub use crate::operation::greeting_with_errors::_greeting_with_errors_input::GreetingWithErrorsInput;
  911   1054   
        1055  +
/* RustModule.kt:172 */
  912   1056   
mod _greeting_with_errors_input;
  913   1057   
        1058  +
/* RustModule.kt:172 */
  914   1059   
mod _greeting_with_errors_output;
  915   1060   
  916         -
/// Builders
        1061  +
/// /* CodegenDelegator.kt:51 */Builders
  917   1062   
pub mod builders;

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/greeting_with_errors/_greeting_with_errors_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/greeting_with_errors/_greeting_with_errors_output.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/greeting_with_errors/builders.rs

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