Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

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

@@ -1,1 +62,101 @@
    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 ResponseCodeRequiredOperationOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct ResponseCodeRequiredOperationOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub response_code: i32,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl ResponseCodeRequiredOperationOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn response_code(&self) -> i32 {
          20  +
        /* StructureGenerator.kt:168 */
   12     21   
        self.response_code
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl ResponseCodeRequiredOperationOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          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 ResponseCodeRequiredOperationOutputBuilder {
   26         -
    pub(crate) response_code: ::std::option::Option<i32>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) response_code: ::std::option::Option<i32>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl ResponseCodeRequiredOperationOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
   30         -
    /// This field is required.
          52  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          53  +
    /* BuilderGenerator.kt:291 */
   31     54   
    pub fn response_code(mut self, input: i32) -> Self {
          55  +
        /* BuilderGenerator.kt:292 */
   32     56   
        self.response_code = ::std::option::Option::Some(input);
          57  +
        /* BuilderGenerator.kt:293 */
   33     58   
        self
          59  +
        /* BuilderGenerator.kt:291 */
   34     60   
    }
          61  +
    /* BuilderGenerator.kt:312 */
   35     62   
    #[allow(missing_docs)] // documentation missing in model
          63  +
                           /* BuilderGenerator.kt:314 */
   36     64   
    pub fn set_response_code(mut self, input: ::std::option::Option<i32>) -> Self {
          65  +
        /* BuilderGenerator.kt:315 */
   37     66   
        self.response_code = input;
   38     67   
        self
          68  +
        /* BuilderGenerator.kt:314 */
   39     69   
    }
          70  +
    /* BuilderGenerator.kt:334 */
   40     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* BuilderGenerator.kt:336 */
   41     73   
    pub fn get_response_code(&self) -> &::std::option::Option<i32> {
          74  +
        /* BuilderGenerator.kt:337 */
   42     75   
        &self.response_code
          76  +
        /* BuilderGenerator.kt:336 */
   43     77   
    }
   44         -
    /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
   45         -
    /// This method will fail if any of the following fields are not set:
   46         -
    /// - [`response_code`](crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::response_code)
          78  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ResponseCodeRequiredOperationOutput`](crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput).
          79  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
          80  +
    /// /* BuilderGenerator.kt:246 */- [`response_code`](crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::response_code)
          81  +
    /* BuilderGenerator.kt:253 */
   47     82   
    pub fn build(
   48     83   
        self,
   49     84   
    ) -> ::std::result::Result<
   50     85   
        crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput,
   51     86   
        ::aws_smithy_types::error::operation::BuildError,
   52     87   
    > {
   53         -
        ::std::result::Result::Ok(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput {
   54         -
            response_code: self.response_code.ok_or_else(|| {
   55         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   56         -
                    "response_code",
   57         -
                    "response_code was not specified but it is required when building ResponseCodeRequiredOperationOutput",
   58         -
                )
   59         -
            })?,
   60         -
        })
          88  +
        /* BuilderGenerator.kt:254 */
          89  +
        ::std::result::Result::Ok(
          90  +
            /* BuilderGenerator.kt:477 */crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput {
          91  +
                /* BuilderGenerator.kt:481 */response_code: self.response_code
          92  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
          93  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("response_code", "response_code was not specified but it is required when building ResponseCodeRequiredOperationOutput")
          94  +
                    /* BuilderGenerator.kt:494 */)?
          95  +
                ,
          96  +
            /* BuilderGenerator.kt:477 */}
          97  +
        /* BuilderGenerator.kt:254 */)
          98  +
        /* BuilderGenerator.kt:253 */
   61     99   
    }
         100  +
    /* BuilderGenerator.kt:355 */
   62    101   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/operation/response_code_required_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_required_operation::_response_code_required_operation_output::ResponseCodeRequiredOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::response_code_required_operation::_response_code_required_operation_input::ResponseCodeRequiredOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationInputBuilder {
    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_required_operation::ResponseCodeRequiredOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.response_code_required_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `ResponseCodeRequiredOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `ResponseCodeRequiredOperation`.
   24     27   
///
   25         -
/// This operation tests that `@httpResponseCode` is `@required` and is used over `@http's` code.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This operation tests that `@httpResponseCode` is `@required` and is used over `@http's` code.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct ResponseCodeRequiredOperationFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationInputBuilder,
   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_required_operation::ResponseCodeRequiredOperationOutput,
   35     41   
        crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   36     42   
    > for ResponseCodeRequiredOperationFluentBuilder
   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_required_operation::ResponseCodeRequiredOperationOutput,
   44     50   
            crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   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 ResponseCodeRequiredOperationFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `ResponseCodeRequiredOperationFluentBuilder`.
   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 ResponseCodeRequiredOperation as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationInputBuilder {
   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_required_operation::ResponseCodeRequiredOperationOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   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_required_operation::ResponseCodeRequiredOperation::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_required_operation::ResponseCodeRequiredOperation::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_required_operation::ResponseCodeRequiredOperationOutput,
   97    107   
        crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   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/type_complexity_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 `TypeComplexityOperation`.
           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 TypeComplexityOperation;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl TypeComplexityOperation {
    7         -
    /// Creates a new `TypeComplexityOperation`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `TypeComplexityOperation`
          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::type_complexity_operation::TypeComplexityOperationInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::type_complexity_operation::TypeComplexityOperationOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::type_complexity_operation::TypeComplexityOperationError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +337,408 @@
   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 TypeComplexityOperation {
   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("TypeComplexityOperation");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            TypeComplexityOperationRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            TypeComplexityOperationResponseDeserializer,
  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   
            "TypeComplexityOperation",
  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("TypeComplexityOperation")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(TypeComplexityOperationEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::type_complexity_operation::TypeComplexityOperationError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::type_complexity_operation::TypeComplexityOperationError,
  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 TypeComplexityOperationResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TypeComplexityOperationResponseDeserializer {
  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_type_complexity_operation::de_type_complexity_operation_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_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 TypeComplexityOperationRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TypeComplexityOperationRequestSerializer {
  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::type_complexity_operation::TypeComplexityOperationInput>()
  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::type_complexity_operation::TypeComplexityOperationInput,
  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, "/typeComplexityOperation").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::type_complexity_operation::TypeComplexityOperationInput,
  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_type_complexity_operation::ser_type_complexity_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 TypeComplexityOperationEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TypeComplexityOperationEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "TypeComplexityOperationEndpointParamsInterceptor"
  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::<TypeComplexityOperationInput>()
  226    240   
            .ok_or("failed to downcast to TypeComplexityOperationInput")?;
  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 `TypeComplexityOperationError` operation.
         256  +
/* RustType.kt:516 */
  241    257   
#[non_exhaustive]
         258  +
/* RustType.kt:516 */
  242    259   
#[derive(::std::fmt::Debug)]
  243         -
pub enum TypeComplexityOperationError {
         260  +
pub /* OperationErrorGenerator.kt:81 */ enum TypeComplexityOperationError {
         261  +
    /* OperationErrorGenerator.kt:88 */
  244    262   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  245    263   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  246    264   
    variable wildcard pattern and check `.code()`:
  247    265   
     \
  248    266   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  249    267   
     \
  250    268   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-TypeComplexityOperationError) for what information is available for the error.")]
  251    269   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         270  +
    /* OperationErrorGenerator.kt:81 */
  252    271   
}
         272  +
/* OperationErrorGenerator.kt:218 */
  253    273   
impl TypeComplexityOperationError {
         274  +
    /* OperationErrorGenerator.kt:219 */
  254    275   
    /// Creates the `TypeComplexityOperationError::Unhandled` variant from any error type.
  255    276   
    pub fn unhandled(
  256    277   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  257    278   
    ) -> Self {
  258    279   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  259    280   
            source: err.into(),
  260    281   
            meta: ::std::default::Default::default(),
  261    282   
        })
  262    283   
    }
  263    284   
  264    285   
    /// Creates the `TypeComplexityOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  265    286   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  266    287   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  267    288   
            source: err.clone().into(),
  268    289   
            meta: err,
  269    290   
        })
  270    291   
    }
  271         -
    ///
         292  +
    /// /* OperationErrorGenerator.kt:236 */
  272    293   
    /// Returns error metadata, which includes the error code, message,
  273    294   
    /// request ID, and potentially additional information.
  274    295   
    ///
         296  +
    /* OperationErrorGenerator.kt:242 */
  275    297   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         298  +
        /* OperationErrorGenerator.kt:243 */
  276    299   
        match self {
  277         -
            Self::Unhandled(e) => &e.meta,
         300  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         301  +
            /* OperationErrorGenerator.kt:243 */
  278    302   
        }
         303  +
        /* OperationErrorGenerator.kt:242 */
  279    304   
    }
         305  +
    /* OperationErrorGenerator.kt:218 */
  280    306   
}
         307  +
