Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/fractional_seconds.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 `FractionalSeconds`.
           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 FractionalSeconds;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl FractionalSeconds {
    7         -
    /// Creates a new `FractionalSeconds`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `FractionalSeconds`
          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::fractional_seconds::FractionalSecondsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::fractional_seconds::FractionalSecondsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::fractional_seconds::FractionalSecondsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +382,458 @@
   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 FractionalSeconds {
   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("FractionalSeconds");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            FractionalSecondsRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            FractionalSecondsResponseDeserializer,
  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   
            "FractionalSeconds",
  111    122   
            "Rest Xml 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("FractionalSeconds")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(FractionalSecondsEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::fractional_seconds::FractionalSecondsError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::fractional_seconds::FractionalSecondsError,
  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 FractionalSecondsResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FractionalSecondsResponseDeserializer {
  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_fractional_seconds::de_fractional_seconds_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds_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 FractionalSecondsRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for FractionalSecondsRequestSerializer {
  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::fractional_seconds::FractionalSecondsInput>()
  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::fractional_seconds::FractionalSecondsInput,
  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, "/FractionalSeconds").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::fractional_seconds::FractionalSecondsInput,
  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
  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 FractionalSecondsEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for FractionalSecondsEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "FractionalSecondsEndpointParamsInterceptor"
  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::<FractionalSecondsInput>()
  220    234   
            .ok_or("failed to downcast to FractionalSecondsInput")?;
  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 fractional_seconds_test {
  237    254   
  238    255   
    /// Ensures that clients can correctly parse datetime timestamps with fractional seconds
  239    256   
    /// Test ID: RestXmlDateTimeWithFractionalSeconds
  240    257   
    #[::tokio::test]
  241    258   
    #[::tracing_test::traced_test]
  242    259   
    async fn rest_xml_date_time_with_fractional_seconds_response() {
  243    260   
        let expected_output = crate::operation::fractional_seconds::FractionalSecondsOutput::builder()
  244    261   
            .set_datetime(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  245    262   
                946845296, 0.123_f64,
  246    263   
            )))
  247    264   
            .build();
  248    265   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  249    266   
            ::http::response::Builder::new()
  250    267   
                .header("Content-Type", "application/xml")
  251    268   
                .status(200)
  252    269   
                .body(::aws_smithy_types::body::SdkBody::from(
  253    270   
                    "<FractionalSecondsOutput>\n    <datetime>2000-01-02T20:34:56.123Z</datetime>\n</FractionalSecondsOutput>\n",
  254    271   
                ))
  255    272   
                .unwrap(),
  256    273   
        )
  257    274   
        .unwrap();
  258    275   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  259    276   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  260    277   
  261    278   
        let op = crate::operation::fractional_seconds::FractionalSeconds::new();
  262    279   
        let config = op.config().expect("the operation has config");
  263    280   
        let de = config
  264    281   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  265    282   
            .expect("the config must have a deserializer");
  266    283   
  267    284   
        let parsed = de.deserialize_streaming(&mut http_response);
  268    285   
        let parsed = parsed.unwrap_or_else(|| {
  269    286   
            let http_response = http_response.map(|body| {
  270    287   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  271    288   
                    body.bytes().unwrap(),
  272    289   
                    ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  273    290   
                )))
  274    291   
            });
  275    292   
            de.deserialize_nonstreaming(&http_response)
  276    293   
        });
  277    294   
        let parsed = parsed
  278    295   
            .expect("should be successful response")
  279    296   
            .downcast::<crate::operation::fractional_seconds::FractionalSecondsOutput>()
  280    297   
            .unwrap();
  281    298   
        ::pretty_assertions::assert_eq!(parsed.datetime, expected_output.datetime, "Unexpected value for `datetime`");
  282    299   
    }
         300  +
         301  +
    /* ProtocolTestGenerator.kt:98 */
  283    302   
}
  284    303   
         304  +
/* OperationErrorGenerator.kt:79 */
  285    305   
/// Error type for the `FractionalSecondsError` operation.
         306  +
/* RustType.kt:516 */
  286    307   
#[non_exhaustive]
         308  +
/* RustType.kt:516 */
  287    309   
