Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_header_collection_operation.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `RequiredHeaderCollectionOperation`.
           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 RequiredHeaderCollectionOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl RequiredHeaderCollectionOperation {
    7         -
    /// Creates a new `RequiredHeaderCollectionOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `RequiredHeaderCollectionOperation`
          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::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +348,442 @@
   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 RequiredHeaderCollectionOperation {
   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("RequiredHeaderCollectionOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            RequiredHeaderCollectionOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            RequiredHeaderCollectionOperationResponseDeserializer,
  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   
            "RequiredHeaderCollectionOperation",
  111    122   
            "MiscService",
  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("RequiredHeaderCollectionOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(RequiredHeaderCollectionOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
  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 RequiredHeaderCollectionOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RequiredHeaderCollectionOperationResponseDeserializer {
  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_required_header_collection_operation::de_required_header_collection_operation_http_error(
  151    163   
                status, headers, body,
  152    164   
            )
  153    165   
        } else {
  154    166   
            crate::protocol_serde::shape_required_header_collection_operation::de_required_header_collection_operation_http_response(
  155    167   
                status, headers, body,
  156    168   
            )
  157    169   
        };
  158    170   
        crate::protocol_serde::type_erase_result(parse_result)
  159    171   
    }
  160    172   
}
         173  +
/* RequestSerializerGenerator.kt:67 */
  161    174   
#[derive(Debug)]
  162    175   
struct RequiredHeaderCollectionOperationRequestSerializer;
  163    176   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RequiredHeaderCollectionOperationRequestSerializer {
  164    177   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  165    178   
    fn serialize_input(
  166    179   
        &self,
  167    180   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  168    181   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  169    182   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  170    183   
        let input = input
  171    184   
            .downcast::<crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput>()
  172    185   
            .expect("correct type");
  173    186   
        let _header_serialization_settings = _cfg
  174    187   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  175    188   
            .cloned()
  176    189   
            .unwrap_or_default();
  177    190   
        let mut request_builder = {
  178    191   
            fn uri_base(
  179    192   
                _input: &crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
  180    193   
                output: &mut ::std::string::String,
  181    194   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  182    195   
                use ::std::fmt::Write as _;
  183    196   
                ::std::write!(output, "/required-header-collection-operation").expect("formatting should succeed");
  184    197   
                ::std::result::Result::Ok(())
  185    198   
            }
  186    199   
            #[allow(clippy::unnecessary_wraps)]
  187    200   
            fn update_http_builder(
  188    201   
                input: &crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
  189    202   
                builder: ::http::request::Builder,
  190    203   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  191    204   
                let mut uri = ::std::string::String::new();
  192    205   
                uri_base(input, &mut uri)?;
  193    206   
                let builder = crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_headers(
  194    207   
                    input, builder,
  195    208   
                )?;
  196    209   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  197    210   
            }
  198    211   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  199    212   
            builder
  200    213   
        };
  201    214   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  202    215   
  203    216   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  204    217   
    }
  205    218   
}
         219  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  206    220   
#[derive(Debug)]
  207    221   
struct RequiredHeaderCollectionOperationEndpointParamsInterceptor;
  208    222   
  209    223   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RequiredHeaderCollectionOperationEndpointParamsInterceptor {
  210    224   
    fn name(&self) -> &'static str {
  211    225   
        "RequiredHeaderCollectionOperationEndpointParamsInterceptor"
  212    226   
    }
  213    227   
  214    228   
    fn read_before_execution(
  215    229   
        &self,
  216    230   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  217    231   
            '_,
  218    232   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  220    234   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  221    235   
        >,
  222    236   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  223    237   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  224    238   
        let _input = context
  225    239   
            .input()
  226    240   
            .downcast_ref::<RequiredHeaderCollectionOperationInput>()
  227    241   
            .ok_or("failed to downcast to RequiredHeaderCollectionOperationInput")?;
  228    242   
  229    243   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  230    244   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  231    245   
        })?;
  232    246   
        cfg.interceptor_state()
  233    247   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  234    248   
        ::std::result::Result::Ok(())
  235    249   
    }
  236    250   
}
  237    251   
  238    252   
// The get_* functions below are generated from JMESPath expressions in the
  239    253   
// operationContextParams trait. They target the operation's input shape.
  240    254   
         255  +
/* OperationErrorGenerator.kt:79 */
  241    256   
/// Error type for the `RequiredHeaderCollectionOperationError` operation.
         257  +
/* RustType.kt:516 */
  242    258   
#[non_exhaustive]
         259  +
/* RustType.kt:516 */
  243    260   
#[derive(::std::fmt::Debug)]
  244         -
pub enum RequiredHeaderCollectionOperationError {
  245         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         261  +
pub /* OperationErrorGenerator.kt:81 */ enum RequiredHeaderCollectionOperationError {
         262  +
    /// /* OperationErrorGenerator.kt:83 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         263  +
    /* OperationErrorGenerator.kt:86 */
  246    264   
    ValidationError(crate::types::error::ValidationError),
         265  +
    /* OperationErrorGenerator.kt:88 */
  247    266   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  248    267   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  249    268   
    variable wildcard pattern and check `.code()`:
  250    269   
     \
  251    270   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  252    271   
     \
  253    272   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RequiredHeaderCollectionOperationError) for what information is available for the error.")]
  254    273   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         274  +
    /* OperationErrorGenerator.kt:81 */
  255    275   
}
         276  +
/* OperationErrorGenerator.kt:218 */
  256    277   
impl RequiredHeaderCollectionOperationError {
         278  +
    /* OperationErrorGenerator.kt:219 */
  257    279   
    /// Creates the `RequiredHeaderCollectionOperationError::Unhandled` variant from any error type.
  258    280   
    pub fn unhandled(
  259    281   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  260    282   
    ) -> Self {
  261    283   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  262    284   
            source: err.into(),
  263    285   
            meta: ::std::default::Default::default(),
  264    286   
        })
  265    287   
    }
  266    288   
  267    289   
    /// Creates the `RequiredHeaderCollectionOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  268    290   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  269    291   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  270    292   
            source: err.clone().into(),
  271    293   
            meta: err,
  272    294   
        })
  273    295   
    }
  274         -
    ///
         296  +
    /// /* OperationErrorGenerator.kt:236 */
  275    297   
    /// Returns error metadata, which includes the error code, message,
  276    298   
    /// request ID, and potentially additional information.
  277    299   
    ///
         300  +
    /* OperationErrorGenerator.kt:242 */
  278    301   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         302  +
        /* OperationErrorGenerator.kt:243 */
  279    303   
        match self {
  280         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  281         -
            Self::Unhandled(e) => &e.meta,
         304  +
            /* OperationErrorGenerator.kt:246 */ Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         305  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         306  +
            /* OperationErrorGenerator.kt:243 */
  282    307   
        }
         308  +
        /* OperationErrorGenerator.kt:242 */
  283    309   
    }
         310  +
    /* OperationErrorGenerator.kt:257 */
  284    311   
    /// Returns `true` if the error kind is `RequiredHeaderCollectionOperationError::ValidationError`.
         312  +
    /* OperationErrorGenerator.kt:258 */
  285    313   
    pub fn is_validation_error(&self) -> bool {
         314  +
        /* OperationErrorGenerator.kt:259 */
  286    315   
        matches!(self, Self::ValidationError(_))
         316  +
        /* OperationErrorGenerator.kt:258 */
  287    317   
    }
         318  +
    /* OperationErrorGenerator.kt:218 */
  288    319   
}
         320  +
/* OperationErrorGenerator.kt:269 */
  289    321   
impl ::std::error::Error for RequiredHeaderCollectionOperationError {
         322  +
    /* OperationErrorGenerator.kt:270 */
  290    323   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         324  +
        /* OperationErrorGenerator.kt:318 */
  291    325   
        match self {
  292         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  293         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         326  +
            /* OperationErrorGenerator.kt:321 */
         327  +
            Self::ValidationError(_inner) =>
         328  +
            /* OperationErrorGenerator.kt:283 */
         329  +
            {
         330  +
                ::std::option::Option::Some(_inner)
         331  +
            }
         332  +
            ,
         333  +
            /* OperationErrorGenerator.kt:326 */
         334  +
            Self::Unhandled(_inner) => {
         335  +
                /* OperationErrorGenerator.kt:279 */
         336  +
                ::std::option::Option::Some(&*_inner.source)
         337  +
                /* OperationErrorGenerator.kt:326 */
         338  +
            } /* OperationErrorGenerator.kt:318 */
  294    339   
        }
         340  +
        /* OperationErrorGenerator.kt:270 */
  295    341   
    }
         342  +
    /* OperationErrorGenerator.kt:269 */
  296    343   
}
         344  +
/* OperationErrorGenerator.kt:133 */
  297    345   
impl ::std::fmt::Display for RequiredHeaderCollectionOperationError {
         346  +
    /* OperationErrorGenerator.kt:134 */
  298    347   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         348  +
        /* OperationErrorGenerator.kt:318 */
  299    349   
        match self {
  300         -
            Self::ValidationError(_inner) => _inner.fmt(f),
         350  +
            /* OperationErrorGenerator.kt:321 */
         351  +
            Self::ValidationError(_inner) =>
         352  +
            /* OperationErrorGenerator.kt:151 */
         353  +
            {
         354  +
                _inner.fmt(f)
         355  +
            }
         356  +
            ,
         357  +
            /* OperationErrorGenerator.kt:326 */
  301    358   
            Self::Unhandled(_inner) => {
         359  +
                /* OperationErrorGenerator.kt:139 */
  302    360   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  303    361   
                    write!(f, "unhandled error ({code})")
  304    362   
                } else {
  305    363   
                    f.write_str("unhandled error")
  306    364   
                }
  307         -
            }
         365  +
                /* OperationErrorGenerator.kt:326 */
         366  +
            } /* OperationErrorGenerator.kt:318 */
  308    367   
        }
         368  +
        /* OperationErrorGenerator.kt:134 */
  309    369   
    }
         370  +
    /* OperationErrorGenerator.kt:133 */
  310    371   
}
         372  +
