Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/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   
    > {
@@ -63,72 +358,434 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for HostWithPathOperation {
   95    106   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   96    107   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("HostWithPathOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            HostWithPathOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            HostWithPathOperationResponseDeserializer,
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  106    117   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  107    118   
        ));
  108    119   
  109    120   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  110    121   
            "HostWithPathOperation",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("HostWithPathOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(HostWithPathOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::host_with_path_operation::HostWithPathOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::host_with_path_operation::HostWithPathOperationError,
  130    141   
            >::new());
  131    142   
  132    143   
        ::std::borrow::Cow::Owned(rcb)
  133    144   
    }
  134    145   
}
  135    146   
         147  +
/* ResponseDeserializerGenerator.kt:64 */
  136    148   
#[derive(Debug)]
  137    149   
struct HostWithPathOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HostWithPathOperationResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 200 || force_error {
  150    162   
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct HostWithPathOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HostWithPathOperationRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::host_with_path_operation::HostWithPathOperationInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::host_with_path_operation::HostWithPathOperationInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/HostWithPathOperation").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::host_with_path_operation::HostWithPathOperationInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct HostWithPathOperationEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HostWithPathOperationEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "HostWithPathOperationEndpointParamsInterceptor"
  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::<HostWithPathOperationInput>()
  220    234   
            .ok_or("failed to downcast to HostWithPathOperationInput")?;
  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 host_with_path_operation_test {
  237    254   
  238    255   
    /// Custom endpoints supplied by users can have paths
  239    256   
    /// Test ID: RestJsonHostWithPath
  240    257   
    #[::tokio::test]
  241    258   
    #[::tracing_test::traced_test]
  242    259   
    async fn rest_json_host_with_path_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()
  245    262   
            .with_test_defaults()
  246    263   
            .endpoint_url("https://example.com/custom");
  247    264   
  248    265   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  249    266   
        let result = client.host_with_path_operation().send().await;
  250    267   
        let _ = dbg!(result);
  251    268   
        let http_request = request_receiver.expect_request();
  252    269   
        let body = http_request.body().bytes().expect("body should be strict");
  253    270   
        // No body.
  254    271   
        ::pretty_assertions::assert_eq!(&body, &bytes::Bytes::new());
  255    272   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  256    273   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  257    274   
        ::pretty_assertions::assert_eq!(uri.path(), "/custom/HostWithPathOperation", "path was incorrect");
  258    275   
    }
         276  +
         277  +
    /* ProtocolTestGenerator.kt:98 */
  259    278   
}
  260    279   
         280  +
/* OperationErrorGenerator.kt:79 */
  261    281   
/// Error type for the `HostWithPathOperationError` operation.
         282  +
/* RustType.kt:516 */
  262    283   
#[non_exhaustive]
         284  +
/* RustType.kt:516 */
  263    285   
#[derive(::std::fmt::Debug)]
  264         -
pub enum HostWithPathOperationError {
         286  +
pub /* OperationErrorGenerator.kt:81 */ enum HostWithPathOperationError {
         287  +
    /* OperationErrorGenerator.kt:88 */
  265    288   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  266    289   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  267    290   
    variable wildcard pattern and check `.code()`:
  268    291   
     \
  269    292   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  270    293   
     \
  271    294   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-HostWithPathOperationError) for what information is available for the error.")]
  272    295   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         296  +
    /* OperationErrorGenerator.kt:81 */
  273    297   
}
         298  +
/* OperationErrorGenerator.kt:218 */
  274    299   
impl HostWithPathOperationError {
         300  +
    /* OperationErrorGenerator.kt:219 */
  275    301   
    /// Creates the `HostWithPathOperationError::Unhandled` variant from any error type.
  276    302   
    pub fn unhandled(
  277    303   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  278    304   
    ) -> Self {
  279    305   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  280    306   
            source: err.into(),
  281    307   
            meta: ::std::default::Default::default(),
  282    308   
        })
  283    309   
    }
  284    310   
  285    311   
    /// Creates the `HostWithPathOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  286    312   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  287    313   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  288    314   
            source: err.clone().into(),
  289    315   
            meta: err,
  290    316   
        })
  291    317   
    }
  292         -
    ///
         318  +
    /// /* OperationErrorGenerator.kt:236 */
  293    319   
    /// Returns error metadata, which includes the error code, message,
  294    320   
    /// request ID, and potentially additional information.
  295    321   
    ///
         322  +
    /* OperationErrorGenerator.kt:242 */
  296    323   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         324  +
        /* OperationErrorGenerator.kt:243 */
  297    325   
        match self {
  298         -
            Self::Unhandled(e) => &e.meta,
         326  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         327  +
            /* OperationErrorGenerator.kt:243 */
  299    328   
        }
         329  +
        /* OperationErrorGenerator.kt:242 */
  300    330   
    }
         331  +
    /* OperationErrorGenerator.kt:218 */
  301    332   
}
         333  +
/* OperationErrorGenerator.kt:269 */
  302    334   
