Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type.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 `DocumentType`.
           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 DocumentType;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl DocumentType {
    7         -
    /// Creates a new `DocumentType`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `DocumentType`
          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::document_type::DocumentTypeInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::document_type::DocumentTypeOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::document_type::DocumentTypeError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +263,280 @@
   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 DocumentType {
   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("DocumentType");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            DocumentTypeRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            DocumentTypeResponseDeserializer,
   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   
            "DocumentType",
  105    116   
            "Rest 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("DocumentType")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(DocumentTypeEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::document_type::DocumentTypeError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::document_type::DocumentTypeError,
  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 DocumentTypeResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DocumentTypeResponseDeserializer {
  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_document_type::de_document_type_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_document_type::de_document_type_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 DocumentTypeRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DocumentTypeRequestSerializer {
  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::document_type::DocumentTypeInput>()
  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::document_type::DocumentTypeInput,
  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, "/DocumentType").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::document_type::DocumentTypeInput,
  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("PUT").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/json");
  187    200   
            builder
  188    201   
        };
  189    202   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_document_type::ser_document_type_input(&input)?);
  190    203   
        if let Some(content_length) = body.content_length() {
  191    204   
            let content_length = content_length.to_string();
  192    205   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  193    206   
        }
  194    207   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  195    208   
    }
  196    209   
}
         210  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  197    211   
#[derive(Debug)]
  198    212   
struct DocumentTypeEndpointParamsInterceptor;
  199    213   
  200    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DocumentTypeEndpointParamsInterceptor {
  201    215   
    fn name(&self) -> &'static str {
  202    216   
        "DocumentTypeEndpointParamsInterceptor"
  203    217   
    }
  204    218   
  205    219   
    fn read_before_execution(
  206    220   
        &self,
  207    221   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  208    222   
            '_,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  210    224   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  212    226   
        >,
  213    227   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  214    228   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  215    229   
        let _input = context
  216    230   
            .input()
  217    231   
            .downcast_ref::<DocumentTypeInput>()
  218    232   
            .ok_or("failed to downcast to DocumentTypeInput")?;
  219    233   
  220    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  222    236   
        })?;
  223    237   
        cfg.interceptor_state()
  224    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  225    239   
        ::std::result::Result::Ok(())
  226    240   
    }
  227    241   
}
  228    242   
  229    243   
// The get_* functions below are generated from JMESPath expressions in the
  230    244   
// operationContextParams trait. They target the operation's input shape.
  231    245   
         246  +
/* RustType.kt:516 */
  232    247   
#[allow(unreachable_code, unused_variables)]
         248  +
/* RustType.kt:516 */
  233    249   
#[cfg(test)]
         250  +
/* ProtocolTestGenerator.kt:98 */
  234    251   
mod document_type_test {
  235    252   
  236    253   
    /// Serializes document types as part of the JSON request payload with no escaping.
  237    254   
    /// Test ID: DocumentTypeInputWithObject
  238    255   
    #[::tokio::test]
  239    256   
    #[::tracing_test::traced_test]
  240    257   
    async fn document_type_input_with_object_request() {
  241    258   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  242    259   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  243    260   
@@ -665,682 +794,870 @@
  685    702   
            .expect("should be successful response")
  686    703   
            .downcast::<crate::operation::document_type::DocumentTypeOutput>()
  687    704   
            .unwrap();
  688    705   
        ::pretty_assertions::assert_eq!(parsed.string_value, expected_output.string_value, "Unexpected value for `string_value`");
  689    706   
        ::pretty_assertions::assert_eq!(
  690    707   
            parsed.document_value,
  691    708   
            expected_output.document_value,
  692    709   
            "Unexpected value for `document_value`"
  693    710   
        );
  694    711   
    }
         712  +
         713  +
    /* ProtocolTestGenerator.kt:98 */
  695    714   
}
  696    715   
         716  +
/* OperationErrorGenerator.kt:79 */
  697    717   
/// Error type for the `DocumentTypeError` operation.
         718  +
/* RustType.kt:516 */
  698    719   
#[non_exhaustive]
         720  +
/* RustType.kt:516 */
  699    721   
#[derive(::std::fmt::Debug)]
  700         -
pub enum DocumentTypeError {
         722  +
pub /* OperationErrorGenerator.kt:81 */ enum DocumentTypeError {
         723  +
    /* OperationErrorGenerator.kt:88 */
  701    724   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  702    725   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  703    726   
    variable wildcard pattern and check `.code()`:
  704    727   
     \
  705    728   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  706    729   
     \
  707    730   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DocumentTypeError) for what information is available for the error.")]
  708    731   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         732  +
    /* OperationErrorGenerator.kt:81 */
  709    733   
}
         734  +
/* OperationErrorGenerator.kt:218 */
  710    735   
impl DocumentTypeError {
         736  +
    /* OperationErrorGenerator.kt:219 */
  711    737   
    /// Creates the `DocumentTypeError::Unhandled` variant from any error type.
  712    738   
    pub fn unhandled(
  713    739   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  714    740   
    ) -> Self {
  715    741   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  716    742   
            source: err.into(),
  717    743   
            meta: ::std::default::Default::default(),
  718    744   
        })
  719    745   
    }
  720    746   
  721    747   
    /// Creates the `DocumentTypeError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  722    748   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  723    749   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  724    750   
            source: err.clone().into(),
  725    751   
            meta: err,
  726    752   
        })
  727    753   
    }
  728         -
    ///
         754  +
    /// /* OperationErrorGenerator.kt:236 */
  729    755   
    /// Returns error metadata, which includes the error code, message,
  730    756   
    /// request ID, and potentially additional information.
  731    757   
    ///
         758  +
    /* OperationErrorGenerator.kt:242 */
  732    759   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         760  +
        /* OperationErrorGenerator.kt:243 */
  733    761   
        match self {
  734         -
            Self::Unhandled(e) => &e.meta,
         762  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         763  +
            /* OperationErrorGenerator.kt:243 */
  735    764   
        }
         765  +
        /* OperationErrorGenerator.kt:242 */
  736    766   
    }
         767  +
    /* OperationErrorGenerator.kt:218 */
  737    768   
}
         769  +
/* OperationErrorGenerator.kt:269 */
  738    770   
impl ::std::error::Error for DocumentTypeError {
         771  +
    /* OperationErrorGenerator.kt:270 */
  739    772   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         773  +
        /* OperationErrorGenerator.kt:318 */
  740    774   
        match self {
  741         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         775  +
            /* OperationErrorGenerator.kt:326 */
         776  +
            Self::Unhandled(_inner) => {
         777  +
                /* OperationErrorGenerator.kt:279 */
         778  +
                ::std::option::Option::Some(&*_inner.source)
         779  +
                /* OperationErrorGenerator.kt:326 */
         780  +
            } /* OperationErrorGenerator.kt:318 */
  742    781   
        }
         782  +
        /* OperationErrorGenerator.kt:270 */
  743    783   
    }
         784  +
    /* OperationErrorGenerator.kt:269 */
  744    785   
}
         786  +
/* OperationErrorGenerator.kt:133 */
  745    787   
impl ::std::fmt::Display for DocumentTypeError {
         788  +
    /* OperationErrorGenerator.kt:134 */
  746    789   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         790  +
        /* OperationErrorGenerator.kt:318 */
  747    791   
        match self {
         792  +
            /* OperationErrorGenerator.kt:326 */
  748    793   
            Self::Unhandled(_inner) => {
         794  +
                /* OperationErrorGenerator.kt:139 */
  749    795   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  750    796   
                    write!(f, "unhandled error ({code})")
  751    797   
                } else {
  752    798   
                    f.write_str("unhandled error")
  753    799   
                }
         800  +
                /* OperationErrorGenerator.kt:326 */
         801  +
            } /* OperationErrorGenerator.kt:318 */
  754    802   
        }
         803  +
        /* OperationErrorGenerator.kt:134 */
  755    804   
    }
  756         -
    }
         805  +
    /* OperationErrorGenerator.kt:133 */
  757    806   
}
         807  +
