Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

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

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/host_with_path_operation/_host_with_path_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 HostWithPathOperationOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct HostWithPathOperationOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl HostWithPathOperationOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`HostWithPathOperationOutput`](crate::operation::host_with_path_operation::HostWithPathOperationOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`HostWithPathOperationOutput`](crate::operation::host_with_path_operation::HostWithPathOperationOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::host_with_path_operation::builders::HostWithPathOperationOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::host_with_path_operation::builders::HostWithPathOperationOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`HostWithPathOperationOutput`](crate::operation::host_with_path_operation::HostWithPathOperationOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`HostWithPathOperationOutput`](crate::operation::host_with_path_operation::HostWithPathOperationOutput).
          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 HostWithPathOperationOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct HostWithPathOperationOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl HostWithPathOperationOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`HostWithPathOperationOutput`](crate::operation::host_with_path_operation::HostWithPathOperationOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`HostWithPathOperationOutput`](crate::operation::host_with_path_operation::HostWithPathOperationOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::host_with_path_operation::HostWithPathOperationOutput {
   20         -
        crate::operation::host_with_path_operation::HostWithPathOperationOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::host_with_path_operation::HostWithPathOperationOutput {
          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/host_with_path_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::host_with_path_operation::_host_with_path_operation_output::HostWithPathOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::host_with_path_operation::_host_with_path_operation_input::HostWithPathOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::host_with_path_operation::builders::HostWithPathOperationInputBuilder {
    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::host_with_path_operation::HostWithPathOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::host_with_path_operation::HostWithPathOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.host_with_path_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `HostWithPathOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `HostWithPathOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct HostWithPathOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::host_with_path_operation::builders::HostWithPathOperationInputBuilder,
   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::host_with_path_operation::HostWithPathOperationOutput,
   34     40   
        crate::operation::host_with_path_operation::HostWithPathOperationError,
   35     41   
    > for HostWithPathOperationFluentBuilder
   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::host_with_path_operation::HostWithPathOperationOutput,
   43     49   
            crate::operation::host_with_path_operation::HostWithPathOperationError,
   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 HostWithPathOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `HostWithPathOperationFluentBuilder`.
   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 HostWithPathOperation as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::host_with_path_operation::builders::HostWithPathOperationInputBuilder {
   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::host_with_path_operation::HostWithPathOperationOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::host_with_path_operation::HostWithPathOperationError,
   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::host_with_path_operation::HostWithPathOperation::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::host_with_path_operation::HostWithPathOperation::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::host_with_path_operation::HostWithPathOperationOutput,
   96    106   
        crate::operation::host_with_path_operation::HostWithPathOperationError,
   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/json_unions.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 `JsonUnions`.
           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 JsonUnions;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl JsonUnions {
    7         -
    /// Creates a new `JsonUnions`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `JsonUnions`
          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::json_unions::JsonUnionsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::json_unions::JsonUnionsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::json_unions::JsonUnionsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +263,280 @@
   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 JsonUnions {
   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("JsonUnions");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            JsonUnionsRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            JsonUnionsResponseDeserializer,
   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("JsonUnions", "JSON RPC 10"));
  104    115   
  105    116   
        ::std::option::Option::Some(cfg.freeze())
  106    117   
    }
  107    118   
  108    119   
    fn runtime_components(
  109    120   
        &self,
  110    121   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  111    122   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  112    123   
        #[allow(unused_mut)]
  113    124   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("JsonUnions")
  114    125   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  115    126   
            .with_interceptor(JsonUnionsEndpointParamsInterceptor)
  116    127   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  117    128   
                crate::operation::json_unions::JsonUnionsError,
  118    129   
            >::new())
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  120    131   
                crate::operation::json_unions::JsonUnionsError,
  121    132   
            >::new());
  122    133   
  123    134   
        ::std::borrow::Cow::Owned(rcb)
  124    135   
    }
  125    136   
}
  126    137   
         138  +
/* ResponseDeserializerGenerator.kt:64 */
  127    139   
#[derive(Debug)]
  128    140   
struct JsonUnionsResponseDeserializer;
  129    141   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonUnionsResponseDeserializer {
  130    142   
    fn deserialize_nonstreaming(
  131    143   
        &self,
  132    144   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  133    145   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  134    146   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  135    147   
        let headers = response.headers();
  136    148   
        let body = response.body().bytes().expect("body loaded");
  137    149   
        #[allow(unused_mut)]
  138    150   
        let mut force_error = false;
  139    151   
  140    152   
        let parse_result = if !success && status != 200 || force_error {
  141    153   
            crate::protocol_serde::shape_json_unions::de_json_unions_http_error(status, headers, body)
  142    154   
        } else {
  143    155   
            crate::protocol_serde::shape_json_unions::de_json_unions_http_response(status, headers, body)
  144    156   
        };
  145    157   
        crate::protocol_serde::type_erase_result(parse_result)
  146    158   
    }
  147    159   
}
         160  +
/* RequestSerializerGenerator.kt:67 */
  148    161   
#[derive(Debug)]
  149    162   
struct JsonUnionsRequestSerializer;
  150    163   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonUnionsRequestSerializer {
  151    164   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  152    165   
    fn serialize_input(
  153    166   
        &self,
  154    167   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  155    168   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  156    169   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  157    170   
        let input = input.downcast::<crate::operation::json_unions::JsonUnionsInput>().expect("correct type");
  158    171   
        let _header_serialization_settings = _cfg
  159    172   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  160    173   
            .cloned()
  161    174   
            .unwrap_or_default();
  162    175   
        let mut request_builder = {
  163    176   
            fn uri_base(
  164    177   
                _input: &crate::operation::json_unions::JsonUnionsInput,
  165    178   
                output: &mut ::std::string::String,
  166    179   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  167    180   
                use ::std::fmt::Write as _;
  168    181   
                ::std::write!(output, "/").expect("formatting should succeed");
  169    182   
                ::std::result::Result::Ok(())
  170    183   
            }
  171    184   
            #[allow(clippy::unnecessary_wraps)]
  172    185   
            fn update_http_builder(
  173    186   
                input: &crate::operation::json_unions::JsonUnionsInput,
  174    187   
                builder: ::http::request::Builder,
  175    188   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  176    189   
                let mut uri = ::std::string::String::new();
  177    190   
                uri_base(input, &mut uri)?;
  178    191   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  179    192   
            }
  180    193   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  181    194   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  182    195   
            builder = _header_serialization_settings.set_default_header(
  183    196   
                builder,
  184    197   
                ::http::header::HeaderName::from_static("x-amz-target"),
  185    198   
                "JsonRpc10.JsonUnions",
  186    199   
            );
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_unions::ser_json_unions_input(&input)?);
  190    203   
        if let Some(content_length) = body.content_length() {
  191    204   
            let content_length = content_length.to_string();
  192    205   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  193    206   
        }
  194    207   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  195    208   
    }
  196    209   
}
         210  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  197    211   
#[derive(Debug)]
  198    212   
struct JsonUnionsEndpointParamsInterceptor;
  199    213   
  200    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonUnionsEndpointParamsInterceptor {
  201    215   
    fn name(&self) -> &'static str {
  202    216   
        "JsonUnionsEndpointParamsInterceptor"
  203    217   
    }
  204    218   
  205    219   
    fn read_before_execution(
  206    220   
        &self,
  207    221   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  208    222   
            '_,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  210    224   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  212    226   
        >,
  213    227   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  214    228   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  215    229   
        let _input = context
  216    230   
            .input()
  217    231   
            .downcast_ref::<JsonUnionsInput>()
  218    232   
            .ok_or("failed to downcast to JsonUnionsInput")?;
  219    233   
  220    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  222    236   
        })?;
  223    237   
        cfg.interceptor_state()
  224    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  225    239   
        ::std::result::Result::Ok(())
  226    240   
    }
  227    241   
}
  228    242   
  229    243   