/* OperationErrorGenerator.kt:182 */
  311    373   
impl ::aws_smithy_types::retry::ProvideErrorKind for RequiredHeaderCollectionOperationError {
         374  +
    /* OperationErrorGenerator.kt:186 */
  312    375   
    fn code(&self) -> ::std::option::Option<&str> {
         376  +
        /* OperationErrorGenerator.kt:187 */
  313    377   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         378  +
        /* OperationErrorGenerator.kt:186 */
  314    379   
    }
         380  +
    /* OperationErrorGenerator.kt:190 */
  315    381   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         382  +
        /* OperationErrorGenerator.kt:197 */
  316    383   
        ::std::option::Option::None
         384  +
        /* OperationErrorGenerator.kt:190 */
  317    385   
    }
         386  +
    /* OperationErrorGenerator.kt:182 */
  318    387   
}
         388  +
/* OperationErrorGenerator.kt:163 */
  319    389   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RequiredHeaderCollectionOperationError {
         390  +
    /* OperationErrorGenerator.kt:164 */
  320    391   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         392  +
        /* OperationErrorGenerator.kt:318 */
  321    393   
        match self {
  322         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  323         -
            Self::Unhandled(_inner) => &_inner.meta,
         394  +
            /* OperationErrorGenerator.kt:321 */
         395  +
            Self::ValidationError(_inner) =>
         396  +
            /* OperationErrorGenerator.kt:169 */
         397  +
            {
         398  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         399  +
            }
         400  +
            ,
         401  +
            /* OperationErrorGenerator.kt:326 */
         402  +
            Self::Unhandled(_inner) => {
         403  +
                /* OperationErrorGenerator.kt:168 */
         404  +
                &_inner.meta
         405  +
                /* OperationErrorGenerator.kt:326 */
         406  +
            } /* OperationErrorGenerator.kt:318 */
  324    407   
        }
         408  +
        /* OperationErrorGenerator.kt:164 */
  325    409   
    }
         410  +
    /* OperationErrorGenerator.kt:163 */
  326    411   
}
         412  +
/* OperationErrorGenerator.kt:109 */
  327    413   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RequiredHeaderCollectionOperationError {
         414  +
    /* OperationErrorGenerator.kt:110 */
  328    415   
    fn create_unhandled_error(
  329    416   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  330    417   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  331    418   
    ) -> Self {
         419  +
        /* OperationErrorGenerator.kt:121 */
  332    420   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  333    421   
            source,
  334    422   
            meta: meta.unwrap_or_default(),
  335    423   
        })
         424  +
        /* OperationErrorGenerator.kt:110 */
  336    425   
    }
         426  +
    /* OperationErrorGenerator.kt:109 */
  337    427   
}
  338    428   
         429  +
/* CodegenDelegator.kt:255 */
  339    430   
pub use crate::operation::required_header_collection_operation::_required_header_collection_operation_output::RequiredHeaderCollectionOperationOutput;
  340    431   
         432  +
/* CodegenDelegator.kt:255 */
  341    433   
pub use crate::operation::required_header_collection_operation::_required_header_collection_operation_input::RequiredHeaderCollectionOperationInput;
  342    434   
         435  +
/* RustModule.kt:172 */
  343    436   
mod _required_header_collection_operation_input;
  344    437   
         438  +
/* RustModule.kt:172 */
  345    439   
mod _required_header_collection_operation_output;
  346    440   
  347         -
/// Builders
         441  +
/// /* CodegenDelegator.kt:51 */Builders
  348    442   
pub mod builders;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_header_collection_operation/_required_header_collection_operation_input.rs

@@ -1,1 +92,158 @@
    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 RequiredHeaderCollectionOperationInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct RequiredHeaderCollectionOperationInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub required_header_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub required_header_set: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl RequiredHeaderCollectionOperationInput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
   13         -
    ///
   14         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.required_header_list.is_none()`.
          21  +
    /// /* StructureGenerator.kt:162 */
          22  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.required_header_list.is_none()`.
          23  +
    /* StructureGenerator.kt:166 */
   15     24   
    pub fn required_header_list(&self) -> &[::std::string::String] {
   16         -
        self.required_header_list.as_deref().unwrap_or_default()
          25  +
        /* StructureGenerator.kt:169 */
          26  +
        self.required_header_list
          27  +
            .as_deref()
          28  +
            /* StructureGenerator.kt:175 */
          29  +
            .unwrap_or_default()
          30  +
        /* StructureGenerator.kt:166 */
   17     31   
    }
          32  +
    /* StructureGenerator.kt:231 */
   18     33   
    #[allow(missing_docs)] // documentation missing in model
   19         -
    ///
   20         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.required_header_set.is_none()`.
          34  +
    /// /* StructureGenerator.kt:162 */
          35  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.required_header_set.is_none()`.
          36  +
    /* StructureGenerator.kt:166 */
   21     37   
    pub fn required_header_set(&self) -> &[::std::string::String] {
   22         -
        self.required_header_set.as_deref().unwrap_or_default()
          38  +
        /* StructureGenerator.kt:169 */
          39  +
        self.required_header_set
          40  +
            .as_deref()
          41  +
            /* StructureGenerator.kt:175 */
          42  +
            .unwrap_or_default()
          43  +
        /* StructureGenerator.kt:166 */
   23     44   
    }
          45  +
    /* StructureGenerator.kt:135 */
   24     46   
}
          47  +
/* ClientCodegenVisitor.kt:237 */
   25     48   
impl RequiredHeaderCollectionOperationInput {
   26         -
    /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationInput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput).
          49  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationInput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput).
          50  +
    /* BuilderGenerator.kt:175 */
   27     51   
    pub fn builder() -> crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder {
          52  +
        /* BuilderGenerator.kt:176 */
   28     53   
        crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder::default()
          54  +
        /* BuilderGenerator.kt:175 */
   29     55   
    }
          56  +
    /* ClientCodegenVisitor.kt:237 */
   30     57   
}
   31     58   
   32         -
/// A builder for [`RequiredHeaderCollectionOperationInput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput).
          59  +
/// /* BuilderGenerator.kt:342 */A builder for [`RequiredHeaderCollectionOperationInput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput).
          60  +
/* RustType.kt:516 */
   33     61   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          62  +
/* RustType.kt:516 */
   34     63   
#[non_exhaustive]
          64  +
/* BuilderGenerator.kt:345 */
   35     65   
pub struct RequiredHeaderCollectionOperationInputBuilder {
   36         -
    pub(crate) required_header_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          66  +
    /* BuilderGenerator.kt:275 */ pub(crate) required_header_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          67  +
    /* BuilderGenerator.kt:275 */
   37     68   
    pub(crate) required_header_set: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          69  +
    /* BuilderGenerator.kt:345 */
   38     70   
}
          71  +
/* BuilderGenerator.kt:355 */
   39     72   