/* OperationErrorGenerator.kt:182 */
  758    808   
impl ::aws_smithy_types::retry::ProvideErrorKind for DocumentTypeError {
         809  +
    /* OperationErrorGenerator.kt:186 */
  759    810   
    fn code(&self) -> ::std::option::Option<&str> {
         811  +
        /* OperationErrorGenerator.kt:187 */
  760    812   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         813  +
        /* OperationErrorGenerator.kt:186 */
  761    814   
    }
         815  +
    /* OperationErrorGenerator.kt:190 */
  762    816   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         817  +
        /* OperationErrorGenerator.kt:197 */
  763    818   
        ::std::option::Option::None
         819  +
        /* OperationErrorGenerator.kt:190 */
  764    820   
    }
         821  +
    /* OperationErrorGenerator.kt:182 */
  765    822   
}
         823  +
/* OperationErrorGenerator.kt:163 */
  766    824   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DocumentTypeError {
         825  +
    /* OperationErrorGenerator.kt:164 */
  767    826   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         827  +
        /* OperationErrorGenerator.kt:318 */
  768    828   
        match self {
  769         -
            Self::Unhandled(_inner) => &_inner.meta,
         829  +
            /* OperationErrorGenerator.kt:326 */
         830  +
            Self::Unhandled(_inner) => {
         831  +
                /* OperationErrorGenerator.kt:168 */
         832  +
                &_inner.meta
         833  +
                /* OperationErrorGenerator.kt:326 */
         834  +
            } /* OperationErrorGenerator.kt:318 */
  770    835   
        }
         836  +
        /* OperationErrorGenerator.kt:164 */
  771    837   
    }
         838  +
    /* OperationErrorGenerator.kt:163 */
  772    839   
}
         840  +
/* OperationErrorGenerator.kt:109 */
  773    841   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DocumentTypeError {
         842  +
    /* OperationErrorGenerator.kt:110 */
  774    843   
    fn create_unhandled_error(
  775    844   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  776    845   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  777    846   
    ) -> Self {
         847  +
        /* OperationErrorGenerator.kt:121 */
  778    848   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  779    849   
            source,
  780    850   
            meta: meta.unwrap_or_default(),
  781    851   
        })
         852  +
        /* OperationErrorGenerator.kt:110 */
  782    853   
    }
         854  +
    /* OperationErrorGenerator.kt:109 */
  783    855   
}
  784    856   
         857  +
/* CodegenDelegator.kt:255 */
  785    858   
pub use crate::operation::document_type::_document_type_output::DocumentTypeOutput;
  786    859   
         860  +
/* CodegenDelegator.kt:255 */
  787    861   
pub use crate::operation::document_type::_document_type_input::DocumentTypeInput;
  788    862   
         863  +
/* RustModule.kt:172 */
  789    864   
mod _document_type_input;
  790    865   
         866  +
/* RustModule.kt:172 */
  791    867   
mod _document_type_output;
  792    868   
  793         -
/// Builders
         869  +
/// /* CodegenDelegator.kt:51 */Builders
  794    870   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type/_document_type_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type/_document_type_output.rs

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

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

@@ -1,1 +139,163 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::document_type::_document_type_output::DocumentTypeOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::document_type::_document_type_input::DocumentTypeInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::document_type::builders::DocumentTypeInputBuilder {
    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::document_type::DocumentTypeOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::document_type::DocumentTypeError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.document_type();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `DocumentType`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `DocumentType`.
   24     27   
///
   25         -
/// This example serializes a document as part of the payload.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example serializes a document as part of the payload.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct DocumentTypeFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::document_type::builders::DocumentTypeInputBuilder,
   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::document_type::DocumentTypeOutput,
   35     41   
        crate::operation::document_type::DocumentTypeError,
   36     42   
    > for DocumentTypeFluentBuilder
   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::document_type::DocumentTypeOutput,
   44     50   
            crate::operation::document_type::DocumentTypeError,
   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 DocumentTypeFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `DocumentTypeFluentBuilder`.
   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 DocumentType as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::document_type::builders::DocumentTypeInputBuilder {
   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::document_type::DocumentTypeOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::document_type::DocumentTypeError,
   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::document_type::DocumentType::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::document_type::DocumentType::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::document_type::DocumentTypeOutput,
   97    107   
        crate::operation::document_type::DocumentTypeError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:498 */
  111    123   
    #[allow(missing_docs)] // documentation missing in model
         124  +
                           /* FluentBuilderGenerator.kt:500 */
  112    125   
    pub fn string_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  113    126   
        self.inner = self.inner.string_value(input.into());
  114    127   
        self
  115    128   
    }
         129  +
    /* FluentBuilderGenerator.kt:498 */
  116    130   
    #[allow(missing_docs)] // documentation missing in model
         131  +
                           /* FluentBuilderGenerator.kt:500 */
  117    132   
    pub fn set_string_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  118    133   
        self.inner = self.inner.set_string_value(input);
  119    134   
        self
  120    135   
    }
         136  +
    /* FluentBuilderGenerator.kt:518 */
  121    137   
    #[allow(missing_docs)] // documentation missing in model
         138  +
                           /* FluentBuilderGenerator.kt:520 */
  122    139   
    pub fn get_string_value(&self) -> &::std::option::Option<::std::string::String> {
  123    140   
        self.inner.get_string_value()
  124    141   
    }
         142  +
    /* FluentBuilderGenerator.kt:498 */
  125    143   
    #[allow(missing_docs)] // documentation missing in model
         144  +
                           /* FluentBuilderGenerator.kt:500 */
  126    145   
    pub fn document_value(mut self, input: ::aws_smithy_types::Document) -> Self {
  127    146   
        self.inner = self.inner.document_value(input);
  128    147   
        self
  129    148   
    }
         149  +
    /* FluentBuilderGenerator.kt:498 */
  130    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* FluentBuilderGenerator.kt:500 */
  131    152   
    pub fn set_document_value(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
  132    153   
        self.inner = self.inner.set_document_value(input);
  133    154   
        self
  134    155   
    }
         156  +
    /* FluentBuilderGenerator.kt:518 */
  135    157   
    #[allow(missing_docs)] // documentation missing in model
         158  +
                           /* FluentBuilderGenerator.kt:520 */
  136    159   
    pub fn get_document_value(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
  137    160   
        self.inner.get_document_value()
  138    161   
    }
         162  +
    /* FluentBuilderGenerator.kt:282 */
  139    163   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type_as_map_value.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 `DocumentTypeAsMapValue`.
           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 DocumentTypeAsMapValue;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl DocumentTypeAsMapValue {
    7         -
    /// Creates a new `DocumentTypeAsMapValue`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `DocumentTypeAsMapValue`
          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::document_type_as_map_value::DocumentTypeAsMapValueInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +271,288 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DocumentTypeAsMapValue {
   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("DocumentTypeAsMapValue");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            DocumentTypeAsMapValueRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            DocumentTypeAsMapValueResponseDeserializer,
  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   
            "DocumentTypeAsMapValue",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DocumentTypeAsMapValue")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(DocumentTypeAsMapValueEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
  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 DocumentTypeAsMapValueResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DocumentTypeAsMapValueResponseDeserializer {
  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_document_type_as_map_value::de_document_type_as_map_value_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_document_type_as_map_value::de_document_type_as_map_value_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 DocumentTypeAsMapValueRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DocumentTypeAsMapValueRequestSerializer {
  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::document_type_as_map_value::DocumentTypeAsMapValueInput>()
  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::document_type_as_map_value::DocumentTypeAsMapValueInput,
  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, "/DocumentTypeAsMapValue").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::document_type_as_map_value::DocumentTypeAsMapValueInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from(
  196    209   
            crate::protocol_serde::shape_document_type_as_map_value::ser_document_type_as_map_value_input(&input)?,
  197    210   
        );
  198    211   
        if let Some(content_length) = body.content_length() {
  199    212   
            let content_length = content_length.to_string();
  200    213   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  201    214   
        }
  202    215   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  203    216   
    }
  204    217   
}
         218  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  205    219   
#[derive(Debug)]
  206    220   
struct DocumentTypeAsMapValueEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DocumentTypeAsMapValueEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "DocumentTypeAsMapValueEndpointParamsInterceptor"
  211    225   
    }
  212    226   
  213    227   
    fn read_before_execution(
  214    228   
        &self,
  215    229   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  216    230   
            '_,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  218    232   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  220    234   
        >,
  221    235   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  222    236   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  223    237   
        let _input = context
  224    238   
            .input()
  225    239   
            .downcast_ref::<DocumentTypeAsMapValueInput>()
  226    240   
            .ok_or("failed to downcast to DocumentTypeAsMapValueInput")?;
  227    241   
  228    242   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  229    243   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  230    244   
        })?;
  231    245   
        cfg.interceptor_state()
  232    246   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  233    247   
        ::std::result::Result::Ok(())
  234    248   
    }
  235    249   
}
  236    250   
  237    251   