// The get_* functions below are generated from JMESPath expressions in the
  230    244   
// operationContextParams trait. They target the operation's input shape.
  231    245   
         246  +
/* RustType.kt:516 */
  232    247   
#[allow(unreachable_code, unused_variables)]
         248  +
/* RustType.kt:516 */
  233    249   
#[cfg(test)]
         250  +
/* ProtocolTestGenerator.kt:98 */
  234    251   
mod json_unions_test {
  235    252   
  236    253   
    /// Serializes a string union value
  237    254   
    /// Test ID: AwsJson10SerializeStringUnionValue
  238    255   
    #[::tokio::test]
  239    256   
    #[::tracing_test::traced_test]
  240    257   
    async fn aws_json10_serialize_string_union_value_request() {
  241    258   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  242    259   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  243    260   
@@ -1055,1072 +1184,1260 @@
 1075   1092   
                )))
 1076   1093   
            });
 1077   1094   
            de.deserialize_nonstreaming(&http_response)
 1078   1095   
        });
 1079   1096   
        let parsed = parsed
 1080   1097   
            .expect("should be successful response")
 1081   1098   
            .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
 1082   1099   
            .unwrap();
 1083   1100   
        ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
 1084   1101   
    }
        1102  +
        1103  +
    /* ProtocolTestGenerator.kt:98 */
 1085   1104   
}
 1086   1105   
        1106  +
/* OperationErrorGenerator.kt:79 */
 1087   1107   
/// Error type for the `JsonUnionsError` operation.
        1108  +
/* RustType.kt:516 */
 1088   1109   
#[non_exhaustive]
        1110  +
/* RustType.kt:516 */
 1089   1111   
#[derive(::std::fmt::Debug)]
 1090         -
pub enum JsonUnionsError {
        1112  +
pub /* OperationErrorGenerator.kt:81 */ enum JsonUnionsError {
        1113  +
    /* OperationErrorGenerator.kt:88 */
 1091   1114   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
 1092   1115   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
 1093   1116   
    variable wildcard pattern and check `.code()`:
 1094   1117   
     \
 1095   1118   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
 1096   1119   
     \
 1097   1120   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-JsonUnionsError) for what information is available for the error.")]
 1098   1121   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
        1122  +
    /* OperationErrorGenerator.kt:81 */
 1099   1123   
}
        1124  +
/* OperationErrorGenerator.kt:218 */
 1100   1125   
impl JsonUnionsError {
        1126  +
    /* OperationErrorGenerator.kt:219 */
 1101   1127   
    /// Creates the `JsonUnionsError::Unhandled` variant from any error type.
 1102   1128   
    pub fn unhandled(
 1103   1129   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
 1104   1130   
    ) -> Self {
 1105   1131   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
 1106   1132   
            source: err.into(),
 1107   1133   
            meta: ::std::default::Default::default(),
 1108   1134   
        })
 1109   1135   
    }
 1110   1136   
 1111   1137   
    /// Creates the `JsonUnionsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
 1112   1138   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
 1113   1139   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
 1114   1140   
            source: err.clone().into(),
 1115   1141   
            meta: err,
 1116   1142   
        })
 1117   1143   
    }
 1118         -
    ///
        1144  +
    /// /* OperationErrorGenerator.kt:236 */
 1119   1145   
    /// Returns error metadata, which includes the error code, message,
 1120   1146   
    /// request ID, and potentially additional information.
 1121   1147   
    ///
        1148  +
    /* OperationErrorGenerator.kt:242 */
 1122   1149   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
        1150  +
        /* OperationErrorGenerator.kt:243 */
 1123   1151   
        match self {
 1124         -
            Self::Unhandled(e) => &e.meta,
        1152  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
        1153  +
            /* OperationErrorGenerator.kt:243 */
 1125   1154   
        }
        1155  +
        /* OperationErrorGenerator.kt:242 */
 1126   1156   
    }
        1157  +
    /* OperationErrorGenerator.kt:218 */
 1127   1158   
}
        1159  +
/* OperationErrorGenerator.kt:269 */
 1128   1160   
impl ::std::error::Error for JsonUnionsError {
        1161  +
    /* OperationErrorGenerator.kt:270 */
 1129   1162   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
        1163  +
        /* OperationErrorGenerator.kt:318 */
 1130   1164   
        match self {
 1131         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
        1165  +
            /* OperationErrorGenerator.kt:326 */
        1166  +
            Self::Unhandled(_inner) => {
        1167  +
                /* OperationErrorGenerator.kt:279 */
        1168  +
                ::std::option::Option::Some(&*_inner.source)
        1169  +
                /* OperationErrorGenerator.kt:326 */
        1170  +
            } /* OperationErrorGenerator.kt:318 */
 1132   1171   
        }
        1172  +
        /* OperationErrorGenerator.kt:270 */
 1133   1173   
    }
        1174  +
    /* OperationErrorGenerator.kt:269 */
 1134   1175   
}
        1176  +
/* OperationErrorGenerator.kt:133 */
 1135   1177   
impl ::std::fmt::Display for JsonUnionsError {
        1178  +
    /* OperationErrorGenerator.kt:134 */
 1136   1179   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        1180  +
        /* OperationErrorGenerator.kt:318 */
 1137   1181   
        match self {
        1182  +
            /* OperationErrorGenerator.kt:326 */
 1138   1183   
            Self::Unhandled(_inner) => {
        1184  +
                /* OperationErrorGenerator.kt:139 */
 1139   1185   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
 1140   1186   
                    write!(f, "unhandled error ({code})")
 1141   1187   
                } else {
 1142   1188   
                    f.write_str("unhandled error")
 1143   1189   
                }
 1144         -
            }
        1190  +
                /* OperationErrorGenerator.kt:326 */
        1191  +
            } /* OperationErrorGenerator.kt:318 */
 1145   1192   
        }
        1193  +
        /* OperationErrorGenerator.kt:134 */
 1146   1194   
    }
        1195  +
    /* OperationErrorGenerator.kt:133 */
 1147   1196   
}
        1197  +
/* OperationErrorGenerator.kt:182 */
 1148   1198   
impl ::aws_smithy_types::retry::ProvideErrorKind for JsonUnionsError {
        1199  +
    /* OperationErrorGenerator.kt:186 */
 1149   1200   
    fn code(&self) -> ::std::option::Option<&str> {
        1201  +
        /* OperationErrorGenerator.kt:187 */
 1150   1202   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
        1203  +
        /* OperationErrorGenerator.kt:186 */
 1151   1204   
    }
        1205  +
    /* OperationErrorGenerator.kt:190 */
 1152   1206   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
        1207  +
        /* OperationErrorGenerator.kt:197 */
 1153   1208   
        ::std::option::Option::None
        1209  +
        /* OperationErrorGenerator.kt:190 */
 1154   1210   
    }
        1211  +
    /* OperationErrorGenerator.kt:182 */
 1155   1212   
}
        1213  +
