Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

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

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

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/fractional_seconds/_fractional_seconds_output.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/fractional_seconds/builders.rs

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

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

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `GreetingWithErrors`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct GreetingWithErrors;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl GreetingWithErrors {
    7         -
    /// Creates a new `GreetingWithErrors`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `GreetingWithErrors`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::greeting_with_errors::GreetingWithErrorsInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::greeting_with_errors::GreetingWithErrorsOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::greeting_with_errors::GreetingWithErrorsError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +266,283 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GreetingWithErrors {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GreetingWithErrors");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            GreetingWithErrorsRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            GreetingWithErrorsResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "GreetingWithErrors",
  105    116   
            "Json Protocol",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GreetingWithErrors")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(GreetingWithErrorsEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::greeting_with_errors::GreetingWithErrorsError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::greeting_with_errors::GreetingWithErrorsError,
  124    135   
            >::new());
  125    136   
  126    137   
        ::std::borrow::Cow::Owned(rcb)
  127    138   
    }
  128    139   
}
  129    140   
         141  +
/* ResponseDeserializerGenerator.kt:64 */
  130    142   
#[derive(Debug)]
  131    143   
struct GreetingWithErrorsResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GreetingWithErrorsResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct GreetingWithErrorsRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GreetingWithErrorsRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input
  161    174   
            .downcast::<crate::operation::greeting_with_errors::GreetingWithErrorsInput>()
  162    175   
            .expect("correct type");
  163    176   
        let _header_serialization_settings = _cfg
  164    177   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  165    178   
            .cloned()
  166    179   
            .unwrap_or_default();
  167    180   
        let mut request_builder = {
  168    181   
            fn uri_base(
  169    182   
                _input: &crate::operation::greeting_with_errors::GreetingWithErrorsInput,
  170    183   
                output: &mut ::std::string::String,
  171    184   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172    185   
                use ::std::fmt::Write as _;
  173    186   
                ::std::write!(output, "/").expect("formatting should succeed");
  174    187   
                ::std::result::Result::Ok(())
  175    188   
            }
  176    189   
            #[allow(clippy::unnecessary_wraps)]
  177    190   
            fn update_http_builder(
  178    191   
                input: &crate::operation::greeting_with_errors::GreetingWithErrorsInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  187    200   
            builder = _header_serialization_settings.set_default_header(
  188    201   
                builder,
  189    202   
                ::http::header::HeaderName::from_static("x-amz-target"),
  190    203   
                "JsonProtocol.GreetingWithErrors",
  191    204   
            );
  192    205   
            builder
  193    206   
        };
  194    207   
        let body =
  195    208   
            ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_input(&input)?);
  196    209   
  197    210   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  198    211   
    }
  199    212   
}
         213  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  200    214   
#[derive(Debug)]
  201    215   
struct GreetingWithErrorsEndpointParamsInterceptor;
  202    216   
  203    217   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GreetingWithErrorsEndpointParamsInterceptor {
  204    218   
    fn name(&self) -> &'static str {
  205    219   
        "GreetingWithErrorsEndpointParamsInterceptor"
  206    220   
    }
  207    221   
  208    222   
    fn read_before_execution(
  209    223   
        &self,
  210    224   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  211    225   
            '_,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  214    228   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  215    229   
        >,
  216    230   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  217    231   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  218    232   
        let _input = context
  219    233   
            .input()
  220    234   
            .downcast_ref::<GreetingWithErrorsInput>()
  221    235   
            .ok_or("failed to downcast to GreetingWithErrorsInput")?;
  222    236   
  223    237   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  224    238   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  225    239   
        })?;
  226    240   
        cfg.interceptor_state()
  227    241   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  228    242   
        ::std::result::Result::Ok(())
  229    243   
    }
  230    244   
}
  231    245   
  232    246   
// The get_* functions below are generated from JMESPath expressions in the
  233    247   
// operationContextParams trait. They target the operation's input shape.
  234    248   
         249  +
/* RustType.kt:516 */
  235    250   
#[allow(unreachable_code, unused_variables)]
         251  +
/* RustType.kt:516 */
  236    252   
#[cfg(test)]
         253  +
/* ProtocolTestGenerator.kt:98 */
  237    254   
mod greeting_with_errors_test {
  238    255   
  239    256   
    /// Parses simple JSON errors
  240    257   
    /// Test ID: AwsJson11InvalidGreetingError
  241    258   
    #[::tokio::test]
  242    259   
    #[::tracing_test::traced_test]
  243    260   
    async fn aws_json11_invalid_greeting_error_response() {
  244    261   
        let expected_output = crate::types::error::InvalidGreeting::builder()
  245    262   
            .set_message(::std::option::Option::Some("Hi".to_owned()))
  246    263   
            .build();
@@ -755,772 +914,1059 @@
  775    792   
        });
  776    793   
        let parsed = parsed.expect_err("should be error response");
  777    794   
        let parsed: &crate::operation::greeting_with_errors::GreetingWithErrorsError =
  778    795   
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  779    796   
        if let crate::operation::greeting_with_errors::GreetingWithErrorsError::FooError(parsed) = parsed {
  780    797   
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  781    798   
        } else {
  782    799   
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  783    800   
        }
  784    801   
    }
         802  +
         803  +
    /* ProtocolTestGenerator.kt:98 */
  785    804   
}
  786    805   
         806  +
/* OperationErrorGenerator.kt:79 */
  787    807   
/// Error type for the `GreetingWithErrorsError` operation.
         808  +
/* RustType.kt:516 */
  788    809   
#[non_exhaustive]
         810  +
/* RustType.kt:516 */
  789    811   
#[derive(::std::fmt::Debug)]
  790         -
pub enum GreetingWithErrorsError {
  791         -
    /// This error is thrown when an invalid greeting value is provided.
         812  +
pub /* OperationErrorGenerator.kt:81 */ enum GreetingWithErrorsError {
         813  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when an invalid greeting value is provided.
         814  +
    /* OperationErrorGenerator.kt:86 */
  792    815   
    InvalidGreeting(crate::types::error::InvalidGreeting),
  793         -
    /// This error is thrown when a request is invalid.
         816  +
    /// /* OperationErrorGenerator.kt:83 */This error is thrown when a request is invalid.
         817  +
    /* OperationErrorGenerator.kt:86 */
  794    818   
    ComplexError(crate::types::error::ComplexError),
  795         -
    /// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         819  +
    /// /* OperationErrorGenerator.kt:83 */This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         820  +
    /* OperationErrorGenerator.kt:86 */
  796    821   
    FooError(crate::types::error::FooError),
         822  +
    /* OperationErrorGenerator.kt:88 */
  797    823   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  798    824   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  799    825   
    variable wildcard pattern and check `.code()`:
  800    826   
     \
  801    827   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  802    828   
     \
  803    829   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GreetingWithErrorsError) for what information is available for the error.")]
  804    830   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         831  +
    /* OperationErrorGenerator.kt:81 */
  805    832   
}
         833  +
/* OperationErrorGenerator.kt:218 */
  806    834   