/* OperationErrorGenerator.kt:269 */
  281    308   
impl ::std::error::Error for TypeComplexityOperationError {
         309  +
    /* OperationErrorGenerator.kt:270 */
  282    310   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         311  +
        /* OperationErrorGenerator.kt:318 */
  283    312   
        match self {
  284         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         313  +
            /* OperationErrorGenerator.kt:326 */
         314  +
            Self::Unhandled(_inner) => {
         315  +
                /* OperationErrorGenerator.kt:279 */
         316  +
                ::std::option::Option::Some(&*_inner.source)
         317  +
                /* OperationErrorGenerator.kt:326 */
         318  +
            } /* OperationErrorGenerator.kt:318 */
  285    319   
        }
         320  +
        /* OperationErrorGenerator.kt:270 */
  286    321   
    }
         322  +
    /* OperationErrorGenerator.kt:269 */
  287    323   
}
         324  +
/* OperationErrorGenerator.kt:133 */
  288    325   
impl ::std::fmt::Display for TypeComplexityOperationError {
         326  +
    /* OperationErrorGenerator.kt:134 */
  289    327   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         328  +
        /* OperationErrorGenerator.kt:318 */
  290    329   
        match self {
         330  +
            /* OperationErrorGenerator.kt:326 */
  291    331   
            Self::Unhandled(_inner) => {
         332  +
                /* OperationErrorGenerator.kt:139 */
  292    333   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  293    334   
                    write!(f, "unhandled error ({code})")
  294    335   
                } else {
  295    336   
                    f.write_str("unhandled error")
  296    337   
                }
  297         -
            }
         338  +
                /* OperationErrorGenerator.kt:326 */
         339  +
            } /* OperationErrorGenerator.kt:318 */
  298    340   
        }
         341  +
        /* OperationErrorGenerator.kt:134 */
  299    342   
    }
         343  +
    /* OperationErrorGenerator.kt:133 */
  300    344   
}
         345  +
/* OperationErrorGenerator.kt:182 */
  301    346   
impl ::aws_smithy_types::retry::ProvideErrorKind for TypeComplexityOperationError {
         347  +
    /* OperationErrorGenerator.kt:186 */
  302    348   
    fn code(&self) -> ::std::option::Option<&str> {
         349  +
        /* OperationErrorGenerator.kt:187 */
  303    350   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         351  +
        /* OperationErrorGenerator.kt:186 */
  304    352   
    }
         353  +
    /* OperationErrorGenerator.kt:190 */
  305    354   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         355  +
        /* OperationErrorGenerator.kt:197 */
  306    356   
        ::std::option::Option::None
         357  +
        /* OperationErrorGenerator.kt:190 */
  307    358   
    }
         359  +
    /* OperationErrorGenerator.kt:182 */
  308    360   
}
         361  +
/* OperationErrorGenerator.kt:163 */
  309    362   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for TypeComplexityOperationError {
         363  +
    /* OperationErrorGenerator.kt:164 */
  310    364   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         365  +
        /* OperationErrorGenerator.kt:318 */
  311    366   
        match self {
  312         -
            Self::Unhandled(_inner) => &_inner.meta,
         367  +
            /* OperationErrorGenerator.kt:326 */
         368  +
            Self::Unhandled(_inner) => {
         369  +
                /* OperationErrorGenerator.kt:168 */
         370  +
                &_inner.meta
         371  +
                /* OperationErrorGenerator.kt:326 */
         372  +
            } /* OperationErrorGenerator.kt:318 */
  313    373   
        }
         374  +
        /* OperationErrorGenerator.kt:164 */
  314    375   
    }
         376  +
    /* OperationErrorGenerator.kt:163 */
  315    377   
}
         378  +