impl RequiredHeaderCollectionOperationInputBuilder {
   40         -
    /// Appends an item to `required_header_list`.
          73  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `required_header_list`.
          74  +
    /* BuilderGenerator.kt:411 */
   41     75   
    ///
   42         -
    /// To override the contents of this collection use [`set_required_header_list`](Self::set_required_header_list).
          76  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_required_header_list`](Self::set_required_header_list).
          77  +
    /* BuilderGenerator.kt:413 */
   43     78   
    ///
          79  +
    /* BuilderGenerator.kt:418 */
   44     80   
    pub fn required_header_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          81  +
        /* BuilderGenerator.kt:419 */
   45     82   
        let mut v = self.required_header_list.unwrap_or_default();
   46     83   
        v.push(input.into());
   47     84   
        self.required_header_list = ::std::option::Option::Some(v);
   48     85   
        self
          86  +
        /* BuilderGenerator.kt:418 */
   49     87   
    }
          88  +
    /* BuilderGenerator.kt:312 */
   50     89   
    #[allow(missing_docs)] // documentation missing in model
          90  +
                           /* BuilderGenerator.kt:314 */
   51     91   
    pub fn set_required_header_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
          92  +
        /* BuilderGenerator.kt:315 */
   52     93   
        self.required_header_list = input;
   53     94   
        self
          95  +
        /* BuilderGenerator.kt:314 */
   54     96   
    }
          97  +
    /* BuilderGenerator.kt:334 */
   55     98   
    #[allow(missing_docs)] // documentation missing in model
          99  +
                           /* BuilderGenerator.kt:336 */
   56    100   
    pub fn get_required_header_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         101  +
        /* BuilderGenerator.kt:337 */
   57    102   
        &self.required_header_list
         103  +
        /* BuilderGenerator.kt:336 */
   58    104   
    }
   59         -
    /// Appends an item to `required_header_set`.
         105  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `required_header_set`.
         106  +
    /* BuilderGenerator.kt:411 */
   60    107   
    ///
   61         -
    /// To override the contents of this collection use [`set_required_header_set`](Self::set_required_header_set).
         108  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_required_header_set`](Self::set_required_header_set).
         109  +
    /* BuilderGenerator.kt:413 */
   62    110   
    ///
         111  +
    /* BuilderGenerator.kt:418 */
   63    112   
    pub fn required_header_set(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         113  +
        /* BuilderGenerator.kt:419 */
   64    114   
        let mut v = self.required_header_set.unwrap_or_default();
   65    115   
        v.push(input.into());
   66    116   
        self.required_header_set = ::std::option::Option::Some(v);
   67    117   
        self
         118  +
        /* BuilderGenerator.kt:418 */
   68    119   
    }
         120  +
    /* BuilderGenerator.kt:312 */
   69    121   
    #[allow(missing_docs)] // documentation missing in model
         122  +
                           /* BuilderGenerator.kt:314 */
   70    123   
    pub fn set_required_header_set(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         124  +
        /* BuilderGenerator.kt:315 */
   71    125   
        self.required_header_set = input;
   72    126   
        self
         127  +
        /* BuilderGenerator.kt:314 */
   73    128   
    }
         129  +
    /* BuilderGenerator.kt:334 */
   74    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* BuilderGenerator.kt:336 */
   75    132   
    pub fn get_required_header_set(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         133  +
        /* BuilderGenerator.kt:337 */
   76    134   
        &self.required_header_set
         135  +
        /* BuilderGenerator.kt:336 */
   77    136   
    }
   78         -
    /// Consumes the builder and constructs a [`RequiredHeaderCollectionOperationInput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput).
         137  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`RequiredHeaderCollectionOperationInput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput).
         138  +
    /* BuilderGenerator.kt:253 */
   79    139   
    pub fn build(
   80    140   
        self,
   81    141   
    ) -> ::std::result::Result<
   82    142   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
   83    143   
        ::aws_smithy_types::error::operation::BuildError,
   84    144   
    > {
         145  +
        /* BuilderGenerator.kt:254 */
   85    146   
        ::std::result::Result::Ok(
         147  +
            /* BuilderGenerator.kt:477 */
   86    148   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput {
   87         -
                required_header_list: self.required_header_list,
         149  +
                /* BuilderGenerator.kt:481 */ required_header_list: self.required_header_list,
         150  +
                /* BuilderGenerator.kt:481 */
   88    151   
                required_header_set: self.required_header_set,
   89         -
            },
         152  +
                /* BuilderGenerator.kt:477 */
         153  +
            }, /* BuilderGenerator.kt:254 */
   90    154   
        )
         155  +
        /* BuilderGenerator.kt:253 */
   91    156   
    }
         157  +
    /* BuilderGenerator.kt:355 */
   92    158   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_header_collection_operation/_required_header_collection_operation_output.rs

@@ -1,1 +103,158 @@
    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 RequiredHeaderCollectionOperationOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct RequiredHeaderCollectionOperationOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub required_header_list: ::std::vec::Vec<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub required_header_set: ::std::vec::Vec<::std::string::String>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl RequiredHeaderCollectionOperationOutput {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn required_header_list(&self) -> &[::std::string::String] {
          23  +
        /* StructureGenerator.kt:171 */
   14     24   
        use std::ops::Deref;
   15     25   
        self.required_header_list.deref()
          26  +
        /* StructureGenerator.kt:166 */
   16     27   
    }
          28  +
    /* StructureGenerator.kt:231 */
   17     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
                           /* StructureGenerator.kt:166 */
   18     31   
    pub fn required_header_set(&self) -> &[::std::string::String] {
          32  +
        /* StructureGenerator.kt:171 */
   19     33   
        use std::ops::Deref;
   20     34   
        self.required_header_set.deref()
          35  +
        /* StructureGenerator.kt:166 */
   21     36   
    }
          37  +
    /* StructureGenerator.kt:135 */
   22     38   
}
          39  +
/* ClientCodegenVisitor.kt:237 */
   23     40   
impl RequiredHeaderCollectionOperationOutput {
   24         -
    /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationOutput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput).
          41  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationOutput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput).
          42  +
    /* BuilderGenerator.kt:175 */
   25     43   
    pub fn builder() -> crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder {
          44  +
        /* BuilderGenerator.kt:176 */
   26     45   
        crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::default()
          46  +
        /* BuilderGenerator.kt:175 */
   27     47   
    }
          48  +
    /* ClientCodegenVisitor.kt:237 */
   28     49   
}
   29     50   
   30         -
/// A builder for [`RequiredHeaderCollectionOperationOutput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput).
          51  +
/// /* BuilderGenerator.kt:342 */A builder for [`RequiredHeaderCollectionOperationOutput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput).
          52  +
/* RustType.kt:516 */
   31     53   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          54  +
/* RustType.kt:516 */
   32     55   
#[non_exhaustive]
          56  +
/* BuilderGenerator.kt:345 */
   33     57   
pub struct RequiredHeaderCollectionOperationOutputBuilder {
   34         -
    pub(crate) required_header_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          58  +
    /* BuilderGenerator.kt:275 */ pub(crate) required_header_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          59  +
    /* BuilderGenerator.kt:275 */
   35     60   
    pub(crate) required_header_set: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          61  +
    /* BuilderGenerator.kt:345 */
   36     62   
}
          63  +
/* BuilderGenerator.kt:355 */
   37     64   