// The get_* functions below are generated from JMESPath expressions in the
  238    252   
// operationContextParams trait. They target the operation's input shape.
  239    253   
         254  +
/* RustType.kt:516 */
  240    255   
#[allow(unreachable_code, unused_variables)]
         256  +
/* RustType.kt:516 */
  241    257   
#[cfg(test)]
         258  +
/* ProtocolTestGenerator.kt:98 */
  242    259   
mod document_type_as_map_value_test {
  243    260   
  244    261   
    /// Serializes a map that uses documents as the value.
  245    262   
    /// Test ID: DocumentTypeAsMapValueInput
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn document_type_as_map_value_input_request() {
  249    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    267   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  251    268   
@@ -334,351 +463,539 @@
  354    371   
        let parsed = parsed
  355    372   
            .expect("should be successful response")
  356    373   
            .downcast::<crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput>()
  357    374   
            .unwrap();
  358    375   
        ::pretty_assertions::assert_eq!(
  359    376   
            parsed.doc_valued_map,
  360    377   
            expected_output.doc_valued_map,
  361    378   
            "Unexpected value for `doc_valued_map`"
  362    379   
        );
  363    380   
    }
         381  +
         382  +
    /* ProtocolTestGenerator.kt:98 */
  364    383   
}
  365    384   
         385  +
/* OperationErrorGenerator.kt:79 */
  366    386   
/// Error type for the `DocumentTypeAsMapValueError` operation.
         387  +
/* RustType.kt:516 */
  367    388   
#[non_exhaustive]
         389  +
/* RustType.kt:516 */
  368    390   
#[derive(::std::fmt::Debug)]
  369         -
pub enum DocumentTypeAsMapValueError {
         391  +
pub /* OperationErrorGenerator.kt:81 */ enum DocumentTypeAsMapValueError {
         392  +
    /* OperationErrorGenerator.kt:88 */
  370    393   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  371    394   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  372    395   
    variable wildcard pattern and check `.code()`:
  373    396   
     \
  374    397   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  375    398   
     \
  376    399   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DocumentTypeAsMapValueError) for what information is available for the error.")]
  377    400   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         401  +
    /* OperationErrorGenerator.kt:81 */
  378    402   
}
         403  +
/* OperationErrorGenerator.kt:218 */
  379    404   
impl DocumentTypeAsMapValueError {
         405  +
    /* OperationErrorGenerator.kt:219 */
  380    406   
    /// Creates the `DocumentTypeAsMapValueError::Unhandled` variant from any error type.
  381    407   
    pub fn unhandled(
  382    408   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  383    409   
    ) -> Self {
  384    410   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  385    411   
            source: err.into(),
  386    412   
            meta: ::std::default::Default::default(),
  387    413   
        })
  388    414   
    }
  389    415   
  390    416   
    /// Creates the `DocumentTypeAsMapValueError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  391    417   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  392    418   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  393    419   
            source: err.clone().into(),
  394    420   
            meta: err,
  395    421   
        })
  396    422   
    }
  397         -
    ///
         423  +
    /// /* OperationErrorGenerator.kt:236 */
  398    424   
    /// Returns error metadata, which includes the error code, message,
  399    425   
    /// request ID, and potentially additional information.
  400    426   
    ///
         427  +
    /* OperationErrorGenerator.kt:242 */
  401    428   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         429  +
        /* OperationErrorGenerator.kt:243 */
  402    430   
        match self {
  403         -
            Self::Unhandled(e) => &e.meta,
         431  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         432  +
            /* OperationErrorGenerator.kt:243 */
  404    433   
        }
         434  +
        /* OperationErrorGenerator.kt:242 */
  405    435   
    }
         436  +
    /* OperationErrorGenerator.kt:218 */
  406    437   
}
         438  +
/* OperationErrorGenerator.kt:269 */
  407    439   
impl ::std::error::Error for DocumentTypeAsMapValueError {
         440  +
    /* OperationErrorGenerator.kt:270 */
  408    441   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         442  +
        /* OperationErrorGenerator.kt:318 */
  409    443   
        match self {
  410         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         444  +
            /* OperationErrorGenerator.kt:326 */
         445  +
            Self::Unhandled(_inner) => {
         446  +
                /* OperationErrorGenerator.kt:279 */
         447  +
                ::std::option::Option::Some(&*_inner.source)
         448  +
                /* OperationErrorGenerator.kt:326 */
         449  +
            } /* OperationErrorGenerator.kt:318 */
  411    450   
        }
         451  +
        /* OperationErrorGenerator.kt:270 */
  412    452   
    }
         453  +
    /* OperationErrorGenerator.kt:269 */
  413    454   
}
         455  +
/* OperationErrorGenerator.kt:133 */
  414    456   
impl ::std::fmt::Display for DocumentTypeAsMapValueError {
         457  +
    /* OperationErrorGenerator.kt:134 */
  415    458   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         459  +
        /* OperationErrorGenerator.kt:318 */
  416    460   
        match self {
         461  +
            /* OperationErrorGenerator.kt:326 */
  417    462   
            Self::Unhandled(_inner) => {
         463  +
                /* OperationErrorGenerator.kt:139 */
  418    464   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  419    465   
                    write!(f, "unhandled error ({code})")
  420    466   
                } else {
  421    467   
                    f.write_str("unhandled error")
  422    468   
                }
         469  +
                /* OperationErrorGenerator.kt:326 */
         470  +
            } /* OperationErrorGenerator.kt:318 */
  423    471   
        }
         472  +
        /* OperationErrorGenerator.kt:134 */
  424    473   
    }
  425         -
    }
         474  +
    /* OperationErrorGenerator.kt:133 */
  426    475   
}
         476  +
/* OperationErrorGenerator.kt:182 */
  427    477   
impl ::aws_smithy_types::retry::ProvideErrorKind for DocumentTypeAsMapValueError {
         478  +
    /* OperationErrorGenerator.kt:186 */
  428    479   
    fn code(&self) -> ::std::option::Option<&str> {
         480  +
        /* OperationErrorGenerator.kt:187 */
  429    481   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         482  +
        /* OperationErrorGenerator.kt:186 */
  430    483   
    }
         484  +
    /* OperationErrorGenerator.kt:190 */
  431    485   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         486  +
        /* OperationErrorGenerator.kt:197 */
  432    487   
        ::std::option::Option::None
         488  +
        /* OperationErrorGenerator.kt:190 */
  433    489   
    }
         490  +
    /* OperationErrorGenerator.kt:182 */
  434    491   
}
         492  +