/* OperationErrorGenerator.kt:109 */
  316    379   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for TypeComplexityOperationError {
         380  +
    /* OperationErrorGenerator.kt:110 */
  317    381   
    fn create_unhandled_error(
  318    382   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  319    383   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  320    384   
    ) -> Self {
         385  +
        /* OperationErrorGenerator.kt:121 */
  321    386   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  322    387   
            source,
  323    388   
            meta: meta.unwrap_or_default(),
  324    389   
        })
         390  +
        /* OperationErrorGenerator.kt:110 */
  325    391   
    }
         392  +
    /* OperationErrorGenerator.kt:109 */
  326    393   
}
  327    394   
         395  +
/* CodegenDelegator.kt:255 */
  328    396   
pub use crate::operation::type_complexity_operation::_type_complexity_operation_output::TypeComplexityOperationOutput;
  329    397   
         398  +
/* CodegenDelegator.kt:255 */
  330    399   
pub use crate::operation::type_complexity_operation::_type_complexity_operation_input::TypeComplexityOperationInput;
  331    400   
         401  +
/* RustModule.kt:172 */
  332    402   
mod _type_complexity_operation_input;
  333    403   
         404  +
/* RustModule.kt:172 */
  334    405   
mod _type_complexity_operation_output;
  335    406   
  336         -
/// Builders
         407  +
/// /* CodegenDelegator.kt:51 */Builders
  337    408   
pub mod builders;

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

@@ -1,1 +75,123 @@
    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 TypeComplexityOperationInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct TypeComplexityOperationInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub list: ::std::option::Option<
    8     12   
        ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
    9     13   
    >,
          14  +
    /* StructureGenerator.kt:201 */
   10     15   
}
          16  +
/* StructureGenerator.kt:135 */
   11     17   
impl TypeComplexityOperationInput {
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[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 `.list.is_none()`.
          20  +
    /// /* StructureGenerator.kt:162 */
          21  +
    /// /* 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 `.list.is_none()`.
          22  +
    /* StructureGenerator.kt:166 */
   15     23   
    pub fn list(&self) -> &[::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>] {
   16         -
        self.list.as_deref().unwrap_or_default()
          24  +
        /* StructureGenerator.kt:169 */
          25  +
        self.list
          26  +
            .as_deref()
          27  +
            /* StructureGenerator.kt:175 */
          28  +
            .unwrap_or_default()
          29  +
        /* StructureGenerator.kt:166 */
   17     30   
    }
          31  +
    /* StructureGenerator.kt:135 */
   18     32   
}
          33  +
/* ClientCodegenVisitor.kt:237 */
   19     34   
impl TypeComplexityOperationInput {
   20         -
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationInput`](crate::operation::type_complexity_operation::TypeComplexityOperationInput).
          35  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`TypeComplexityOperationInput`](crate::operation::type_complexity_operation::TypeComplexityOperationInput).
          36  +
    /* BuilderGenerator.kt:175 */
   21     37   
    pub fn builder() -> crate::operation::type_complexity_operation::builders::TypeComplexityOperationInputBuilder {
          38  +
        /* BuilderGenerator.kt:176 */
   22     39   
        crate::operation::type_complexity_operation::builders::TypeComplexityOperationInputBuilder::default()
          40  +
        /* BuilderGenerator.kt:175 */
   23     41   
    }
          42  +
    /* ClientCodegenVisitor.kt:237 */
   24     43   
}
   25     44   
   26         -
/// A builder for [`TypeComplexityOperationInput`](crate::operation::type_complexity_operation::TypeComplexityOperationInput).
          45  +
/// /* BuilderGenerator.kt:342 */A builder for [`TypeComplexityOperationInput`](crate::operation::type_complexity_operation::TypeComplexityOperationInput).
          46  +
/* RustType.kt:516 */
   27     47   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          48  +
/* RustType.kt:516 */
   28     49   
#[non_exhaustive]
          50  +
/* BuilderGenerator.kt:345 */
   29     51   
pub struct TypeComplexityOperationInputBuilder {
          52  +
    /* BuilderGenerator.kt:275 */
   30     53   
    pub(crate) list: ::std::option::Option<
   31     54   
        ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
   32     55   
    >,
          56  +
    /* BuilderGenerator.kt:345 */
   33     57   
}
          58  +
/* BuilderGenerator.kt:355 */
   34     59   
impl TypeComplexityOperationInputBuilder {
   35         -
    /// Appends an item to `list`.
          60  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `list`.
          61  +
    /* BuilderGenerator.kt:411 */
   36     62   
    ///
   37         -
    /// To override the contents of this collection use [`set_list`](Self::set_list).
          63  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_list`](Self::set_list).
          64  +
    /* BuilderGenerator.kt:413 */
   38     65   
    ///
          66  +
    /* BuilderGenerator.kt:418 */
   39     67   
    pub fn list(
   40     68   
        mut self,
   41     69   
        input: ::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>,
   42     70   
    ) -> Self {
          71  +
        /* BuilderGenerator.kt:419 */
   43     72   
        let mut v = self.list.unwrap_or_default();
   44     73   
        v.push(input);
   45     74   
        self.list = ::std::option::Option::Some(v);
   46     75   
        self
          76  +
        /* BuilderGenerator.kt:418 */
   47     77   
    }
          78  +
    /* BuilderGenerator.kt:312 */
   48     79   
    #[allow(missing_docs)] // documentation missing in model
          80  +
                           /* BuilderGenerator.kt:314 */
   49     81   
    pub fn set_list(
   50     82   
        mut self,
   51     83   
        input: ::std::option::Option<
   52     84   
            ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
   53     85   
        >,
   54     86   
    ) -> Self {
          87  +
        /* BuilderGenerator.kt:315 */
   55     88   
        self.list = input;
   56     89   
        self
          90  +
        /* BuilderGenerator.kt:314 */
   57     91   
    }
          92  +
    /* BuilderGenerator.kt:334 */
   58     93   
    #[allow(missing_docs)] // documentation missing in model
          94  +
                           /* BuilderGenerator.kt:336 */
   59     95   
    pub fn get_list(
   60     96   
        &self,
   61     97   
    ) -> &::std::option::Option<
   62     98   
        ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
   63     99   
    > {
         100  +
        /* BuilderGenerator.kt:337 */
   64    101   
        &self.list
         102  +
        /* BuilderGenerator.kt:336 */
   65    103   
    }
   66         -
    /// Consumes the builder and constructs a [`TypeComplexityOperationInput`](crate::operation::type_complexity_operation::TypeComplexityOperationInput).
         104  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`TypeComplexityOperationInput`](crate::operation::type_complexity_operation::TypeComplexityOperationInput).
         105  +
    /* BuilderGenerator.kt:253 */
   67    106   
    pub fn build(
   68    107   
        self,
   69    108   
    ) -> ::std::result::Result<
   70    109   
        crate::operation::type_complexity_operation::TypeComplexityOperationInput,
   71    110   
        ::aws_smithy_types::error::operation::BuildError,
   72    111   
    > {
   73         -
        ::std::result::Result::Ok(crate::operation::type_complexity_operation::TypeComplexityOperationInput { list: self.list })
         112  +
        /* BuilderGenerator.kt:254 */
         113  +
        ::std::result::Result::Ok(
         114  +
            /* BuilderGenerator.kt:477 */
         115  +
            crate::operation::type_complexity_operation::TypeComplexityOperationInput {
         116  +
                /* BuilderGenerator.kt:481 */ list: self.list,
         117  +
                /* BuilderGenerator.kt:477 */
         118  +
            }, /* BuilderGenerator.kt:254 */
         119  +
        )
         120  +
        /* BuilderGenerator.kt:253 */
   74    121   
    }
         122  +
    /* BuilderGenerator.kt:355 */
   75    123   
}

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