impl RequiredHeaderCollectionOperationOutputBuilder {
   38         -
    /// Appends an item to `required_header_list`.
          65  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `required_header_list`.
          66  +
    /* BuilderGenerator.kt:411 */
   39     67   
    ///
   40         -
    /// To override the contents of this collection use [`set_required_header_list`](Self::set_required_header_list).
          68  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_required_header_list`](Self::set_required_header_list).
          69  +
    /* BuilderGenerator.kt:413 */
   41     70   
    ///
          71  +
    /* BuilderGenerator.kt:418 */
   42     72   
    pub fn required_header_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          73  +
        /* BuilderGenerator.kt:419 */
   43     74   
        let mut v = self.required_header_list.unwrap_or_default();
   44     75   
        v.push(input.into());
   45     76   
        self.required_header_list = ::std::option::Option::Some(v);
   46     77   
        self
          78  +
        /* BuilderGenerator.kt:418 */
   47     79   
    }
          80  +
    /* BuilderGenerator.kt:312 */
   48     81   
    #[allow(missing_docs)] // documentation missing in model
          82  +
                           /* BuilderGenerator.kt:314 */
   49     83   
    pub fn set_required_header_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
          84  +
        /* BuilderGenerator.kt:315 */
   50     85   
        self.required_header_list = input;
   51     86   
        self
          87  +
        /* BuilderGenerator.kt:314 */
   52     88   
    }
          89  +
    /* BuilderGenerator.kt:334 */
   53     90   
    #[allow(missing_docs)] // documentation missing in model
          91  +
                           /* BuilderGenerator.kt:336 */
   54     92   
    pub fn get_required_header_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
          93  +
        /* BuilderGenerator.kt:337 */
   55     94   
        &self.required_header_list
          95  +
        /* BuilderGenerator.kt:336 */
   56     96   
    }
   57         -
    /// Appends an item to `required_header_set`.
          97  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `required_header_set`.
          98  +
    /* BuilderGenerator.kt:411 */
   58     99   
    ///
   59         -
    /// To override the contents of this collection use [`set_required_header_set`](Self::set_required_header_set).
         100  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_required_header_set`](Self::set_required_header_set).
         101  +
    /* BuilderGenerator.kt:413 */
   60    102   
    ///
         103  +
    /* BuilderGenerator.kt:418 */
   61    104   
    pub fn required_header_set(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         105  +
        /* BuilderGenerator.kt:419 */
   62    106   
        let mut v = self.required_header_set.unwrap_or_default();
   63    107   
        v.push(input.into());
   64    108   
        self.required_header_set = ::std::option::Option::Some(v);
   65    109   
        self
         110  +
        /* BuilderGenerator.kt:418 */
   66    111   
    }
         112  +
    /* BuilderGenerator.kt:312 */
   67    113   
    #[allow(missing_docs)] // documentation missing in model
         114  +
                           /* BuilderGenerator.kt:314 */
   68    115   
    pub fn set_required_header_set(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         116  +
        /* BuilderGenerator.kt:315 */
   69    117   
        self.required_header_set = input;
   70    118   
        self
         119  +
        /* BuilderGenerator.kt:314 */
   71    120   
    }
         121  +
    /* BuilderGenerator.kt:334 */
   72    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* BuilderGenerator.kt:336 */
   73    124   
    pub fn get_required_header_set(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         125  +
        /* BuilderGenerator.kt:337 */
   74    126   
        &self.required_header_set
         127  +
        /* BuilderGenerator.kt:336 */
   75    128   
    }
   76         -
    /// Consumes the builder and constructs a [`RequiredHeaderCollectionOperationOutput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput).
   77         -
    /// This method will fail if any of the following fields are not set:
   78         -
    /// - [`required_header_list`](crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::required_header_list)
   79         -
    /// - [`required_header_set`](crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::required_header_set)
         129  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`RequiredHeaderCollectionOperationOutput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput).
         130  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         131  +
    /// /* BuilderGenerator.kt:246 */- [`required_header_list`](crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::required_header_list)
         132  +
    /// /* BuilderGenerator.kt:246 */- [`required_header_set`](crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::required_header_set)
         133  +
    /* BuilderGenerator.kt:253 */
   80    134   
    pub fn build(
   81    135   
        self,
   82    136   
    ) -> ::std::result::Result<
   83    137   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   84    138   
        ::aws_smithy_types::error::operation::BuildError,
   85    139   
    > {
         140  +
        /* BuilderGenerator.kt:254 */
   86    141   
        ::std::result::Result::Ok(
   87         -
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput {
   88         -
                required_header_list: self.required_header_list.ok_or_else(|| {
   89         -
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
   90         -
                        "required_header_list",
   91         -
                        "required_header_list was not specified but it is required when building RequiredHeaderCollectionOperationOutput",
   92         -
                    )
   93         -
                })?,
   94         -
                required_header_set: self.required_header_set.ok_or_else(|| {
   95         -
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
   96         -
                        "required_header_set",
   97         -
                        "required_header_set was not specified but it is required when building RequiredHeaderCollectionOperationOutput",
   98         -
                    )
   99         -
                })?,
  100         -
            },
  101         -
        )
         142  +
            /* BuilderGenerator.kt:477 */crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput {
         143  +
                /* BuilderGenerator.kt:481 */required_header_list: self.required_header_list
         144  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         145  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("required_header_list", "required_header_list was not specified but it is required when building RequiredHeaderCollectionOperationOutput")
         146  +
                    /* BuilderGenerator.kt:494 */)?
         147  +
                ,
         148  +
                /* BuilderGenerator.kt:481 */required_header_set: self.required_header_set
         149  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         150  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("required_header_set", "required_header_set was not specified but it is required when building RequiredHeaderCollectionOperationOutput")
         151  +
                    /* BuilderGenerator.kt:494 */)?
         152  +
                ,
         153  +
            /* BuilderGenerator.kt:477 */}
         154  +
        /* BuilderGenerator.kt:254 */)
         155  +
        /* BuilderGenerator.kt:253 */
  102    156   
    }
         157  +
    /* BuilderGenerator.kt:355 */
  103    158   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_header_collection_operation/builders.rs

@@ -1,1 +148,172 @@
    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::required_header_collection_operation::_required_header_collection_operation_output::RequiredHeaderCollectionOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::required_header_collection_operation::_required_header_collection_operation_input::RequiredHeaderCollectionOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder {
    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::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.required_header_collection_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `RequiredHeaderCollectionOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `RequiredHeaderCollectionOperation`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct RequiredHeaderCollectionOperationFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder,
   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::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   34     40   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   35     41   
    > for RequiredHeaderCollectionOperationFluentBuilder
   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::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   43     49   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   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 RequiredHeaderCollectionOperationFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `RequiredHeaderCollectionOperationFluentBuilder`.
   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 RequiredHeaderCollectionOperation as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationInputBuilder {
   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::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   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::required_header_collection_operation::RequiredHeaderCollectionOperation::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::required_header_collection_operation::RequiredHeaderCollectionOperation::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::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   96    106   
        crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   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   
    }
  110         -
    ///
         121  +
    /// /* FluentBuilderGenerator.kt:436 */
  111    122   
    /// Appends an item to `requiredHeaderList`.
  112    123   
    ///
  113    124   
    /// To override the contents of this collection use [`set_required_header_list`](Self::set_required_header_list).
  114    125   
    ///
         126  +
    /* FluentBuilderGenerator.kt:443 */
  115    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* FluentBuilderGenerator.kt:446 */
  116    129   
    pub fn required_header_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  117    130   
        self.inner = self.inner.required_header_list(input.into());
  118    131   
        self
  119    132   
    }
         133  +
    /* FluentBuilderGenerator.kt:498 */
  120    134   
    #[allow(missing_docs)] // documentation missing in model
         135  +
                           /* FluentBuilderGenerator.kt:500 */
  121    136   
    pub fn set_required_header_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  122    137   
        self.inner = self.inner.set_required_header_list(input);
  123    138   
        self
  124    139   
    }
         140  +
    /* FluentBuilderGenerator.kt:518 */
  125    141   
    #[allow(missing_docs)] // documentation missing in model
         142  +
                           /* FluentBuilderGenerator.kt:520 */
  126    143   
    pub fn get_required_header_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  127    144   
        self.inner.get_required_header_list()
  128    145   
    }
  129         -
    ///
         146  +
    /// /* FluentBuilderGenerator.kt:436 */
  130    147   
    /// Appends an item to `requiredHeaderSet`.
  131    148   
    ///
  132    149   
    /// To override the contents of this collection use [`set_required_header_set`](Self::set_required_header_set).
  133    150   
    ///
         151  +
    /* FluentBuilderGenerator.kt:443 */
  134    152   
    #[allow(missing_docs)] // documentation missing in model
         153  +
                           /* FluentBuilderGenerator.kt:446 */
  135    154   
    pub fn required_header_set(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  136    155   
        self.inner = self.inner.required_header_set(input.into());
  137    156   
        self
  138    157   
    }
         158  +
    /* FluentBuilderGenerator.kt:498 */
  139    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* FluentBuilderGenerator.kt:500 */
  140    161   
    pub fn set_required_header_set(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
  141    162   
        self.inner = self.inner.set_required_header_set(input);
  142    163   
        self
  143    164   
    }
         165  +
    /* FluentBuilderGenerator.kt:518 */
  144    166   
    #[allow(missing_docs)] // documentation missing in model
         167  +
                           /* FluentBuilderGenerator.kt:520 */
  145    168   
    pub fn get_required_header_set(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
  146    169   
        self.inner.get_required_header_set()
  147    170   
    }
         171  +
    /* FluentBuilderGenerator.kt:282 */
  148    172   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `RequiredInnerShapeOperation`.
           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 RequiredInnerShapeOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl RequiredInnerShapeOperation {
    7         -
    /// Creates a new `RequiredInnerShapeOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `RequiredInnerShapeOperation`
          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::required_inner_shape_operation::RequiredInnerShapeOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +347,441 @@
   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 RequiredInnerShapeOperation {
   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("RequiredInnerShapeOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            RequiredInnerShapeOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            RequiredInnerShapeOperationResponseDeserializer,
  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   
            "RequiredInnerShapeOperation",
  111    122   
            "MiscService",
  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("RequiredInnerShapeOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(RequiredInnerShapeOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
  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 RequiredInnerShapeOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RequiredInnerShapeOperationResponseDeserializer {
  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_required_inner_shape_operation::de_required_inner_shape_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct RequiredInnerShapeOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RequiredInnerShapeOperationRequestSerializer {
  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::required_inner_shape_operation::RequiredInnerShapeOperationInput>()
  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::required_inner_shape_operation::RequiredInnerShapeOperationInput,
  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, "/requiredInnerShapeOperation").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::required_inner_shape_operation::RequiredInnerShapeOperationInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from(
  196    209   
            crate::protocol_serde::shape_required_inner_shape_operation::ser_required_inner_shape_operation_input(&input)?,
  197    210   
        );
  198    211   
        if let Some(content_length) = body.content_length() {
  199    212   
            let content_length = content_length.to_string();
  200    213   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  201    214   
        }
  202    215   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  203    216   
    }
  204    217   
}
         218  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  205    219   
#[derive(Debug)]
  206    220   
struct RequiredInnerShapeOperationEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RequiredInnerShapeOperationEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "RequiredInnerShapeOperationEndpointParamsInterceptor"
  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::<RequiredInnerShapeOperationInput>()
  226    240   
            .ok_or("failed to downcast to RequiredInnerShapeOperationInput")?;
  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  +
/* OperationErrorGenerator.kt:79 */
  240    255   
/// Error type for the `RequiredInnerShapeOperationError` operation.
         256  +
/* RustType.kt:516 */
  241    257   
#[non_exhaustive]
         258  +
/* RustType.kt:516 */
  242    259   
#[derive(::std::fmt::Debug)]
  243         -
pub enum RequiredInnerShapeOperationError {
  244         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         260  +
pub /* OperationErrorGenerator.kt:81 */ enum RequiredInnerShapeOperationError {
         261  +
    /// /* OperationErrorGenerator.kt:83 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         262  +
    /* OperationErrorGenerator.kt:86 */
  245    263   
    ValidationError(crate::types::error::ValidationError),
         264  +
    /* OperationErrorGenerator.kt:88 */
  246    265   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  247    266   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  248    267   
    variable wildcard pattern and check `.code()`:
  249    268   
     \
  250    269   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  251    270   
     \
  252    271   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RequiredInnerShapeOperationError) for what information is available for the error.")]
  253    272   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         273  +
    /* OperationErrorGenerator.kt:81 */
  254    274   
}
         275  +
/* OperationErrorGenerator.kt:218 */
  255    276   
impl RequiredInnerShapeOperationError {
         277  +
    /* OperationErrorGenerator.kt:219 */
  256    278   
    /// Creates the `RequiredInnerShapeOperationError::Unhandled` variant from any error type.
  257    279   
    pub fn unhandled(
  258    280   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  259    281   
    ) -> Self {
  260    282   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  261    283   
            source: err.into(),
  262    284   
            meta: ::std::default::Default::default(),
  263    285   
        })
  264    286   
    }
  265    287   
  266    288   
    /// Creates the `RequiredInnerShapeOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  267    289   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  268    290   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  269    291   
            source: err.clone().into(),
  270    292   
            meta: err,
  271    293   
        })
  272    294   
    }
  273         -
    ///
         295  +
    /// /* OperationErrorGenerator.kt:236 */
  274    296   
    /// Returns error metadata, which includes the error code, message,
  275    297   
    /// request ID, and potentially additional information.
  276    298   
    ///
         299  +
    /* OperationErrorGenerator.kt:242 */
  277    300   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         301  +
        /* OperationErrorGenerator.kt:243 */
  278    302   
        match self {
  279         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  280         -
            Self::Unhandled(e) => &e.meta,
         303  +
            /* OperationErrorGenerator.kt:246 */ Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         304  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         305  +
            /* OperationErrorGenerator.kt:243 */
  281    306   
        }
         307  +
        /* OperationErrorGenerator.kt:242 */
  282    308   
    }
         309  +
    /* OperationErrorGenerator.kt:257 */
  283    310   
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::ValidationError`.
         311  +
    /* OperationErrorGenerator.kt:258 */
  284    312   
    pub fn is_validation_error(&self) -> bool {
         313  +
        /* OperationErrorGenerator.kt:259 */
  285    314   
        matches!(self, Self::ValidationError(_))
         315  +
        /* OperationErrorGenerator.kt:258 */
  286    316   
    }
         317  +
    /* OperationErrorGenerator.kt:218 */
  287    318   
}
         319  +
/* OperationErrorGenerator.kt:269 */
  288    320   
impl ::std::error::Error for RequiredInnerShapeOperationError {
         321  +
    /* OperationErrorGenerator.kt:270 */
  289    322   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         323  +
        /* OperationErrorGenerator.kt:318 */
  290    324   
        match self {
  291         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  292         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         325  +
            /* OperationErrorGenerator.kt:321 */
         326  +
            Self::ValidationError(_inner) =>
         327  +
            /* OperationErrorGenerator.kt:283 */
         328  +
            {
         329  +
                ::std::option::Option::Some(_inner)
         330  +
            }
         331  +
            ,
         332  +
            /* OperationErrorGenerator.kt:326 */
         333  +
            Self::Unhandled(_inner) => {
         334  +
                /* OperationErrorGenerator.kt:279 */
         335  +
                ::std::option::Option::Some(&*_inner.source)
         336  +
                /* OperationErrorGenerator.kt:326 */
         337  +
            } /* OperationErrorGenerator.kt:318 */
  293    338   
        }
         339  +
        /* OperationErrorGenerator.kt:270 */
  294    340   
    }
         341  +
    /* OperationErrorGenerator.kt:269 */
  295    342   
}
         343  +
/* OperationErrorGenerator.kt:133 */
  296    344   
impl ::std::fmt::Display for RequiredInnerShapeOperationError {
         345  +
    /* OperationErrorGenerator.kt:134 */
  297    346   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         347  +
        /* OperationErrorGenerator.kt:318 */
  298    348   
        match self {
  299         -
            Self::ValidationError(_inner) => _inner.fmt(f),
         349  +
            /* OperationErrorGenerator.kt:321 */
         350  +
            Self::ValidationError(_inner) =>
         351  +
            /* OperationErrorGenerator.kt:151 */
         352  +
            {
         353  +
                _inner.fmt(f)
         354  +
            }
         355  +
            ,
         356  +
            /* OperationErrorGenerator.kt:326 */
  300    357   
            Self::Unhandled(_inner) => {
         358  +
                /* OperationErrorGenerator.kt:139 */
  301    359   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  302    360   
                    write!(f, "unhandled error ({code})")
  303    361   
                } else {
  304    362   
                    f.write_str("unhandled error")
  305    363   
                }
  306         -
            }
         364  +
                /* OperationErrorGenerator.kt:326 */
         365  +
            } /* OperationErrorGenerator.kt:318 */
  307    366   
        }
         367  +
        /* OperationErrorGenerator.kt:134 */
  308    368   
    }
         369  +
    /* OperationErrorGenerator.kt:133 */
  309    370   
}
         371  +
/* OperationErrorGenerator.kt:182 */
  310    372   
impl ::aws_smithy_types::retry::ProvideErrorKind for RequiredInnerShapeOperationError {
         373  +
    /* OperationErrorGenerator.kt:186 */
  311    374   
    fn code(&self) -> ::std::option::Option<&str> {
         375  +
        /* OperationErrorGenerator.kt:187 */
  312    376   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         377  +
        /* OperationErrorGenerator.kt:186 */
  313    378   
    }
         379  +
    /* OperationErrorGenerator.kt:190 */
  314    380   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         381  +
        /* OperationErrorGenerator.kt:197 */
  315    382   
        ::std::option::Option::None
         383  +
        /* OperationErrorGenerator.kt:190 */
  316    384   
    }
         385  +
    /* OperationErrorGenerator.kt:182 */
  317    386   
}
         387  +
/* OperationErrorGenerator.kt:163 */
  318    388   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RequiredInnerShapeOperationError {
         389  +
    /* OperationErrorGenerator.kt:164 */
  319    390   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         391  +
        /* OperationErrorGenerator.kt:318 */
  320    392   
        match self {
  321         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  322         -
            Self::Unhandled(_inner) => &_inner.meta,
         393  +
            /* OperationErrorGenerator.kt:321 */
         394  +
            Self::ValidationError(_inner) =>
         395  +
            /* OperationErrorGenerator.kt:169 */
         396  +
            {
         397  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         398  +
            }
         399  +
            ,
         400  +
            /* OperationErrorGenerator.kt:326 */
         401  +
            Self::Unhandled(_inner) => {
         402  +
                /* OperationErrorGenerator.kt:168 */
         403  +
                &_inner.meta
         404  +
                /* OperationErrorGenerator.kt:326 */
         405  +
            } /* OperationErrorGenerator.kt:318 */
  323    406   
        }
         407  +
        /* OperationErrorGenerator.kt:164 */
  324    408   
    }
         409  +
    /* OperationErrorGenerator.kt:163 */
  325    410   
}
         411  +
/* OperationErrorGenerator.kt:109 */
  326    412   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RequiredInnerShapeOperationError {
         413  +
    /* OperationErrorGenerator.kt:110 */
  327    414   
    fn create_unhandled_error(
  328    415   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  329    416   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  330    417   
    ) -> Self {
         418  +
        /* OperationErrorGenerator.kt:121 */
  331    419   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  332    420   
            source,
  333    421   
            meta: meta.unwrap_or_default(),
  334    422   
        })
         423  +
        /* OperationErrorGenerator.kt:110 */
  335    424   
    }
         425  +
    /* OperationErrorGenerator.kt:109 */
  336    426   
}
  337    427   
         428  +
/* CodegenDelegator.kt:255 */
  338    429   
pub use crate::operation::required_inner_shape_operation::_required_inner_shape_operation_output::RequiredInnerShapeOperationOutput;
  339    430   
         431  +
/* CodegenDelegator.kt:255 */
  340    432   
pub use crate::operation::required_inner_shape_operation::_required_inner_shape_operation_input::RequiredInnerShapeOperationInput;
  341    433   
         434  +
/* RustModule.kt:172 */
  342    435   
mod _required_inner_shape_operation_input;
  343    436   
         437  +
/* RustModule.kt:172 */
  344    438   
mod _required_inner_shape_operation_output;
  345    439   
  346         -
/// Builders
         440  +
/// /* CodegenDelegator.kt:51 */Builders
  347    441   
pub mod builders;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation/_required_inner_shape_operation_input.rs

@@ -1,1 +52,96 @@
    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 RequiredInnerShapeOperationInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct RequiredInnerShapeOperationInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub inner: ::std::option::Option<crate::types::InnerShape>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl RequiredInnerShapeOperationInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn inner(&self) -> ::std::option::Option<&crate::types::InnerShape> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.inner.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl RequiredInnerShapeOperationInput {
   16         -
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          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 RequiredInnerShapeOperationInputBuilder {
   26         -
    pub(crate) inner: ::std::option::Option<crate::types::InnerShape>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) inner: ::std::option::Option<crate::types::InnerShape>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl RequiredInnerShapeOperationInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn inner(mut self, input: crate::types::InnerShape) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.inner = ::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_inner(mut self, input: ::std::option::Option<crate::types::InnerShape>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.inner = 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_inner(&self) -> &::std::option::Option<crate::types::InnerShape> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.inner
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`RequiredInnerShapeOperationInput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(
   45     80   
        self,
   46     81   
    ) -> ::std::result::Result<
   47     82   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
   48     83   
        ::aws_smithy_types::error::operation::BuildError,
   49     84   
    > {
   50         -
        ::std::result::Result::Ok(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput { inner: self.inner })
          85  +
        /* BuilderGenerator.kt:254 */
          86  +
        ::std::result::Result::Ok(
          87  +
            /* BuilderGenerator.kt:477 */
          88  +
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput {
          89  +
                /* BuilderGenerator.kt:481 */ inner: self.inner,
          90  +
                /* BuilderGenerator.kt:477 */
          91  +
            }, /* BuilderGenerator.kt:254 */
          92  +
        )
          93  +
        /* BuilderGenerator.kt:253 */
   51     94   
    }
          95  +
    /* BuilderGenerator.kt:355 */
   52     96   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation/_required_inner_shape_operation_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 RequiredInnerShapeOperationOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct RequiredInnerShapeOperationOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub inner: ::std::option::Option<crate::types::InnerShape>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl RequiredInnerShapeOperationOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn inner(&self) -> ::std::option::Option<&crate::types::InnerShape> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.inner.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl RequiredInnerShapeOperationOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          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 RequiredInnerShapeOperationOutputBuilder {
   26         -
    pub(crate) inner: ::std::option::Option<crate::types::InnerShape>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) inner: ::std::option::Option<crate::types::InnerShape>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl RequiredInnerShapeOperationOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn inner(mut self, input: crate::types::InnerShape) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.inner = ::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_inner(mut self, input: ::std::option::Option<crate::types::InnerShape>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.inner = 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_inner(&self) -> &::std::option::Option<crate::types::InnerShape> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.inner
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput {
   45         -
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput { inner: self.inner }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput {
          82  +
            /* BuilderGenerator.kt:481 */ inner: self.inner,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/required_inner_shape_operation/builders.rs

@@ -1,1 +125,143 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::required_inner_shape_operation::_required_inner_shape_operation_output::RequiredInnerShapeOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::required_inner_shape_operation::_required_inner_shape_operation_input::RequiredInnerShapeOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder {
    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::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.required_inner_shape_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `RequiredInnerShapeOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `RequiredInnerShapeOperation`.
   24     27   
///
   25         -
/// This operation tests that (de)serializing required values from a nested shape works correctly.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation tests that (de)serializing required values from a nested shape works correctly.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct RequiredInnerShapeOperationFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder,
   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::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   35     41   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   36     42   
    > for RequiredInnerShapeOperationFluentBuilder
   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::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   44     50   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   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 RequiredInnerShapeOperationFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `RequiredInnerShapeOperationFluentBuilder`.
   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 RequiredInnerShapeOperation as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationInputBuilder {
   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::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   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::required_inner_shape_operation::RequiredInnerShapeOperation::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::required_inner_shape_operation::RequiredInnerShapeOperation::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::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   97    107   
        crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   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 inner(mut self, input: crate::types::InnerShape) -> Self {
  113    126   
        self.inner = self.inner.inner(input);
  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_inner(mut self, input: ::std::option::Option<crate::types::InnerShape>) -> Self {
  118    133   
        self.inner = self.inner.set_inner(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_inner(&self) -> &::std::option::Option<crate::types::InnerShape> {
  123    140   
        self.inner.get_inner()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:282 */
  125    143   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `ResponseCodeDefaultOperation`.
           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 ResponseCodeDefaultOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl ResponseCodeDefaultOperation {
    7         -
    /// Creates a new `ResponseCodeDefaultOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `ResponseCodeDefaultOperation`
          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::response_code_default_operation::ResponseCodeDefaultOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +373,449 @@
   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 ResponseCodeDefaultOperation {
   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("ResponseCodeDefaultOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            ResponseCodeDefaultOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            ResponseCodeDefaultOperationResponseDeserializer,
  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   
            "ResponseCodeDefaultOperation",
  111    122   
            "MiscService",
  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("ResponseCodeDefaultOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(ResponseCodeDefaultOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
  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 ResponseCodeDefaultOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeDefaultOperationResponseDeserializer {
  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_response_code_default_operation::de_response_code_default_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct ResponseCodeDefaultOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeDefaultOperationRequestSerializer {
  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::response_code_default_operation::ResponseCodeDefaultOperationInput>()
  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::response_code_default_operation::ResponseCodeDefaultOperationInput,
  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, "/responseCodeDefaultOperation").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::response_code_default_operation::ResponseCodeDefaultOperationInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct ResponseCodeDefaultOperationEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeDefaultOperationEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "ResponseCodeDefaultOperationEndpointParamsInterceptor"
  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::<ResponseCodeDefaultOperationInput>()
  220    234   
            .ok_or("failed to downcast to ResponseCodeDefaultOperationInput")?;
  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 response_code_default_operation_test {
  237    254   
  238    255   
    /// Test ID: ResponseCodeDefaultOperation
  239    256   
    #[::tokio::test]
  240    257   
    #[::tracing_test::traced_test]
  241    258   
    async fn response_code_default_operation_response() {
  242    259   
        let expected_output = crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput::builder().build();
  243    260   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  244    261   
            ::http::response::Builder::new()
  245    262   
                .status(200)
  246    263   
                .body(::aws_smithy_types::body::SdkBody::from(vec![]))
  247    264   
                .unwrap(),
  248    265   
        )
  249    266   
        .unwrap();
  250    267   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  251    268   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  252    269   
  253    270   
        let op = crate::operation::response_code_default_operation::ResponseCodeDefaultOperation::new();
  254    271   
        let config = op.config().expect("the operation has config");
  255    272   
        let de = config
  256    273   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  257    274   
            .expect("the config must have a deserializer");
  258    275   
  259    276   
        let parsed = de.deserialize_streaming(&mut http_response);
  260    277   
        let parsed = parsed.unwrap_or_else(|| {
  261    278   
            let http_response = http_response.map(|body| {
  262    279   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  263    280   
                    body.bytes().unwrap(),
  264    281   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  265    282   
                )))
  266    283   
            });
  267    284   
            de.deserialize_nonstreaming(&http_response)
  268    285   
        });
  269    286   
        let parsed = parsed
  270    287   
            .expect("should be successful response")
  271    288   
            .downcast::<crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput>()
  272    289   
            .unwrap();
  273    290   
    }
         291  +
         292  +
    /* ProtocolTestGenerator.kt:98 */
  274    293   
}
  275    294   
         295  +
/* OperationErrorGenerator.kt:79 */
  276    296   
/// Error type for the `ResponseCodeDefaultOperationError` operation.
         297  +
/* RustType.kt:516 */
  277    298   
#[non_exhaustive]
         299  +
/* RustType.kt:516 */
  278    300   
#[derive(::std::fmt::Debug)]
  279         -
pub enum ResponseCodeDefaultOperationError {
         301  +
pub /* OperationErrorGenerator.kt:81 */ enum ResponseCodeDefaultOperationError {
         302  +
    /* OperationErrorGenerator.kt:88 */
  280    303   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  281    304   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  282    305   
    variable wildcard pattern and check `.code()`:
  283    306   
     \
  284    307   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  285    308   
     \
  286    309   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseCodeDefaultOperationError) for what information is available for the error.")]
  287    310   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         311  +
    /* OperationErrorGenerator.kt:81 */
  288    312   
}
         313  +
/* OperationErrorGenerator.kt:218 */
  289    314   
impl ResponseCodeDefaultOperationError {
         315  +
    /* OperationErrorGenerator.kt:219 */
  290    316   
    /// Creates the `ResponseCodeDefaultOperationError::Unhandled` variant from any error type.
  291    317   
    pub fn unhandled(
  292    318   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  293    319   
    ) -> Self {
  294    320   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  295    321   
            source: err.into(),
  296    322   
            meta: ::std::default::Default::default(),
  297    323   
        })
  298    324   
    }
  299    325   
  300    326   
    /// Creates the `ResponseCodeDefaultOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  301    327   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  302    328   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  303    329   
            source: err.clone().into(),
  304    330   
            meta: err,
  305    331   
        })
  306    332   
    }
  307         -
    ///
         333  +
    /// /* OperationErrorGenerator.kt:236 */
  308    334   
    /// Returns error metadata, which includes the error code, message,
  309    335   
    /// request ID, and potentially additional information.
  310    336   
    ///
         337  +
    /* OperationErrorGenerator.kt:242 */
  311    338   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         339  +
        /* OperationErrorGenerator.kt:243 */
  312    340   
        match self {
  313         -
            Self::Unhandled(e) => &e.meta,
         341  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         342  +
            /* OperationErrorGenerator.kt:243 */
  314    343   
        }
         344  +
        /* OperationErrorGenerator.kt:242 */
  315    345   
    }
         346  +
    /* OperationErrorGenerator.kt:218 */
  316    347   
}
         348  +