#[derive(::std::fmt::Debug)]
  288         -
pub enum FractionalSecondsError {
         310  +
pub /* OperationErrorGenerator.kt:81 */ enum FractionalSecondsError {
         311  +
    /* OperationErrorGenerator.kt:88 */
  289    312   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  290    313   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  291    314   
    variable wildcard pattern and check `.code()`:
  292    315   
     \
  293    316   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  294    317   
     \
  295    318   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-FractionalSecondsError) for what information is available for the error.")]
  296    319   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         320  +
    /* OperationErrorGenerator.kt:81 */
  297    321   
}
         322  +
/* OperationErrorGenerator.kt:218 */
  298    323   
impl FractionalSecondsError {
         324  +
    /* OperationErrorGenerator.kt:219 */
  299    325   
    /// Creates the `FractionalSecondsError::Unhandled` variant from any error type.
  300    326   
    pub fn unhandled(
  301    327   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  302    328   
    ) -> Self {
  303    329   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  304    330   
            source: err.into(),
  305    331   
            meta: ::std::default::Default::default(),
  306    332   
        })
  307    333   
    }
  308    334   
  309    335   
    /// Creates the `FractionalSecondsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  310    336   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  311    337   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  312    338   
            source: err.clone().into(),
  313    339   
            meta: err,
  314    340   
        })
  315    341   
    }
  316         -
    ///
         342  +
    /// /* OperationErrorGenerator.kt:236 */
  317    343   
    /// Returns error metadata, which includes the error code, message,
  318    344   
    /// request ID, and potentially additional information.
  319    345   
    ///
         346  +
    /* OperationErrorGenerator.kt:242 */
  320    347   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         348  +
        /* OperationErrorGenerator.kt:243 */
  321    349   
        match self {
  322         -
            Self::Unhandled(e) => &e.meta,
         350  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         351  +
            /* OperationErrorGenerator.kt:243 */
  323    352   
        }
         353  +
        /* OperationErrorGenerator.kt:242 */
  324    354   
    }
         355  +
    /* OperationErrorGenerator.kt:218 */
  325    356   
}
         357  +
/* OperationErrorGenerator.kt:269 */
  326    358   
impl ::std::error::Error for FractionalSecondsError {
         359  +
    /* OperationErrorGenerator.kt:270 */
  327    360   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         361  +
        /* OperationErrorGenerator.kt:318 */
  328    362   
        match self {
  329         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         363  +
            /* OperationErrorGenerator.kt:326 */
         364  +
            Self::Unhandled(_inner) => {
         365  +
                /* OperationErrorGenerator.kt:279 */
         366  +
                ::std::option::Option::Some(&*_inner.source)
         367  +
                /* OperationErrorGenerator.kt:326 */
         368  +
            } /* OperationErrorGenerator.kt:318 */
  330    369   
        }
         370  +
        /* OperationErrorGenerator.kt:270 */
  331    371   
    }
         372  +
    /* OperationErrorGenerator.kt:269 */
  332    373   
}
         374  +
/* OperationErrorGenerator.kt:133 */
  333    375   
impl ::std::fmt::Display for FractionalSecondsError {
         376  +
    /* OperationErrorGenerator.kt:134 */
  334    377   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         378  +
        /* OperationErrorGenerator.kt:318 */
  335    379   
        match self {
         380  +
            /* OperationErrorGenerator.kt:326 */
  336    381   
            Self::Unhandled(_inner) => {
         382  +
                /* OperationErrorGenerator.kt:139 */
  337    383   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  338    384   
                    write!(f, "unhandled error ({code})")
  339    385   
                } else {
  340    386   
                    f.write_str("unhandled error")
  341    387   
                }
         388  +
                /* OperationErrorGenerator.kt:326 */
         389  +
            } /* OperationErrorGenerator.kt:318 */
  342    390   
        }
         391  +
        /* OperationErrorGenerator.kt:134 */
  343    392   
    }
  344         -
    }
         393  +
    /* OperationErrorGenerator.kt:133 */
  345    394   
}
         395  +
/* OperationErrorGenerator.kt:182 */
  346    396   