/* OperationErrorGenerator.kt:163 */
  435    493   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DocumentTypeAsMapValueError {
         494  +
    /* OperationErrorGenerator.kt:164 */
  436    495   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         496  +
        /* OperationErrorGenerator.kt:318 */
  437    497   
        match self {
  438         -
            Self::Unhandled(_inner) => &_inner.meta,
         498  +
            /* OperationErrorGenerator.kt:326 */
         499  +
            Self::Unhandled(_inner) => {
         500  +
                /* OperationErrorGenerator.kt:168 */
         501  +
                &_inner.meta
         502  +
                /* OperationErrorGenerator.kt:326 */
         503  +
            } /* OperationErrorGenerator.kt:318 */
  439    504   
        }
         505  +
        /* OperationErrorGenerator.kt:164 */
  440    506   
    }
         507  +
    /* OperationErrorGenerator.kt:163 */
  441    508   
}
         509  +
/* OperationErrorGenerator.kt:109 */
  442    510   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DocumentTypeAsMapValueError {
         511  +
    /* OperationErrorGenerator.kt:110 */
  443    512   
    fn create_unhandled_error(
  444    513   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  445    514   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  446    515   
    ) -> Self {
         516  +
        /* OperationErrorGenerator.kt:121 */
  447    517   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  448    518   
            source,
  449    519   
            meta: meta.unwrap_or_default(),
  450    520   
        })
         521  +
        /* OperationErrorGenerator.kt:110 */
  451    522   
    }
         523  +
    /* OperationErrorGenerator.kt:109 */
  452    524   
}
  453    525   
         526  +
/* CodegenDelegator.kt:255 */
  454    527   
pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_output::DocumentTypeAsMapValueOutput;
  455    528   
         529  +
/* CodegenDelegator.kt:255 */
  456    530   
pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_input::DocumentTypeAsMapValueInput;
  457    531   
         532  +
/* RustModule.kt:172 */
  458    533   
mod _document_type_as_map_value_input;
  459    534   
         535  +
/* RustModule.kt:172 */
  460    536   
mod _document_type_as_map_value_output;
  461    537   
  462         -
/// Builders
         538  +
/// /* CodegenDelegator.kt:51 */Builders
  463    539   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type_as_map_value/_document_type_as_map_value_input.rs

@@ -1,1 +62,105 @@
    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 DocumentTypeAsMapValueInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct DocumentTypeAsMapValueInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub doc_valued_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl DocumentTypeAsMapValueInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn doc_valued_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.doc_valued_map.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl DocumentTypeAsMapValueInput {
   16         -
    /// Creates a new builder-style object to manufacture [`DocumentTypeAsMapValueInput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`DocumentTypeAsMapValueInput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`DocumentTypeAsMapValueInput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`DocumentTypeAsMapValueInput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput).
          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 DocumentTypeAsMapValueInputBuilder {
          45  +
    /* BuilderGenerator.kt:275 */
   26     46   
    pub(crate) doc_valued_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>>,
          47  +
    /* BuilderGenerator.kt:345 */
   27     48   
}
          49  +
/* BuilderGenerator.kt:355 */
   28     50   
impl DocumentTypeAsMapValueInputBuilder {
   29         -
    /// Adds a key-value pair to `doc_valued_map`.
          51  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `doc_valued_map`.
          52  +
    /* BuilderGenerator.kt:437 */
   30     53   
    ///
   31         -
    /// To override the contents of this collection use [`set_doc_valued_map`](Self::set_doc_valued_map).
          54  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_doc_valued_map`](Self::set_doc_valued_map).
          55  +
    /* BuilderGenerator.kt:439 */
   32     56   
    ///
          57  +
    /* BuilderGenerator.kt:445 */
   33     58   
    pub fn doc_valued_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self {
          59  +
        /* BuilderGenerator.kt:448 */
   34     60   
        let mut hash_map = self.doc_valued_map.unwrap_or_default();
   35     61   
        hash_map.insert(k.into(), v);
   36     62   
        self.doc_valued_map = ::std::option::Option::Some(hash_map);
   37     63   
        self
          64  +
        /* BuilderGenerator.kt:445 */
   38     65   
    }
          66  +
    /* BuilderGenerator.kt:312 */
   39     67   
    #[allow(missing_docs)] // documentation missing in model
          68  +
                           /* BuilderGenerator.kt:314 */
   40     69   
    pub fn set_doc_valued_map(
   41     70   
        mut self,
   42     71   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>>,
   43     72   
    ) -> Self {
          73  +
        /* BuilderGenerator.kt:315 */
   44     74   
        self.doc_valued_map = input;
   45     75   
        self
          76  +
        /* BuilderGenerator.kt:314 */
   46     77   
    }
          78  +
    /* BuilderGenerator.kt:334 */
   47     79   
    #[allow(missing_docs)] // documentation missing in model
          80  +
                           /* BuilderGenerator.kt:336 */
   48     81   
    pub fn get_doc_valued_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>> {
          82  +
        /* BuilderGenerator.kt:337 */
   49     83   
        &self.doc_valued_map
          84  +
        /* BuilderGenerator.kt:336 */
   50     85   
    }
   51         -
    /// Consumes the builder and constructs a [`DocumentTypeAsMapValueInput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput).
          86  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`DocumentTypeAsMapValueInput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput).
          87  +
    /* BuilderGenerator.kt:253 */
   52     88   
    pub fn build(
   53     89   
        self,
   54     90   
    ) -> ::std::result::Result<
   55     91   
        crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput,
   56     92   
        ::aws_smithy_types::error::operation::BuildError,
   57     93   
    > {
   58         -
        ::std::result::Result::Ok(crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput {
   59         -
            doc_valued_map: self.doc_valued_map,
   60         -
        })
          94  +
        /* BuilderGenerator.kt:254 */
          95  +
        ::std::result::Result::Ok(
          96  +
            /* BuilderGenerator.kt:477 */
          97  +
            crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput {
          98  +
                /* BuilderGenerator.kt:481 */ doc_valued_map: self.doc_valued_map,
          99  +
                /* BuilderGenerator.kt:477 */
         100  +
            }, /* BuilderGenerator.kt:254 */
         101  +
        )
         102  +
        /* BuilderGenerator.kt:253 */
   61    103   
    }
         104  +
    /* BuilderGenerator.kt:355 */
   62    105   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type_as_map_value/_document_type_as_map_value_output.rs

@@ -1,1 +57,97 @@
    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 DocumentTypeAsMapValueOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct DocumentTypeAsMapValueOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub doc_valued_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl DocumentTypeAsMapValueOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn doc_valued_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.doc_valued_map.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl DocumentTypeAsMapValueOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`DocumentTypeAsMapValueOutput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`DocumentTypeAsMapValueOutput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`DocumentTypeAsMapValueOutput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`DocumentTypeAsMapValueOutput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput).
          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 DocumentTypeAsMapValueOutputBuilder {
          45  +
    /* BuilderGenerator.kt:275 */
   26     46   
    pub(crate) doc_valued_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>>,
          47  +
    /* BuilderGenerator.kt:345 */
   27     48   
}
          49  +
/* BuilderGenerator.kt:355 */
   28     50   
impl DocumentTypeAsMapValueOutputBuilder {
   29         -
    /// Adds a key-value pair to `doc_valued_map`.
          51  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `doc_valued_map`.
          52  +
    /* BuilderGenerator.kt:437 */
   30     53   
    ///
   31         -
    /// To override the contents of this collection use [`set_doc_valued_map`](Self::set_doc_valued_map).
          54  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_doc_valued_map`](Self::set_doc_valued_map).
          55  +
    /* BuilderGenerator.kt:439 */
   32     56   
    ///
          57  +
    /* BuilderGenerator.kt:445 */
   33     58   
    pub fn doc_valued_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self {
          59  +
        /* BuilderGenerator.kt:448 */
   34     60   
        let mut hash_map = self.doc_valued_map.unwrap_or_default();
   35     61   
        hash_map.insert(k.into(), v);
   36     62   
        self.doc_valued_map = ::std::option::Option::Some(hash_map);
   37     63   
        self
          64  +
        /* BuilderGenerator.kt:445 */
   38     65   
    }
          66  +
    /* BuilderGenerator.kt:312 */
   39     67   
    #[allow(missing_docs)] // documentation missing in model
          68  +
                           /* BuilderGenerator.kt:314 */
   40     69   
    pub fn set_doc_valued_map(
   41     70   
        mut self,
   42     71   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>>,
   43     72   
    ) -> Self {
          73  +
        /* BuilderGenerator.kt:315 */
   44     74   
        self.doc_valued_map = input;
   45     75   
        self
          76  +
        /* BuilderGenerator.kt:314 */
   46     77   
    }
          78  +
    /* BuilderGenerator.kt:334 */
   47     79   
    #[allow(missing_docs)] // documentation missing in model
          80  +
                           /* BuilderGenerator.kt:336 */
   48     81   
    pub fn get_doc_valued_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>> {
          82  +
        /* BuilderGenerator.kt:337 */
   49     83   
        &self.doc_valued_map
          84  +
        /* BuilderGenerator.kt:336 */
   50     85   
    }
   51         -
    /// Consumes the builder and constructs a [`DocumentTypeAsMapValueOutput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput).
          86  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`DocumentTypeAsMapValueOutput`](crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput).
          87  +
    /* BuilderGenerator.kt:253 */
   52     88   
    pub fn build(self) -> crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput {
          89  +
        /* BuilderGenerator.kt:477 */
   53     90   
        crate::operation::document_type_as_map_value::DocumentTypeAsMapValueOutput {
   54         -
            doc_valued_map: self.doc_valued_map,
          91  +
            /* BuilderGenerator.kt:481 */ doc_valued_map: self.doc_valued_map,
          92  +
            /* BuilderGenerator.kt:477 */
   55     93   
        }
          94  +
        /* BuilderGenerator.kt:253 */
   56     95   
    }
          96  +
    /* BuilderGenerator.kt:355 */
   57     97   
}

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