/* OperationErrorGenerator.kt:269 */
  317    349   
impl ::std::error::Error for ResponseCodeDefaultOperationError {
         350  +
    /* OperationErrorGenerator.kt:270 */
  318    351   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         352  +
        /* OperationErrorGenerator.kt:318 */
  319    353   
        match self {
  320         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         354  +
            /* OperationErrorGenerator.kt:326 */
         355  +
            Self::Unhandled(_inner) => {
         356  +
                /* OperationErrorGenerator.kt:279 */
         357  +
                ::std::option::Option::Some(&*_inner.source)
         358  +
                /* OperationErrorGenerator.kt:326 */
         359  +
            } /* OperationErrorGenerator.kt:318 */
  321    360   
        }
         361  +
        /* OperationErrorGenerator.kt:270 */
  322    362   
    }
         363  +
    /* OperationErrorGenerator.kt:269 */
  323    364   
}
         365  +
/* OperationErrorGenerator.kt:133 */
  324    366   
impl ::std::fmt::Display for ResponseCodeDefaultOperationError {
         367  +
    /* OperationErrorGenerator.kt:134 */
  325    368   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         369  +
        /* OperationErrorGenerator.kt:318 */
  326    370   
        match self {
         371  +
            /* OperationErrorGenerator.kt:326 */
  327    372   
            Self::Unhandled(_inner) => {
         373  +
                /* OperationErrorGenerator.kt:139 */
  328    374   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  329    375   
                    write!(f, "unhandled error ({code})")
  330    376   
                } else {
  331    377   
                    f.write_str("unhandled error")
  332    378   
                }
  333         -
            }
         379  +
                /* OperationErrorGenerator.kt:326 */
         380  +
            } /* OperationErrorGenerator.kt:318 */
  334    381   
        }
         382  +
        /* OperationErrorGenerator.kt:134 */
  335    383   
    }
         384  +
    /* OperationErrorGenerator.kt:133 */
  336    385   
}
         386  +