impl GreetingWithErrorsError {
         835  +
    /* OperationErrorGenerator.kt:219 */
  807    836   
    /// Creates the `GreetingWithErrorsError::Unhandled` variant from any error type.
  808    837   
    pub fn unhandled(
  809    838   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  810    839   
    ) -> Self {
  811    840   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  812    841   
            source: err.into(),
  813    842   
            meta: ::std::default::Default::default(),
  814    843   
        })
  815    844   
    }
  816    845   
  817    846   
    /// Creates the `GreetingWithErrorsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  818    847   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  819    848   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  820    849   
            source: err.clone().into(),
  821    850   
            meta: err,
  822    851   
        })
  823    852   
    }
  824         -
    ///
         853  +
    /// /* OperationErrorGenerator.kt:236 */
  825    854   
    /// Returns error metadata, which includes the error code, message,
  826    855   
    /// request ID, and potentially additional information.
  827    856   
    ///
         857  +
    /* OperationErrorGenerator.kt:242 */
  828    858   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         859  +
        /* OperationErrorGenerator.kt:243 */
  829    860   
        match self {
  830         -
            Self::InvalidGreeting(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  831         -
            Self::ComplexError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  832         -
            Self::FooError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  833         -
            Self::Unhandled(e) => &e.meta,
         861  +
            /* OperationErrorGenerator.kt:246 */ Self::InvalidGreeting(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         862  +
            /* OperationErrorGenerator.kt:246 */ Self::ComplexError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         863  +
            /* OperationErrorGenerator.kt:246 */ Self::FooError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         864  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         865  +
            /* OperationErrorGenerator.kt:243 */
  834    866   
        }
         867  +
        /* OperationErrorGenerator.kt:242 */
  835    868   
    }
         869  +
    /* OperationErrorGenerator.kt:257 */
  836    870   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::InvalidGreeting`.
         871  +
    /* OperationErrorGenerator.kt:258 */
  837    872   
    pub fn is_invalid_greeting(&self) -> bool {
         873  +
        /* OperationErrorGenerator.kt:259 */
  838    874   
        matches!(self, Self::InvalidGreeting(_))
         875  +
        /* OperationErrorGenerator.kt:258 */
  839    876   
    }
         877  +
    /* OperationErrorGenerator.kt:257 */
  840    878   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::ComplexError`.
         879  +
    /* OperationErrorGenerator.kt:258 */
  841    880   
    pub fn is_complex_error(&self) -> bool {
         881  +
        /* OperationErrorGenerator.kt:259 */
  842    882   
        matches!(self, Self::ComplexError(_))
         883  +
        /* OperationErrorGenerator.kt:258 */
  843    884   
    }
         885  +
    /* OperationErrorGenerator.kt:257 */
  844    886   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::FooError`.
         887  +
    /* OperationErrorGenerator.kt:258 */
  845    888   
    pub fn is_foo_error(&self) -> bool {
         889  +
        /* OperationErrorGenerator.kt:259 */
  846    890   
        matches!(self, Self::FooError(_))
         891  +
        /* OperationErrorGenerator.kt:258 */
  847    892   
    }
         893  +
    /* OperationErrorGenerator.kt:218 */
  848    894   
}
         895  +
/* OperationErrorGenerator.kt:269 */
  849    896   
impl ::std::error::Error for GreetingWithErrorsError {
         897  +
    /* OperationErrorGenerator.kt:270 */
  850    898   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         899  +
        /* OperationErrorGenerator.kt:318 */
  851    900   
        match self {
  852         -
            Self::InvalidGreeting(_inner) => ::std::option::Option::Some(_inner),
  853         -
            Self::ComplexError(_inner) => ::std::option::Option::Some(_inner),
  854         -
            Self::FooError(_inner) => ::std::option::Option::Some(_inner),
  855         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         901  +
            /* OperationErrorGenerator.kt:321 */
         902  +
            Self::InvalidGreeting(_inner) =>
         903  +
            /* OperationErrorGenerator.kt:283 */
         904  +
            {
         905  +
                ::std::option::Option::Some(_inner)
  856    906   
            }
         907  +
            ,
         908  +
            /* OperationErrorGenerator.kt:321 */
         909  +
            Self::ComplexError(_inner) =>
         910  +
            /* OperationErrorGenerator.kt:283 */
         911  +
            {
         912  +
                ::std::option::Option::Some(_inner)
  857    913   
            }
         914  +
            ,
         915  +
            /* OperationErrorGenerator.kt:321 */
         916  +
            Self::FooError(_inner) =>
         917  +
            /* OperationErrorGenerator.kt:283 */
         918  +
            {
         919  +
                ::std::option::Option::Some(_inner)
         920  +
            }
         921  +
            ,
         922  +
            /* OperationErrorGenerator.kt:326 */
         923  +
            Self::Unhandled(_inner) => {
         924  +
                /* OperationErrorGenerator.kt:279 */
         925  +
                ::std::option::Option::Some(&*_inner.source)
         926  +
                /* OperationErrorGenerator.kt:326 */
         927  +
            } /* OperationErrorGenerator.kt:318 */
         928  +
        }
         929  +
        /* OperationErrorGenerator.kt:270 */
         930  +
    }
         931  +
    /* OperationErrorGenerator.kt:269 */
  858    932   
}
         933  +
/* OperationErrorGenerator.kt:133 */
  859    934   
impl ::std::fmt::Display for GreetingWithErrorsError {
         935  +
    /* OperationErrorGenerator.kt:134 */
  860    936   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         937  +
        /* OperationErrorGenerator.kt:318 */
  861    938   
        match self {
  862         -
            Self::InvalidGreeting(_inner) => _inner.fmt(f),
  863         -
            Self::ComplexError(_inner) => _inner.fmt(f),
  864         -
            Self::FooError(_inner) => _inner.fmt(f),
         939  +
            /* OperationErrorGenerator.kt:321 */
         940  +
            Self::InvalidGreeting(_inner) =>
         941  +
            /* OperationErrorGenerator.kt:151 */
         942  +
            {
         943  +
                _inner.fmt(f)
         944  +
            }
         945  +
            ,
         946  +
            /* OperationErrorGenerator.kt:321 */
         947  +
            Self::ComplexError(_inner) =>
         948  +
            /* OperationErrorGenerator.kt:151 */
         949  +
            {
         950  +
                _inner.fmt(f)
         951  +
            }
         952  +
            ,
         953  +
            /* OperationErrorGenerator.kt:321 */
         954  +
            Self::FooError(_inner) =>
         955  +
            /* OperationErrorGenerator.kt:151 */
         956  +
            {
         957  +
                _inner.fmt(f)
         958  +
            }
         959  +
            ,
         960  +
            /* OperationErrorGenerator.kt:326 */
  865    961   
            Self::Unhandled(_inner) => {
         962  +
                /* OperationErrorGenerator.kt:139 */
  866    963   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  867    964   
                    write!(f, "unhandled error ({code})")
  868    965   
                } else {
  869    966   
                    f.write_str("unhandled error")
  870    967   
                }
         968  +
                /* OperationErrorGenerator.kt:326 */
         969  +
            } /* OperationErrorGenerator.kt:318 */
  871    970   
        }
         971  +
        /* OperationErrorGenerator.kt:134 */
  872    972   
    }
  873         -
    }
         973  +
    /* OperationErrorGenerator.kt:133 */
  874    974   
}
         975  +
/* OperationErrorGenerator.kt:182 */
  875    976   
impl ::aws_smithy_types::retry::ProvideErrorKind for GreetingWithErrorsError {
         977  +
    /* OperationErrorGenerator.kt:186 */
  876    978   
    fn code(&self) -> ::std::option::Option<&str> {
         979  +
        /* OperationErrorGenerator.kt:187 */
  877    980   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         981  +
        /* OperationErrorGenerator.kt:186 */
  878    982   
    }
         983  +
    /* OperationErrorGenerator.kt:190 */
  879    984   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         985  +
        /* OperationErrorGenerator.kt:197 */
  880    986   
        ::std::option::Option::None
         987  +
        /* OperationErrorGenerator.kt:190 */
  881    988   
    }
         989  +
    /* OperationErrorGenerator.kt:182 */
  882    990   
}
         991  +
/* OperationErrorGenerator.kt:163 */
  883    992   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GreetingWithErrorsError {
         993  +
    /* OperationErrorGenerator.kt:164 */
  884    994   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         995  +
        /* OperationErrorGenerator.kt:318 */
  885    996   
        match self {
  886         -
            Self::InvalidGreeting(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  887         -
            Self::ComplexError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  888         -
            Self::FooError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  889         -
            Self::Unhandled(_inner) => &_inner.meta,
         997  +
            /* OperationErrorGenerator.kt:321 */
         998  +
            Self::InvalidGreeting(_inner) =>
         999  +
            /* OperationErrorGenerator.kt:169 */
        1000  +
            {
        1001  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
        1002  +
            }
        1003  +
            ,
        1004  +
            /* OperationErrorGenerator.kt:321 */
        1005  +
            Self::ComplexError(_inner) =>
        1006  +
            /* OperationErrorGenerator.kt:169 */
        1007  +
            {
        1008  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
        1009  +
            }
        1010  +
            ,
        1011  +
            /* OperationErrorGenerator.kt:321 */
        1012  +
            Self::FooError(_inner) =>
        1013  +
            /* OperationErrorGenerator.kt:169 */
        1014  +
            {
        1015  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
        1016  +
            }
        1017  +
            ,
        1018  +
            /* OperationErrorGenerator.kt:326 */
        1019  +
            Self::Unhandled(_inner) => {
        1020  +
                /* OperationErrorGenerator.kt:168 */
        1021  +
                &_inner.meta
        1022  +
                /* OperationErrorGenerator.kt:326 */
        1023  +
            } /* OperationErrorGenerator.kt:318 */
  890   1024   
        }
        1025  +
        /* OperationErrorGenerator.kt:164 */
  891   1026   
    }
        1027  +
    /* OperationErrorGenerator.kt:163 */
  892   1028   
}
        1029  +
/* OperationErrorGenerator.kt:109 */
  893   1030   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GreetingWithErrorsError {
        1031  +
    /* OperationErrorGenerator.kt:110 */
  894   1032   
    fn create_unhandled_error(
  895   1033   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  896   1034   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  897   1035   
    ) -> Self {
        1036  +
        /* OperationErrorGenerator.kt:121 */
  898   1037   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  899   1038   
            source,
  900   1039   
            meta: meta.unwrap_or_default(),
  901   1040   
        })
        1041  +
        /* OperationErrorGenerator.kt:110 */
  902   1042   
    }
        1043  +
    /* OperationErrorGenerator.kt:109 */
  903   1044   
}
  904   1045   
        1046  +
/* CodegenDelegator.kt:255 */
  905   1047   
pub use crate::operation::greeting_with_errors::_greeting_with_errors_output::GreetingWithErrorsOutput;
  906   1048   
        1049  +
/* CodegenDelegator.kt:255 */
  907   1050   
pub use crate::operation::greeting_with_errors::_greeting_with_errors_input::GreetingWithErrorsInput;
  908   1051   
        1052  +
/* RustModule.kt:172 */
  909   1053   
mod _greeting_with_errors_input;
  910   1054   
        1055  +
/* RustModule.kt:172 */
  911   1056   
mod _greeting_with_errors_output;
  912   1057   
  913         -
/// Builders
        1058  +
/// /* CodegenDelegator.kt:51 */Builders
  914   1059   
pub mod builders;

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/greeting_with_errors/_greeting_with_errors_input.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/greeting_with_errors/_greeting_with_errors_output.rs

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

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

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

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

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

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

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/host_with_path_operation/_host_with_path_operation_output.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/host_with_path_operation/builders.rs

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

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

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_enums/_json_enums_input.rs

@@ -1,1 +181,325 @@
    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 JsonEnumsInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct JsonEnumsInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo_enum1: ::std::option::Option<crate::types::FooEnum>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub foo_enum2: ::std::option::Option<crate::types::FooEnum>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub foo_enum3: ::std::option::Option<crate::types::FooEnum>,
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[allow(missing_docs)] // documentation missing in model
   13     20   
    pub foo_enum_list: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
          21  +
    /* StructureGenerator.kt:231 */
   14     22   
    #[allow(missing_docs)] // documentation missing in model
   15     23   
    pub foo_enum_set: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
          24  +
    /* StructureGenerator.kt:231 */
   16     25   
    #[allow(missing_docs)] // documentation missing in model
   17     26   
    pub foo_enum_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>>,
          27  +
    /* StructureGenerator.kt:201 */
   18     28   
}
          29  +
/* StructureGenerator.kt:135 */
   19     30   
impl JsonEnumsInput {
          31  +
    /* StructureGenerator.kt:231 */
   20     32   
    #[allow(missing_docs)] // documentation missing in model
          33  +
                           /* StructureGenerator.kt:166 */
   21     34   
    pub fn foo_enum1(&self) -> ::std::option::Option<&crate::types::FooEnum> {
          35  +
        /* StructureGenerator.kt:170 */
   22     36   
        self.foo_enum1.as_ref()
          37  +
        /* StructureGenerator.kt:166 */
   23     38   
    }
          39  +
    /* StructureGenerator.kt:231 */
   24     40   
    #[allow(missing_docs)] // documentation missing in model
          41  +
                           /* StructureGenerator.kt:166 */
   25     42   
    pub fn foo_enum2(&self) -> ::std::option::Option<&crate::types::FooEnum> {
          43  +
        /* StructureGenerator.kt:170 */
   26     44   
        self.foo_enum2.as_ref()
          45  +
        /* StructureGenerator.kt:166 */
   27     46   
    }
          47  +
    /* StructureGenerator.kt:231 */
   28     48   
    #[allow(missing_docs)] // documentation missing in model
          49  +
                           /* StructureGenerator.kt:166 */
   29     50   
    pub fn foo_enum3(&self) -> ::std::option::Option<&crate::types::FooEnum> {
          51  +
        /* StructureGenerator.kt:170 */
   30     52   
        self.foo_enum3.as_ref()
          53  +
        /* StructureGenerator.kt:166 */
   31     54   
    }
          55  +
    /* StructureGenerator.kt:231 */
   32     56   
    #[allow(missing_docs)] // documentation missing in model
   33         -
    ///
   34         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.foo_enum_list.is_none()`.
          57  +
    /// /* StructureGenerator.kt:162 */
          58  +
    /// /* 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 `.foo_enum_list.is_none()`.
          59  +
    /* StructureGenerator.kt:166 */
   35     60   
    pub fn foo_enum_list(&self) -> &[crate::types::FooEnum] {
   36         -
        self.foo_enum_list.as_deref().unwrap_or_default()
          61  +
        /* StructureGenerator.kt:169 */
          62  +
        self.foo_enum_list
          63  +
            .as_deref()
          64  +
            /* StructureGenerator.kt:175 */
          65  +
            .unwrap_or_default()
          66  +
        /* StructureGenerator.kt:166 */
   37     67   
    }
          68  +
    /* StructureGenerator.kt:231 */
   38     69   
    #[allow(missing_docs)] // documentation missing in model
   39         -
    ///
   40         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.foo_enum_set.is_none()`.
          70  +
    /// /* StructureGenerator.kt:162 */
          71  +
    /// /* 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 `.foo_enum_set.is_none()`.
          72  +
    /* StructureGenerator.kt:166 */
   41     73   
    pub fn foo_enum_set(&self) -> &[crate::types::FooEnum] {
   42         -
        self.foo_enum_set.as_deref().unwrap_or_default()
          74  +
        /* StructureGenerator.kt:169 */
          75  +
        self.foo_enum_set
          76  +
            .as_deref()
          77  +
            /* StructureGenerator.kt:175 */
          78  +
            .unwrap_or_default()
          79  +
        /* StructureGenerator.kt:166 */
   43     80   
    }
          81  +
    /* StructureGenerator.kt:231 */
   44     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* StructureGenerator.kt:166 */
   45     84   
    pub fn foo_enum_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::FooEnum>> {
          85  +
        /* StructureGenerator.kt:170 */
   46     86   
        self.foo_enum_map.as_ref()
          87  +
        /* StructureGenerator.kt:166 */
   47     88   
    }
          89  +
    /* StructureGenerator.kt:135 */
   48     90   
}
          91  +
/* ClientCodegenVisitor.kt:237 */
   49     92   
impl JsonEnumsInput {
   50         -
    /// Creates a new builder-style object to manufacture [`JsonEnumsInput`](crate::operation::json_enums::JsonEnumsInput).
          93  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`JsonEnumsInput`](crate::operation::json_enums::JsonEnumsInput).
          94  +
    /* BuilderGenerator.kt:175 */
   51     95   
    pub fn builder() -> crate::operation::json_enums::builders::JsonEnumsInputBuilder {
          96  +
        /* BuilderGenerator.kt:176 */
   52     97   
        crate::operation::json_enums::builders::JsonEnumsInputBuilder::default()
          98  +
        /* BuilderGenerator.kt:175 */
   53     99   
    }
         100  +
    /* ClientCodegenVisitor.kt:237 */
   54    101   
}
   55    102   
   56         -
/// A builder for [`JsonEnumsInput`](crate::operation::json_enums::JsonEnumsInput).
         103  +
/// /* BuilderGenerator.kt:342 */A builder for [`JsonEnumsInput`](crate::operation::json_enums::JsonEnumsInput).
         104  +
/* RustType.kt:516 */
   57    105   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         106  +
/* RustType.kt:516 */
   58    107   
#[non_exhaustive]
         108  +
/* BuilderGenerator.kt:345 */
   59    109   
pub struct JsonEnumsInputBuilder {
   60         -
    pub(crate) foo_enum1: ::std::option::Option<crate::types::FooEnum>,
   61         -
    pub(crate) foo_enum2: ::std::option::Option<crate::types::FooEnum>,
   62         -
    pub(crate) foo_enum3: ::std::option::Option<crate::types::FooEnum>,
   63         -
    pub(crate) foo_enum_list: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
   64         -
    pub(crate) foo_enum_set: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
         110  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum1: ::std::option::Option<crate::types::FooEnum>,
         111  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum2: ::std::option::Option<crate::types::FooEnum>,
         112  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum3: ::std::option::Option<crate::types::FooEnum>,
         113  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum_list: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
         114  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum_set: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
         115  +
    /* BuilderGenerator.kt:275 */
   65    116   
    pub(crate) foo_enum_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>>,
         117  +
    /* BuilderGenerator.kt:345 */
   66    118   
}
         119  +
/* BuilderGenerator.kt:355 */
   67    120   
impl JsonEnumsInputBuilder {
         121  +
    /* BuilderGenerator.kt:286 */
   68    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* BuilderGenerator.kt:291 */
   69    124   
    pub fn foo_enum1(mut self, input: crate::types::FooEnum) -> Self {
         125  +
        /* BuilderGenerator.kt:292 */
   70    126   
        self.foo_enum1 = ::std::option::Option::Some(input);
         127  +
        /* BuilderGenerator.kt:293 */
   71    128   
        self
         129  +
        /* BuilderGenerator.kt:291 */
   72    130   
    }
         131  +
    /* BuilderGenerator.kt:312 */
   73    132   
    #[allow(missing_docs)] // documentation missing in model
         133  +
                           /* BuilderGenerator.kt:314 */
   74    134   
    pub fn set_foo_enum1(mut self, input: ::std::option::Option<crate::types::FooEnum>) -> Self {
         135  +
        /* BuilderGenerator.kt:315 */
   75    136   
        self.foo_enum1 = input;
   76    137   
        self
         138  +
        /* BuilderGenerator.kt:314 */
   77    139   
    }
         140  +
    /* BuilderGenerator.kt:334 */
   78    141   
    #[allow(missing_docs)] // documentation missing in model
         142  +
                           /* BuilderGenerator.kt:336 */
   79    143   
    pub fn get_foo_enum1(&self) -> &::std::option::Option<crate::types::FooEnum> {
         144  +
        /* BuilderGenerator.kt:337 */
   80    145   
        &self.foo_enum1
         146  +
        /* BuilderGenerator.kt:336 */
   81    147   
    }
         148  +
    /* BuilderGenerator.kt:286 */
   82    149   
    #[allow(missing_docs)] // documentation missing in model
         150  +
                           /* BuilderGenerator.kt:291 */
   83    151   
    pub fn foo_enum2(mut self, input: crate::types::FooEnum) -> Self {
         152  +
        /* BuilderGenerator.kt:292 */
   84    153   
        self.foo_enum2 = ::std::option::Option::Some(input);
         154  +
        /* BuilderGenerator.kt:293 */
   85    155   
        self
         156  +
        /* BuilderGenerator.kt:291 */
   86    157   
    }
         158  +
    /* BuilderGenerator.kt:312 */
   87    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* BuilderGenerator.kt:314 */
   88    161   
    pub fn set_foo_enum2(mut self, input: ::std::option::Option<crate::types::FooEnum>) -> Self {
         162  +
        /* BuilderGenerator.kt:315 */
   89    163   
        self.foo_enum2 = input;
   90    164   
        self
         165  +
        /* BuilderGenerator.kt:314 */
   91    166   
    }
         167  +
    /* BuilderGenerator.kt:334 */
   92    168   
    #[allow(missing_docs)] // documentation missing in model
         169  +
                           /* BuilderGenerator.kt:336 */
   93    170   
    pub fn get_foo_enum2(&self) -> &::std::option::Option<crate::types::FooEnum> {
         171  +
        /* BuilderGenerator.kt:337 */
   94    172   
        &self.foo_enum2
         173  +
        /* BuilderGenerator.kt:336 */
   95    174   
    }
         175  +
    /* BuilderGenerator.kt:286 */
   96    176   
    #[allow(missing_docs)] // documentation missing in model
         177  +
                           /* BuilderGenerator.kt:291 */
   97    178   
    pub fn foo_enum3(mut self, input: crate::types::FooEnum) -> Self {
         179  +
        /* BuilderGenerator.kt:292 */
   98    180   
        self.foo_enum3 = ::std::option::Option::Some(input);
         181  +
        /* BuilderGenerator.kt:293 */
   99    182   
        self
         183  +
        /* BuilderGenerator.kt:291 */
  100    184   
    }
         185  +
    /* BuilderGenerator.kt:312 */
  101    186   
    #[allow(missing_docs)] // documentation missing in model
         187  +
                           /* BuilderGenerator.kt:314 */
  102    188   
    pub fn set_foo_enum3(mut self, input: ::std::option::Option<crate::types::FooEnum>) -> Self {
         189  +
        /* BuilderGenerator.kt:315 */
  103    190   
        self.foo_enum3 = input;
  104    191   
        self
         192  +
        /* BuilderGenerator.kt:314 */
  105    193   
    }
         194  +
    /* BuilderGenerator.kt:334 */
  106    195   
    #[allow(missing_docs)] // documentation missing in model
         196  +
                           /* BuilderGenerator.kt:336 */
  107    197   
    pub fn get_foo_enum3(&self) -> &::std::option::Option<crate::types::FooEnum> {
         198  +
        /* BuilderGenerator.kt:337 */
  108    199   
        &self.foo_enum3
         200  +
        /* BuilderGenerator.kt:336 */
  109    201   
    }
  110         -
    /// Appends an item to `foo_enum_list`.
         202  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `foo_enum_list`.
         203  +
    /* BuilderGenerator.kt:411 */
  111    204   
    ///
  112         -
    /// To override the contents of this collection use [`set_foo_enum_list`](Self::set_foo_enum_list).
         205  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_foo_enum_list`](Self::set_foo_enum_list).
         206  +
    /* BuilderGenerator.kt:413 */
  113    207   
    ///
         208  +
    /* BuilderGenerator.kt:418 */
  114    209   
    pub fn foo_enum_list(mut self, input: crate::types::FooEnum) -> Self {
         210  +
        /* BuilderGenerator.kt:419 */
  115    211   
        let mut v = self.foo_enum_list.unwrap_or_default();
  116    212   
        v.push(input);
  117    213   
        self.foo_enum_list = ::std::option::Option::Some(v);
  118    214   
        self
         215  +
        /* BuilderGenerator.kt:418 */
  119    216   
    }
         217  +
    /* BuilderGenerator.kt:312 */
  120    218   
    #[allow(missing_docs)] // documentation missing in model
         219  +
                           /* BuilderGenerator.kt:314 */
  121    220   
    pub fn set_foo_enum_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>) -> Self {
         221  +
        /* BuilderGenerator.kt:315 */
  122    222   
        self.foo_enum_list = input;
  123    223   
        self
         224  +
        /* BuilderGenerator.kt:314 */
  124    225   
    }
         226  +
    /* BuilderGenerator.kt:334 */
  125    227   
    #[allow(missing_docs)] // documentation missing in model
         228  +
                           /* BuilderGenerator.kt:336 */
  126    229   
    pub fn get_foo_enum_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FooEnum>> {
         230  +
        /* BuilderGenerator.kt:337 */
  127    231   
        &self.foo_enum_list
         232  +
        /* BuilderGenerator.kt:336 */
  128    233   
    }
  129         -
    /// Appends an item to `foo_enum_set`.
         234  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `foo_enum_set`.
         235  +
    /* BuilderGenerator.kt:411 */
  130    236   
    ///
  131         -
    /// To override the contents of this collection use [`set_foo_enum_set`](Self::set_foo_enum_set).
         237  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_foo_enum_set`](Self::set_foo_enum_set).
         238  +
    /* BuilderGenerator.kt:413 */
  132    239   
    ///
         240  +
    /* BuilderGenerator.kt:418 */
  133    241   
    pub fn foo_enum_set(mut self, input: crate::types::FooEnum) -> Self {
         242  +
        /* BuilderGenerator.kt:419 */
  134    243   
        let mut v = self.foo_enum_set.unwrap_or_default();
  135    244   
        v.push(input);
  136    245   
        self.foo_enum_set = ::std::option::Option::Some(v);
  137    246   
        self
         247  +
        /* BuilderGenerator.kt:418 */
  138    248   
    }
         249  +
    /* BuilderGenerator.kt:312 */
  139    250   
    #[allow(missing_docs)] // documentation missing in model
         251  +
                           /* BuilderGenerator.kt:314 */
  140    252   
    pub fn set_foo_enum_set(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>) -> Self {
         253  +
        /* BuilderGenerator.kt:315 */
  141    254   
        self.foo_enum_set = input;
  142    255   
        self
         256  +
        /* BuilderGenerator.kt:314 */
  143    257   
    }
         258  +
    /* BuilderGenerator.kt:334 */
  144    259   
    #[allow(missing_docs)] // documentation missing in model
         260  +
                           /* BuilderGenerator.kt:336 */
  145    261   
    pub fn get_foo_enum_set(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FooEnum>> {
         262  +
        /* BuilderGenerator.kt:337 */
  146    263   
        &self.foo_enum_set
         264  +
        /* BuilderGenerator.kt:336 */
  147    265   
    }
  148         -
    /// Adds a key-value pair to `foo_enum_map`.
         266  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `foo_enum_map`.
         267  +
    /* BuilderGenerator.kt:437 */
  149    268   
    ///
  150         -
    /// To override the contents of this collection use [`set_foo_enum_map`](Self::set_foo_enum_map).
         269  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_foo_enum_map`](Self::set_foo_enum_map).
         270  +
    /* BuilderGenerator.kt:439 */
  151    271   
    ///
         272  +
    /* BuilderGenerator.kt:445 */
  152    273   
    pub fn foo_enum_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::FooEnum) -> Self {
         274  +
        /* BuilderGenerator.kt:448 */
  153    275   
        let mut hash_map = self.foo_enum_map.unwrap_or_default();
  154    276   
        hash_map.insert(k.into(), v);
  155    277   
        self.foo_enum_map = ::std::option::Option::Some(hash_map);
  156    278   
        self
         279  +
        /* BuilderGenerator.kt:445 */
  157    280   
    }
         281  +
    /* BuilderGenerator.kt:312 */
  158    282   
    #[allow(missing_docs)] // documentation missing in model
         283  +
                           /* BuilderGenerator.kt:314 */
  159    284   
    pub fn set_foo_enum_map(
  160    285   
        mut self,
  161    286   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>>,
  162    287   
    ) -> Self {
         288  +
        /* BuilderGenerator.kt:315 */
  163    289   
        self.foo_enum_map = input;
  164    290   
        self
         291  +
        /* BuilderGenerator.kt:314 */
  165    292   
    }
         293  +
    /* BuilderGenerator.kt:334 */
  166    294   
    #[allow(missing_docs)] // documentation missing in model
         295  +
                           /* BuilderGenerator.kt:336 */
  167    296   
    pub fn get_foo_enum_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>> {
         297  +
        /* BuilderGenerator.kt:337 */
  168    298   
        &self.foo_enum_map
         299  +
        /* BuilderGenerator.kt:336 */
  169    300   
    }
  170         -
    /// Consumes the builder and constructs a [`JsonEnumsInput`](crate::operation::json_enums::JsonEnumsInput).
         301  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`JsonEnumsInput`](crate::operation::json_enums::JsonEnumsInput).
         302  +
    /* BuilderGenerator.kt:253 */
  171    303   
    pub fn build(self) -> ::std::result::Result<crate::operation::json_enums::JsonEnumsInput, ::aws_smithy_types::error::operation::BuildError> {
  172         -
        ::std::result::Result::Ok(crate::operation::json_enums::JsonEnumsInput {
  173         -
            foo_enum1: self.foo_enum1,
         304  +
        /* BuilderGenerator.kt:254 */
         305  +
        ::std::result::Result::Ok(
         306  +
            /* BuilderGenerator.kt:477 */
         307  +
            crate::operation::json_enums::JsonEnumsInput {
         308  +
                /* BuilderGenerator.kt:481 */ foo_enum1: self.foo_enum1,
         309  +
                /* BuilderGenerator.kt:481 */
  174    310   
                foo_enum2: self.foo_enum2,
         311  +
                /* BuilderGenerator.kt:481 */
  175    312   
                foo_enum3: self.foo_enum3,
         313  +
                /* BuilderGenerator.kt:481 */
  176    314   
                foo_enum_list: self.foo_enum_list,
         315  +
                /* BuilderGenerator.kt:481 */
  177    316   
                foo_enum_set: self.foo_enum_set,
         317  +
                /* BuilderGenerator.kt:481 */
  178    318   
                foo_enum_map: self.foo_enum_map,
  179         -
        })
         319  +
                /* BuilderGenerator.kt:477 */
         320  +
            }, /* BuilderGenerator.kt:254 */
         321  +
        )
         322  +
        /* BuilderGenerator.kt:253 */
  180    323   
    }
         324  +
    /* BuilderGenerator.kt:355 */
  181    325   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/operation/json_enums/_json_enums_output.rs