/* OperationErrorGenerator.kt:163 */
 1156   1214   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for JsonUnionsError {
        1215  +
    /* OperationErrorGenerator.kt:164 */
 1157   1216   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
        1217  +
        /* OperationErrorGenerator.kt:318 */
 1158   1218   
        match self {
 1159         -
            Self::Unhandled(_inner) => &_inner.meta,
        1219  +
            /* OperationErrorGenerator.kt:326 */
        1220  +
            Self::Unhandled(_inner) => {
        1221  +
                /* OperationErrorGenerator.kt:168 */
        1222  +
                &_inner.meta
        1223  +
                /* OperationErrorGenerator.kt:326 */
        1224  +
            } /* OperationErrorGenerator.kt:318 */
 1160   1225   
        }
        1226  +
        /* OperationErrorGenerator.kt:164 */
 1161   1227   
    }
        1228  +
    /* OperationErrorGenerator.kt:163 */
 1162   1229   
}
        1230  +
/* OperationErrorGenerator.kt:109 */
 1163   1231   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for JsonUnionsError {
        1232  +
    /* OperationErrorGenerator.kt:110 */
 1164   1233   
    fn create_unhandled_error(
 1165   1234   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
 1166   1235   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
 1167   1236   
    ) -> Self {
        1237  +
        /* OperationErrorGenerator.kt:121 */
 1168   1238   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
 1169   1239   
            source,
 1170   1240   
            meta: meta.unwrap_or_default(),
 1171   1241   
        })
        1242  +
        /* OperationErrorGenerator.kt:110 */
 1172   1243   
    }
        1244  +
    /* OperationErrorGenerator.kt:109 */
 1173   1245   
}
 1174   1246   
        1247  +
/* CodegenDelegator.kt:255 */
 1175   1248   
pub use crate::operation::json_unions::_json_unions_output::JsonUnionsOutput;
 1176   1249   
        1250  +
/* CodegenDelegator.kt:255 */
 1177   1251   
pub use crate::operation::json_unions::_json_unions_input::JsonUnionsInput;
 1178   1252   
        1253  +
/* RustModule.kt:172 */
 1179   1254   
mod _json_unions_input;
 1180   1255   
        1256  +
/* RustModule.kt:172 */
 1181   1257   
mod _json_unions_output;
 1182   1258   
 1183         -
/// Builders
        1259  +
/// /* CodegenDelegator.kt:51 */Builders
 1184   1260   
pub mod builders;

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

@@ -1,1 +47,86 @@
    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 JsonUnionsInput {
    6         -
    /// A union with a representative set of types for members.
           8  +
pub /* StructureGenerator.kt:201 */ struct JsonUnionsInput {
           9  +
    /// /* StructureGenerator.kt:231 */A union with a representative set of types for members.
    7     10   
    pub contents: ::std::option::Option<crate::types::MyUnion>,
          11  +
    /* StructureGenerator.kt:201 */
    8     12   
}
          13  +
/* StructureGenerator.kt:135 */
    9     14   
impl JsonUnionsInput {
   10         -
    /// A union with a representative set of types for members.
          15  +
    /// /* StructureGenerator.kt:231 */A union with a representative set of types for members.
          16  +
    /* StructureGenerator.kt:166 */
   11     17   
    pub fn contents(&self) -> ::std::option::Option<&crate::types::MyUnion> {
          18  +
        /* StructureGenerator.kt:170 */
   12     19   
        self.contents.as_ref()
          20  +
        /* StructureGenerator.kt:166 */
   13     21   
    }
          22  +
    /* StructureGenerator.kt:135 */
   14     23   
}
          24  +
/* ClientCodegenVisitor.kt:237 */
   15     25   
impl JsonUnionsInput {
   16         -
    /// Creates a new builder-style object to manufacture [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
          26  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
          27  +
    /* BuilderGenerator.kt:175 */
   17     28   
    pub fn builder() -> crate::operation::json_unions::builders::JsonUnionsInputBuilder {
          29  +
        /* BuilderGenerator.kt:176 */
   18     30   
        crate::operation::json_unions::builders::JsonUnionsInputBuilder::default()
          31  +
        /* BuilderGenerator.kt:175 */
   19     32   
    }
          33  +
    /* ClientCodegenVisitor.kt:237 */
   20     34   
}
   21     35   
   22         -
/// A builder for [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
          36  +
/// /* BuilderGenerator.kt:342 */A builder for [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
          37  +
/* RustType.kt:516 */
   23     38   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          39  +
/* RustType.kt:516 */
   24     40   
#[non_exhaustive]
          41  +
/* BuilderGenerator.kt:345 */
   25     42   
pub struct JsonUnionsInputBuilder {
   26         -
    pub(crate) contents: ::std::option::Option<crate::types::MyUnion>,
          43  +
    /* BuilderGenerator.kt:275 */ pub(crate) contents: ::std::option::Option<crate::types::MyUnion>,
          44  +
    /* BuilderGenerator.kt:345 */
   27     45   
}
          46  +
/* BuilderGenerator.kt:355 */
   28     47   
impl JsonUnionsInputBuilder {
   29         -
    /// A union with a representative set of types for members.
          48  +
    /// /* BuilderGenerator.kt:286 */A union with a representative set of types for members.
          49  +
    /* BuilderGenerator.kt:291 */
   30     50   
    pub fn contents(mut self, input: crate::types::MyUnion) -> Self {
          51  +
        /* BuilderGenerator.kt:292 */
   31     52   
        self.contents = ::std::option::Option::Some(input);
          53  +
        /* BuilderGenerator.kt:293 */
   32     54   
        self
          55  +
        /* BuilderGenerator.kt:291 */
   33     56   
    }
   34         -
    /// A union with a representative set of types for members.
          57  +
    /// /* BuilderGenerator.kt:312 */A union with a representative set of types for members.
          58  +
    /* BuilderGenerator.kt:314 */
   35     59   
    pub fn set_contents(mut self, input: ::std::option::Option<crate::types::MyUnion>) -> Self {
          60  +
        /* BuilderGenerator.kt:315 */
   36     61   
        self.contents = input;
   37     62   
        self
          63  +
        /* BuilderGenerator.kt:314 */
   38     64   
    }
   39         -
    /// A union with a representative set of types for members.
          65  +
    /// /* BuilderGenerator.kt:334 */A union with a representative set of types for members.
          66  +
    /* BuilderGenerator.kt:336 */
   40     67   
    pub fn get_contents(&self) -> &::std::option::Option<crate::types::MyUnion> {
          68  +
        /* BuilderGenerator.kt:337 */
   41     69   
        &self.contents
          70  +
        /* BuilderGenerator.kt:336 */
   42     71   
    }
   43         -
    /// Consumes the builder and constructs a [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
          72  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`JsonUnionsInput`](crate::operation::json_unions::JsonUnionsInput).
          73  +
    /* BuilderGenerator.kt:253 */
   44     74   
    pub fn build(self) -> ::std::result::Result<crate::operation::json_unions::JsonUnionsInput, ::aws_smithy_types::error::operation::BuildError> {
   45         -
        ::std::result::Result::Ok(crate::operation::json_unions::JsonUnionsInput { contents: self.contents })
          75  +
        /* BuilderGenerator.kt:254 */
          76  +
        ::std::result::Result::Ok(
          77  +
            /* BuilderGenerator.kt:477 */
          78  +
            crate::operation::json_unions::JsonUnionsInput {
          79  +
                /* BuilderGenerator.kt:481 */ contents: self.contents,
          80  +
                /* BuilderGenerator.kt:477 */
          81  +
            }, /* BuilderGenerator.kt:254 */
          82  +
        )
          83  +
        /* BuilderGenerator.kt:253 */
   46     84   
    }
          85  +
    /* BuilderGenerator.kt:355 */
   47     86   
}

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