@@ -1,1 +133,151 @@
    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::document_type_as_map_value::_document_type_as_map_value_output::DocumentTypeAsMapValueOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::document_type_as_map_value::_document_type_as_map_value_input::DocumentTypeAsMapValueInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueInputBuilder {
    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::document_type_as_map_value::DocumentTypeAsMapValueOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.document_type_as_map_value();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `DocumentTypeAsMapValue`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `DocumentTypeAsMapValue`.
   24     27   
///
   25         -
/// This example serializes documents as the value of maps.
          28  +
/// /* FluentBuilderGenerator.kt:130 */This example serializes documents as the value of maps.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct DocumentTypeAsMapValueFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueInputBuilder,
   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::document_type_as_map_value::DocumentTypeAsMapValueOutput,
   35     41   
        crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
   36     42   
    > for DocumentTypeAsMapValueFluentBuilder
   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::document_type_as_map_value::DocumentTypeAsMapValueOutput,
   44     50   
            crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
   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 DocumentTypeAsMapValueFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `DocumentTypeAsMapValueFluentBuilder`.
   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 DocumentTypeAsMapValue as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueInputBuilder {
   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::document_type_as_map_value::DocumentTypeAsMapValueOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
   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::document_type_as_map_value::DocumentTypeAsMapValue::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::document_type_as_map_value::DocumentTypeAsMapValue::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::document_type_as_map_value::DocumentTypeAsMapValueOutput,
   97    107   
        crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
  111         -
    ///
         122  +
    /// /* FluentBuilderGenerator.kt:466 */
  112    123   
    /// Adds a key-value pair to `docValuedMap`.
  113    124   
    ///
  114    125   
    /// To override the contents of this collection use [`set_doc_valued_map`](Self::set_doc_valued_map).
  115    126   
    ///
         127  +
    /* FluentBuilderGenerator.kt:473 */
  116    128   
    #[allow(missing_docs)] // documentation missing in model
         129  +
                           /* FluentBuilderGenerator.kt:475 */
  117    130   
    pub fn doc_valued_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self {
  118    131   
        self.inner = self.inner.doc_valued_map(k.into(), v);
  119    132   
        self
  120    133   
    }
         134  +
    /* FluentBuilderGenerator.kt:498 */
  121    135   
    #[allow(missing_docs)] // documentation missing in model
         136  +
                           /* FluentBuilderGenerator.kt:500 */
  122    137   
    pub fn set_doc_valued_map(
  123    138   
        mut self,
  124    139   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>>,
  125    140   
    ) -> Self {
  126    141   
        self.inner = self.inner.set_doc_valued_map(input);
  127    142   
        self
  128    143   
    }
         144  +
    /* FluentBuilderGenerator.kt:518 */
  129    145   
    #[allow(missing_docs)] // documentation missing in model
         146  +
                           /* FluentBuilderGenerator.kt:520 */
  130    147   
    pub fn get_doc_valued_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>> {
  131    148   
        self.inner.get_doc_valued_map()
  132    149   
    }
         150  +
    /* FluentBuilderGenerator.kt:282 */
  133    151   
}

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

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `DocumentTypeAsPayload`.
           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 DocumentTypeAsPayload;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl DocumentTypeAsPayload {
    7         -
    /// Creates a new `DocumentTypeAsPayload`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `DocumentTypeAsPayload`
          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::document_type_as_payload::DocumentTypeAsPayloadInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::document_type_as_payload::DocumentTypeAsPayloadOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::document_type_as_payload::DocumentTypeAsPayloadError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +271,288 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DocumentTypeAsPayload {
   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("DocumentTypeAsPayload");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            DocumentTypeAsPayloadRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            DocumentTypeAsPayloadResponseDeserializer,
  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   
            "DocumentTypeAsPayload",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DocumentTypeAsPayload")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(DocumentTypeAsPayloadEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::document_type_as_payload::DocumentTypeAsPayloadError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::document_type_as_payload::DocumentTypeAsPayloadError,
  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 DocumentTypeAsPayloadResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DocumentTypeAsPayloadResponseDeserializer {
  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_document_type_as_payload::de_document_type_as_payload_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_document_type_as_payload::de_document_type_as_payload_http_response(status, headers, body)
  153    165   
        };
  154    166   
        crate::protocol_serde::type_erase_result(parse_result)
  155    167   
    }
  156    168   
}
         169  +
/* RequestSerializerGenerator.kt:67 */
  157    170   
#[derive(Debug)]
  158    171   
struct DocumentTypeAsPayloadRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DocumentTypeAsPayloadRequestSerializer {
  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::document_type_as_payload::DocumentTypeAsPayloadInput>()
  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::document_type_as_payload::DocumentTypeAsPayloadInput,
  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, "/DocumentTypeAsPayload").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::document_type_as_payload::DocumentTypeAsPayloadInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
  193    206   
            builder
  194    207   
        };
  195    208   
        let body = ::aws_smithy_types::body::SdkBody::from(
  196    209   
            crate::protocol_serde::shape_document_type_as_payload_input::ser_document_value_http_payload(&input.document_value)?,
  197    210   
        );
  198    211   
        if let Some(content_length) = body.content_length() {
  199    212   
            let content_length = content_length.to_string();
  200    213   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  201    214   
        }
  202    215   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  203    216   
    }
  204    217   
}
         218  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  205    219   
#[derive(Debug)]
  206    220   