impl ::std::error::Error for HostWithPathOperationError {
         335  +
    /* OperationErrorGenerator.kt:270 */
  303    336   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         337  +
        /* OperationErrorGenerator.kt:318 */
  304    338   
        match self {
  305         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         339  +
            /* OperationErrorGenerator.kt:326 */
         340  +
            Self::Unhandled(_inner) => {
         341  +
                /* OperationErrorGenerator.kt:279 */
         342  +
                ::std::option::Option::Some(&*_inner.source)
         343  +
                /* OperationErrorGenerator.kt:326 */
         344  +
            } /* OperationErrorGenerator.kt:318 */
  306    345   
        }
         346  +
        /* OperationErrorGenerator.kt:270 */
  307    347   
    }
         348  +
    /* OperationErrorGenerator.kt:269 */
  308    349   
}
         350  +
/* OperationErrorGenerator.kt:133 */
  309    351   
impl ::std::fmt::Display for HostWithPathOperationError {
         352  +
    /* OperationErrorGenerator.kt:134 */
  310    353   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         354  +
        /* OperationErrorGenerator.kt:318 */
  311    355   
        match self {
         356  +
            /* OperationErrorGenerator.kt:326 */
  312    357   
            Self::Unhandled(_inner) => {
         358  +
                /* OperationErrorGenerator.kt:139 */
  313    359   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  314    360   
                    write!(f, "unhandled error ({code})")
  315    361   
                } else {
  316    362   
                    f.write_str("unhandled error")
  317    363   
                }
         364  +
                /* OperationErrorGenerator.kt:326 */
         365  +
            } /* OperationErrorGenerator.kt:318 */
  318    366   
        }
         367  +
        /* OperationErrorGenerator.kt:134 */
  319    368   
    }
  320         -
    }
         369  +
    /* OperationErrorGenerator.kt:133 */
  321    370   
}
         371  +
/* OperationErrorGenerator.kt:182 */
  322    372   
impl ::aws_smithy_types::retry::ProvideErrorKind for HostWithPathOperationError {
         373  +
    /* OperationErrorGenerator.kt:186 */
  323    374   
    fn code(&self) -> ::std::option::Option<&str> {
         375  +
        /* OperationErrorGenerator.kt:187 */
  324    376   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         377  +
        /* OperationErrorGenerator.kt:186 */
  325    378   
    }
         379  +
    /* OperationErrorGenerator.kt:190 */
  326    380   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         381  +
        /* OperationErrorGenerator.kt:197 */
  327    382   
        ::std::option::Option::None
         383  +
        /* OperationErrorGenerator.kt:190 */
  328    384   
    }
         385  +
    /* OperationErrorGenerator.kt:182 */
  329    386   
}
         387  +
/* OperationErrorGenerator.kt:163 */
  330    388   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for HostWithPathOperationError {
         389  +
    /* OperationErrorGenerator.kt:164 */
  331    390   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         391  +
        /* OperationErrorGenerator.kt:318 */
  332    392   
        match self {
  333         -
            Self::Unhandled(_inner) => &_inner.meta,
         393  +
            /* OperationErrorGenerator.kt:326 */
         394  +
            Self::Unhandled(_inner) => {
         395  +
                /* OperationErrorGenerator.kt:168 */
         396  +
                &_inner.meta
         397  +
                /* OperationErrorGenerator.kt:326 */
         398  +
            } /* OperationErrorGenerator.kt:318 */
  334    399   
        }
         400  +
        /* OperationErrorGenerator.kt:164 */
  335    401   
    }
         402  +
    /* OperationErrorGenerator.kt:163 */
  336    403   
}
         404  +
/* OperationErrorGenerator.kt:109 */
  337    405   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for HostWithPathOperationError {
         406  +
    /* OperationErrorGenerator.kt:110 */
  338    407   
    fn create_unhandled_error(
  339    408   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  340    409   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  341    410   
    ) -> Self {
         411  +
        /* OperationErrorGenerator.kt:121 */
  342    412   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  343    413   
            source,
  344    414   
            meta: meta.unwrap_or_default(),
  345    415   
        })
         416  +
        /* OperationErrorGenerator.kt:110 */
  346    417   
    }
         418  +
    /* OperationErrorGenerator.kt:109 */
  347    419   
}
  348    420   
         421  +
/* CodegenDelegator.kt:255 */
  349    422   
pub use crate::operation::host_with_path_operation::_host_with_path_operation_output::HostWithPathOperationOutput;
  350    423   
         424  +
/* CodegenDelegator.kt:255 */
  351    425   
pub use crate::operation::host_with_path_operation::_host_with_path_operation_input::HostWithPathOperationInput;
  352    426   
         427  +
/* RustModule.kt:172 */
  353    428   
mod _host_with_path_operation_input;
  354    429   
         430  +
/* RustModule.kt:172 */
  355    431   
mod _host_with_path_operation_output;
  356    432   
  357         -
/// Builders
         433  +
/// /* CodegenDelegator.kt:51 */Builders
  358    434   
pub mod builders;

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_checksum_required/_http_checksum_required_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_checksum_required/_http_checksum_required_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_checksum_required/builders.rs