@@ -1,1 +47,83 @@
    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 JsonUnionsOutput {
    6         -
    /// A union with a representative set of types for members.
           8  +
pub /* StructureGenerator.kt:201 */ struct JsonUnionsOutput {
           9  +
    /// /* StructureGenerator.kt:231 */A union with a representative set of types for members.
    7     10   
    pub contents: ::std::option::Option<crate::types::MyUnion>,
          11  +
    /* StructureGenerator.kt:201 */
    8     12   
}
          13  +
/* StructureGenerator.kt:135 */
    9     14   
impl JsonUnionsOutput {
   10         -
    /// A union with a representative set of types for members.
          15  +
    /// /* StructureGenerator.kt:231 */A union with a representative set of types for members.
          16  +
    /* StructureGenerator.kt:166 */
   11     17   
    pub fn contents(&self) -> ::std::option::Option<&crate::types::MyUnion> {
          18  +
        /* StructureGenerator.kt:170 */
   12     19   
        self.contents.as_ref()
          20  +
        /* StructureGenerator.kt:166 */
   13     21   
    }
          22  +
    /* StructureGenerator.kt:135 */
   14     23   
}
          24  +
/* ClientCodegenVisitor.kt:237 */
   15     25   
impl JsonUnionsOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
          26  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
          27  +
    /* BuilderGenerator.kt:175 */
   17     28   
    pub fn builder() -> crate::operation::json_unions::builders::JsonUnionsOutputBuilder {
          29  +
        /* BuilderGenerator.kt:176 */
   18     30   
        crate::operation::json_unions::builders::JsonUnionsOutputBuilder::default()
          31  +
        /* BuilderGenerator.kt:175 */
   19     32   
    }
          33  +
    /* ClientCodegenVisitor.kt:237 */
   20     34   
}
   21     35   
   22         -
/// A builder for [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
          36  +
/// /* BuilderGenerator.kt:342 */A builder for [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
          37  +
/* RustType.kt:516 */
   23     38   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          39  +
/* RustType.kt:516 */
   24     40   
#[non_exhaustive]
          41  +
/* BuilderGenerator.kt:345 */
   25     42   
pub struct JsonUnionsOutputBuilder {
   26         -
    pub(crate) contents: ::std::option::Option<crate::types::MyUnion>,
          43  +
    /* BuilderGenerator.kt:275 */ pub(crate) contents: ::std::option::Option<crate::types::MyUnion>,
          44  +
    /* BuilderGenerator.kt:345 */
   27     45   
}
          46  +
/* BuilderGenerator.kt:355 */
   28     47   
impl JsonUnionsOutputBuilder {
   29         -
    /// A union with a representative set of types for members.
          48  +
    /// /* BuilderGenerator.kt:286 */A union with a representative set of types for members.
          49  +
    /* BuilderGenerator.kt:291 */
   30     50   
    pub fn contents(mut self, input: crate::types::MyUnion) -> Self {
          51  +
        /* BuilderGenerator.kt:292 */
   31     52   
        self.contents = ::std::option::Option::Some(input);
          53  +
        /* BuilderGenerator.kt:293 */
   32     54   
        self
          55  +
        /* BuilderGenerator.kt:291 */
   33     56   
    }
   34         -
    /// A union with a representative set of types for members.
          57  +
    /// /* BuilderGenerator.kt:312 */A union with a representative set of types for members.
          58  +
    /* BuilderGenerator.kt:314 */
   35     59   
    pub fn set_contents(mut self, input: ::std::option::Option<crate::types::MyUnion>) -> Self {
          60  +
        /* BuilderGenerator.kt:315 */
   36     61   
        self.contents = input;
   37     62   
        self
          63  +
        /* BuilderGenerator.kt:314 */
   38     64   
    }
   39         -
    /// A union with a representative set of types for members.
          65  +
    /// /* BuilderGenerator.kt:334 */A union with a representative set of types for members.
          66  +
    /* BuilderGenerator.kt:336 */
   40     67   
    pub fn get_contents(&self) -> &::std::option::Option<crate::types::MyUnion> {
          68  +
        /* BuilderGenerator.kt:337 */
   41     69   
        &self.contents
          70  +
        /* BuilderGenerator.kt:336 */
   42     71   
    }
   43         -
    /// Consumes the builder and constructs a [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
          72  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`JsonUnionsOutput`](crate::operation::json_unions::JsonUnionsOutput).
          73  +
    /* BuilderGenerator.kt:253 */
   44     74   
    pub fn build(self) -> crate::operation::json_unions::JsonUnionsOutput {
   45         -
        crate::operation::json_unions::JsonUnionsOutput { contents: self.contents }
          75  +
        /* BuilderGenerator.kt:477 */
          76  +
        crate::operation::json_unions::JsonUnionsOutput {
          77  +
            /* BuilderGenerator.kt:481 */ contents: self.contents,
          78  +
            /* BuilderGenerator.kt:477 */
          79  +
        }
          80  +
        /* BuilderGenerator.kt:253 */
   46     81   
    }
          82  +
    /* BuilderGenerator.kt:355 */
   47     83   
}

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