struct DocumentTypeAsPayloadEndpointParamsInterceptor;
  207    221   
  208    222   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DocumentTypeAsPayloadEndpointParamsInterceptor {
  209    223   
    fn name(&self) -> &'static str {
  210    224   
        "DocumentTypeAsPayloadEndpointParamsInterceptor"
  211    225   
    }
  212    226   
  213    227   
    fn read_before_execution(
  214    228   
        &self,
  215    229   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  216    230   
            '_,
  217    231   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  218    232   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  219    233   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  220    234   
        >,
  221    235   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  222    236   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  223    237   
        let _input = context
  224    238   
            .input()
  225    239   
            .downcast_ref::<DocumentTypeAsPayloadInput>()
  226    240   
            .ok_or("failed to downcast to DocumentTypeAsPayloadInput")?;
  227    241   
  228    242   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  229    243   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  230    244   
        })?;
  231    245   
        cfg.interceptor_state()
  232    246   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  233    247   
        ::std::result::Result::Ok(())
  234    248   
    }
  235    249   
}
  236    250   
  237    251   
// The get_* functions below are generated from JMESPath expressions in the
  238    252   
// operationContextParams trait. They target the operation's input shape.
  239    253   
         254  +
/* RustType.kt:516 */
  240    255   
#[allow(unreachable_code, unused_variables)]
         256  +
/* RustType.kt:516 */
  241    257   
#[cfg(test)]
         258  +
/* ProtocolTestGenerator.kt:98 */
  242    259   
mod document_type_as_payload_test {
  243    260   
  244    261   
    /// Serializes a document as the target of the httpPayload trait.
  245    262   
    /// Test ID: DocumentTypeAsPayloadInput
  246    263   
    #[::tokio::test]
  247    264   
    #[::tracing_test::traced_test]
  248    265   
    async fn document_type_as_payload_input_request() {
  249    266   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  250    267   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  251    268   
@@ -383,400 +512,588 @@
  403    420   
        let parsed = parsed
  404    421   
            .expect("should be successful response")
  405    422   
            .downcast::<crate::operation::document_type_as_payload::DocumentTypeAsPayloadOutput>()
  406    423   
            .unwrap();
  407    424   
        ::pretty_assertions::assert_eq!(
  408    425   
            parsed.document_value,
  409    426   
            expected_output.document_value,
  410    427   
            "Unexpected value for `document_value`"
  411    428   
        );
  412    429   
    }
         430  +
         431  +
    /* ProtocolTestGenerator.kt:98 */
  413    432   
}
  414    433   
         434  +
/* OperationErrorGenerator.kt:79 */
  415    435   
/// Error type for the `DocumentTypeAsPayloadError` operation.
         436  +
/* RustType.kt:516 */
  416    437   
#[non_exhaustive]
         438  +
/* RustType.kt:516 */
  417    439   
#[derive(::std::fmt::Debug)]
  418         -
pub enum DocumentTypeAsPayloadError {
         440  +
pub /* OperationErrorGenerator.kt:81 */ enum DocumentTypeAsPayloadError {
         441  +
    /* OperationErrorGenerator.kt:88 */
  419    442   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  420    443   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  421    444   
    variable wildcard pattern and check `.code()`:
  422    445   
     \
  423    446   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  424    447   
     \
  425    448   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DocumentTypeAsPayloadError) for what information is available for the error.")]
  426    449   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         450  +
    /* OperationErrorGenerator.kt:81 */
  427    451   
}
         452  +
/* OperationErrorGenerator.kt:218 */
  428    453   
impl DocumentTypeAsPayloadError {
         454  +
    /* OperationErrorGenerator.kt:219 */
  429    455   
    /// Creates the `DocumentTypeAsPayloadError::Unhandled` variant from any error type.
  430    456   
    pub fn unhandled(
  431    457   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  432    458   
    ) -> Self {
  433    459   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  434    460   
            source: err.into(),
  435    461   
            meta: ::std::default::Default::default(),
  436    462   
        })
  437    463   
    }
  438    464   
  439    465   
    /// Creates the `DocumentTypeAsPayloadError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  440    466   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  441    467   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  442    468   
            source: err.clone().into(),
  443    469   
            meta: err,
  444    470   
        })
  445    471   
    }
  446         -
    ///
         472  +
    /// /* OperationErrorGenerator.kt:236 */
  447    473   
    /// Returns error metadata, which includes the error code, message,
  448    474   
    /// request ID, and potentially additional information.
  449    475   
    ///
         476  +
    /* OperationErrorGenerator.kt:242 */
  450    477   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         478  +
        /* OperationErrorGenerator.kt:243 */
  451    479   
        match self {
  452         -
            Self::Unhandled(e) => &e.meta,
         480  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         481  +
            /* OperationErrorGenerator.kt:243 */
  453    482   
        }
         483  +
        /* OperationErrorGenerator.kt:242 */
  454    484   
    }
         485  +
    /* OperationErrorGenerator.kt:218 */
  455    486   
}
         487  +
/* OperationErrorGenerator.kt:269 */
  456    488   
impl ::std::error::Error for DocumentTypeAsPayloadError {
         489  +
    /* OperationErrorGenerator.kt:270 */
  457    490   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         491  +
        /* OperationErrorGenerator.kt:318 */
  458    492   
        match self {
  459         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         493  +
            /* OperationErrorGenerator.kt:326 */
         494  +
            Self::Unhandled(_inner) => {
         495  +
                /* OperationErrorGenerator.kt:279 */
         496  +
                ::std::option::Option::Some(&*_inner.source)
         497  +
                /* OperationErrorGenerator.kt:326 */
         498  +
            } /* OperationErrorGenerator.kt:318 */
  460    499   
        }
         500  +
        /* OperationErrorGenerator.kt:270 */
  461    501   
    }
         502  +
    /* OperationErrorGenerator.kt:269 */
  462    503   
}
         504  +
/* OperationErrorGenerator.kt:133 */
  463    505   
impl ::std::fmt::Display for DocumentTypeAsPayloadError {
         506  +
    /* OperationErrorGenerator.kt:134 */
  464    507   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         508  +
        /* OperationErrorGenerator.kt:318 */
  465    509   
        match self {
         510  +
            /* OperationErrorGenerator.kt:326 */
  466    511   
            Self::Unhandled(_inner) => {
         512  +
                /* OperationErrorGenerator.kt:139 */
  467    513   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  468    514   
                    write!(f, "unhandled error ({code})")
  469    515   
                } else {
  470    516   
                    f.write_str("unhandled error")
  471    517   
                }
         518  +
                /* OperationErrorGenerator.kt:326 */
         519  +
            } /* OperationErrorGenerator.kt:318 */
  472    520   
        }
         521  +
        /* OperationErrorGenerator.kt:134 */
  473    522   
    }
  474         -
    }
         523  +
    /* OperationErrorGenerator.kt:133 */
  475    524   
}
         525  +
/* OperationErrorGenerator.kt:182 */
  476    526   
impl ::aws_smithy_types::retry::ProvideErrorKind for DocumentTypeAsPayloadError {
         527  +
    /* OperationErrorGenerator.kt:186 */
  477    528   
    fn code(&self) -> ::std::option::Option<&str> {
         529  +
        /* OperationErrorGenerator.kt:187 */
  478    530   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         531  +
        /* OperationErrorGenerator.kt:186 */
  479    532   
    }
         533  +
    /* OperationErrorGenerator.kt:190 */
  480    534   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         535  +
        /* OperationErrorGenerator.kt:197 */
  481    536   
        ::std::option::Option::None
         537  +
        /* OperationErrorGenerator.kt:190 */
  482    538   
    }
         539  +
    /* OperationErrorGenerator.kt:182 */
  483    540   
}
         541  +