@@ -1,1 +125,143 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::http_checksum_required::_http_checksum_required_output::HttpChecksumRequiredOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::http_checksum_required::_http_checksum_required_input::HttpChecksumRequiredInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::http_checksum_required::builders::HttpChecksumRequiredInputBuilder {
    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::http_checksum_required::HttpChecksumRequiredOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::http_checksum_required::HttpChecksumRequiredError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.http_checksum_required();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `HttpChecksumRequired`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `HttpChecksumRequired`.
   24     27   
///
   25         -
/// This example tests httpChecksumRequired trait
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example tests httpChecksumRequired trait
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct HttpChecksumRequiredFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::http_checksum_required::builders::HttpChecksumRequiredInputBuilder,
   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::http_checksum_required::HttpChecksumRequiredOutput,
   35     41   
        crate::operation::http_checksum_required::HttpChecksumRequiredError,
   36     42   
    > for HttpChecksumRequiredFluentBuilder
   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::http_checksum_required::HttpChecksumRequiredOutput,
   44     50   
            crate::operation::http_checksum_required::HttpChecksumRequiredError,
   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 HttpChecksumRequiredFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `HttpChecksumRequiredFluentBuilder`.
   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 HttpChecksumRequired as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::http_checksum_required::builders::HttpChecksumRequiredInputBuilder {
   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::http_checksum_required::HttpChecksumRequiredOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::http_checksum_required::HttpChecksumRequiredError,
   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::http_checksum_required::HttpChecksumRequired::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::http_checksum_required::HttpChecksumRequired::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::http_checksum_required::HttpChecksumRequiredOutput,
   97    107   
        crate::operation::http_checksum_required::HttpChecksumRequiredError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:498 */
  111    123   
    #[allow(missing_docs)] // documentation missing in model
         124  +
                           /* FluentBuilderGenerator.kt:500 */
  112    125   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.foo(input.into());
  114    127   
        self
  115    128   
    }
         129  +
    /* FluentBuilderGenerator.kt:498 */
  116    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* FluentBuilderGenerator.kt:500 */
  117    132   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_foo(input);
  119    134   
        self
  120    135   
    }
         136  +
    /* FluentBuilderGenerator.kt:518 */
  121    137   
    #[allow(missing_docs)] // documentation missing in model
         138  +
                           /* FluentBuilderGenerator.kt:520 */
  122    139   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_foo()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:282 */
  125    143   
}

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_enum_payload/_http_enum_payload_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_enum_payload/_http_enum_payload_output.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_enum_payload/builders.rs