@@ -1,1 +70,115 @@
    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 TypeComplexityOperationOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct TypeComplexityOperationOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub list: ::std::option::Option<
    8     12   
        ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
    9     13   
    >,
          14  +
    /* StructureGenerator.kt:201 */
   10     15   
}
          16  +
/* StructureGenerator.kt:135 */
   11     17   
impl TypeComplexityOperationOutput {
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[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 `.list.is_none()`.
          20  +
    /// /* StructureGenerator.kt:162 */
          21  +
    /// /* 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 `.list.is_none()`.
          22  +
    /* StructureGenerator.kt:166 */
   15     23   
    pub fn list(&self) -> &[::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>] {
   16         -
        self.list.as_deref().unwrap_or_default()
          24  +
        /* StructureGenerator.kt:169 */
          25  +
        self.list
          26  +
            .as_deref()
          27  +
            /* StructureGenerator.kt:175 */
          28  +
            .unwrap_or_default()
          29  +
        /* StructureGenerator.kt:166 */
   17     30   
    }
          31  +
    /* StructureGenerator.kt:135 */
   18     32   
}
          33  +
/* ClientCodegenVisitor.kt:237 */
   19     34   
impl TypeComplexityOperationOutput {
   20         -
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationOutput`](crate::operation::type_complexity_operation::TypeComplexityOperationOutput).
          35  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`TypeComplexityOperationOutput`](crate::operation::type_complexity_operation::TypeComplexityOperationOutput).
          36  +
    /* BuilderGenerator.kt:175 */
   21     37   
    pub fn builder() -> crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder {
          38  +
        /* BuilderGenerator.kt:176 */
   22     39   
        crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder::default()
          40  +
        /* BuilderGenerator.kt:175 */
   23     41   
    }
          42  +
    /* ClientCodegenVisitor.kt:237 */
   24     43   
}
   25     44   
   26         -
/// A builder for [`TypeComplexityOperationOutput`](crate::operation::type_complexity_operation::TypeComplexityOperationOutput).
          45  +
/// /* BuilderGenerator.kt:342 */A builder for [`TypeComplexityOperationOutput`](crate::operation::type_complexity_operation::TypeComplexityOperationOutput).
          46  +
/* RustType.kt:516 */
   27     47   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          48  +
/* RustType.kt:516 */
   28     49   
#[non_exhaustive]
          50  +
/* BuilderGenerator.kt:345 */
   29     51   
pub struct TypeComplexityOperationOutputBuilder {
          52  +
    /* BuilderGenerator.kt:275 */
   30     53   
    pub(crate) list: ::std::option::Option<
   31     54   
        ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
   32     55   
    >,
          56  +
    /* BuilderGenerator.kt:345 */
   33     57   
}
          58  +
/* BuilderGenerator.kt:355 */
   34     59   
impl TypeComplexityOperationOutputBuilder {
   35         -
    /// Appends an item to `list`.
          60  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `list`.
          61  +
    /* BuilderGenerator.kt:411 */
   36     62   
    ///
   37         -
    /// To override the contents of this collection use [`set_list`](Self::set_list).
          63  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_list`](Self::set_list).
          64  +
    /* BuilderGenerator.kt:413 */
   38     65   
    ///
          66  +
    /* BuilderGenerator.kt:418 */
   39     67   
    pub fn list(
   40     68   
        mut self,
   41     69   
        input: ::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>,
   42     70   
    ) -> Self {
          71  +
        /* BuilderGenerator.kt:419 */
   43     72   
        let mut v = self.list.unwrap_or_default();
   44     73   
        v.push(input);
   45     74   
        self.list = ::std::option::Option::Some(v);
   46     75   
        self
          76  +
        /* BuilderGenerator.kt:418 */
   47     77   
    }
          78  +
    /* BuilderGenerator.kt:312 */
   48     79   
    #[allow(missing_docs)] // documentation missing in model
          80  +
                           /* BuilderGenerator.kt:314 */
   49     81   
    pub fn set_list(
   50     82   
        mut self,
   51     83   
        input: ::std::option::Option<
   52     84   
            ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
   53     85   
        >,
   54     86   
    ) -> Self {
          87  +
        /* BuilderGenerator.kt:315 */
   55     88   
        self.list = input;
   56     89   
        self
          90  +
        /* BuilderGenerator.kt:314 */
   57     91   
    }
          92  +
    /* BuilderGenerator.kt:334 */
   58     93   
    #[allow(missing_docs)] // documentation missing in model
          94  +
                           /* BuilderGenerator.kt:336 */
   59     95   
    pub fn get_list(
   60     96   
        &self,
   61     97   
    ) -> &::std::option::Option<
   62     98   
        ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
   63     99   
    > {
         100  +
        /* BuilderGenerator.kt:337 */
   64    101   
        &self.list
         102  +
        /* BuilderGenerator.kt:336 */
   65    103   
    }
   66         -
    /// Consumes the builder and constructs a [`TypeComplexityOperationOutput`](crate::operation::type_complexity_operation::TypeComplexityOperationOutput).
         104  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`TypeComplexityOperationOutput`](crate::operation::type_complexity_operation::TypeComplexityOperationOutput).
         105  +
    /* BuilderGenerator.kt:253 */
   67    106   
    pub fn build(self) -> crate::operation::type_complexity_operation::TypeComplexityOperationOutput {
   68         -
        crate::operation::type_complexity_operation::TypeComplexityOperationOutput { list: self.list }
         107  +
        /* BuilderGenerator.kt:477 */
         108  +
        crate::operation::type_complexity_operation::TypeComplexityOperationOutput {
         109  +
            /* BuilderGenerator.kt:481 */ list: self.list,
         110  +
            /* BuilderGenerator.kt:477 */
         111  +
        }
         112  +
        /* BuilderGenerator.kt:253 */
   69    113   
    }
         114  +
    /* BuilderGenerator.kt:355 */
   70    115   
}

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