/* OperationErrorGenerator.kt:163 */
  484    542   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DocumentTypeAsPayloadError {
         543  +
    /* OperationErrorGenerator.kt:164 */
  485    544   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         545  +
        /* OperationErrorGenerator.kt:318 */
  486    546   
        match self {
  487         -
            Self::Unhandled(_inner) => &_inner.meta,
         547  +
            /* OperationErrorGenerator.kt:326 */
         548  +
            Self::Unhandled(_inner) => {
         549  +
                /* OperationErrorGenerator.kt:168 */
         550  +
                &_inner.meta
         551  +
                /* OperationErrorGenerator.kt:326 */
         552  +
            } /* OperationErrorGenerator.kt:318 */
  488    553   
        }
         554  +
        /* OperationErrorGenerator.kt:164 */
  489    555   
    }
         556  +
    /* OperationErrorGenerator.kt:163 */
  490    557   
}
         558  +
/* OperationErrorGenerator.kt:109 */
  491    559   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DocumentTypeAsPayloadError {
         560  +
    /* OperationErrorGenerator.kt:110 */
  492    561   
    fn create_unhandled_error(
  493    562   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  494    563   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  495    564   
    ) -> Self {
         565  +
        /* OperationErrorGenerator.kt:121 */
  496    566   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  497    567   
            source,
  498    568   
            meta: meta.unwrap_or_default(),
  499    569   
        })
         570  +
        /* OperationErrorGenerator.kt:110 */
  500    571   
    }
         572  +
    /* OperationErrorGenerator.kt:109 */
  501    573   
}
  502    574   
         575  +
/* CodegenDelegator.kt:255 */
  503    576   
pub use crate::operation::document_type_as_payload::_document_type_as_payload_output::DocumentTypeAsPayloadOutput;
  504    577   
         578  +
/* CodegenDelegator.kt:255 */
  505    579   
pub use crate::operation::document_type_as_payload::_document_type_as_payload_input::DocumentTypeAsPayloadInput;
  506    580   
         581  +
/* RustModule.kt:172 */
  507    582   
mod _document_type_as_payload_input;
  508    583   
         584  +
/* RustModule.kt:172 */
  509    585   
mod _document_type_as_payload_output;
  510    586   
  511         -
/// Builders
         587  +
/// /* CodegenDelegator.kt:51 */Builders
  512    588   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type_as_payload/_document_type_as_payload_input.rs

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type_as_payload/_document_type_as_payload_output.rs

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

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/empty_input_and_empty_output.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 `EmptyInputAndEmptyOutput`.
           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 EmptyInputAndEmptyOutput;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl EmptyInputAndEmptyOutput {
    7         -
    /// Creates a new `EmptyInputAndEmptyOutput`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `EmptyInputAndEmptyOutput`
          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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -63,72 +265,282 @@
   83     92   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   84     93   
            }
   85     94   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   86     95   
                config_override,
   87     96   
                client_config.config.clone(),
   88     97   
                &client_config.runtime_components,
   89     98   
            ));
   90     99   
        }
   91    100   
        runtime_plugins
   92    101   
    }
         102  +
    /* OperationGenerator.kt:85 */
   93    103   
}
         104  +
/* OperationRuntimePluginGenerator.kt:55 */
   94    105   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for EmptyInputAndEmptyOutput {
   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("EmptyInputAndEmptyOutput");
   97    108   
   98    109   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   99    110   
            EmptyInputAndEmptyOutputRequestSerializer,
  100    111   
        ));
  101    112   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
  102    113   
            EmptyInputAndEmptyOutputResponseDeserializer,
  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   
            "EmptyInputAndEmptyOutput",
  111    122   
            "Rest Json Protocol",
  112    123   
        ));
  113    124   
  114    125   
        ::std::option::Option::Some(cfg.freeze())
  115    126   
    }
  116    127   
  117    128   
    fn runtime_components(
  118    129   
        &self,
  119    130   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  120    131   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  121    132   
        #[allow(unused_mut)]
  122    133   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("EmptyInputAndEmptyOutput")
  123    134   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  124    135   
            .with_interceptor(EmptyInputAndEmptyOutputEndpointParamsInterceptor)
  125    136   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  126    137   
                crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
  127    138   
            >::new())
  128    139   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  129    140   
                crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
  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 EmptyInputAndEmptyOutputResponseDeserializer;
  138    150   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EmptyInputAndEmptyOutputResponseDeserializer {
  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_empty_input_and_empty_output::de_empty_input_and_empty_output_http_error(status, headers, body)
  151    163   
        } else {
  152    164   
            crate::protocol_serde::shape_empty_input_and_empty_output::de_empty_input_and_empty_output_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 EmptyInputAndEmptyOutputRequestSerializer;
  159    172   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EmptyInputAndEmptyOutputRequestSerializer {
  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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput>()
  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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
  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, "/EmptyInputAndEmptyOutput").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::empty_input_and_empty_output::EmptyInputAndEmptyOutputInput,
  185    198   
                builder: ::http::request::Builder,
  186    199   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    200   
                let mut uri = ::std::string::String::new();
  188    201   
                uri_base(input, &mut uri)?;
  189    202   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    203   
            }
  191    204   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct EmptyInputAndEmptyOutputEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EmptyInputAndEmptyOutputEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "EmptyInputAndEmptyOutputEndpointParamsInterceptor"
  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::<EmptyInputAndEmptyOutputInput>()
  220    234   
            .ok_or("failed to downcast to EmptyInputAndEmptyOutputInput")?;
  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 empty_input_and_empty_output_test {
  237    254   
  238    255   
    /// Clients should not serialize a JSON payload when no parameters
  239    256   
    /// are given that are sent in the body. A service will tolerate
  240    257   
    /// clients that omit a payload or that send a JSON object.
  241    258   
    /// Test ID: RestJsonEmptyInputAndEmptyOutput
  242    259   
    #[::tokio::test]
  243    260   
    #[::tracing_test::traced_test]
  244    261   
    async fn rest_json_empty_input_and_empty_output_request() {
  245    262   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
@@ -309,326 +438,514 @@
  329    346   
                    ::aws_smithy_protocol_test::MediaType::from("unknown"),
  330    347   
                )))
  331    348   
            });
  332    349   
            de.deserialize_nonstreaming(&http_response)
  333    350   
        });
  334    351   
        let parsed = parsed
  335    352   
            .expect("should be successful response")
  336    353   
            .downcast::<crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput>()
  337    354   
            .unwrap();
  338    355   
    }
         356  +
         357  +
    /* ProtocolTestGenerator.kt:98 */
  339    358   
}
  340    359   
         360  +
/* OperationErrorGenerator.kt:79 */
  341    361   
/// Error type for the `EmptyInputAndEmptyOutputError` operation.
         362  +
/* RustType.kt:516 */
  342    363   
#[non_exhaustive]
         364  +
/* RustType.kt:516 */
  343    365   
#[derive(::std::fmt::Debug)]
  344         -
pub enum EmptyInputAndEmptyOutputError {
         366  +
pub /* OperationErrorGenerator.kt:81 */ enum EmptyInputAndEmptyOutputError {
         367  +
    /* OperationErrorGenerator.kt:88 */
  345    368   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  346    369   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  347    370   
    variable wildcard pattern and check `.code()`:
  348    371   
     \
  349    372   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  350    373   
     \
  351    374   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EmptyInputAndEmptyOutputError) for what information is available for the error.")]
  352    375   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         376  +
    /* OperationErrorGenerator.kt:81 */
  353    377   
}
         378  +
/* OperationErrorGenerator.kt:218 */
  354    379   