@@ -1,1 +124,142 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::http_enum_payload::_http_enum_payload_output::HttpEnumPayloadOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::http_enum_payload::_http_enum_payload_input::HttpEnumPayloadInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::http_enum_payload::builders::HttpEnumPayloadInputBuilder {
    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::http_enum_payload::HttpEnumPayloadOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::http_enum_payload::HttpEnumPayloadError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.http_enum_payload();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `HttpEnumPayload`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `HttpEnumPayload`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct HttpEnumPayloadFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::http_enum_payload::builders::HttpEnumPayloadInputBuilder,
   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::http_enum_payload::HttpEnumPayloadOutput,
   34     40   
        crate::operation::http_enum_payload::HttpEnumPayloadError,
   35     41   
    > for HttpEnumPayloadFluentBuilder
   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::http_enum_payload::HttpEnumPayloadOutput,
   43     49   
            crate::operation::http_enum_payload::HttpEnumPayloadError,
   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 HttpEnumPayloadFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `HttpEnumPayloadFluentBuilder`.
   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 HttpEnumPayload as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::http_enum_payload::builders::HttpEnumPayloadInputBuilder {
   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::http_enum_payload::HttpEnumPayloadOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::http_enum_payload::HttpEnumPayloadError,
   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::http_enum_payload::HttpEnumPayload::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::http_enum_payload::HttpEnumPayload::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::http_enum_payload::HttpEnumPayloadOutput,
   96    106   
        crate::operation::http_enum_payload::HttpEnumPayloadError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn payload(mut self, input: crate::types::StringEnum) -> Self {
  112    125   
        self.inner = self.inner.payload(input);
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_payload(mut self, input: ::std::option::Option<crate::types::StringEnum>) -> Self {
  117    132   
        self.inner = self.inner.set_payload(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_payload(&self) -> &::std::option::Option<crate::types::StringEnum> {
  122    139   
        self.inner.get_payload()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:282 */
  124    142   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_traits.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 `HttpPayloadTraits`.
           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 HttpPayloadTraits;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl HttpPayloadTraits {
    7         -
    /// Creates a new `HttpPayloadTraits`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `HttpPayloadTraits`
          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::http_payload_traits::HttpPayloadTraitsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::http_payload_traits::HttpPayloadTraitsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::http_payload_traits::HttpPayloadTraitsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +271,288 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for HttpPayloadTraits {
   95    106   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   96    107   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("HttpPayloadTraits");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            HttpPayloadTraitsRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            HttpPayloadTraitsResponseDeserializer,
  103    114   
        ));
  104    115   
  105    116   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  106    117   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  107    118   
        ));
  108    119   
  109    120   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  110    121   
            "HttpPayloadTraits",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("HttpPayloadTraits")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(HttpPayloadTraitsEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::http_payload_traits::HttpPayloadTraitsError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::http_payload_traits::HttpPayloadTraitsError,
  130    141   
            >::new());
  131    142   
  132    143   
        ::std::borrow::Cow::Owned(rcb)
  133    144   
    }
  134    145   
}
  135    146   
         147  +
/* ResponseDeserializerGenerator.kt:64 */
  136    148   
#[derive(Debug)]
  137    149   
struct HttpPayloadTraitsResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpPayloadTraitsResponseDeserializer {
  139    151   
    fn deserialize_nonstreaming(
  140    152   
        &self,
  141    153   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  142    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  143    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  144    156   
        let headers = response.headers();
  145    157   
        let body = response.body().bytes().expect("body loaded");
  146    158   
        #[allow(unused_mut)]
  147    159   
        let mut force_error = false;
  148    160   
  149    161   
        let parse_result = if !success && status != 200 || force_error {
  150    162   
            crate::protocol_serde::shape_http_payload_traits::de_http_payload_traits_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_http_payload_traits::de_http_payload_traits_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct HttpPayloadTraitsRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpPayloadTraitsRequestSerializer {
  160    173   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  161    174   
    fn serialize_input(
  162    175   
        &self,
  163    176   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  164    177   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  165    178   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  166    179   
        let input = input
  167    180   
            .downcast::<crate::operation::http_payload_traits::HttpPayloadTraitsInput>()
  168    181   
            .expect("correct type");
  169    182   
        let _header_serialization_settings = _cfg
  170    183   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  171    184   
            .cloned()
  172    185   
            .unwrap_or_default();
  173    186   
        let mut request_builder = {
  174    187   
            fn uri_base(
  175    188   
                _input: &crate::operation::http_payload_traits::HttpPayloadTraitsInput,
  176    189   
                output: &mut ::std::string::String,
  177    190   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    191   
                use ::std::fmt::Write as _;
  179    192   
                ::std::write!(output, "/HttpPayloadTraits").expect("formatting should succeed");
  180    193   
                ::std::result::Result::Ok(())
  181    194   
            }
  182    195   
            #[allow(clippy::unnecessary_wraps)]
  183    196   
            fn update_http_builder(
  184    197   
                input: &crate::operation::http_payload_traits::HttpPayloadTraitsInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                let builder = crate::protocol_serde::shape_http_payload_traits::ser_http_payload_traits_headers(input, builder)?;
  190    203   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  191    204   
            }
  192    205   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  193    206   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/octet-stream");
  194    207   
            builder
  195    208   
        };
  196    209   
        let body =
  197    210   
            ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_http_payload_traits_input::ser_blob_http_payload(input.blob)?);
  198    211   
        if let Some(content_length) = body.content_length() {
  199    212   
            let content_length = content_length.to_string();
  200    213   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  201    214   
        }
  202    215   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  203    216   
    }
  204    217   
}
         218  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  205    219   
#[derive(Debug)]
  206    220   
struct HttpPayloadTraitsEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpPayloadTraitsEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "HttpPayloadTraitsEndpointParamsInterceptor"
  211    225   
    }
  212    226   
  213    227   
    fn read_before_execution(
  214    228   
        &self,
  215    229   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  216    230   
            '_,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  218    232   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  220    234   
        >,
  221    235   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  222    236   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  223    237   
        let _input = context
  224    238   
            .input()
  225    239   
            .downcast_ref::<HttpPayloadTraitsInput>()
  226    240   
            .ok_or("failed to downcast to HttpPayloadTraitsInput")?;
  227    241   
  228    242   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  229    243   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  230    244   
        })?;
  231    245   
        cfg.interceptor_state()
  232    246   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  233    247   
        ::std::result::Result::Ok(())
  234    248   
    }
  235    249   
}
  236    250   
  237    251   
// The get_* functions below are generated from JMESPath expressions in the
  238    252   
// operationContextParams trait. They target the operation's input shape.
  239    253   
         254  +
/* RustType.kt:516 */
  240    255   
#[allow(unreachable_code, unused_variables)]
         256  +
/* RustType.kt:516 */
  241    257   
#[cfg(test)]
         258  +
/* ProtocolTestGenerator.kt:98 */
  242    259   
mod http_payload_traits_test {
  243    260   
  244    261   
    /// Serializes a blob in the HTTP payload
  245    262   
    /// Test ID: RestJsonHttpPayloadTraitsWithBlob
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn rest_json_http_payload_traits_with_blob_request() {
  249    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    267   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  251    268   
@@ -358,375 +487,563 @@
  378    395   
            });
  379    396   
            de.deserialize_nonstreaming(&http_response)
  380    397   
        });
  381    398   
        let parsed = parsed
  382    399   
            .expect("should be successful response")
  383    400   
            .downcast::<crate::operation::http_payload_traits::HttpPayloadTraitsOutput>()
  384    401   
            .unwrap();
  385    402   
        ::pretty_assertions::assert_eq!(parsed.foo, expected_output.foo, "Unexpected value for `foo`");
  386    403   
        ::pretty_assertions::assert_eq!(parsed.blob, expected_output.blob, "Unexpected value for `blob`");
  387    404   
    }
         405  +
         406  +
    /* ProtocolTestGenerator.kt:98 */
  388    407   
}
  389    408   
         409  +
/* OperationErrorGenerator.kt:79 */
  390    410   
/// Error type for the `HttpPayloadTraitsError` operation.
         411  +
/* RustType.kt:516 */
  391    412   
#[non_exhaustive]
         413  +
/* RustType.kt:516 */
  392    414   
#[derive(::std::fmt::Debug)]
  393         -