impl ::aws_smithy_types::retry::ProvideErrorKind for FractionalSecondsError {
         397  +
    /* OperationErrorGenerator.kt:186 */
  347    398   
    fn code(&self) -> ::std::option::Option<&str> {
         399  +
        /* OperationErrorGenerator.kt:187 */
  348    400   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         401  +
        /* OperationErrorGenerator.kt:186 */
  349    402   
    }
         403  +
    /* OperationErrorGenerator.kt:190 */
  350    404   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         405  +
        /* OperationErrorGenerator.kt:197 */
  351    406   
        ::std::option::Option::None
         407  +
        /* OperationErrorGenerator.kt:190 */
  352    408   
    }
         409  +
    /* OperationErrorGenerator.kt:182 */
  353    410   
}
         411  +
/* OperationErrorGenerator.kt:163 */
  354    412   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for FractionalSecondsError {
         413  +
    /* OperationErrorGenerator.kt:164 */
  355    414   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         415  +
        /* OperationErrorGenerator.kt:318 */
  356    416   
        match self {
  357         -
            Self::Unhandled(_inner) => &_inner.meta,
         417  +
            /* OperationErrorGenerator.kt:326 */
         418  +
            Self::Unhandled(_inner) => {
         419  +
                /* OperationErrorGenerator.kt:168 */
         420  +
                &_inner.meta
         421  +
                /* OperationErrorGenerator.kt:326 */
         422  +
            } /* OperationErrorGenerator.kt:318 */
  358    423   
        }
         424  +
        /* OperationErrorGenerator.kt:164 */
  359    425   
    }
         426  +
    /* OperationErrorGenerator.kt:163 */
  360    427   
}
         428  +
/* OperationErrorGenerator.kt:109 */
  361    429   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for FractionalSecondsError {
         430  +
    /* OperationErrorGenerator.kt:110 */
  362    431   
    fn create_unhandled_error(
  363    432   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  364    433   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  365    434   
    ) -> Self {
         435  +
        /* OperationErrorGenerator.kt:121 */
  366    436   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  367    437   
            source,
  368    438   
            meta: meta.unwrap_or_default(),
  369    439   
        })
         440  +
        /* OperationErrorGenerator.kt:110 */
  370    441   
    }
         442  +
    /* OperationErrorGenerator.kt:109 */
  371    443   
}
  372    444   
         445  +
/* CodegenDelegator.kt:255 */
  373    446   
pub use crate::operation::fractional_seconds::_fractional_seconds_output::FractionalSecondsOutput;
  374    447   
         448  +
/* CodegenDelegator.kt:255 */
  375    449   
pub use crate::operation::fractional_seconds::_fractional_seconds_input::FractionalSecondsInput;
  376    450   
         451  +
/* RustModule.kt:172 */
  377    452   
mod _fractional_seconds_input;
  378    453   
         454  +
/* RustModule.kt:172 */
  379    455   
mod _fractional_seconds_output;
  380    456   
  381         -
/// Builders
         457  +