@@ -1,1 +181,322 @@
    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 JsonEnumsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct JsonEnumsOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub foo_enum1: ::std::option::Option<crate::types::FooEnum>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub foo_enum2: ::std::option::Option<crate::types::FooEnum>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub foo_enum3: ::std::option::Option<crate::types::FooEnum>,
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[allow(missing_docs)] // documentation missing in model
   13     20   
    pub foo_enum_list: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
          21  +
    /* StructureGenerator.kt:231 */
   14     22   
    #[allow(missing_docs)] // documentation missing in model
   15     23   
    pub foo_enum_set: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
          24  +
    /* StructureGenerator.kt:231 */
   16     25   
    #[allow(missing_docs)] // documentation missing in model
   17     26   
    pub foo_enum_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>>,
          27  +
    /* StructureGenerator.kt:201 */
   18     28   
}
          29  +
/* StructureGenerator.kt:135 */
   19     30   
impl JsonEnumsOutput {
          31  +
    /* StructureGenerator.kt:231 */
   20     32   
    #[allow(missing_docs)] // documentation missing in model
          33  +
                           /* StructureGenerator.kt:166 */
   21     34   
    pub fn foo_enum1(&self) -> ::std::option::Option<&crate::types::FooEnum> {
          35  +
        /* StructureGenerator.kt:170 */
   22     36   
        self.foo_enum1.as_ref()
          37  +
        /* StructureGenerator.kt:166 */
   23     38   
    }
          39  +
    /* StructureGenerator.kt:231 */
   24     40   
    #[allow(missing_docs)] // documentation missing in model
          41  +
                           /* StructureGenerator.kt:166 */
   25     42   
    pub fn foo_enum2(&self) -> ::std::option::Option<&crate::types::FooEnum> {
          43  +
        /* StructureGenerator.kt:170 */
   26     44   
        self.foo_enum2.as_ref()
          45  +
        /* StructureGenerator.kt:166 */
   27     46   
    }
          47  +
    /* StructureGenerator.kt:231 */
   28     48   
    #[allow(missing_docs)] // documentation missing in model
          49  +
                           /* StructureGenerator.kt:166 */
   29     50   
    pub fn foo_enum3(&self) -> ::std::option::Option<&crate::types::FooEnum> {
          51  +
        /* StructureGenerator.kt:170 */
   30     52   
        self.foo_enum3.as_ref()
          53  +
        /* StructureGenerator.kt:166 */
   31     54   
    }
          55  +
    /* StructureGenerator.kt:231 */
   32     56   
    #[allow(missing_docs)] // documentation missing in model
   33         -
    ///
   34         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.foo_enum_list.is_none()`.
          57  +
    /// /* StructureGenerator.kt:162 */
          58  +
    /// /* 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 `.foo_enum_list.is_none()`.
          59  +
    /* StructureGenerator.kt:166 */
   35     60   
    pub fn foo_enum_list(&self) -> &[crate::types::FooEnum] {
   36         -
        self.foo_enum_list.as_deref().unwrap_or_default()
          61  +
        /* StructureGenerator.kt:169 */
          62  +
        self.foo_enum_list
          63  +
            .as_deref()
          64  +
            /* StructureGenerator.kt:175 */
          65  +
            .unwrap_or_default()
          66  +
        /* StructureGenerator.kt:166 */
   37     67   
    }
          68  +
    /* StructureGenerator.kt:231 */
   38     69   
    #[allow(missing_docs)] // documentation missing in model
   39         -
    ///
   40         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.foo_enum_set.is_none()`.
          70  +
    /// /* StructureGenerator.kt:162 */
          71  +
    /// /* 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 `.foo_enum_set.is_none()`.
          72  +
    /* StructureGenerator.kt:166 */
   41     73   
    pub fn foo_enum_set(&self) -> &[crate::types::FooEnum] {
   42         -
        self.foo_enum_set.as_deref().unwrap_or_default()
          74  +
        /* StructureGenerator.kt:169 */
          75  +
        self.foo_enum_set
          76  +
            .as_deref()
          77  +
            /* StructureGenerator.kt:175 */
          78  +
            .unwrap_or_default()
          79  +
        /* StructureGenerator.kt:166 */
   43     80   
    }
          81  +
    /* StructureGenerator.kt:231 */
   44     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* StructureGenerator.kt:166 */
   45     84   
    pub fn foo_enum_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::FooEnum>> {
          85  +
        /* StructureGenerator.kt:170 */
   46     86   
        self.foo_enum_map.as_ref()
          87  +
        /* StructureGenerator.kt:166 */
   47     88   
    }
          89  +
    /* StructureGenerator.kt:135 */
   48     90   
}
          91  +