pub enum HttpPayloadTraitsError {
         415  +
pub /* OperationErrorGenerator.kt:81 */ enum HttpPayloadTraitsError {
         416  +
    /* OperationErrorGenerator.kt:88 */
  394    417   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  395    418   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  396    419   
    variable wildcard pattern and check `.code()`:
  397    420   
     \
  398    421   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  399    422   
     \
  400    423   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-HttpPayloadTraitsError) for what information is available for the error.")]
  401    424   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         425  +
    /* OperationErrorGenerator.kt:81 */
  402    426   
}
         427  +
/* OperationErrorGenerator.kt:218 */
  403    428   
impl HttpPayloadTraitsError {
         429  +
    /* OperationErrorGenerator.kt:219 */
  404    430   
    /// Creates the `HttpPayloadTraitsError::Unhandled` variant from any error type.
  405    431   
    pub fn unhandled(
  406    432   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  407    433   
    ) -> Self {
  408    434   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  409    435   
            source: err.into(),
  410    436   
            meta: ::std::default::Default::default(),
  411    437   
        })
  412    438   
    }
  413    439   
  414    440   
    /// Creates the `HttpPayloadTraitsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  415    441   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  416    442   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  417    443   
            source: err.clone().into(),
  418    444   
            meta: err,
  419    445   
        })
  420    446   
    }
  421         -
    ///
         447  +
    /// /* OperationErrorGenerator.kt:236 */
  422    448   
    /// Returns error metadata, which includes the error code, message,
  423    449   
    /// request ID, and potentially additional information.
  424    450   
    ///
         451  +
    /* OperationErrorGenerator.kt:242 */
  425    452   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         453  +
        /* OperationErrorGenerator.kt:243 */
  426    454   
        match self {
  427         -
            Self::Unhandled(e) => &e.meta,
         455  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         456  +
            /* OperationErrorGenerator.kt:243 */
  428    457   
        }
         458  +
        /* OperationErrorGenerator.kt:242 */
  429    459   
    }
         460  +
    /* OperationErrorGenerator.kt:218 */
  430    461   
}
         462  +
/* OperationErrorGenerator.kt:269 */
  431    463   
impl ::std::error::Error for HttpPayloadTraitsError {
         464  +
    /* OperationErrorGenerator.kt:270 */
  432    465   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         466  +
        /* OperationErrorGenerator.kt:318 */
  433    467   
        match self {
  434         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         468  +
            /* OperationErrorGenerator.kt:326 */
         469  +
            Self::Unhandled(_inner) => {
         470  +
                /* OperationErrorGenerator.kt:279 */
         471  +
                ::std::option::Option::Some(&*_inner.source)
         472  +
                /* OperationErrorGenerator.kt:326 */
         473  +
            } /* OperationErrorGenerator.kt:318 */
  435    474   
        }
         475  +
        /* OperationErrorGenerator.kt:270 */
  436    476   
    }
         477  +
    /* OperationErrorGenerator.kt:269 */
  437    478   
}
         479  +
/* OperationErrorGenerator.kt:133 */
  438    480   
impl ::std::fmt::Display for HttpPayloadTraitsError {
         481  +
    /* OperationErrorGenerator.kt:134 */
  439    482   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         483  +
        /* OperationErrorGenerator.kt:318 */
  440    484   
        match self {
         485  +
            /* OperationErrorGenerator.kt:326 */
  441    486   
            Self::Unhandled(_inner) => {
         487  +
                /* OperationErrorGenerator.kt:139 */
  442    488   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  443    489   
                    write!(f, "unhandled error ({code})")
  444    490   
                } else {
  445    491   
                    f.write_str("unhandled error")
  446    492   
                }
         493  +
                /* OperationErrorGenerator.kt:326 */
         494  +
            } /* OperationErrorGenerator.kt:318 */
  447    495   
        }
         496  +
        /* OperationErrorGenerator.kt:134 */
  448    497   
    }
  449         -
    }
         498  +
    /* OperationErrorGenerator.kt:133 */
  450    499   
}
         500  +
/* OperationErrorGenerator.kt:182 */
  451    501   
impl ::aws_smithy_types::retry::ProvideErrorKind for HttpPayloadTraitsError {
         502  +
    /* OperationErrorGenerator.kt:186 */
  452    503   
    fn code(&self) -> ::std::option::Option<&str> {
         504  +
        /* OperationErrorGenerator.kt:187 */
  453    505   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         506  +
        /* OperationErrorGenerator.kt:186 */
  454    507   
    }
         508  +
    /* OperationErrorGenerator.kt:190 */
  455    509   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         510  +
        /* OperationErrorGenerator.kt:197 */
  456    511   
        ::std::option::Option::None
         512  +
        /* OperationErrorGenerator.kt:190 */
  457    513   
    }
         514  +
    /* OperationErrorGenerator.kt:182 */
  458    515   
}
         516  +
/* OperationErrorGenerator.kt:163 */
  459    517   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for HttpPayloadTraitsError {
         518  +
    /* OperationErrorGenerator.kt:164 */
  460    519   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         520  +
        /* OperationErrorGenerator.kt:318 */
  461    521   
        match self {
  462         -
            Self::Unhandled(_inner) => &_inner.meta,
         522  +
            /* OperationErrorGenerator.kt:326 */
         523  +
            Self::Unhandled(_inner) => {
         524  +
                /* OperationErrorGenerator.kt:168 */
         525  +
                &_inner.meta
         526  +
                /* OperationErrorGenerator.kt:326 */
         527  +
            } /* OperationErrorGenerator.kt:318 */
  463    528   
        }
         529  +
        /* OperationErrorGenerator.kt:164 */
  464    530   
    }
         531  +
    /* OperationErrorGenerator.kt:163 */
  465    532   
}
         533  +