@@ -1,1 +142,160 @@
    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::type_complexity_operation::_type_complexity_operation_output::TypeComplexityOperationOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::type_complexity_operation::_type_complexity_operation_input::TypeComplexityOperationInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::type_complexity_operation::builders::TypeComplexityOperationInputBuilder {
    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::type_complexity_operation::TypeComplexityOperationOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::type_complexity_operation::TypeComplexityOperationError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.type_complexity_operation();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `TypeComplexityOperation`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `TypeComplexityOperation`.
   24     27   
///
   25         -
/// An operation whose shapes generate complex Rust types. See https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity.
          28  +
/// /* FluentBuilderGenerator.kt:130 */An operation whose shapes generate complex Rust types. See https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct TypeComplexityOperationFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::type_complexity_operation::builders::TypeComplexityOperationInputBuilder,
   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::type_complexity_operation::TypeComplexityOperationOutput,
   35     41   
        crate::operation::type_complexity_operation::TypeComplexityOperationError,
   36     42   
    > for TypeComplexityOperationFluentBuilder
   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::type_complexity_operation::TypeComplexityOperationOutput,
   44     50   
            crate::operation::type_complexity_operation::TypeComplexityOperationError,
   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 TypeComplexityOperationFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `TypeComplexityOperationFluentBuilder`.
   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 TypeComplexityOperation as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::type_complexity_operation::builders::TypeComplexityOperationInputBuilder {
   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::type_complexity_operation::TypeComplexityOperationOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::type_complexity_operation::TypeComplexityOperationError,
   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::type_complexity_operation::TypeComplexityOperation::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::type_complexity_operation::TypeComplexityOperation::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::type_complexity_operation::TypeComplexityOperationOutput,
   97    107   
        crate::operation::type_complexity_operation::TypeComplexityOperationError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
  111         -
    ///
         122  +
    /// /* FluentBuilderGenerator.kt:436 */
  112    123   
    /// Appends an item to `list`.
  113    124   
    ///
  114    125   
    /// To override the contents of this collection use [`set_list`](Self::set_list).
  115    126   
    ///
         127  +
    /* FluentBuilderGenerator.kt:443 */
  116    128   
    #[allow(missing_docs)] // documentation missing in model
         129  +
                           /* FluentBuilderGenerator.kt:446 */
  117    130   
    pub fn list(
  118    131   
        mut self,
  119    132   
        input: ::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>,
  120    133   
    ) -> Self {
  121    134   
        self.inner = self.inner.list(input);
  122    135   
        self
  123    136   
    }
         137  +
    /* FluentBuilderGenerator.kt:498 */
  124    138   
    #[allow(missing_docs)] // documentation missing in model
         139  +
                           /* FluentBuilderGenerator.kt:500 */
  125    140   
    pub fn set_list(
  126    141   
        mut self,
  127    142   
        input: ::std::option::Option<
  128    143   
            ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
  129    144   
        >,
  130    145   
    ) -> Self {
  131    146   
        self.inner = self.inner.set_list(input);
  132    147   
        self
  133    148   
    }
         149  +
    /* FluentBuilderGenerator.kt:518 */
  134    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* FluentBuilderGenerator.kt:520 */
  135    152   
    pub fn get_list(
  136    153   
        &self,
  137    154   
    ) -> &::std::option::Option<
  138    155   
        ::std::vec::Vec<::std::vec::Vec<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>>,
  139    156   
    > {
  140    157   
        self.inner.get_list()
  141    158   
    }
         159  +
    /* FluentBuilderGenerator.kt:282 */
  142    160   
}

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

@@ -1,1 +7,8 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
    3      4   
pub use ::aws_smithy_types::Blob;
    4         -
pub use ::aws_smithy_types::DateTime;
           5  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;
    5      6   
    6         -
/// Event stream related primitives such as `Message` or `Header`.
           7  +
/// /* ClientRustModule.kt:121 */Event stream related primitives such as `Message` or `Header`.
    7      8   
pub mod event_stream;

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

@@ -1,1 +69,72 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ResponseDeserializerGenerator.kt:170 */
    2      3   
pub(crate) fn type_erase_result<O, E>(
    3      4   
    result: ::std::result::Result<O, E>,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6      7   
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7      8   
>
    8      9   
where
    9     10   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     11   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     12   
{
   12     13   
    result
   13     14   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     15   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     16   
        .map_err(::std::convert::Into::into)
   16     17   
}
   17     18   
          19  +
/* RestJson.kt:122 */
   18     20   
pub fn parse_http_error_metadata(
   19     21   
    _response_status: u16,
   20     22   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21     23   
    response_body: &[u8],
   22     24   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23     25   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24     26   
}
   25     27   
   26     28   
pub(crate) mod shape_required_header_collection_operation;
   27     29   
   28     30   
pub(crate) mod shape_required_inner_shape_operation;
   29     31   
   30     32   
pub(crate) mod shape_response_code_default_operation;
   31     33   
   32     34   
pub(crate) mod shape_response_code_http_fallback_operation;
   33     35   
   34     36   
pub(crate) mod shape_response_code_required_operation;
   35     37   
   36     38   
pub(crate) mod shape_type_complexity_operation;
   37     39   
   38     40   
pub(crate) mod shape_required_header_collection_operation_output;
   39     41   
          42  +
/* JsonParserGenerator.kt:227 */
   40     43   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   41     44   
    if data.is_empty() {
   42     45   
        b"{}"
   43     46   
    } else {
   44     47   
        data
   45     48   
    }
   46     49   
}
   47     50   
   48     51   
pub(crate) mod shape_required_inner_shape_operation_input;
   49     52   

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_map.rs

@@ -1,1 +42,64 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_a_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::DateTime>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   21         -
                            tokens.next(),
   22         -
                            ::aws_smithy_types::date_time::Format::EpochSeconds,
   23         -
                        )?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
          33  +
                        /* JsonParserGenerator.kt:474 */;
          34  +
                        /* JsonParserGenerator.kt:491 */
   24     35   
                        if let Some(value) = value {
   25     36   
                            map.insert(key, value);
   26     37   
                        }
          38  +
                        /* JsonParserGenerator.kt:686 */
   27     39   
                    }
          40  +
                    /* JsonParserGenerator.kt:695 */
   28     41   
                    other => {
   29     42   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   30     43   
                            "expected object key or end object, found: {:?}",
   31     44   
                            other
   32     45   
                        )))
   33         -
                    }
          46  +
                    } /* JsonParserGenerator.kt:685 */
   34     47   
                }
          48  +
                /* JsonParserGenerator.kt:684 */
   35     49   
            }
          50  +
            /* JsonParserGenerator.kt:504 */
   36     51   
            Ok(Some(map))
          52  +
            /* JsonParserGenerator.kt:713 */
   37     53   
        }
   38         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39         -
            "expected start object or null",
   40         -
        )),
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
                "expected start object or null",
          59  +
            ))
          60  +
            /* JsonParserGenerator.kt:722 */
          61  +
        } /* JsonParserGenerator.kt:712 */
   41     62   
    }
          63  +
    /* JsonParserGenerator.kt:460 */
   42     64   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_string_list.rs