@@ -1,1 +125,140 @@
    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::json_unions::_json_unions_output::JsonUnionsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::json_unions::_json_unions_input::JsonUnionsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::json_unions::builders::JsonUnionsInputBuilder {
    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::json_unions::JsonUnionsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::json_unions::JsonUnionsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.json_unions();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `JsonUnions`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `JsonUnions`.
   24     27   
///
   25         -
/// This operation uses unions for inputs and outputs.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation uses unions for inputs and outputs.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct JsonUnionsFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::json_unions::builders::JsonUnionsInputBuilder,
   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::json_unions::JsonUnionsOutput,
   35     41   
        crate::operation::json_unions::JsonUnionsError,
   36     42   
    > for JsonUnionsFluentBuilder
   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::json_unions::JsonUnionsOutput,
   44     50   
            crate::operation::json_unions::JsonUnionsError,
   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 JsonUnionsFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `JsonUnionsFluentBuilder`.
   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 JsonUnions as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::json_unions::builders::JsonUnionsInputBuilder {
   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::json_unions::JsonUnionsOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::json_unions::JsonUnionsError,
   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::json_unions::JsonUnions::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::json_unions::JsonUnions::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::json_unions::JsonUnionsOutput,
   97    107   
        crate::operation::json_unions::JsonUnionsError,
   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   
    }
  111         -
    /// A union with a representative set of types for members.
         122  +
    /// /* FluentBuilderGenerator.kt:498 */A union with a representative set of types for members.
         123  +
    /* FluentBuilderGenerator.kt:500 */
  112    124   
    pub fn contents(mut self, input: crate::types::MyUnion) -> Self {
  113    125   
        self.inner = self.inner.contents(input);
  114    126   
        self
  115    127   
    }
  116         -
    /// A union with a representative set of types for members.
         128  +
    /// /* FluentBuilderGenerator.kt:498 */A union with a representative set of types for members.
         129  +
    /* FluentBuilderGenerator.kt:500 */
  117    130   
    pub fn set_contents(mut self, input: ::std::option::Option<crate::types::MyUnion>) -> Self {
  118    131   
        self.inner = self.inner.set_contents(input);
  119    132   
        self
  120    133   
    }
  121         -
    /// A union with a representative set of types for members.
         134  +
    /// /* FluentBuilderGenerator.kt:518 */A union with a representative set of types for members.
         135  +
    /* FluentBuilderGenerator.kt:520 */
  122    136   
    pub fn get_contents(&self) -> &::std::option::Option<crate::types::MyUnion> {
  123    137   
        self.inner.get_contents()
  124    138   
    }
         139  +
    /* FluentBuilderGenerator.kt:282 */
  125    140   
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/no_input_and_no_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 `NoInputAndNoOutput`.
           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 NoInputAndNoOutput;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl NoInputAndNoOutput {
    7         -
    /// Creates a new `NoInputAndNoOutput`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `NoInputAndNoOutput`
          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::no_input_and_no_output::NoInputAndNoOutputInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +267,284 @@
   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 NoInputAndNoOutput {
   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("NoInputAndNoOutput");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            NoInputAndNoOutputRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            NoInputAndNoOutputResponseDeserializer,
   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   
            "NoInputAndNoOutput",
  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("NoInputAndNoOutput")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(NoInputAndNoOutputEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
  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 NoInputAndNoOutputResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for NoInputAndNoOutputResponseDeserializer {
  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_no_input_and_no_output::de_no_input_and_no_output_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_no_input_and_no_output::de_no_input_and_no_output_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 NoInputAndNoOutputRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for NoInputAndNoOutputRequestSerializer {
  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::no_input_and_no_output::NoInputAndNoOutputInput>()
  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::no_input_and_no_output::NoInputAndNoOutputInput,
  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::no_input_and_no_output::NoInputAndNoOutputInput,
  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.NoInputAndNoOutput",
  191    204   
            );
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_no_input_and_no_output::ser_no_input_and_no_output_input(
  195    208   
            &input,
  196    209   
        )?);
  197    210   
  198    211   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  199    212   
    }
  200    213   
}
         214  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  201    215   
#[derive(Debug)]
  202    216   
struct NoInputAndNoOutputEndpointParamsInterceptor;
  203    217   
  204    218   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for NoInputAndNoOutputEndpointParamsInterceptor {
  205    219   
    fn name(&self) -> &'static str {
  206    220   
        "NoInputAndNoOutputEndpointParamsInterceptor"
  207    221   
    }
  208    222   
  209    223   
    fn read_before_execution(
  210    224   
        &self,
  211    225   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  212    226   
            '_,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  214    228   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  216    230   
        >,
  217    231   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  218    232   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  219    233   
        let _input = context
  220    234   
            .input()
  221    235   
            .downcast_ref::<NoInputAndNoOutputInput>()
  222    236   
            .ok_or("failed to downcast to NoInputAndNoOutputInput")?;
  223    237   
  224    238   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  225    239   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  226    240   
        })?;
  227    241   
        cfg.interceptor_state()
  228    242   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  229    243   
        ::std::result::Result::Ok(())
  230    244   
    }
  231    245   
}
  232    246   
  233    247   
// The get_* functions below are generated from JMESPath expressions in the
  234    248   
// operationContextParams trait. They target the operation's input shape.
  235    249   
         250  +
/* RustType.kt:516 */
  236    251   
#[allow(unreachable_code, unused_variables)]
         252  +
/* RustType.kt:516 */
  237    253   
#[cfg(test)]
         254  +
/* ProtocolTestGenerator.kt:98 */
  238    255   
mod no_input_and_no_output_test {
  239    256   
  240    257   
    /// Clients must always send an empty JSON object payload for
  241    258   
    /// operations with no input (that is, `{}`). While AWS service
  242    259   
    /// implementations support requests with no payload or requests
  243    260   
    /// that send `{}`, always sending `{}` from the client is
  244    261   
    /// preferred for forward compatibility in case input is ever
  245    262   
    /// added to an operation.
  246    263   
    /// Test ID: AwsJson10MustAlwaysSendEmptyJsonPayload
  247    264   
    #[::tokio::test]
@@ -369,386 +498,574 @@
  389    406   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  390    407   
                )))
  391    408   
            });
  392    409   
            de.deserialize_nonstreaming(&http_response)
  393    410   
        });
  394    411   
        let parsed = parsed
  395    412   
            .expect("should be successful response")
  396    413   
            .downcast::<crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput>()
  397    414   
            .unwrap();
  398    415   
    }
         416  +
         417  +
    /* ProtocolTestGenerator.kt:98 */
  399    418   
}
  400    419   
         420  +
/* OperationErrorGenerator.kt:79 */
  401    421   
/// Error type for the `NoInputAndNoOutputError` operation.
         422  +
/* RustType.kt:516 */
  402    423   
#[non_exhaustive]
         424  +
/* RustType.kt:516 */
  403    425   
#[derive(::std::fmt::Debug)]
  404         -
pub enum NoInputAndNoOutputError {
         426  +
pub /* OperationErrorGenerator.kt:81 */ enum NoInputAndNoOutputError {
         427  +
    /* OperationErrorGenerator.kt:88 */
  405    428   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  406    429   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  407    430   
    variable wildcard pattern and check `.code()`:
  408    431   
     \
  409    432   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  410    433   
     \
  411    434   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-NoInputAndNoOutputError) for what information is available for the error.")]
  412    435   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         436  +
    /* OperationErrorGenerator.kt:81 */
  413    437   
}
         438  +
/* OperationErrorGenerator.kt:218 */
  414    439   
impl NoInputAndNoOutputError {
         440  +
    /* OperationErrorGenerator.kt:219 */
  415    441   
    /// Creates the `NoInputAndNoOutputError::Unhandled` variant from any error type.
  416    442   
    pub fn unhandled(
  417    443   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  418    444   
    ) -> Self {
  419    445   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  420    446   
            source: err.into(),
  421    447   
            meta: ::std::default::Default::default(),
  422    448   
        })
  423    449   
    }
  424    450   
  425    451   
    /// Creates the `NoInputAndNoOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  426    452   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  427    453   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  428    454   
            source: err.clone().into(),
  429    455   
            meta: err,
  430    456   
        })
  431    457   
    }
  432         -
    ///
         458  +
    /// /* OperationErrorGenerator.kt:236 */
  433    459   
    /// Returns error metadata, which includes the error code, message,
  434    460   
    /// request ID, and potentially additional information.
  435    461   
    ///
         462  +
    /* OperationErrorGenerator.kt:242 */
  436    463   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         464  +
        /* OperationErrorGenerator.kt:243 */
  437    465   
        match self {
  438         -
            Self::Unhandled(e) => &e.meta,
         466  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         467  +
            /* OperationErrorGenerator.kt:243 */
  439    468   
        }
         469  +
        /* OperationErrorGenerator.kt:242 */
  440    470   
    }
         471  +
    /* OperationErrorGenerator.kt:218 */
  441    472   
}
         473  +