/* OperationErrorGenerator.kt:182 */
  337    387   
impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseCodeDefaultOperationError {
         388  +
    /* OperationErrorGenerator.kt:186 */
  338    389   
    fn code(&self) -> ::std::option::Option<&str> {
         390  +
        /* OperationErrorGenerator.kt:187 */
  339    391   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         392  +
        /* OperationErrorGenerator.kt:186 */
  340    393   
    }
         394  +
    /* OperationErrorGenerator.kt:190 */
  341    395   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         396  +
        /* OperationErrorGenerator.kt:197 */
  342    397   
        ::std::option::Option::None
         398  +
        /* OperationErrorGenerator.kt:190 */
  343    399   
    }
         400  +
    /* OperationErrorGenerator.kt:182 */
  344    401   
}
         402  +
/* OperationErrorGenerator.kt:163 */
  345    403   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseCodeDefaultOperationError {
         404  +
    /* OperationErrorGenerator.kt:164 */
  346    405   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         406  +
        /* OperationErrorGenerator.kt:318 */
  347    407   
        match self {
  348         -
            Self::Unhandled(_inner) => &_inner.meta,
         408  +
            /* OperationErrorGenerator.kt:326 */
         409  +
            Self::Unhandled(_inner) => {
         410  +
                /* OperationErrorGenerator.kt:168 */
         411  +
                &_inner.meta
         412  +
                /* OperationErrorGenerator.kt:326 */
         413  +
            } /* OperationErrorGenerator.kt:318 */
  349    414   
        }
         415  +
        /* OperationErrorGenerator.kt:164 */
  350    416   
    }
         417  +
    /* OperationErrorGenerator.kt:163 */
  351    418   
}
         419  +