@@ -1,1 +34,59 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_a_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                            .transpose()?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          31  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          32  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          33  +
                                /* JsonParserGenerator.kt:339 */)
          34  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          35  +
                        /* JsonParserGenerator.kt:419 */;
          36  +
                        /* JsonParserGenerator.kt:422 */
   22     37   
                        if let Some(value) = value {
   23     38   
                            items.push(value);
   24     39   
                        }
   25         -
                    }
          40  +
                        /* JsonParserGenerator.kt:413 */
          41  +
                    } /* JsonParserGenerator.kt:409 */
   26     42   
                }
          43  +
                /* JsonParserGenerator.kt:408 */
   27     44   
            }
          45  +
            /* JsonParserGenerator.kt:446 */
   28     46   
            Ok(Some(items))
          47  +
            /* JsonParserGenerator.kt:713 */
   29     48   
        }
   30         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "expected start array or null",
   32         -
        )),
          49  +
        /* JsonParserGenerator.kt:722 */
          50  +
        _ => {
          51  +
            /* JsonParserGenerator.kt:723 */
          52  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          53  +
                "expected start array or null",
          54  +
            ))
          55  +
            /* JsonParserGenerator.kt:722 */
          56  +
        } /* JsonParserGenerator.kt:712 */
   33     57   
    }
          58  +
    /* JsonParserGenerator.kt:398 */
   34     59   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_string_set.rs

@@ -1,1 +34,59 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_a_string_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                            .transpose()?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          31  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          32  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          33  +
                                /* JsonParserGenerator.kt:339 */)
          34  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          35  +
                        /* JsonParserGenerator.kt:419 */;
          36  +
                        /* JsonParserGenerator.kt:422 */
   22     37   
                        if let Some(value) = value {
   23     38   
                            items.push(value);
   24     39   
                        }
   25         -
                    }
          40  +
                        /* JsonParserGenerator.kt:413 */
          41  +
                    } /* JsonParserGenerator.kt:409 */
   26     42   
                }
          43  +
                /* JsonParserGenerator.kt:408 */
   27     44   
            }
          45  +
            /* JsonParserGenerator.kt:446 */
   28     46   
            Ok(Some(items))
          47  +
            /* JsonParserGenerator.kt:713 */
   29     48   
        }
   30         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "expected start array or null",
   32         -
        )),
          49  +
        /* JsonParserGenerator.kt:722 */
          50  +
        _ => {
          51  +
            /* JsonParserGenerator.kt:723 */
          52  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          53  +
                "expected start array or null",
          54  +
            ))
          55  +
            /* JsonParserGenerator.kt:722 */
          56  +
        } /* JsonParserGenerator.kt:712 */
   33     57   
    }
          58  +
    /* JsonParserGenerator.kt:398 */
   34     59   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_a_union.rs