/* OperationErrorGenerator.kt:269 */
  442    474   
impl ::std::error::Error for NoInputAndNoOutputError {
         475  +
    /* OperationErrorGenerator.kt:270 */
  443    476   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         477  +
        /* OperationErrorGenerator.kt:318 */
  444    478   
        match self {
  445         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         479  +
            /* OperationErrorGenerator.kt:326 */
         480  +
            Self::Unhandled(_inner) => {
         481  +
                /* OperationErrorGenerator.kt:279 */
         482  +
                ::std::option::Option::Some(&*_inner.source)
         483  +
                /* OperationErrorGenerator.kt:326 */
         484  +
            } /* OperationErrorGenerator.kt:318 */
  446    485   
        }
         486  +
        /* OperationErrorGenerator.kt:270 */
  447    487   
    }
         488  +
    /* OperationErrorGenerator.kt:269 */
  448    489   
}
         490  +
/* OperationErrorGenerator.kt:133 */
  449    491   
impl ::std::fmt::Display for NoInputAndNoOutputError {
         492  +
    /* OperationErrorGenerator.kt:134 */
  450    493   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         494  +
        /* OperationErrorGenerator.kt:318 */
  451    495   
        match self {
         496  +
            /* OperationErrorGenerator.kt:326 */
  452    497   
            Self::Unhandled(_inner) => {
         498  +
                /* OperationErrorGenerator.kt:139 */
  453    499   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  454    500   
                    write!(f, "unhandled error ({code})")
  455    501   
                } else {
  456    502   
                    f.write_str("unhandled error")
  457    503   
                }
  458         -
            }
         504  +
                /* OperationErrorGenerator.kt:326 */
         505  +
            } /* OperationErrorGenerator.kt:318 */
  459    506   
        }
         507  +
        /* OperationErrorGenerator.kt:134 */
  460    508   
    }
         509  +
    /* OperationErrorGenerator.kt:133 */
  461    510   
}
         511  +
/* OperationErrorGenerator.kt:182 */
  462    512   
impl ::aws_smithy_types::retry::ProvideErrorKind for NoInputAndNoOutputError {
         513  +
    /* OperationErrorGenerator.kt:186 */
  463    514   
    fn code(&self) -> ::std::option::Option<&str> {
         515  +
        /* OperationErrorGenerator.kt:187 */
  464    516   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         517  +
        /* OperationErrorGenerator.kt:186 */
  465    518   
    }
         519  +
    /* OperationErrorGenerator.kt:190 */
  466    520   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         521  +
        /* OperationErrorGenerator.kt:197 */
  467    522   
        ::std::option::Option::None
         523  +
        /* OperationErrorGenerator.kt:190 */
  468    524   
    }
         525  +
    /* OperationErrorGenerator.kt:182 */
  469    526   
}
         527  +
/* OperationErrorGenerator.kt:163 */
  470    528   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for NoInputAndNoOutputError {
         529  +
    /* OperationErrorGenerator.kt:164 */
  471    530   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         531  +
        /* OperationErrorGenerator.kt:318 */
  472    532   
        match self {
  473         -
            Self::Unhandled(_inner) => &_inner.meta,
         533  +
            /* OperationErrorGenerator.kt:326 */
         534  +
            Self::Unhandled(_inner) => {
         535  +
                /* OperationErrorGenerator.kt:168 */
         536  +
                &_inner.meta
         537  +
                /* OperationErrorGenerator.kt:326 */
         538  +
            } /* OperationErrorGenerator.kt:318 */
  474    539   
        }
         540  +
        /* OperationErrorGenerator.kt:164 */
  475    541   
    }
         542  +
    /* OperationErrorGenerator.kt:163 */
  476    543   
}
         544  +
/* OperationErrorGenerator.kt:109 */
  477    545   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for NoInputAndNoOutputError {
         546  +
    /* OperationErrorGenerator.kt:110 */
  478    547   
    fn create_unhandled_error(
  479    548   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  480    549   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  481    550   
    ) -> Self {
         551  +
        /* OperationErrorGenerator.kt:121 */
  482    552   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  483    553   
            source,
  484    554   
            meta: meta.unwrap_or_default(),
  485    555   
        })
         556  +
        /* OperationErrorGenerator.kt:110 */
  486    557   
    }
         558  +
    /* OperationErrorGenerator.kt:109 */
  487    559   
}
  488    560   
         561  +
/* CodegenDelegator.kt:255 */
  489    562   
pub use crate::operation::no_input_and_no_output::_no_input_and_no_output_output::NoInputAndNoOutputOutput;
  490    563   
         564  +
/* CodegenDelegator.kt:255 */
  491    565   
pub use crate::operation::no_input_and_no_output::_no_input_and_no_output_input::NoInputAndNoOutputInput;
  492    566   
         567  +
/* RustModule.kt:172 */
  493    568   
mod _no_input_and_no_output_input;
  494    569   
         570  +
/* RustModule.kt:172 */
  495    571   
mod _no_input_and_no_output_output;
  496    572   
  497         -
/// Builders
         573  +
/// /* CodegenDelegator.kt:51 */Builders
  498    574   