/* ClientCodegenVisitor.kt:237 */
   49     92   
impl JsonEnumsOutput {
   50         -
    /// Creates a new builder-style object to manufacture [`JsonEnumsOutput`](crate::operation::json_enums::JsonEnumsOutput).
          93  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`JsonEnumsOutput`](crate::operation::json_enums::JsonEnumsOutput).
          94  +
    /* BuilderGenerator.kt:175 */
   51     95   
    pub fn builder() -> crate::operation::json_enums::builders::JsonEnumsOutputBuilder {
          96  +
        /* BuilderGenerator.kt:176 */
   52     97   
        crate::operation::json_enums::builders::JsonEnumsOutputBuilder::default()
          98  +
        /* BuilderGenerator.kt:175 */
   53     99   
    }
         100  +
    /* ClientCodegenVisitor.kt:237 */
   54    101   
}
   55    102   
   56         -
/// A builder for [`JsonEnumsOutput`](crate::operation::json_enums::JsonEnumsOutput).
         103  +
/// /* BuilderGenerator.kt:342 */A builder for [`JsonEnumsOutput`](crate::operation::json_enums::JsonEnumsOutput).
         104  +
/* RustType.kt:516 */
   57    105   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         106  +
/* RustType.kt:516 */
   58    107   
#[non_exhaustive]
         108  +