@@ -1,1 +103,176 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_a_union<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::AUnion>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:565 */
    8     10   
    let mut variant = None;
          11  +
    /* JsonParserGenerator.kt:567 */
    9     12   
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
   12         -
            match tokens.next().transpose()? {
   13         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   14         -
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   15         -
                    if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
   16         -
                        tokens.peek()
   17         -
                    {
   18         -
                        let _ = tokens.next().expect("peek returned a token")?;
   19         -
                        continue;
   20         -
                    }
   21         -
                    let key = key.to_unescaped()?;
   22         -
                    if key == "__type" {
   23         -
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   24         -
                        continue;
   25         -
                    }
   26         -
                    if variant.is_some() {
   27         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                            "encountered mixed variants in union",
   29         -
                        ));
   30         -
                    }
   31         -
                    variant = match key.as_ref() {
   32         -
                        "i32" => Some(crate::types::AUnion::I32(
   33         -
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   34         -
                                .map(i32::try_from)
   35         -
                                .transpose()?
   36         -
                                .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'i32' cannot be null"))?,
   37         -
                        )),
   38         -
                        "string" => Some(crate::types::AUnion::String(
   39         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   40         -
                                .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   41         -
                                .transpose()?
   42         -
                                .ok_or_else(|| {
   43         -
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'string' cannot be null")
   44         -
                                })?,
   45         -
                        )),
   46         -
                        "time" => Some(crate::types::AUnion::Time(
   47         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   48         -
                                tokens.next(),
   49         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   50         -
                            )?
   51         -
                            .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'time' cannot be null"))?,
   52         -
                        )),
   53         -
                        _ => {
          13  +
        /* JsonParserGenerator.kt:568 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
          14  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          15  +
            /* JsonParserGenerator.kt:684 */
          16  +
            loop {
          17  +
                /* JsonParserGenerator.kt:685 */
          18  +
                match tokens.next().transpose()? {
          19  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          20  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          21  +
                        /* JsonParserGenerator.kt:576 */
          22  +
                        if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
          23  +
                            tokens.peek()
          24  +
                        {
          25  +
                            let _ = tokens.next().expect("peek returned a token")?;
          26  +
                            continue;
          27  +
                        }
          28  +
                        /* JsonParserGenerator.kt:585 */
          29  +
                        let key = key.to_unescaped()?;
          30  +
                        if key == "__type" {
   54     31   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   55         -
                            Some(crate::types::AUnion::Unknown)
          32  +
                            continue;
   56     33   
                        }
   57         -
                    };
   58         -
                }
   59         -
                other => {
   60         -
                    return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   61         -
                        "expected object key or end object, found: {:?}",
   62         -
                        other
   63         -
                    )))
          34  +
                        if variant.is_some() {
          35  +
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          36  +
                                "encountered mixed variants in union",
          37  +
                            ));
          38  +
                        }
          39  +
                        /* JsonParserGenerator.kt:598 */
          40  +
                        variant = match key.as_ref() {
          41  +
                            /* JsonParserGenerator.kt:601 */
          42  +
                            "i32" => {
          43  +
                                /* JsonParserGenerator.kt:611 */
          44  +
                                Some(crate::types::AUnion::I32(
          45  +
                                    /* JsonParserGenerator.kt:365 */
          46  +
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          47  +
                                        .map(i32::try_from)
          48  +
                                        .transpose()?
          49  +
                                        /* JsonParserGenerator.kt:670 */
          50  +
                                        .ok_or_else(|| {
          51  +
                                            ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'i32' cannot be null")
          52  +
                                        })?, /* JsonParserGenerator.kt:611 */
          53  +
                                ))
          54  +
                                /* JsonParserGenerator.kt:601 */
          55  +
                            }
          56  +
                            /* JsonParserGenerator.kt:601 */
          57  +
                            "string" => {
          58  +
                                /* JsonParserGenerator.kt:611 */
          59  +
                                Some(crate::types::AUnion::String(
          60  +
                                    /* JsonParserGenerator.kt:354 */
          61  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          62  +
                                        .map(|s|
          63  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          64  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          65  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          66  +
                                        .transpose()?
          67  +
                                        /* JsonParserGenerator.kt:670 */
          68  +
                                        .ok_or_else(|| {
          69  +
                                            ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'string' cannot be null")
          70  +
                                        })?, /* JsonParserGenerator.kt:611 */
          71  +
                                ))
          72  +
                                /* JsonParserGenerator.kt:601 */
          73  +
                            }
          74  +
                            /* JsonParserGenerator.kt:601 */
          75  +
                            "time" => {
          76  +
                                /* JsonParserGenerator.kt:611 */
          77  +
                                Some(crate::types::AUnion::Time(
          78  +
                                    /* JsonParserGenerator.kt:384 */
          79  +
                                    ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
          80  +
                                        tokens.next(),
          81  +
                                        ::aws_smithy_types::date_time::Format::EpochSeconds,
          82  +
                                    )?
          83  +
                                    /* JsonParserGenerator.kt:670 */
          84  +
                                    .ok_or_else(|| {
          85  +
                                        ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'time' cannot be null")
          86  +
                                    })?, /* JsonParserGenerator.kt:611 */
          87  +
                                ))
          88  +
                                /* JsonParserGenerator.kt:601 */
          89  +
                            }
          90  +
                            /* JsonParserGenerator.kt:621 */
          91  +
                            _ => {
          92  +
                                ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
          93  +
                                Some(crate::types::AUnion::Unknown)
          94  +
                            } /* JsonParserGenerator.kt:598 */
          95  +
                        };
          96  +
                        /* JsonParserGenerator.kt:686 */
          97  +
                    }
          98  +
                    /* JsonParserGenerator.kt:695 */
          99  +
                    other => {
         100  +
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
         101  +
                            "expected object key or end object, found: {:?}",
         102  +
                            other
         103  +
                        )))
         104  +
                    } /* JsonParserGenerator.kt:685 */
   64    105   
                }
         106  +
                /* JsonParserGenerator.kt:684 */
   65    107   
            }
   66         -
        },
         108  +
            /* JsonParserGenerator.kt:568 */
         109  +
        }
         110  +
        /* JsonParserGenerator.kt:642 */
   67    111   
        _ => {
   68    112   
            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   69    113   
                "expected start object or null",
   70    114   
            ))
   71         -
        }
         115  +
        } /* JsonParserGenerator.kt:567 */
   72    116   
    }
         117  +
    /* JsonParserGenerator.kt:649 */
   73    118   
    if variant.is_none() {
   74    119   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   75    120   
            "Union did not contain a valid variant.",
   76    121   
        ));
   77    122   
    }
         123  +
    /* JsonParserGenerator.kt:657 */
   78    124   
    Ok(variant)
         125  +
    /* JsonParserGenerator.kt:551 */
   79    126   
}
   80    127   
         128  +
/* JsonSerializerGenerator.kt:547 */
   81    129   
pub fn ser_a_union(
   82    130   
    object_8: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   83    131   
    input: &crate::types::AUnion,
   84    132   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         133  +
    /* JsonSerializerGenerator.kt:556 */
   85    134   
    match input {
         135  +
        /* JsonSerializerGenerator.kt:564 */
   86    136   
        crate::types::AUnion::I32(inner) => {
   87         -
            object_8.key("i32").number(
   88         -
                #[allow(clippy::useless_conversion)]
   89         -
                ::aws_smithy_types::Number::NegInt((*inner).into()),
   90         -
            );
         137  +
            /* SerializerUtil.kt:42 */
         138  +
            {
         139  +
                /* JsonSerializerGenerator.kt:432 */
         140  +
                object_8.key("i32").number(
         141  +
                    #[allow(clippy::useless_conversion)]
         142  +
                    ::aws_smithy_types::Number::NegInt((*inner).into()),
         143  +
                );
         144  +
                /* SerializerUtil.kt:42 */
         145  +
            }
         146  +
            /* JsonSerializerGenerator.kt:564 */
   91    147   
        }
         148  +
        /* JsonSerializerGenerator.kt:564 */
   92    149   
        crate::types::AUnion::String(inner) => {
   93         -
            object_8.key("string").string(inner.as_str());
         150  +
            /* SerializerUtil.kt:42 */
         151  +
            {
         152  +
                /* JsonSerializerGenerator.kt:423 */
         153  +
                object_8.key("string").string(inner.as_str());
         154  +
                /* SerializerUtil.kt:42 */
         155  +
            }
         156  +
            /* JsonSerializerGenerator.kt:564 */
   94    157   
        }
         158  +
        /* JsonSerializerGenerator.kt:564 */
   95    159   
        crate::types::AUnion::Time(inner) => {
   96         -
            object_8
   97         -
                .key("time")
   98         -
                .date_time(inner, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         160  +
            /* SerializerUtil.kt:42 */
         161  +
            {
         162  +
                /* JsonSerializerGenerator.kt:448 */
         163  +
                object_8
         164  +
                    .key("time")
         165  +
                    .date_time(inner, ::aws_smithy_types::date_time::Format::EpochSeconds)?;
         166  +
                /* SerializerUtil.kt:42 */
         167  +
            }
         168  +
            /* JsonSerializerGenerator.kt:564 */
   99    169   
        }
  100         -
        crate::types::AUnion::Unknown => return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant("AUnion")),
         170  +
        /* JsonSerializerGenerator.kt:569 */
         171  +
        crate::types::AUnion::Unknown => return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant("AUnion")), /* JsonSerializerGenerator.kt:556 */
  101    172   
    }
         173  +
    /* JsonSerializerGenerator.kt:576 */
  102    174   
    Ok(())
         175  +
    /* JsonSerializerGenerator.kt:547 */
  103    176   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_empty_structure.rs