/* OperationErrorGenerator.kt:109 */
  466    534   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for HttpPayloadTraitsError {
         535  +
    /* OperationErrorGenerator.kt:110 */
  467    536   
    fn create_unhandled_error(
  468    537   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  469    538   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  470    539   
    ) -> Self {
         540  +
        /* OperationErrorGenerator.kt:121 */
  471    541   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  472    542   
            source,
  473    543   
            meta: meta.unwrap_or_default(),
  474    544   
        })
         545  +
        /* OperationErrorGenerator.kt:110 */
  475    546   
    }
         547  +
    /* OperationErrorGenerator.kt:109 */
  476    548   
}
  477    549   
         550  +
/* CodegenDelegator.kt:255 */
  478    551   
pub use crate::operation::http_payload_traits::_http_payload_traits_output::HttpPayloadTraitsOutput;
  479    552   
         553  +
/* CodegenDelegator.kt:255 */
  480    554   
pub use crate::operation::http_payload_traits::_http_payload_traits_input::HttpPayloadTraitsInput;
  481    555   
         556  +
/* RustModule.kt:172 */
  482    557   
mod _http_payload_traits_input;
  483    558   
         559  +
/* RustModule.kt:172 */
  484    560   
mod _http_payload_traits_output;
  485    561   
  486         -
/// Builders
         562  +
/// /* CodegenDelegator.kt:51 */Builders
  487    563   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_traits/_http_payload_traits_input.rs

@@ -1,1 +73,134 @@
    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 HttpPayloadTraitsInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct HttpPayloadTraitsInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl HttpPayloadTraitsInput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn foo(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.foo.as_deref()
          25  +
        /* StructureGenerator.kt:166 */
   15     26   
    }
          27  +
    /* StructureGenerator.kt:231 */
   16     28   
    #[allow(missing_docs)] // documentation missing in model
          29  +
                           /* StructureGenerator.kt:166 */
   17     30   
    pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
          31  +
        /* StructureGenerator.kt:170 */
   18     32   
        self.blob.as_ref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl HttpPayloadTraitsInput {
   22         -
    /// Creates a new builder-style object to manufacture [`HttpPayloadTraitsInput`](crate::operation::http_payload_traits::HttpPayloadTraitsInput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`HttpPayloadTraitsInput`](crate::operation::http_payload_traits::HttpPayloadTraitsInput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::http_payload_traits::builders::HttpPayloadTraitsInputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::http_payload_traits::builders::HttpPayloadTraitsInputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`HttpPayloadTraitsInput`](crate::operation::http_payload_traits::HttpPayloadTraitsInput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`HttpPayloadTraitsInput`](crate::operation::http_payload_traits::HttpPayloadTraitsInput).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct HttpPayloadTraitsInputBuilder {
   32         -
    pub(crate) foo: ::std::option::Option<::std::string::String>,
   33         -
    pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */ pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
          58  +
    /* BuilderGenerator.kt:345 */
   34     59   
}
          60  +
/* BuilderGenerator.kt:355 */
   35     61   