/* BuilderGenerator.kt:345 */
   59    109   
pub struct JsonEnumsOutputBuilder {
   60         -
    pub(crate) foo_enum1: ::std::option::Option<crate::types::FooEnum>,
   61         -
    pub(crate) foo_enum2: ::std::option::Option<crate::types::FooEnum>,
   62         -
    pub(crate) foo_enum3: ::std::option::Option<crate::types::FooEnum>,
   63         -
    pub(crate) foo_enum_list: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
   64         -
    pub(crate) foo_enum_set: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
         110  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum1: ::std::option::Option<crate::types::FooEnum>,
         111  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum2: ::std::option::Option<crate::types::FooEnum>,
         112  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum3: ::std::option::Option<crate::types::FooEnum>,
         113  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum_list: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
         114  +
    /* BuilderGenerator.kt:275 */ pub(crate) foo_enum_set: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>,
         115  +
    /* BuilderGenerator.kt:275 */
   65    116   
    pub(crate) foo_enum_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>>,
         117  +
    /* BuilderGenerator.kt:345 */
   66    118   
}
         119  +
/* BuilderGenerator.kt:355 */
   67    120   
impl JsonEnumsOutputBuilder {
         121  +
    /* BuilderGenerator.kt:286 */
   68    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* BuilderGenerator.kt:291 */
   69    124   
    pub fn foo_enum1(mut self, input: crate::types::FooEnum) -> Self {
         125  +
        /* BuilderGenerator.kt:292 */
   70    126   
        self.foo_enum1 = ::std::option::Option::Some(input);
         127  +
        /* BuilderGenerator.kt:293 */
   71    128   
        self
         129  +
        /* BuilderGenerator.kt:291 */
   72    130   
    }
         131  +
    /* BuilderGenerator.kt:312 */
   73    132   
    #[allow(missing_docs)] // documentation missing in model
         133  +
                           /* BuilderGenerator.kt:314 */
   74    134   
    pub fn set_foo_enum1(mut self, input: ::std::option::Option<crate::types::FooEnum>) -> Self {
         135  +
        /* BuilderGenerator.kt:315 */
   75    136   
        self.foo_enum1 = input;
   76    137   
        self
         138  +
        /* BuilderGenerator.kt:314 */
   77    139   
    }
         140  +
    /* BuilderGenerator.kt:334 */
   78    141   
    #[allow(missing_docs)] // documentation missing in model
         142  +
                           /* BuilderGenerator.kt:336 */
   79    143   
    pub fn get_foo_enum1(&self) -> &::std::option::Option<crate::types::FooEnum> {
         144  +
        /* BuilderGenerator.kt:337 */
   80    145   
        &self.foo_enum1
         146  +
        /* BuilderGenerator.kt:336 */
   81    147   
    }
         148  +
    /* BuilderGenerator.kt:286 */
   82    149   
    #[allow(missing_docs)] // documentation missing in model
         150  +
                           /* BuilderGenerator.kt:291 */
   83    151   
    pub fn foo_enum2(mut self, input: crate::types::FooEnum) -> Self {
         152  +
        /* BuilderGenerator.kt:292 */
   84    153   
        self.foo_enum2 = ::std::option::Option::Some(input);
         154  +
        /* BuilderGenerator.kt:293 */
   85    155   
        self
         156  +
        /* BuilderGenerator.kt:291 */
   86    157   
    }
         158  +
    /* BuilderGenerator.kt:312 */
   87    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* BuilderGenerator.kt:314 */
   88    161   
    pub fn set_foo_enum2(mut self, input: ::std::option::Option<crate::types::FooEnum>) -> Self {
         162  +
        /* BuilderGenerator.kt:315 */
   89    163   
        self.foo_enum2 = input;
   90    164   
        self
         165  +
        /* BuilderGenerator.kt:314 */
   91    166   
    }
         167  +
    /* BuilderGenerator.kt:334 */
   92    168   
    #[allow(missing_docs)] // documentation missing in model
         169  +
                           /* BuilderGenerator.kt:336 */
   93    170   
    pub fn get_foo_enum2(&self) -> &::std::option::Option<crate::types::FooEnum> {
         171  +
        /* BuilderGenerator.kt:337 */
   94    172   
        &self.foo_enum2
         173  +
        /* BuilderGenerator.kt:336 */
   95    174   
    }
         175  +
    /* BuilderGenerator.kt:286 */
   96    176   
    #[allow(missing_docs)] // documentation missing in model
         177  +
                           /* BuilderGenerator.kt:291 */
   97    178   
    pub fn foo_enum3(mut self, input: crate::types::FooEnum) -> Self {
         179  +
        /* BuilderGenerator.kt:292 */
   98    180   
        self.foo_enum3 = ::std::option::Option::Some(input);
         181  +
        /* BuilderGenerator.kt:293 */
   99    182   
        self
         183  +
        /* BuilderGenerator.kt:291 */
  100    184   
    }
         185  +
    /* BuilderGenerator.kt:312 */
  101    186   
    #[allow(missing_docs)] // documentation missing in model
         187  +
                           /* BuilderGenerator.kt:314 */
  102    188   
    pub fn set_foo_enum3(mut self, input: ::std::option::Option<crate::types::FooEnum>) -> Self {
         189  +
        /* BuilderGenerator.kt:315 */
  103    190   
        self.foo_enum3 = input;
  104    191   
        self
         192  +
        /* BuilderGenerator.kt:314 */
  105    193   
    }
         194  +
    /* BuilderGenerator.kt:334 */
  106    195   
    #[allow(missing_docs)] // documentation missing in model
         196  +
                           /* BuilderGenerator.kt:336 */
  107    197   
    pub fn get_foo_enum3(&self) -> &::std::option::Option<crate::types::FooEnum> {
         198  +
        /* BuilderGenerator.kt:337 */
  108    199   
        &self.foo_enum3
         200  +
        /* BuilderGenerator.kt:336 */
  109    201   
    }
  110         -
    /// Appends an item to `foo_enum_list`.
         202  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `foo_enum_list`.
         203  +
    /* BuilderGenerator.kt:411 */
  111    204   
    ///
  112         -
    /// To override the contents of this collection use [`set_foo_enum_list`](Self::set_foo_enum_list).
         205  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_foo_enum_list`](Self::set_foo_enum_list).
         206  +
    /* BuilderGenerator.kt:413 */
  113    207   
    ///
         208  +
    /* BuilderGenerator.kt:418 */
  114    209   
    pub fn foo_enum_list(mut self, input: crate::types::FooEnum) -> Self {
         210  +
        /* BuilderGenerator.kt:419 */
  115    211   
        let mut v = self.foo_enum_list.unwrap_or_default();
  116    212   
        v.push(input);
  117    213   
        self.foo_enum_list = ::std::option::Option::Some(v);
  118    214   
        self
         215  +
        /* BuilderGenerator.kt:418 */
  119    216   
    }
         217  +
    /* BuilderGenerator.kt:312 */
  120    218   
    #[allow(missing_docs)] // documentation missing in model
         219  +
                           /* BuilderGenerator.kt:314 */
  121    220   
    pub fn set_foo_enum_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>) -> Self {
         221  +
        /* BuilderGenerator.kt:315 */
  122    222   
        self.foo_enum_list = input;
  123    223   
        self
         224  +
        /* BuilderGenerator.kt:314 */
  124    225   
    }
         226  +
    /* BuilderGenerator.kt:334 */
  125    227   
    #[allow(missing_docs)] // documentation missing in model
         228  +
                           /* BuilderGenerator.kt:336 */
  126    229   
    pub fn get_foo_enum_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FooEnum>> {
         230  +
        /* BuilderGenerator.kt:337 */
  127    231   
        &self.foo_enum_list
         232  +
        /* BuilderGenerator.kt:336 */
  128    233   
    }
  129         -
    /// Appends an item to `foo_enum_set`.
         234  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `foo_enum_set`.
         235  +
    /* BuilderGenerator.kt:411 */
  130    236   
    ///
  131         -
    /// To override the contents of this collection use [`set_foo_enum_set`](Self::set_foo_enum_set).
         237  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_foo_enum_set`](Self::set_foo_enum_set).
         238  +
    /* BuilderGenerator.kt:413 */
  132    239   
    ///
         240  +
    /* BuilderGenerator.kt:418 */
  133    241   
    pub fn foo_enum_set(mut self, input: crate::types::FooEnum) -> Self {
         242  +
        /* BuilderGenerator.kt:419 */
  134    243   
        let mut v = self.foo_enum_set.unwrap_or_default();
  135    244   
        v.push(input);
  136    245   
        self.foo_enum_set = ::std::option::Option::Some(v);
  137    246   
        self
         247  +
        /* BuilderGenerator.kt:418 */
  138    248   
    }
         249  +
    /* BuilderGenerator.kt:312 */
  139    250   
    #[allow(missing_docs)] // documentation missing in model
         251  +
                           /* BuilderGenerator.kt:314 */
  140    252   
    pub fn set_foo_enum_set(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FooEnum>>) -> Self {
         253  +
        /* BuilderGenerator.kt:315 */
  141    254   
        self.foo_enum_set = input;
  142    255   
        self
         256  +
        /* BuilderGenerator.kt:314 */
  143    257   
    }
         258  +
    /* BuilderGenerator.kt:334 */
  144    259   
    #[allow(missing_docs)] // documentation missing in model
         260  +
                           /* BuilderGenerator.kt:336 */
  145    261   
    pub fn get_foo_enum_set(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FooEnum>> {
         262  +
        /* BuilderGenerator.kt:337 */
  146    263   
        &self.foo_enum_set
         264  +
        /* BuilderGenerator.kt:336 */
  147    265   
    }
  148         -
    /// Adds a key-value pair to `foo_enum_map`.
         266  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `foo_enum_map`.
         267  +
    /* BuilderGenerator.kt:437 */
  149    268   
    ///
  150         -
    /// To override the contents of this collection use [`set_foo_enum_map`](Self::set_foo_enum_map).
         269  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_foo_enum_map`](Self::set_foo_enum_map).
         270  +
    /* BuilderGenerator.kt:439 */
  151    271   
    ///
         272  +
    /* BuilderGenerator.kt:445 */
  152    273   
    pub fn foo_enum_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::FooEnum) -> Self {
         274  +
        /* BuilderGenerator.kt:448 */
  153    275   
        let mut hash_map = self.foo_enum_map.unwrap_or_default();
  154    276   
        hash_map.insert(k.into(), v);
  155    277   
        self.foo_enum_map = ::std::option::Option::Some(hash_map);
  156    278   
        self
         279  +
        /* BuilderGenerator.kt:445 */
  157    280   
    }
         281  +
    /* BuilderGenerator.kt:312 */
  158    282   
    #[allow(missing_docs)] // documentation missing in model
         283  +
                           /* BuilderGenerator.kt:314 */
  159    284   
    pub fn set_foo_enum_map(
  160    285   
        mut self,
  161    286   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>>,
  162    287   
    ) -> Self {
         288  +
        /* BuilderGenerator.kt:315 */
  163    289   
        self.foo_enum_map = input;
  164    290   
        self
         291  +
        /* BuilderGenerator.kt:314 */
  165    292   
    }
         293  +
    /* BuilderGenerator.kt:334 */
  166    294   
    #[allow(missing_docs)] // documentation missing in model
         295  +
                           /* BuilderGenerator.kt:336 */
  167    296   
    pub fn get_foo_enum_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FooEnum>> {
         297  +
        /* BuilderGenerator.kt:337 */
  168    298   
        &self.foo_enum_map
         299  +
        /* BuilderGenerator.kt:336 */
  169    300   
    }
  170         -
    /// Consumes the builder and constructs a [`JsonEnumsOutput`](crate::operation::json_enums::JsonEnumsOutput).
         301  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`JsonEnumsOutput`](crate::operation::json_enums::JsonEnumsOutput).
         302  +
    /* BuilderGenerator.kt:253 */
  171    303   
    pub fn build(self) -> crate::operation::json_enums::JsonEnumsOutput {
         304  +
        /* BuilderGenerator.kt:477 */
  172    305   
        crate::operation::json_enums::JsonEnumsOutput {
  173         -
            foo_enum1: self.foo_enum1,
         306  +
            /* BuilderGenerator.kt:481 */ foo_enum1: self.foo_enum1,
         307  +
            /* BuilderGenerator.kt:481 */
  174    308   
            foo_enum2: self.foo_enum2,
         309  +
            /* BuilderGenerator.kt:481 */
  175    310   
            foo_enum3: self.foo_enum3,
         311  +
            /* BuilderGenerator.kt:481 */
  176    312   
            foo_enum_list: self.foo_enum_list,
         313  +
            /* BuilderGenerator.kt:481 */
  177    314   
            foo_enum_set: self.foo_enum_set,
         315  +
            /* BuilderGenerator.kt:481 */
  178    316   
            foo_enum_map: self.foo_enum_map,
         317  +
            /* BuilderGenerator.kt:477 */
  179    318   
        }
         319  +
        /* BuilderGenerator.kt:253 */
  180    320   
    }
         321  +
    /* BuilderGenerator.kt:355 */
  181    322   
}