/* OperationErrorGenerator.kt:109 */
  352    420   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseCodeDefaultOperationError {
         421  +
    /* OperationErrorGenerator.kt:110 */
  353    422   
    fn create_unhandled_error(
  354    423   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  355    424   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  356    425   
    ) -> Self {
         426  +
        /* OperationErrorGenerator.kt:121 */
  357    427   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  358    428   
            source,
  359    429   
            meta: meta.unwrap_or_default(),
  360    430   
        })
         431  +
        /* OperationErrorGenerator.kt:110 */
  361    432   
    }
         433  +
    /* OperationErrorGenerator.kt:109 */
  362    434   
}
  363    435   
         436  +
/* CodegenDelegator.kt:255 */
  364    437   
pub use crate::operation::response_code_default_operation::_response_code_default_operation_output::ResponseCodeDefaultOperationOutput;
  365    438   
         439  +
/* CodegenDelegator.kt:255 */
  366    440   
pub use crate::operation::response_code_default_operation::_response_code_default_operation_input::ResponseCodeDefaultOperationInput;
  367    441   
         442  +
/* RustModule.kt:172 */
  368    443   
mod _response_code_default_operation_input;
  369    444   
         445  +
/* RustModule.kt:172 */
  370    446   
mod _response_code_default_operation_output;
  371    447   
  372         -
/// Builders
         448  +
/// /* CodegenDelegator.kt:51 */Builders
  373    449   
pub mod builders;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation/_response_code_default_operation_input.rs

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

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation/_response_code_default_operation_output.rs

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

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_default_operation/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::response_code_default_operation::_response_code_default_operation_output::ResponseCodeDefaultOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::response_code_default_operation::_response_code_default_operation_input::ResponseCodeDefaultOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder {
    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::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.response_code_default_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `ResponseCodeDefaultOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `ResponseCodeDefaultOperation`.
   24     27   
///
   25         -
/// This operation tests that the response code defaults to 200 when no other code is set.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation tests that the response code defaults to 200 when no other code is set.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct ResponseCodeDefaultOperationFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder,
   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::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   35     41   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   36     42   
    > for ResponseCodeDefaultOperationFluentBuilder
   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::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   44     50   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   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 ResponseCodeDefaultOperationFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `ResponseCodeDefaultOperationFluentBuilder`.
   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 ResponseCodeDefaultOperation as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationInputBuilder {
   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::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   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::response_code_default_operation::ResponseCodeDefaultOperation::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::response_code_default_operation::ResponseCodeDefaultOperation::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::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   97    107   
        crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   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/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `ResponseCodeHttpFallbackOperation`.
           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 ResponseCodeHttpFallbackOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl ResponseCodeHttpFallbackOperation {
    7         -
    /// Creates a new `ResponseCodeHttpFallbackOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `ResponseCodeHttpFallbackOperation`
          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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +378,454 @@
   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 ResponseCodeHttpFallbackOperation {
   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("ResponseCodeHttpFallbackOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            ResponseCodeHttpFallbackOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            ResponseCodeHttpFallbackOperationResponseDeserializer,
  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   
            "ResponseCodeHttpFallbackOperation",
  111    122   
            "MiscService",
  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("ResponseCodeHttpFallbackOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(ResponseCodeHttpFallbackOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
  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 ResponseCodeHttpFallbackOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResponseCodeHttpFallbackOperationResponseDeserializer {
  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 != 201 || force_error {
  150    162   
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_error(
  151    163   
                status, headers, body,
  152    164   
            )
  153    165   
        } else {
  154    166   
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_response(
  155    167   
                status, headers, body,
  156    168   
            )
  157    169   
        };
  158    170   
        crate::protocol_serde::type_erase_result(parse_result)
  159    171   
    }
  160    172   
}
         173  +
/* RequestSerializerGenerator.kt:67 */
  161    174   
#[derive(Debug)]
  162    175   
struct ResponseCodeHttpFallbackOperationRequestSerializer;
  163    176   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ResponseCodeHttpFallbackOperationRequestSerializer {
  164    177   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  165    178   
    fn serialize_input(
  166    179   
        &self,
  167    180   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  168    181   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  169    182   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  170    183   
        let input = input
  171    184   
            .downcast::<crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput>()
  172    185   
            .expect("correct type");
  173    186   
        let _header_serialization_settings = _cfg
  174    187   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  175    188   
            .cloned()
  176    189   
            .unwrap_or_default();
  177    190   
        let mut request_builder = {
  178    191   
            fn uri_base(
  179    192   
                _input: &crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
  180    193   
                output: &mut ::std::string::String,
  181    194   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  182    195   
                use ::std::fmt::Write as _;
  183    196   
                ::std::write!(output, "/responseCodeHttpFallbackOperation").expect("formatting should succeed");
  184    197   
                ::std::result::Result::Ok(())
  185    198   
            }
  186    199   
            #[allow(clippy::unnecessary_wraps)]
  187    200   
            fn update_http_builder(
  188    201   
                input: &crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationInput,
  189    202   
                builder: ::http::request::Builder,
  190    203   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  191    204   
                let mut uri = ::std::string::String::new();
  192    205   
                uri_base(input, &mut uri)?;
  193    206   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  194    207   
            }
  195    208   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  196    209   
            builder
  197    210   
        };
  198    211   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  199    212   
  200    213   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  201    214   
    }
  202    215   
}
         216  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  203    217   
#[derive(Debug)]
  204    218   
struct ResponseCodeHttpFallbackOperationEndpointParamsInterceptor;
  205    219   
  206    220   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResponseCodeHttpFallbackOperationEndpointParamsInterceptor {
  207    221   
    fn name(&self) -> &'static str {
  208    222   
        "ResponseCodeHttpFallbackOperationEndpointParamsInterceptor"
  209    223   
    }
  210    224   
  211    225   
    fn read_before_execution(
  212    226   
        &self,
  213    227   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  214    228   
            '_,
  215    229   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  216    230   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  218    232   
        >,
  219    233   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  220    234   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  221    235   
        let _input = context
  222    236   
            .input()
  223    237   
            .downcast_ref::<ResponseCodeHttpFallbackOperationInput>()
  224    238   
            .ok_or("failed to downcast to ResponseCodeHttpFallbackOperationInput")?;
  225    239   
  226    240   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  227    241   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  228    242   
        })?;
  229    243   
        cfg.interceptor_state()
  230    244   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  231    245   
        ::std::result::Result::Ok(())
  232    246   
    }
  233    247   
}
  234    248   
  235    249   
// The get_* functions below are generated from JMESPath expressions in the
  236    250   
// operationContextParams trait. They target the operation's input shape.
  237    251   
         252  +
/* RustType.kt:516 */
  238    253   
#[allow(unreachable_code, unused_variables)]
         254  +
/* RustType.kt:516 */
  239    255   
#[cfg(test)]
         256  +
/* ProtocolTestGenerator.kt:98 */
  240    257   
mod response_code_http_fallback_operation_test {
  241    258   
  242    259   
    /// Test ID: ResponseCodeHttpFallbackOperation
  243    260   
    #[::tokio::test]
  244    261   
    #[::tracing_test::traced_test]
  245    262   
    async fn response_code_http_fallback_operation_response() {
  246    263   
        let expected_output = crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput::builder().build();
  247    264   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  248    265   
            ::http::response::Builder::new()
  249    266   
                .header("Content-Length", "2")
  250    267   
                .status(201)
  251    268   
                .body(::aws_smithy_types::body::SdkBody::from(vec![]))
  252    269   
                .unwrap(),
  253    270   
        )
  254    271   
        .unwrap();
  255    272   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  256    273   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  257    274   
  258    275   
        let op = crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperation::new();
  259    276   
        let config = op.config().expect("the operation has config");
  260    277   
        let de = config
  261    278   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  262    279   
            .expect("the config must have a deserializer");
  263    280   
  264    281   
        let parsed = de.deserialize_streaming(&mut http_response);
  265    282   
        let parsed = parsed.unwrap_or_else(|| {
  266    283   
            let http_response = http_response.map(|body| {
  267    284   
                ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  268    285   
                    body.bytes().unwrap(),
  269    286   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  270    287   
                )))
  271    288   
            });
  272    289   
            de.deserialize_nonstreaming(&http_response)
  273    290   
        });
  274    291   
        let parsed = parsed
  275    292   
            .expect("should be successful response")
  276    293   
            .downcast::<crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput>()
  277    294   
            .unwrap();
  278    295   
    }
         296  +
         297  +
    /* ProtocolTestGenerator.kt:98 */
  279    298   
}
  280    299   
         300  +