/// /* CodegenDelegator.kt:51 */Builders
  382    458   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/fractional_seconds/_fractional_seconds_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/fractional_seconds/_fractional_seconds_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 FractionalSecondsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct FractionalSecondsOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub datetime: ::std::option::Option<::aws_smithy_types::DateTime>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl FractionalSecondsOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn datetime(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.datetime.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl FractionalSecondsOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`FractionalSecondsOutput`](crate::operation::fractional_seconds::FractionalSecondsOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`FractionalSecondsOutput`](crate::operation::fractional_seconds::FractionalSecondsOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`FractionalSecondsOutput`](crate::operation::fractional_seconds::FractionalSecondsOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`FractionalSecondsOutput`](crate::operation::fractional_seconds::FractionalSecondsOutput).
          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 FractionalSecondsOutputBuilder {
   26         -
    pub(crate) datetime: ::std::option::Option<::aws_smithy_types::DateTime>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) datetime: ::std::option::Option<::aws_smithy_types::DateTime>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl FractionalSecondsOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn datetime(mut self, input: ::aws_smithy_types::DateTime) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.datetime = ::std::option::Option::Some(input);
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_datetime(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.datetime = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_datetime(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.datetime
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`FractionalSecondsOutput`](crate::operation::fractional_seconds::FractionalSecondsOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`FractionalSecondsOutput`](crate::operation::fractional_seconds::FractionalSecondsOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::fractional_seconds::FractionalSecondsOutput {
   45         -
        crate::operation::fractional_seconds::FractionalSecondsOutput { datetime: self.datetime }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::fractional_seconds::FractionalSecondsOutput {
          82  +
            /* BuilderGenerator.kt:481 */ datetime: self.datetime,
          83  +
            /* BuilderGenerator.kt:477 */
   46     84   
        }
          85  +
        /* BuilderGenerator.kt:253 */
          86  +
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/fractional_seconds/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::fractional_seconds::_fractional_seconds_output::FractionalSecondsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::fractional_seconds::_fractional_seconds_input::FractionalSecondsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::fractional_seconds::builders::FractionalSecondsInputBuilder {
    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::fractional_seconds::FractionalSecondsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::fractional_seconds::FractionalSecondsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.fractional_seconds();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `FractionalSeconds`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `FractionalSeconds`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct FractionalSecondsFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::fractional_seconds::builders::FractionalSecondsInputBuilder,
   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::fractional_seconds::FractionalSecondsOutput,
   34     40   
        crate::operation::fractional_seconds::FractionalSecondsError,
   35     41   
    > for FractionalSecondsFluentBuilder
   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::fractional_seconds::FractionalSecondsOutput,
   43     49   
            crate::operation::fractional_seconds::FractionalSecondsError,
   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 FractionalSecondsFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `FractionalSecondsFluentBuilder`.
   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 FractionalSeconds as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::fractional_seconds::builders::FractionalSecondsInputBuilder {
   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::fractional_seconds::FractionalSecondsOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::fractional_seconds::FractionalSecondsError,
   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::fractional_seconds::FractionalSeconds::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::fractional_seconds::FractionalSeconds::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::fractional_seconds::FractionalSecondsOutput,
   96    106   
        crate::operation::fractional_seconds::FractionalSecondsError,
   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_xml/rust-client-codegen/src/operation/greeting_with_errors.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `GreetingWithErrors`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct GreetingWithErrors;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl GreetingWithErrors {
    7         -
    /// Creates a new `GreetingWithErrors`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `GreetingWithErrors`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::greeting_with_errors::GreetingWithErrorsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::greeting_with_errors::GreetingWithErrorsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +265,282 @@
   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 GreetingWithErrors {
   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("GreetingWithErrors");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            GreetingWithErrorsRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            GreetingWithErrorsResponseDeserializer,
  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   
            "GreetingWithErrors",
  111    122   
            "Rest Xml 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("GreetingWithErrors")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(GreetingWithErrorsEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::greeting_with_errors::GreetingWithErrorsError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::greeting_with_errors::GreetingWithErrorsError,
  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 GreetingWithErrorsResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GreetingWithErrorsResponseDeserializer {
  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_greeting_with_errors::de_greeting_with_errors_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_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 GreetingWithErrorsRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GreetingWithErrorsRequestSerializer {
  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::greeting_with_errors::GreetingWithErrorsInput>()
  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::greeting_with_errors::GreetingWithErrorsInput,
  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, "/GreetingWithErrors").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::greeting_with_errors::GreetingWithErrorsInput,
  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("PUT").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 GreetingWithErrorsEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GreetingWithErrorsEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "GreetingWithErrorsEndpointParamsInterceptor"
  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::<GreetingWithErrorsInput>()
  220    234   
            .ok_or("failed to downcast to GreetingWithErrorsInput")?;
  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 greeting_with_errors_test {
  237    254   
  238    255   
    /// Ensures that operations with errors successfully know how to deserialize the successful response
  239    256   
    /// Test ID: GreetingWithErrors
  240    257   
    #[::tokio::test]
  241    258   
    #[::tracing_test::traced_test]
  242    259   
    async fn greeting_with_errors_response() {
  243    260   
        let expected_output = crate::operation::greeting_with_errors::GreetingWithErrorsOutput::builder()
  244    261   
            .set_greeting(::std::option::Option::Some("Hello".to_owned()))
  245    262   
            .build();
@@ -342,359 +491,613 @@
  362    379   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  363    380   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  364    381   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::ComplexError(parsed) = parsed {
  365    382   
            ::pretty_assertions::assert_eq!(parsed.header, expected_output.header, "Unexpected value for `header`");
  366    383   
            ::pretty_assertions::assert_eq!(parsed.top_level, expected_output.top_level, "Unexpected value for `top_level`");
  367    384   
            ::pretty_assertions::assert_eq!(parsed.nested, expected_output.nested, "Unexpected value for `nested`");
  368    385   
        } else {
  369    386   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  370    387   
        }
  371    388   
    }
         389  +
         390  +
    /* ProtocolTestGenerator.kt:98 */
  372    391   
}
  373    392   
         393  +
/* OperationErrorGenerator.kt:79 */
  374    394   
/// Error type for the `GreetingWithErrorsError` operation.
         395  +
/* RustType.kt:516 */
  375    396   
#[non_exhaustive]
         397  +
/* RustType.kt:516 */
  376    398   
#[derive(::std::fmt::Debug)]
  377         -
pub enum GreetingWithErrorsError {
  378         -
    /// This error is thrown when an invalid greeting value is provided.
         399  +
pub /* OperationErrorGenerator.kt:81 */ enum GreetingWithErrorsError {
         400  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when an invalid greeting value is provided.
         401  +
    /* OperationErrorGenerator.kt:86 */
  379    402   
    InvalidGreeting(crate::types::error::InvalidGreeting),
  380         -
    /// This error is thrown when a request is invalid.
         403  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when a request is invalid.
         404  +
    /* OperationErrorGenerator.kt:86 */
  381    405   
    ComplexError(crate::types::error::ComplexError),
         406  +
    /* OperationErrorGenerator.kt:88 */
  382    407   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  383    408   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  384    409   
    variable wildcard pattern and check `.code()`:
  385    410   
     \
  386    411   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  387    412   
     \
  388    413   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GreetingWithErrorsError) for what information is available for the error.")]
  389    414   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         415  +
    /* OperationErrorGenerator.kt:81 */
  390    416   
}
         417  +
/* OperationErrorGenerator.kt:218 */
  391    418   
impl GreetingWithErrorsError {
         419  +
    /* OperationErrorGenerator.kt:219 */
  392    420   
    /// Creates the `GreetingWithErrorsError::Unhandled` variant from any error type.
  393    421   
    pub fn unhandled(
  394    422   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  395    423   
    ) -> Self {
  396    424   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  397    425   
            source: err.into(),
  398    426   
            meta: ::std::default::Default::default(),
  399    427   
        })
  400    428   
    }
  401    429   
  402    430   
    /// Creates the `GreetingWithErrorsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  403    431   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  404    432   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  405    433   
            source: err.clone().into(),
  406    434   
            meta: err,
  407    435   
        })
  408    436   
    }
  409         -
    ///
         437  +
    /// /* OperationErrorGenerator.kt:236 */
  410    438   
    /// Returns error metadata, which includes the error code, message,
  411    439   
    /// request ID, and potentially additional information.
  412    440   
    ///
         441  +
    /* OperationErrorGenerator.kt:242 */
  413    442   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         443  +
        /* OperationErrorGenerator.kt:243 */
  414    444   
        match self {
  415         -
            Self::InvalidGreeting(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  416         -
            Self::ComplexError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  417         -
            Self::Unhandled(e) => &e.meta,
         445  +
            /* OperationErrorGenerator.kt:246 */ Self::InvalidGreeting(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         446  +
            /* OperationErrorGenerator.kt:246 */ Self::ComplexError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         447  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         448  +
            /* OperationErrorGenerator.kt:243 */
  418    449   
        }
         450  +
        /* OperationErrorGenerator.kt:242 */
  419    451   
    }
         452  +
    /* OperationErrorGenerator.kt:257 */
  420    453   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::InvalidGreeting`.
         454  +
    /* OperationErrorGenerator.kt:258 */
  421    455   
    pub fn is_invalid_greeting(&self) -> bool {
         456  +
        /* OperationErrorGenerator.kt:259 */
  422    457   
        matches!(self, Self::InvalidGreeting(_))
         458  +
        /* OperationErrorGenerator.kt:258 */
  423    459   
    }
         460  +
    /* OperationErrorGenerator.kt:257 */
  424    461   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::ComplexError`.
         462  +
    /* OperationErrorGenerator.kt:258 */
  425    463   
    pub fn is_complex_error(&self) -> bool {
         464  +
        /* OperationErrorGenerator.kt:259 */
  426    465   
        matches!(self, Self::ComplexError(_))
         466  +
        /* OperationErrorGenerator.kt:258 */
  427    467   
    }
         468  +
    /* OperationErrorGenerator.kt:218 */
  428    469   
}
         470  +
/* OperationErrorGenerator.kt:269 */
  429    471   
impl ::std::error::Error for GreetingWithErrorsError {
         472  +
    /* OperationErrorGenerator.kt:270 */
  430    473   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         474  +
        /* OperationErrorGenerator.kt:318 */
  431    475   
        match self {
  432         -
            Self::InvalidGreeting(_inner) => ::std::option::Option::Some(_inner),
  433         -
            Self::ComplexError(_inner) => ::std::option::Option::Some(_inner),
  434         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         476  +
            /* OperationErrorGenerator.kt:321 */
         477  +
            Self::InvalidGreeting(_inner) =>
         478  +
            /* OperationErrorGenerator.kt:283 */
         479  +
            {
         480  +
                ::std::option::Option::Some(_inner)
         481  +
            }
         482  +
            ,
         483  +
            /* OperationErrorGenerator.kt:321 */
         484  +
            Self::ComplexError(_inner) =>
         485  +
            /* OperationErrorGenerator.kt:283 */
         486  +
            {
         487  +
                ::std::option::Option::Some(_inner)
         488  +
            }
         489  +
            ,
         490  +
            /* OperationErrorGenerator.kt:326 */
         491  +
            Self::Unhandled(_inner) => {
         492  +
                /* OperationErrorGenerator.kt:279 */
         493  +
                ::std::option::Option::Some(&*_inner.source)
         494  +
                /* OperationErrorGenerator.kt:326 */
         495  +
            } /* OperationErrorGenerator.kt:318 */
  435    496   
        }
         497  +
        /* OperationErrorGenerator.kt:270 */
  436    498   
    }
         499  +
    /* OperationErrorGenerator.kt:269 */
  437    500   
}
         501  +
/* OperationErrorGenerator.kt:133 */
  438    502   
impl ::std::fmt::Display for GreetingWithErrorsError {
         503  +
    /* OperationErrorGenerator.kt:134 */
  439    504   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         505  +
        /* OperationErrorGenerator.kt:318 */
  440    506   
        match self {
  441         -
            Self::InvalidGreeting(_inner) => _inner.fmt(f),
  442         -
            Self::ComplexError(_inner) => _inner.fmt(f),
         507  +
            /* OperationErrorGenerator.kt:321 */
         508  +
            Self::InvalidGreeting(_inner) =>
         509  +
            /* OperationErrorGenerator.kt:151 */
         510  +
            {
         511  +
                _inner.fmt(f)
         512  +
            }
         513  +
            ,
         514  +
            /* OperationErrorGenerator.kt:321 */
         515  +
            Self::ComplexError(_inner) =>
         516  +
            /* OperationErrorGenerator.kt:151 */
         517  +
            {
         518  +
                _inner.fmt(f)
         519  +
            }
         520  +
            ,
         521  +
            /* OperationErrorGenerator.kt:326 */
  443    522   
            Self::Unhandled(_inner) => {
         523  +
                /* OperationErrorGenerator.kt:139 */
  444    524   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  445    525   
                    write!(f, "unhandled error ({code})")
  446    526   
                } else {
  447    527   
                    f.write_str("unhandled error")
  448    528   
                }
         529  +
                /* OperationErrorGenerator.kt:326 */
         530  +
            } /* OperationErrorGenerator.kt:318 */
  449    531   
        }
         532  +
        /* OperationErrorGenerator.kt:134 */
  450    533   
    }
  451         -
    }
         534  +
    /* OperationErrorGenerator.kt:133 */
  452    535   
}
         536  +