impl EmptyInputAndEmptyOutputError {
         380  +
    /* OperationErrorGenerator.kt:219 */
  355    381   
    /// Creates the `EmptyInputAndEmptyOutputError::Unhandled` variant from any error type.
  356    382   
    pub fn unhandled(
  357    383   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  358    384   
    ) -> Self {
  359    385   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  360    386   
            source: err.into(),
  361    387   
            meta: ::std::default::Default::default(),
  362    388   
        })
  363    389   
    }
  364    390   
  365    391   
    /// Creates the `EmptyInputAndEmptyOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  366    392   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  367    393   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  368    394   
            source: err.clone().into(),
  369    395   
            meta: err,
  370    396   
        })
  371    397   
    }
  372         -
    ///
         398  +
    /// /* OperationErrorGenerator.kt:236 */
  373    399   
    /// Returns error metadata, which includes the error code, message,
  374    400   
    /// request ID, and potentially additional information.
  375    401   
    ///
         402  +
    /* OperationErrorGenerator.kt:242 */
  376    403   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         404  +
        /* OperationErrorGenerator.kt:243 */
  377    405   
        match self {
  378         -
            Self::Unhandled(e) => &e.meta,
         406  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         407  +
            /* OperationErrorGenerator.kt:243 */
  379    408   
        }
         409  +
        /* OperationErrorGenerator.kt:242 */
  380    410   
    }
         411  +
    /* OperationErrorGenerator.kt:218 */
  381    412   
}
         413  +
/* OperationErrorGenerator.kt:269 */
  382    414   
impl ::std::error::Error for EmptyInputAndEmptyOutputError {
         415  +
    /* OperationErrorGenerator.kt:270 */
  383    416   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         417  +
        /* OperationErrorGenerator.kt:318 */
  384    418   
        match self {
  385         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         419  +
            /* OperationErrorGenerator.kt:326 */
         420  +
            Self::Unhandled(_inner) => {
         421  +
                /* OperationErrorGenerator.kt:279 */
         422  +
                ::std::option::Option::Some(&*_inner.source)
         423  +
                /* OperationErrorGenerator.kt:326 */
         424  +
            } /* OperationErrorGenerator.kt:318 */
  386    425   
        }
         426  +
        /* OperationErrorGenerator.kt:270 */
  387    427   
    }
         428  +
    /* OperationErrorGenerator.kt:269 */
  388    429   
}
         430  +
/* OperationErrorGenerator.kt:133 */
  389    431   
impl ::std::fmt::Display for EmptyInputAndEmptyOutputError {
         432  +
    /* OperationErrorGenerator.kt:134 */
  390    433   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         434  +
        /* OperationErrorGenerator.kt:318 */
  391    435   
        match self {
         436  +
            /* OperationErrorGenerator.kt:326 */
  392    437   
            Self::Unhandled(_inner) => {
         438  +
                /* OperationErrorGenerator.kt:139 */
  393    439   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  394    440   
                    write!(f, "unhandled error ({code})")
  395    441   
                } else {
  396    442   
                    f.write_str("unhandled error")
  397    443   
                }
         444  +
                /* OperationErrorGenerator.kt:326 */
         445  +
            } /* OperationErrorGenerator.kt:318 */
  398    446   
        }
         447  +
        /* OperationErrorGenerator.kt:134 */
  399    448   
    }
  400         -
    }
         449  +
    /* OperationErrorGenerator.kt:133 */
  401    450   
}
         451  +
/* OperationErrorGenerator.kt:182 */
  402    452   
impl ::aws_smithy_types::retry::ProvideErrorKind for EmptyInputAndEmptyOutputError {
         453  +
    /* OperationErrorGenerator.kt:186 */
  403    454   
    fn code(&self) -> ::std::option::Option<&str> {
         455  +
        /* OperationErrorGenerator.kt:187 */
  404    456   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         457  +
        /* OperationErrorGenerator.kt:186 */
  405    458   
    }
         459  +
    /* OperationErrorGenerator.kt:190 */
  406    460   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         461  +
        /* OperationErrorGenerator.kt:197 */
  407    462   
        ::std::option::Option::None
         463  +
        /* OperationErrorGenerator.kt:190 */
  408    464   
    }
         465  +
    /* OperationErrorGenerator.kt:182 */
  409    466   
}
         467  +
/* OperationErrorGenerator.kt:163 */
  410    468   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EmptyInputAndEmptyOutputError {
         469  +
    /* OperationErrorGenerator.kt:164 */
  411    470   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         471  +
        /* OperationErrorGenerator.kt:318 */
  412    472   
        match self {
  413         -
            Self::Unhandled(_inner) => &_inner.meta,
         473  +
            /* OperationErrorGenerator.kt:326 */
         474  +
            Self::Unhandled(_inner) => {
         475  +
                /* OperationErrorGenerator.kt:168 */
         476  +
                &_inner.meta
         477  +
                /* OperationErrorGenerator.kt:326 */
         478  +
            } /* OperationErrorGenerator.kt:318 */
  414    479   
        }
         480  +
        /* OperationErrorGenerator.kt:164 */
  415    481   
    }
         482  +
    /* OperationErrorGenerator.kt:163 */
  416    483   
}
         484  +
/* OperationErrorGenerator.kt:109 */
  417    485   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EmptyInputAndEmptyOutputError {
         486  +
    /* OperationErrorGenerator.kt:110 */
  418    487   
    fn create_unhandled_error(
  419    488   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  420    489   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  421    490   
    ) -> Self {
         491  +
        /* OperationErrorGenerator.kt:121 */
  422    492   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  423    493   
            source,
  424    494   
            meta: meta.unwrap_or_default(),
  425    495   
        })
         496  +
        /* OperationErrorGenerator.kt:110 */
  426    497   
    }
         498  +
    /* OperationErrorGenerator.kt:109 */
  427    499   
}
  428    500   
         501  +
/* CodegenDelegator.kt:255 */
  429    502   
pub use crate::operation::empty_input_and_empty_output::_empty_input_and_empty_output_output::EmptyInputAndEmptyOutputOutput;
  430    503   
         504  +
/* CodegenDelegator.kt:255 */
  431    505   
pub use crate::operation::empty_input_and_empty_output::_empty_input_and_empty_output_input::EmptyInputAndEmptyOutputInput;
  432    506   
         507  +
/* RustModule.kt:172 */
  433    508   
mod _empty_input_and_empty_output_input;
  434    509   
         510  +
/* RustModule.kt:172 */
  435    511   
mod _empty_input_and_empty_output_output;
  436    512   
  437         -
/// Builders
         513  +
/// /* CodegenDelegator.kt:51 */Builders
  438    514   
pub mod builders;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/empty_input_and_empty_output/_empty_input_and_empty_output_input.rs

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

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

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/empty_input_and_empty_output/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::empty_input_and_empty_output::_empty_input_and_empty_output_output::EmptyInputAndEmptyOutputOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::empty_input_and_empty_output::_empty_input_and_empty_output_input::EmptyInputAndEmptyOutputInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::empty_input_and_empty_output::builders::EmptyInputAndEmptyOutputInputBuilder {
    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::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.empty_input_and_empty_output();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `EmptyInputAndEmptyOutput`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `EmptyInputAndEmptyOutput`.
   24     27   
///
   25         -
/// The example tests how requests and responses are serialized when there's no request or response payload because the operation has an empty input and empty output structure that reuses the same shape. While this should be rare, code generators must support this.
          28  +
/// /* FluentBuilderGenerator.kt:130 */The example tests how requests and responses are serialized when there's no request or response payload because the operation has an empty input and empty output structure that reuses the same shape. While this should be rare, code generators must support this.
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct EmptyInputAndEmptyOutputFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::empty_input_and_empty_output::builders::EmptyInputAndEmptyOutputInputBuilder,
   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::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
   35     41   
        crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   36     42   
    > for EmptyInputAndEmptyOutputFluentBuilder
   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::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
   44     50   
            crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   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 EmptyInputAndEmptyOutputFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `EmptyInputAndEmptyOutputFluentBuilder`.
   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 EmptyInputAndEmptyOutput as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::empty_input_and_empty_output::builders::EmptyInputAndEmptyOutputInputBuilder {
   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::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   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::empty_input_and_empty_output::EmptyInputAndEmptyOutput::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::empty_input_and_empty_output::EmptyInputAndEmptyOutput::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::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
   97    107   
        crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   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   
}