/* OperationErrorGenerator.kt:79 */
  281    301   
/// Error type for the `ResponseCodeHttpFallbackOperationError` operation.
         302  +
/* RustType.kt:516 */
  282    303   
#[non_exhaustive]
         304  +
/* RustType.kt:516 */
  283    305   
#[derive(::std::fmt::Debug)]
  284         -
pub enum ResponseCodeHttpFallbackOperationError {
         306  +
pub /* OperationErrorGenerator.kt:81 */ enum ResponseCodeHttpFallbackOperationError {
         307  +
    /* OperationErrorGenerator.kt:88 */
  285    308   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  286    309   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  287    310   
    variable wildcard pattern and check `.code()`:
  288    311   
     \
  289    312   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  290    313   
     \
  291    314   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseCodeHttpFallbackOperationError) for what information is available for the error.")]
  292    315   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         316  +
    /* OperationErrorGenerator.kt:81 */
  293    317   
}
         318  +
/* OperationErrorGenerator.kt:218 */
  294    319   
impl ResponseCodeHttpFallbackOperationError {
         320  +
    /* OperationErrorGenerator.kt:219 */
  295    321   
    /// Creates the `ResponseCodeHttpFallbackOperationError::Unhandled` variant from any error type.
  296    322   
    pub fn unhandled(
  297    323   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  298    324   
    ) -> Self {
  299    325   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  300    326   
            source: err.into(),
  301    327   
            meta: ::std::default::Default::default(),
  302    328   
        })
  303    329   
    }
  304    330   
  305    331   
    /// Creates the `ResponseCodeHttpFallbackOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  306    332   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  307    333   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  308    334   
            source: err.clone().into(),
  309    335   
            meta: err,
  310    336   
        })
  311    337   
    }
  312         -
    ///
         338  +
    /// /* OperationErrorGenerator.kt:236 */
  313    339   
    /// Returns error metadata, which includes the error code, message,
  314    340   
    /// request ID, and potentially additional information.
  315    341   
    ///
         342  +
    /* OperationErrorGenerator.kt:242 */
  316    343   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         344  +
        /* OperationErrorGenerator.kt:243 */
  317    345   
        match self {
  318         -
            Self::Unhandled(e) => &e.meta,
         346  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         347  +
            /* OperationErrorGenerator.kt:243 */
  319    348   
        }
         349  +
        /* OperationErrorGenerator.kt:242 */
  320    350   
    }
         351  +
    /* OperationErrorGenerator.kt:218 */
  321    352   
}
         353  +
/* OperationErrorGenerator.kt:269 */
  322    354   
impl ::std::error::Error for ResponseCodeHttpFallbackOperationError {
         355  +
    /* OperationErrorGenerator.kt:270 */
  323    356   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         357  +
        /* OperationErrorGenerator.kt:318 */
  324    358   
        match self {
  325         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         359  +
            /* OperationErrorGenerator.kt:326 */
         360  +
            Self::Unhandled(_inner) => {
         361  +
                /* OperationErrorGenerator.kt:279 */
         362  +
                ::std::option::Option::Some(&*_inner.source)
         363  +
                /* OperationErrorGenerator.kt:326 */
         364  +
            } /* OperationErrorGenerator.kt:318 */
  326    365   
        }
         366  +
        /* OperationErrorGenerator.kt:270 */
  327    367   
    }
         368  +
    /* OperationErrorGenerator.kt:269 */
  328    369   
}
         370  +
/* OperationErrorGenerator.kt:133 */
  329    371   
impl ::std::fmt::Display for ResponseCodeHttpFallbackOperationError {
         372  +
    /* OperationErrorGenerator.kt:134 */
  330    373   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         374  +
        /* OperationErrorGenerator.kt:318 */
  331    375   
        match self {
         376  +
            /* OperationErrorGenerator.kt:326 */
  332    377   
            Self::Unhandled(_inner) => {
         378  +
                /* OperationErrorGenerator.kt:139 */
  333    379   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  334    380   
                    write!(f, "unhandled error ({code})")
  335    381   
                } else {
  336    382   
                    f.write_str("unhandled error")
  337    383   
                }
  338         -
            }
         384  +
                /* OperationErrorGenerator.kt:326 */
         385  +
            } /* OperationErrorGenerator.kt:318 */
  339    386   
        }
         387  +
        /* OperationErrorGenerator.kt:134 */
  340    388   
    }
         389  +
    /* OperationErrorGenerator.kt:133 */
  341    390   
}
         391  +
/* OperationErrorGenerator.kt:182 */
  342    392   
impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseCodeHttpFallbackOperationError {
         393  +
    /* OperationErrorGenerator.kt:186 */
  343    394   
    fn code(&self) -> ::std::option::Option<&str> {
         395  +
        /* OperationErrorGenerator.kt:187 */
  344    396   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         397  +
        /* OperationErrorGenerator.kt:186 */
  345    398   
    }
         399  +
    /* OperationErrorGenerator.kt:190 */
  346    400   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         401  +
        /* OperationErrorGenerator.kt:197 */
  347    402   
        ::std::option::Option::None
         403  +
        /* OperationErrorGenerator.kt:190 */
  348    404   
    }
         405  +
    /* OperationErrorGenerator.kt:182 */
  349    406   
}
         407  +
/* OperationErrorGenerator.kt:163 */
  350    408   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseCodeHttpFallbackOperationError {
         409  +
    /* OperationErrorGenerator.kt:164 */
  351    410   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         411  +
        /* OperationErrorGenerator.kt:318 */
  352    412   
        match self {
  353         -
            Self::Unhandled(_inner) => &_inner.meta,
         413  +
            /* OperationErrorGenerator.kt:326 */
         414  +
            Self::Unhandled(_inner) => {
         415  +
                /* OperationErrorGenerator.kt:168 */
         416  +
                &_inner.meta
         417  +
                /* OperationErrorGenerator.kt:326 */
         418  +
            } /* OperationErrorGenerator.kt:318 */
  354    419   
        }
         420  +
        /* OperationErrorGenerator.kt:164 */
  355    421   
    }
         422  +
    /* OperationErrorGenerator.kt:163 */
  356    423   
}
         424  +
/* OperationErrorGenerator.kt:109 */
  357    425   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseCodeHttpFallbackOperationError {
         426  +
    /* OperationErrorGenerator.kt:110 */
  358    427   
    fn create_unhandled_error(
  359    428   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  360    429   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  361    430   
    ) -> Self {
         431  +
        /* OperationErrorGenerator.kt:121 */
  362    432   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  363    433   
            source,
  364    434   
            meta: meta.unwrap_or_default(),
  365    435   
        })
         436  +
        /* OperationErrorGenerator.kt:110 */
  366    437   
    }
         438  +
    /* OperationErrorGenerator.kt:109 */
  367    439   
}
  368    440   
         441  +
/* CodegenDelegator.kt:255 */
  369    442   
pub use crate::operation::response_code_http_fallback_operation::_response_code_http_fallback_operation_output::ResponseCodeHttpFallbackOperationOutput;
  370    443   
         444  +
/* CodegenDelegator.kt:255 */
  371    445   
pub use crate::operation::response_code_http_fallback_operation::_response_code_http_fallback_operation_input::ResponseCodeHttpFallbackOperationInput;
  372    446   
         447  +
/* RustModule.kt:172 */
  373    448   
mod _response_code_http_fallback_operation_input;
  374    449   
         450  +
/* RustModule.kt:172 */
  375    451   
mod _response_code_http_fallback_operation_output;
  376    452   
  377         -
/// Builders
         453  +
/// /* CodegenDelegator.kt:51 */Builders
  378    454   
pub mod builders;

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation/_response_code_http_fallback_operation_input.rs

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

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation/_response_code_http_fallback_operation_output.rs

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

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_http_fallback_operation/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::response_code_http_fallback_operation::_response_code_http_fallback_operation_output::ResponseCodeHttpFallbackOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::response_code_http_fallback_operation::_response_code_http_fallback_operation_input::ResponseCodeHttpFallbackOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder {
    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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.response_code_http_fallback_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `ResponseCodeHttpFallbackOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `ResponseCodeHttpFallbackOperation`.
   24     27   
///
   25         -
/// This operation tests that the response code defaults to `@http`'s code.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation tests that the response code defaults to `@http`'s code.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct ResponseCodeHttpFallbackOperationFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder,
   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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   35     41   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   36     42   
    > for ResponseCodeHttpFallbackOperationFluentBuilder
   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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   44     50   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   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 ResponseCodeHttpFallbackOperationFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `ResponseCodeHttpFallbackOperationFluentBuilder`.
   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 ResponseCodeHttpFallbackOperation as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationInputBuilder {
   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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperation::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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperation::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::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   97    107   
        crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   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   
}