/* OperationErrorGenerator.kt:182 */
  453    537   
impl ::aws_smithy_types::retry::ProvideErrorKind for GreetingWithErrorsError {
         538  +
    /* OperationErrorGenerator.kt:186 */
  454    539   
    fn code(&self) -> ::std::option::Option<&str> {
         540  +
        /* OperationErrorGenerator.kt:187 */
  455    541   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         542  +
        /* OperationErrorGenerator.kt:186 */
  456    543   
    }
         544  +
    /* OperationErrorGenerator.kt:190 */
  457    545   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         546  +
        /* OperationErrorGenerator.kt:197 */
  458    547   
        ::std::option::Option::None
         548  +
        /* OperationErrorGenerator.kt:190 */
  459    549   
    }
         550  +
    /* OperationErrorGenerator.kt:182 */
  460    551   
}
         552  +
/* OperationErrorGenerator.kt:163 */
  461    553   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GreetingWithErrorsError {
         554  +
    /* OperationErrorGenerator.kt:164 */
  462    555   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         556  +
        /* OperationErrorGenerator.kt:318 */
  463    557   
        match self {
  464         -
            Self::InvalidGreeting(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  465         -
            Self::ComplexError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  466         -
            Self::Unhandled(_inner) => &_inner.meta,
         558  +
            /* OperationErrorGenerator.kt:321 */
         559  +
            Self::InvalidGreeting(_inner) =>
         560  +
            /* OperationErrorGenerator.kt:169 */
         561  +
            {
         562  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         563  +
            }
         564  +
            ,
         565  +
            /* OperationErrorGenerator.kt:321 */
         566  +
            Self::ComplexError(_inner) =>
         567  +
            /* OperationErrorGenerator.kt:169 */
         568  +
            {
         569  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         570  +
            }
         571  +
            ,
         572  +
            /* OperationErrorGenerator.kt:326 */
         573  +
            Self::Unhandled(_inner) => {
         574  +
                /* OperationErrorGenerator.kt:168 */
         575  +
                &_inner.meta
         576  +
                /* OperationErrorGenerator.kt:326 */
         577  +
            } /* OperationErrorGenerator.kt:318 */
  467    578   
        }
         579  +
        /* OperationErrorGenerator.kt:164 */
  468    580   
    }
         581  +
    /* OperationErrorGenerator.kt:163 */
  469    582   
}
         583  +