pub mod builders;

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

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/no_input_and_no_output/_no_input_and_no_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 NoInputAndNoOutputOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct NoInputAndNoOutputOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl NoInputAndNoOutputOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`NoInputAndNoOutputOutput`](crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`NoInputAndNoOutputOutput`](crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`NoInputAndNoOutputOutput`](crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`NoInputAndNoOutputOutput`](crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput).
          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 NoInputAndNoOutputOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct NoInputAndNoOutputOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl NoInputAndNoOutputOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`NoInputAndNoOutputOutput`](crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`NoInputAndNoOutputOutput`](crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput {
   20         -
        crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::no_input_and_no_output::NoInputAndNoOutputOutput {
          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/no_input_and_no_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::no_input_and_no_output::_no_input_and_no_output_output::NoInputAndNoOutputOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::no_input_and_no_output::_no_input_and_no_output_input::NoInputAndNoOutputInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputInputBuilder {
    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::no_input_and_no_output::NoInputAndNoOutputOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.no_input_and_no_output();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `NoInputAndNoOutput`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `NoInputAndNoOutput`.
   24     27   
///
   25         -
/// The example tests how requests and responses are serialized when there's no request or response payload because the operation has no input or output. 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 no input or output. 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 NoInputAndNoOutputFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputInputBuilder,
   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::no_input_and_no_output::NoInputAndNoOutputOutput,
   35     41   
        crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   36     42   
    > for NoInputAndNoOutputFluentBuilder
   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::no_input_and_no_output::NoInputAndNoOutputOutput,
   44     50   
            crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   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 NoInputAndNoOutputFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `NoInputAndNoOutputFluentBuilder`.
   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 NoInputAndNoOutput as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::no_input_and_no_output::builders::NoInputAndNoOutputInputBuilder {
   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::no_input_and_no_output::NoInputAndNoOutputOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   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::no_input_and_no_output::NoInputAndNoOutput::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::no_input_and_no_output::NoInputAndNoOutput::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::no_input_and_no_output::NoInputAndNoOutputOutput,
   97    107   
        crate::operation::no_input_and_no_output::NoInputAndNoOutputError,
   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/no_input_and_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 `NoInputAndOutput`.
           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 NoInputAndOutput;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl NoInputAndOutput {
    7         -
    /// Creates a new `NoInputAndOutput`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `NoInputAndOutput`
          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::no_input_and_output::NoInputAndOutputInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::no_input_and_output::NoInputAndOutputOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::no_input_and_output::NoInputAndOutputError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +265,282 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for NoInputAndOutput {
   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("NoInputAndOutput");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            NoInputAndOutputRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            NoInputAndOutputResponseDeserializer,
   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   
            "NoInputAndOutput",
  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("NoInputAndOutput")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(NoInputAndOutputEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::no_input_and_output::NoInputAndOutputError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::no_input_and_output::NoInputAndOutputError,
  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 NoInputAndOutputResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for NoInputAndOutputResponseDeserializer {
  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_no_input_and_output::de_no_input_and_output_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_no_input_and_output::de_no_input_and_output_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 NoInputAndOutputRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for NoInputAndOutputRequestSerializer {
  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::no_input_and_output::NoInputAndOutputInput>()
  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::no_input_and_output::NoInputAndOutputInput,
  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::no_input_and_output::NoInputAndOutputInput,
  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.NoInputAndOutput",
  191    204   
            );
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_no_input_and_output::ser_no_input_and_output_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 NoInputAndOutputEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for NoInputAndOutputEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "NoInputAndOutputEndpointParamsInterceptor"
  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::<NoInputAndOutputInput>()
  220    234   
            .ok_or("failed to downcast to NoInputAndOutputInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* RustType.kt:516 */
  234    249   
#[allow(unreachable_code, unused_variables)]
         250  +
/* RustType.kt:516 */
  235    251   
#[cfg(test)]
         252  +
/* ProtocolTestGenerator.kt:98 */
  236    253   
mod no_input_and_output_test {
  237    254   
  238    255   
    /// A client should always send and empty JSON object payload.
  239    256   
    /// Test ID: AwsJson10NoInputAndOutput
  240    257   
    #[::tokio::test]
  241    258   
    #[::tracing_test::traced_test]
  242    259   
    async fn aws_json10_no_input_and_output_request() {
  243    260   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  244    261   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  245    262   
@@ -274,291 +403,479 @@
  294    311   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  295    312   
                )))
  296    313   
            });
  297    314   
            de.deserialize_nonstreaming(&http_response)
  298    315   
        });
  299    316   
        let parsed = parsed
  300    317   
            .expect("should be successful response")
  301    318   
            .downcast::<crate::operation::no_input_and_output::NoInputAndOutputOutput>()
  302    319   
            .unwrap();
  303    320   
    }
         321  +
         322  +
    /* ProtocolTestGenerator.kt:98 */
  304    323   
}
  305    324   
         325  +
/* OperationErrorGenerator.kt:79 */
  306    326   
/// Error type for the `NoInputAndOutputError` operation.
         327  +
/* RustType.kt:516 */
  307    328   
#[non_exhaustive]
         329  +
/* RustType.kt:516 */
  308    330   
#[derive(::std::fmt::Debug)]
  309         -
pub enum NoInputAndOutputError {
         331  +
pub /* OperationErrorGenerator.kt:81 */ enum NoInputAndOutputError {
         332  +
    /* OperationErrorGenerator.kt:88 */
  310    333   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  311    334   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  312    335   
    variable wildcard pattern and check `.code()`:
  313    336   
     \
  314    337   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  315    338   
     \
  316    339   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-NoInputAndOutputError) for what information is available for the error.")]
  317    340   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         341  +
    /* OperationErrorGenerator.kt:81 */
  318    342   
}
         343  +
/* OperationErrorGenerator.kt:218 */
  319    344   
impl NoInputAndOutputError {
         345  +
    /* OperationErrorGenerator.kt:219 */
  320    346   
    /// Creates the `NoInputAndOutputError::Unhandled` variant from any error type.
  321    347   
    pub fn unhandled(
  322    348   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  323    349   
    ) -> Self {
  324    350   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  325    351   
            source: err.into(),
  326    352   
            meta: ::std::default::Default::default(),
  327    353   
        })
  328    354   
    }
  329    355   
  330    356   
    /// Creates the `NoInputAndOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  331    357   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  332    358   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  333    359   
            source: err.clone().into(),
  334    360   
            meta: err,
  335    361   
        })
  336    362   
    }
  337         -
    ///
         363  +
    /// /* OperationErrorGenerator.kt:236 */
  338    364   
    /// Returns error metadata, which includes the error code, message,
  339    365   
    /// request ID, and potentially additional information.
  340    366   
    ///
         367  +
    /* OperationErrorGenerator.kt:242 */
  341    368   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         369  +
        /* OperationErrorGenerator.kt:243 */
  342    370   
        match self {
  343         -
            Self::Unhandled(e) => &e.meta,
         371  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         372  +
            /* OperationErrorGenerator.kt:243 */
  344    373   
        }
         374  +
        /* OperationErrorGenerator.kt:242 */
  345    375   
    }
         376  +
    /* OperationErrorGenerator.kt:218 */
  346    377   
}
         378  +
/* OperationErrorGenerator.kt:269 */
  347    379   
impl ::std::error::Error for NoInputAndOutputError {
         380  +
    /* OperationErrorGenerator.kt:270 */
  348    381   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         382  +
        /* OperationErrorGenerator.kt:318 */
  349    383   
        match self {
  350         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         384  +
            /* OperationErrorGenerator.kt:326 */
         385  +
            Self::Unhandled(_inner) => {
         386  +
                /* OperationErrorGenerator.kt:279 */
         387  +
                ::std::option::Option::Some(&*_inner.source)
         388  +
                /* OperationErrorGenerator.kt:326 */
         389  +
            } /* OperationErrorGenerator.kt:318 */
  351    390   
        }
         391  +
        /* OperationErrorGenerator.kt:270 */
  352    392   
    }
         393  +
    /* OperationErrorGenerator.kt:269 */
  353    394   
}
         395  +
/* OperationErrorGenerator.kt:133 */
  354    396   
impl ::std::fmt::Display for NoInputAndOutputError {
         397  +
    /* OperationErrorGenerator.kt:134 */
  355    398   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         399  +
        /* OperationErrorGenerator.kt:318 */
  356    400   
        match self {
         401  +
            /* OperationErrorGenerator.kt:326 */
  357    402   
            Self::Unhandled(_inner) => {
         403  +
                /* OperationErrorGenerator.kt:139 */
  358    404   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  359    405   
                    write!(f, "unhandled error ({code})")
  360    406   
                } else {
  361    407   
                    f.write_str("unhandled error")
  362    408   
                }
  363         -
            }
         409  +
                /* OperationErrorGenerator.kt:326 */
         410  +
            } /* OperationErrorGenerator.kt:318 */
  364    411   
        }
         412  +
        /* OperationErrorGenerator.kt:134 */
  365    413   
    }
         414  +
    /* OperationErrorGenerator.kt:133 */
  366    415   
}
         416  +
/* OperationErrorGenerator.kt:182 */
  367    417   