impl HttpPayloadTraitsInputBuilder {
          62  +
    /* BuilderGenerator.kt:286 */
   36     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
                           /* BuilderGenerator.kt:291 */
   37     65   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          66  +
        /* BuilderGenerator.kt:292 */
   38     67   
        self.foo = ::std::option::Option::Some(input.into());
          68  +
        /* BuilderGenerator.kt:293 */
   39     69   
        self
          70  +
        /* BuilderGenerator.kt:291 */
   40     71   
    }
          72  +
    /* BuilderGenerator.kt:312 */
   41     73   
    #[allow(missing_docs)] // documentation missing in model
          74  +
                           /* BuilderGenerator.kt:314 */
   42     75   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          76  +
        /* BuilderGenerator.kt:315 */
   43     77   
        self.foo = input;
   44     78   
        self
          79  +
        /* BuilderGenerator.kt:314 */
   45     80   
    }
          81  +
    /* BuilderGenerator.kt:334 */
   46     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:336 */
   47     84   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
          85  +
        /* BuilderGenerator.kt:337 */
   48     86   
        &self.foo
          87  +
        /* BuilderGenerator.kt:336 */
   49     88   
    }
          89  +
    /* BuilderGenerator.kt:286 */
   50     90   
    #[allow(missing_docs)] // documentation missing in model
          91  +
                           /* BuilderGenerator.kt:291 */
   51     92   
    pub fn blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
          93  +
        /* BuilderGenerator.kt:292 */
   52     94   
        self.blob = ::std::option::Option::Some(input);
          95  +
        /* BuilderGenerator.kt:293 */
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:291 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:312 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:314 */
   56    102   
    pub fn set_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
         103  +
        /* BuilderGenerator.kt:315 */
   57    104   
        self.blob = input;
   58    105   
        self
         106  +
        /* BuilderGenerator.kt:314 */
   59    107   
    }
         108  +
    /* BuilderGenerator.kt:334 */
   60    109   
    #[allow(missing_docs)] // documentation missing in model
         110  +
                           /* BuilderGenerator.kt:336 */
   61    111   
    pub fn get_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
         112  +
        /* BuilderGenerator.kt:337 */
   62    113   
        &self.blob
         114  +
        /* BuilderGenerator.kt:336 */
   63    115   
    }
   64         -
    /// Consumes the builder and constructs a [`HttpPayloadTraitsInput`](crate::operation::http_payload_traits::HttpPayloadTraitsInput).
         116  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`HttpPayloadTraitsInput`](crate::operation::http_payload_traits::HttpPayloadTraitsInput).
         117  +
    /* BuilderGenerator.kt:253 */
   65    118   
    pub fn build(
   66    119   
        self,
   67    120   
    ) -> ::std::result::Result<crate::operation::http_payload_traits::HttpPayloadTraitsInput, ::aws_smithy_types::error::operation::BuildError> {
   68         -
        ::std::result::Result::Ok(crate::operation::http_payload_traits::HttpPayloadTraitsInput {
   69         -
            foo: self.foo,
         121  +
        /* BuilderGenerator.kt:254 */
         122  +
        ::std::result::Result::Ok(
         123  +
            /* BuilderGenerator.kt:477 */
         124  +
            crate::operation::http_payload_traits::HttpPayloadTraitsInput {
         125  +
                /* BuilderGenerator.kt:481 */ foo: self.foo,
         126  +
                /* BuilderGenerator.kt:481 */
   70    127   
                blob: self.blob,
   71         -
        })
         128  +
                /* BuilderGenerator.kt:477 */
         129  +
            }, /* BuilderGenerator.kt:254 */
         130  +
        )
         131  +
        /* BuilderGenerator.kt:253 */
   72    132   
    }
         133  +
    /* BuilderGenerator.kt:355 */
   73    134   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_traits/_http_payload_traits_output.rs

@@ -1,1 +71,129 @@
    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 HttpPayloadTraitsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct HttpPayloadTraitsOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl HttpPayloadTraitsOutput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn foo(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.foo.as_deref()
          25  +
        /* StructureGenerator.kt:166 */
   15     26   
    }
          27  +
    /* StructureGenerator.kt:231 */
   16     28   
    #[allow(missing_docs)] // documentation missing in model
          29  +
                           /* StructureGenerator.kt:166 */
   17     30   
    pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
          31  +
        /* StructureGenerator.kt:170 */
   18     32   
        self.blob.as_ref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl HttpPayloadTraitsOutput {
   22         -
    /// Creates a new builder-style object to manufacture [`HttpPayloadTraitsOutput`](crate::operation::http_payload_traits::HttpPayloadTraitsOutput).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`HttpPayloadTraitsOutput`](crate::operation::http_payload_traits::HttpPayloadTraitsOutput).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::operation::http_payload_traits::builders::HttpPayloadTraitsOutputBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::operation::http_payload_traits::builders::HttpPayloadTraitsOutputBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`HttpPayloadTraitsOutput`](crate::operation::http_payload_traits::HttpPayloadTraitsOutput).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`HttpPayloadTraitsOutput`](crate::operation::http_payload_traits::HttpPayloadTraitsOutput).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct HttpPayloadTraitsOutputBuilder {
   32         -
    pub(crate) foo: ::std::option::Option<::std::string::String>,
   33         -
    pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */ pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
          58  +
    /* BuilderGenerator.kt:345 */
   34     59   
}
          60  +
/* BuilderGenerator.kt:355 */
   35     61   