@@ -1,1 +27,43 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_empty_structure(
    3      4   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    #[allow(unused_variables)] input: &crate::types::EmptyStructure,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:372 */
    6      8   
    Ok(())
           9  +
    /* JsonSerializerGenerator.kt:358 */
    7     10   
}
    8     11   
          12  +
/* JsonParserGenerator.kt:516 */
    9     13   
pub(crate) fn de_empty_structure<'a, I>(
   10     14   
    tokens: &mut ::std::iter::Peekable<I>,
   11     15   
) -> ::std::result::Result<Option<crate::types::EmptyStructure>, ::aws_smithy_json::deserialize::error::DeserializeError>
   12     16   
where
   13     17   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   14     18   
{
          19  +
    /* JsonParserGenerator.kt:712 */
   15     20   
    match tokens.next().transpose()? {
   16         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          21  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   17     22   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          23  +
            /* RustType.kt:516 */
   18     24   
            #[allow(unused_mut)]
          25  +
            /* JsonParserGenerator.kt:526 */
   19     26   
            let mut builder = crate::types::builders::EmptyStructureBuilder::default();
          27  +
            /* JsonParserGenerator.kt:682 */
   20     28   
            ::aws_smithy_json::deserialize::token::skip_to_end(tokens)?;
          29  +
            /* JsonParserGenerator.kt:540 */
   21     30   
            Ok(Some(builder.build()))
          31  +
            /* JsonParserGenerator.kt:713 */
   22     32   
        }
   23         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   24         -
            "expected start object or null",
   25         -
        )),
          33  +
        /* JsonParserGenerator.kt:722 */
          34  +
        _ => {
          35  +
            /* JsonParserGenerator.kt:723 */
          36  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          37  +
                "expected start object or null",
          38  +
            ))
          39  +
            /* JsonParserGenerator.kt:722 */
          40  +
        } /* JsonParserGenerator.kt:712 */
   26     41   
    }
          42  +
    /* JsonParserGenerator.kt:516 */
   27     43   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_inner_shape.rs

@@ -1,1 +52,87 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_inner_shape<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::InnerShape>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::InnerShapeBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "requiredInnerMostShape" => {
   18         -
                            builder =
   19         -
                                builder.set_required_inner_most_shape(crate::protocol_serde::shape_innermost_shape::de_innermost_shape(tokens)?);
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
          26  +
                            "requiredInnerMostShape" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
          28  +
                                builder = builder.set_required_inner_most_shape(
          29  +
                                    /* JsonParserGenerator.kt:544 */
          30  +
                                    crate::protocol_serde::shape_innermost_shape::de_innermost_shape(tokens)?, /* JsonParserGenerator.kt:265 */
          31  +
                                );
          32  +
                                /* JsonParserGenerator.kt:262 */
          33  +
                            }
          34  +
                            /* JsonParserGenerator.kt:290 */
          35  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   20     36   
                        }
   21         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   22         -
                    },
          37  +
                        /* JsonParserGenerator.kt:686 */
          38  +
                    }
          39  +
                    /* JsonParserGenerator.kt:695 */
   23     40   
                    other => {
   24     41   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   25     42   
                            "expected object key or end object, found: {:?}",
   26     43   
                            other
   27     44   
                        )))
   28         -
                    }
          45  +
                    } /* JsonParserGenerator.kt:685 */
   29     46   
                }
          47  +
                /* JsonParserGenerator.kt:684 */
   30     48   
            }
          49  +
            /* JsonParserGenerator.kt:540 */
   31     50   
            Ok(Some(crate::serde_util::inner_shape_correct_errors(builder).build().map_err(|err| {
   32     51   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err)
   33     52   
            })?))
          53  +
            /* JsonParserGenerator.kt:713 */
   34     54   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start object or null",
   37         -
        )),
          55  +
        /* JsonParserGenerator.kt:722 */
          56  +
        _ => {
          57  +
            /* JsonParserGenerator.kt:723 */
          58  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          59  +
                "expected start object or null",
          60  +
            ))
          61  +
            /* JsonParserGenerator.kt:722 */
          62  +
        } /* JsonParserGenerator.kt:712 */
   38     63   
    }
          64  +
    /* JsonParserGenerator.kt:516 */
   39     65   
}
   40     66   
          67  +
/* JsonSerializerGenerator.kt:358 */
   41     68   
pub fn ser_inner_shape(
   42     69   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   43     70   
    input: &crate::types::InnerShape,
   44     71   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          72  +
    /* SerializerUtil.kt:42 */
   45     73   
    {
          74  +
        /* JsonSerializerGenerator.kt:495 */
   46     75   
        #[allow(unused_mut)]
          76  +
        /* JsonSerializerGenerator.kt:496 */
   47     77   
        let mut object_1 = object.key("requiredInnerMostShape").start_object();
          78  +
        /* JsonSerializerGenerator.kt:375 */
   48     79   
        crate::protocol_serde::shape_innermost_shape::ser_innermost_shape(&mut object_1, &input.required_inner_most_shape)?;
          80  +
        /* JsonSerializerGenerator.kt:515 */
   49     81   
        object_1.finish();
          82  +
        /* SerializerUtil.kt:42 */
   50     83   
    }
          84  +
    /* JsonSerializerGenerator.kt:372 */
   51     85   
    Ok(())
          86  +
    /* JsonSerializerGenerator.kt:358 */
   52     87   
}