impl ::aws_smithy_types::retry::ProvideErrorKind for NoInputAndOutputError {
         418  +
    /* OperationErrorGenerator.kt:186 */
  368    419   
    fn code(&self) -> ::std::option::Option<&str> {
         420  +
        /* OperationErrorGenerator.kt:187 */
  369    421   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         422  +
        /* OperationErrorGenerator.kt:186 */
  370    423   
    }
         424  +
    /* OperationErrorGenerator.kt:190 */
  371    425   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         426  +
        /* OperationErrorGenerator.kt:197 */
  372    427   
        ::std::option::Option::None
         428  +
        /* OperationErrorGenerator.kt:190 */
  373    429   
    }
         430  +
    /* OperationErrorGenerator.kt:182 */
  374    431   
}
         432  +
/* OperationErrorGenerator.kt:163 */
  375    433   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for NoInputAndOutputError {
         434  +
    /* OperationErrorGenerator.kt:164 */
  376    435   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         436  +
        /* OperationErrorGenerator.kt:318 */
  377    437   
        match self {
  378         -
            Self::Unhandled(_inner) => &_inner.meta,
         438  +
            /* OperationErrorGenerator.kt:326 */
         439  +
            Self::Unhandled(_inner) => {
         440  +
                /* OperationErrorGenerator.kt:168 */
         441  +
                &_inner.meta
         442  +
                /* OperationErrorGenerator.kt:326 */
         443  +
            } /* OperationErrorGenerator.kt:318 */
  379    444   
        }
         445  +
        /* OperationErrorGenerator.kt:164 */
  380    446   
    }
         447  +
    /* OperationErrorGenerator.kt:163 */
  381    448   
}
         449  +
/* OperationErrorGenerator.kt:109 */
  382    450   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for NoInputAndOutputError {
         451  +
    /* OperationErrorGenerator.kt:110 */
  383    452   
    fn create_unhandled_error(
  384    453   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  385    454   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  386    455   
    ) -> Self {
         456  +
        /* OperationErrorGenerator.kt:121 */
  387    457   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  388    458   
            source,
  389    459   
            meta: meta.unwrap_or_default(),
  390    460   
        })
         461  +
        /* OperationErrorGenerator.kt:110 */
  391    462   
    }
         463  +
    /* OperationErrorGenerator.kt:109 */
  392    464   
}
  393    465   
         466  +
/* CodegenDelegator.kt:255 */
  394    467   
pub use crate::operation::no_input_and_output::_no_input_and_output_output::NoInputAndOutputOutput;
  395    468   
         469  +
/* CodegenDelegator.kt:255 */
  396    470   
pub use crate::operation::no_input_and_output::_no_input_and_output_input::NoInputAndOutputInput;
  397    471   
         472  +
/* RustModule.kt:172 */
  398    473   
mod _no_input_and_output_input;
  399    474   
         475  +
/* RustModule.kt:172 */
  400    476   
mod _no_input_and_output_output;
  401    477   
  402         -
/// Builders
         478  +
/// /* CodegenDelegator.kt:51 */Builders
  403    479   
pub mod builders;

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/no_input_and_output/_no_input_and_output_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 NoInputAndOutputInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct NoInputAndOutputInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl NoInputAndOutputInput {
    7         -
    /// Creates a new builder-style object to manufacture [`NoInputAndOutputInput`](crate::operation::no_input_and_output::NoInputAndOutputInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`NoInputAndOutputInput`](crate::operation::no_input_and_output::NoInputAndOutputInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::no_input_and_output::builders::NoInputAndOutputInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::no_input_and_output::builders::NoInputAndOutputInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`NoInputAndOutputInput`](crate::operation::no_input_and_output::NoInputAndOutputInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`NoInputAndOutputInput`](crate::operation::no_input_and_output::NoInputAndOutputInput).
          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 NoInputAndOutputInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct NoInputAndOutputInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl NoInputAndOutputInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`NoInputAndOutputInput`](crate::operation::no_input_and_output::NoInputAndOutputInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`NoInputAndOutputInput`](crate::operation::no_input_and_output::NoInputAndOutputInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(
   20     33   
        self,
   21     34   
    ) -> ::std::result::Result<crate::operation::no_input_and_output::NoInputAndOutputInput, ::aws_smithy_types::error::operation::BuildError> {
   22         -
        ::std::result::Result::Ok(crate::operation::no_input_and_output::NoInputAndOutputInput {})
          35  +
        /* BuilderGenerator.kt:254 */
          36  +
        ::std::result::Result::Ok(
          37  +
            /* BuilderGenerator.kt:477 */
          38  +
            crate::operation::no_input_and_output::NoInputAndOutputInput {
          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/no_input_and_output/_no_input_and_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 NoInputAndOutputOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct NoInputAndOutputOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl NoInputAndOutputOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`NoInputAndOutputOutput`](crate::operation::no_input_and_output::NoInputAndOutputOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`NoInputAndOutputOutput`](crate::operation::no_input_and_output::NoInputAndOutputOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::no_input_and_output::builders::NoInputAndOutputOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::no_input_and_output::builders::NoInputAndOutputOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`NoInputAndOutputOutput`](crate::operation::no_input_and_output::NoInputAndOutputOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`NoInputAndOutputOutput`](crate::operation::no_input_and_output::NoInputAndOutputOutput).
          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 NoInputAndOutputOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct NoInputAndOutputOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl NoInputAndOutputOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`NoInputAndOutputOutput`](crate::operation::no_input_and_output::NoInputAndOutputOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`NoInputAndOutputOutput`](crate::operation::no_input_and_output::NoInputAndOutputOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::no_input_and_output::NoInputAndOutputOutput {
   20         -
        crate::operation::no_input_and_output::NoInputAndOutputOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::no_input_and_output::NoInputAndOutputOutput {
          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/no_input_and_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::no_input_and_output::_no_input_and_output_output::NoInputAndOutputOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::no_input_and_output::_no_input_and_output_input::NoInputAndOutputInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::no_input_and_output::builders::NoInputAndOutputInputBuilder {
    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::no_input_and_output::NoInputAndOutputOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::no_input_and_output::NoInputAndOutputError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.no_input_and_output();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `NoInputAndOutput`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `NoInputAndOutput`.
   24     27   
///
   25         -
/// The example tests how requests and responses are serialized when there's no request or response payload because the operation has no input and the output is empty. 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 no input and the output is empty. 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 NoInputAndOutputFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::no_input_and_output::builders::NoInputAndOutputInputBuilder,
   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::no_input_and_output::NoInputAndOutputOutput,
   35     41   
        crate::operation::no_input_and_output::NoInputAndOutputError,
   36     42   
    > for NoInputAndOutputFluentBuilder
   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::no_input_and_output::NoInputAndOutputOutput,
   44     50   
            crate::operation::no_input_and_output::NoInputAndOutputError,
   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 NoInputAndOutputFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `NoInputAndOutputFluentBuilder`.
   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 NoInputAndOutput as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::no_input_and_output::builders::NoInputAndOutputInputBuilder {
   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::no_input_and_output::NoInputAndOutputOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::no_input_and_output::NoInputAndOutputError,
   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::no_input_and_output::NoInputAndOutput::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::no_input_and_output::NoInputAndOutput::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::no_input_and_output::NoInputAndOutputOutput,
   97    107   
        crate::operation::no_input_and_output::NoInputAndOutputError,
   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   
}