/* OperationErrorGenerator.kt:109 */
  470    584   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GreetingWithErrorsError {
         585  +
    /* OperationErrorGenerator.kt:110 */
  471    586   
    fn create_unhandled_error(
  472    587   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  473    588   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  474    589   
    ) -> Self {
         590  +
        /* OperationErrorGenerator.kt:121 */
  475    591   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  476    592   
            source,
  477    593   
            meta: meta.unwrap_or_default(),
  478    594   
        })
         595  +
        /* OperationErrorGenerator.kt:110 */
  479    596   
    }
         597  +
    /* OperationErrorGenerator.kt:109 */
  480    598   
}
  481    599   
         600  +
/* CodegenDelegator.kt:255 */
  482    601   
pub use crate::operation::greeting_with_errors::_greeting_with_errors_output::GreetingWithErrorsOutput;
  483    602   
         603  +
/* CodegenDelegator.kt:255 */
  484    604   
pub use crate::operation::greeting_with_errors::_greeting_with_errors_input::GreetingWithErrorsInput;
  485    605   
         606  +
/* RustModule.kt:172 */
  486    607   
mod _greeting_with_errors_input;
  487    608   
         609  +
/* RustModule.kt:172 */
  488    610   
mod _greeting_with_errors_output;
  489    611   
  490         -
/// Builders
         612  +
/// /* CodegenDelegator.kt:51 */Builders
  491    613   
pub mod builders;

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

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

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

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

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

tmp-codegen-diff/codegen-client-test/rest_xml/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_xml/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_xml/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_xml/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 Xml 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: HttpPayloadTraitsWithBlob
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn 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_xml/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_xml/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_xml/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 XML 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 XML 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   
}