impl HttpPayloadTraitsOutputBuilder {
          62  +
    /* BuilderGenerator.kt:286 */
   36     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
                           /* BuilderGenerator.kt:291 */
   37     65   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          66  +
        /* BuilderGenerator.kt:292 */
   38     67   
        self.foo = ::std::option::Option::Some(input.into());
          68  +
        /* BuilderGenerator.kt:293 */
   39     69   
        self
          70  +
        /* BuilderGenerator.kt:291 */
   40     71   
    }
          72  +
    /* BuilderGenerator.kt:312 */
   41     73   
    #[allow(missing_docs)] // documentation missing in model
          74  +
                           /* BuilderGenerator.kt:314 */
   42     75   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          76  +
        /* BuilderGenerator.kt:315 */
   43     77   
        self.foo = input;
   44     78   
        self
          79  +
        /* BuilderGenerator.kt:314 */
   45     80   
    }
          81  +
    /* BuilderGenerator.kt:334 */
   46     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:336 */
   47     84   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
          85  +
        /* BuilderGenerator.kt:337 */
   48     86   
        &self.foo
          87  +
        /* BuilderGenerator.kt:336 */
   49     88   
    }
          89  +
    /* BuilderGenerator.kt:286 */
   50     90   
    #[allow(missing_docs)] // documentation missing in model
          91  +
                           /* BuilderGenerator.kt:291 */
   51     92   
    pub fn blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
          93  +
        /* BuilderGenerator.kt:292 */
   52     94   
        self.blob = ::std::option::Option::Some(input);
          95  +
        /* BuilderGenerator.kt:293 */
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:291 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:312 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:314 */
   56    102   
    pub fn set_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
         103  +
        /* BuilderGenerator.kt:315 */
   57    104   
        self.blob = input;
   58    105   
        self
         106  +
        /* BuilderGenerator.kt:314 */
   59    107   
    }
         108  +
    /* BuilderGenerator.kt:334 */
   60    109   
    #[allow(missing_docs)] // documentation missing in model
         110  +
                           /* BuilderGenerator.kt:336 */
   61    111   
    pub fn get_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
         112  +
        /* BuilderGenerator.kt:337 */
   62    113   
        &self.blob
         114  +
        /* BuilderGenerator.kt:336 */
   63    115   
    }
   64         -
    /// Consumes the builder and constructs a [`HttpPayloadTraitsOutput`](crate::operation::http_payload_traits::HttpPayloadTraitsOutput).
         116  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`HttpPayloadTraitsOutput`](crate::operation::http_payload_traits::HttpPayloadTraitsOutput).
         117  +
    /* BuilderGenerator.kt:253 */
   65    118   
    pub fn build(self) -> crate::operation::http_payload_traits::HttpPayloadTraitsOutput {
         119  +
        /* BuilderGenerator.kt:477 */
   66    120   
        crate::operation::http_payload_traits::HttpPayloadTraitsOutput {
   67         -
            foo: self.foo,
         121  +
            /* BuilderGenerator.kt:481 */ foo: self.foo,
         122  +
            /* BuilderGenerator.kt:481 */
   68    123   
            blob: self.blob,
         124  +
            /* BuilderGenerator.kt:477 */
   69    125   
        }
         126  +
        /* BuilderGenerator.kt:253 */
   70    127   
    }
         128  +
    /* BuilderGenerator.kt:355 */
   71    129   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_traits/builders.rs

@@ -1,1 +139,163 @@
    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::http_payload_traits::_http_payload_traits_output::HttpPayloadTraitsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::http_payload_traits::_http_payload_traits_input::HttpPayloadTraitsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::http_payload_traits::builders::HttpPayloadTraitsInputBuilder {
    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::http_payload_traits::HttpPayloadTraitsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::http_payload_traits::HttpPayloadTraitsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.http_payload_traits();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `HttpPayloadTraits`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `HttpPayloadTraits`.
   24     27   
///
   25         -
/// This example serializes a blob shape in the payload. In this example, no JSON document is synthesized because the payload is not a structure or a union type.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example serializes a blob shape in the payload. In this example, no JSON document is synthesized because the payload is not a structure or a union type.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct HttpPayloadTraitsFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::http_payload_traits::builders::HttpPayloadTraitsInputBuilder,
   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::http_payload_traits::HttpPayloadTraitsOutput,
   35     41   
        crate::operation::http_payload_traits::HttpPayloadTraitsError,
   36     42   
    > for HttpPayloadTraitsFluentBuilder
   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::http_payload_traits::HttpPayloadTraitsOutput,
   44     50   
            crate::operation::http_payload_traits::HttpPayloadTraitsError,
   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 HttpPayloadTraitsFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `HttpPayloadTraitsFluentBuilder`.
   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 HttpPayloadTraits as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::http_payload_traits::builders::HttpPayloadTraitsInputBuilder {
   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::http_payload_traits::HttpPayloadTraitsOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::http_payload_traits::HttpPayloadTraitsError,
   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::http_payload_traits::HttpPayloadTraits::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::http_payload_traits::HttpPayloadTraits::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::http_payload_traits::HttpPayloadTraitsOutput,
   97    107   
        crate::operation::http_payload_traits::HttpPayloadTraitsError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:498 */
  111    123   
    #[allow(missing_docs)] // documentation missing in model
         124  +
                           /* FluentBuilderGenerator.kt:500 */
  112    125   
    pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.foo(input.into());
  114    127   
        self
  115    128   
    }
         129  +
    /* FluentBuilderGenerator.kt:498 */
  116    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* FluentBuilderGenerator.kt:500 */
  117    132   
    pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_foo(input);
  119    134   
        self
  120    135   
    }
         136  +
    /* FluentBuilderGenerator.kt:518 */
  121    137   
    #[allow(missing_docs)] // documentation missing in model
         138  +
                           /* FluentBuilderGenerator.kt:520 */
  122    139   
    pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_foo()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:498 */
  125    143   
    #[allow(missing_docs)] // documentation missing in model
         144  +
                           /* FluentBuilderGenerator.kt:500 */
  126    145   
    pub fn blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
  127    146   
        self.inner = self.inner.blob(input);
  128    147   
        self
  129    148   
    }
         149  +
    /* FluentBuilderGenerator.kt:498 */
  130    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* FluentBuilderGenerator.kt:500 */
  131    152   
    pub fn set_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
  132    153   
        self.inner = self.inner.set_blob(input);
  133    154   
        self
  134    155   
    }
         156  +
    /* FluentBuilderGenerator.kt:518 */
  135    157   
    #[allow(missing_docs)] // documentation missing in model
         158  +
                           /* FluentBuilderGenerator.kt:520 */
  136    159   
    pub fn get_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
  137    160   
        self.inner.get_blob()
  138    161   
    }
         162  +
    /* FluentBuilderGenerator.kt:282 */
  139    163   
}