Client Test

Client Test

rev. 0b749be6d000fdc7ef59d1bc26f1dce00358d95c (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/client.rs

@@ -77,77 +148,150 @@
   97     97   
    fn validate_config(handle: &Handle) -> Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
   98     98   
        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
   99     99   
        handle
  100    100   
            .runtime_plugins
  101    101   
            .apply_client_configuration(&mut cfg)?
  102    102   
            .validate_base_client_config(&cfg)?;
  103    103   
        Ok(())
  104    104   
    }
  105    105   
}
  106    106   
         107  +
mod content_type_parameters;
         108  +
  107    109   
/// Operation customization and supporting types.
  108    110   
///
  109    111   
/// The underlying HTTP requests made during an operation can be customized
  110    112   
/// by calling the `customize()` method on the builder returned from a client
  111    113   
/// operation call. For example, this can be used to add an additional HTTP header:
  112    114   
///
  113    115   
/// ```ignore
  114    116   
/// # async fn wrapper() -> ::std::result::Result<(), json_rpc10::Error> {
  115    117   
/// # let client: json_rpc10::Client = unimplemented!();
  116    118   
/// use ::http::header::{HeaderName, HeaderValue};
  117    119   
///
  118         -
/// let result = client.empty_input_and_empty_output()
         120  +
/// let result = client.content_type_parameters()
  119    121   
///     .customize()
  120    122   
///     .mutate_request(|req| {
  121    123   
///         // Add `x-example-header` with value
  122    124   
///         req.headers_mut()
  123    125   
///             .insert(
  124    126   
///                 HeaderName::from_static("x-example-header"),
  125    127   
///                 HeaderValue::from_static("1"),
  126    128   
///             );
  127    129   
///     })
  128    130   
///     .send()

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/client/content_type_parameters.rs

@@ -0,1 +0,12 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
impl super::Client {
           3  +
    /// Constructs a fluent builder for the [`ContentTypeParameters`](crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder) operation.
           4  +
    ///
           5  +
    /// - The fluent builder is configurable:
           6  +
    ///   - [`value(i32)`](crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder::value) / [`set_value(Option<i32>)`](crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder::set_value):<br>required: **false**<br>(undocumented)<br>
           7  +
    /// - On success, responds with [`ContentTypeParametersOutput`](crate::operation::content_type_parameters::ContentTypeParametersOutput)
           8  +
    /// - On failure, responds with [`SdkError<ContentTypeParametersError>`](crate::operation::content_type_parameters::ContentTypeParametersError)
           9  +
    pub fn content_type_parameters(&self) -> crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder {
          10  +
        crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder::new(self.handle.clone())
          11  +
    }
          12  +
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/error_meta.rs

@@ -25,25 +84,107 @@
   45     45   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
   46     46   
    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
   47     47   
        match self {
   48     48   
            Self::ComplexError(inner) => inner.meta(),
   49     49   
            Self::FooError(inner) => inner.meta(),
   50     50   
            Self::InvalidGreeting(inner) => inner.meta(),
   51     51   
            Self::Unhandled(inner) => &inner.meta,
   52     52   
        }
   53     53   
    }
   54     54   
}
          55  +
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::content_type_parameters::ContentTypeParametersError, R>> for Error
          56  +
where
          57  +
    R: Send + Sync + std::fmt::Debug + 'static,
          58  +
{
          59  +
    fn from(
          60  +
        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::content_type_parameters::ContentTypeParametersError, R>,
          61  +
    ) -> Self {
          62  +
        match err {
          63  +
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
          64  +
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
          65  +
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
          66  +
                source: err.into(),
          67  +
            }),
          68  +
        }
          69  +
    }
          70  +
}
          71  +
impl From<crate::operation::content_type_parameters::ContentTypeParametersError> for Error {
          72  +
    fn from(err: crate::operation::content_type_parameters::ContentTypeParametersError) -> Self {
          73  +
        match err {
          74  +
            crate::operation::content_type_parameters::ContentTypeParametersError::Unhandled(inner) => Error::Unhandled(inner),
          75  +
        }
          76  +
    }
          77  +
}
   55     78   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError, R>>
   56     79   
    for Error
   57     80   
where
   58     81   
    R: Send + Sync + std::fmt::Debug + 'static,
   59     82   
{
   60     83   
    fn from(
   61     84   
        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError, R>,
   62     85   
    ) -> Self {
   63     86   
        match err {
   64     87   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),

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

@@ -1,1 +32,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/// Types for the `ContentTypeParameters` operation.
           4  +
pub mod content_type_parameters;
           5  +
    3      6   
/// Types for the `EmptyInputAndEmptyOutput` operation.
    4      7   
pub mod empty_input_and_empty_output;
    5      8   
    6      9   
/// Types for the `EndpointOperation` operation.
    7     10   
pub mod endpoint_operation;
    8     11   
    9     12   
/// Types for the `EndpointWithHostLabelOperation` operation.
   10     13   
pub mod endpoint_with_host_label_operation;
   11     14   
   12     15   
/// Types for the `GreetingWithErrors` operation.

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/content_type_parameters.rs

Renamed from tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/http_enum_payload2.rs

@@ -1,1 +449,324 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Orchestration and serialization glue logic for `HttpEnumPayload2`.
           2  +
/// Orchestration and serialization glue logic for `ContentTypeParameters`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5         -
pub struct HttpEnumPayload2;
    6         -
impl HttpEnumPayload2 {
    7         -
    /// Creates a new `HttpEnumPayload2`
           5  +
pub struct ContentTypeParameters;
           6  +
impl ContentTypeParameters {
           7  +
    /// Creates a new `ContentTypeParameters`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
   11     11   
    pub(crate) async fn orchestrate(
   12     12   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13         -
        input: crate::operation::http_enum_payload2::HttpEnumPayload2Input,
          13  +
        input: crate::operation::content_type_parameters::ContentTypeParametersInput,
   14     14   
    ) -> ::std::result::Result<
   15         -
        crate::operation::http_enum_payload2::HttpEnumPayload2Output,
          15  +
        crate::operation::content_type_parameters::ContentTypeParametersOutput,
   16     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17         -
            crate::operation::http_enum_payload2::HttpEnumPayload2Error,
          17  +
            crate::operation::content_type_parameters::ContentTypeParametersError,
   18     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     19   
        >,
   20     20   
    > {
   21     21   
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
   22     22   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
   23     23   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   24     24   
        >| {
   25     25   
            err.map_service_error(|err| {
   26         -
                err.downcast::<crate::operation::http_enum_payload2::HttpEnumPayload2Error>()
          26  +
                err.downcast::<crate::operation::content_type_parameters::ContentTypeParametersError>()
   27     27   
                    .expect("correct error type")
   28     28   
            })
   29     29   
        };
   30     30   
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
   31     31   
            .await
   32     32   
            .map_err(map_err)?;
   33     33   
        let output = context.finalize().map_err(map_err)?;
   34     34   
        ::std::result::Result::Ok(
   35     35   
            output
   36         -
                .downcast::<crate::operation::http_enum_payload2::HttpEnumPayload2Output>()
          36  +
                .downcast::<crate::operation::content_type_parameters::ContentTypeParametersOutput>()
   37     37   
                .expect("correct output type"),
   38     38   
        )
   39     39   
    }
   40     40   
   41     41   
    pub(crate) async fn orchestrate_with_stop_point(
   42     42   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   43         -
        input: crate::operation::http_enum_payload2::HttpEnumPayload2Input,
          43  +
        input: crate::operation::content_type_parameters::ContentTypeParametersInput,
   44     44   
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
   45     45   
    ) -> ::std::result::Result<
   46     46   
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
   47     47   
        ::aws_smithy_runtime_api::client::result::SdkError<
   48     48   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
   49     49   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   50     50   
        >,
   51     51   
    > {
   52     52   
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
   53         -
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("restjsonprotocol", "HttpEnumPayload2", input, runtime_plugins, stop_point)
          53  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("jsonrpc10", "ContentTypeParameters", input, runtime_plugins, stop_point)
   54     54   
            .await
   55     55   
    }
   56     56   
   57     57   
    pub(crate) fn operation_runtime_plugins(
   58     58   
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   59     59   
        client_config: &crate::config::Config,
   60     60   
        config_override: ::std::option::Option<crate::config::Builder>,
   61     61   
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
   62     62   
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
   63     63   
        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
   64     64   
            ::aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID,
   65     65   
        ]));
   66     66   
        if let ::std::option::Option::Some(config_override) = config_override {
   67     67   
            for plugin in config_override.runtime_plugins.iter().cloned() {
   68     68   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   69     69   
            }
   70     70   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   71     71   
                config_override,
   72     72   
                client_config.config.clone(),
   73     73   
                &client_config.runtime_components,
   74     74   
            ));
   75     75   
        }
   76     76   
        runtime_plugins
   77     77   
    }
   78     78   
}
   79         -
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for HttpEnumPayload2 {
          79  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ContentTypeParameters {
   80     80   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   81         -
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("HttpEnumPayload2");
          81  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ContentTypeParameters");
   82     82   
   83     83   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   84         -
            HttpEnumPayload2RequestSerializer,
          84  +
            ContentTypeParametersRequestSerializer,
   85     85   
        ));
   86     86   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   87         -
            HttpEnumPayload2ResponseDeserializer,
          87  +
            ContentTypeParametersResponseDeserializer,
   88     88   
        ));
   89     89   
   90     90   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
   91     91   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
   92     92   
        ));
   93     93   
   94     94   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
   95         -
            "HttpEnumPayload2",
   96         -
            "restjsonprotocol",
          95  +
            "ContentTypeParameters",
          96  +
            "jsonrpc10",
   97     97   
        ));
   98     98   
   99     99   
        ::std::option::Option::Some(cfg.freeze())
  100    100   
    }
  101    101   
  102    102   
    fn runtime_components(
  103    103   
        &self,
  104    104   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  105    105   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  106    106   
        #[allow(unused_mut)]
  107         -
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("HttpEnumPayload2")
         107  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ContentTypeParameters")
  108    108   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  109         -
            .with_interceptor(HttpEnumPayload2EndpointParamsInterceptor)
         109  +
            .with_interceptor(ContentTypeParametersEndpointParamsInterceptor)
  110    110   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  111         -
                crate::operation::http_enum_payload2::HttpEnumPayload2Error,
         111  +
                crate::operation::content_type_parameters::ContentTypeParametersError,
  112    112   
            >::new())
  113    113   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  114         -
                crate::operation::http_enum_payload2::HttpEnumPayload2Error,
         114  +
                crate::operation::content_type_parameters::ContentTypeParametersError,
  115    115   
            >::new());
  116    116   
  117    117   
        ::std::borrow::Cow::Owned(rcb)
  118    118   
    }
  119    119   
}
  120    120   
  121    121   
#[derive(Debug)]
  122         -
struct HttpEnumPayload2ResponseDeserializer;
  123         -
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpEnumPayload2ResponseDeserializer {
         122  +
struct ContentTypeParametersResponseDeserializer;
         123  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ContentTypeParametersResponseDeserializer {
  124    124   
    fn deserialize_nonstreaming(
  125    125   
        &self,
  126    126   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  127    127   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  128    128   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  129    129   
        let headers = response.headers();
  130    130   
        let body = response.body().bytes().expect("body loaded");
  131    131   
        #[allow(unused_mut)]
  132    132   
        let mut force_error = false;
  133    133   
  134    134   
        let parse_result = if !success && status != 200 || force_error {
  135         -
            crate::protocol_serde::shape_http_enum_payload2::de_http_enum_payload2_http_error(status, headers, body)
         135  +
            crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_error(status, headers, body)
  136    136   
        } else {
  137         -
            crate::protocol_serde::shape_http_enum_payload2::de_http_enum_payload2_http_response(status, headers, body)
         137  +
            crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_response(status, headers, body)
  138    138   
        };
  139    139   
        crate::protocol_serde::type_erase_result(parse_result)
  140    140   
    }
  141    141   
}
  142    142   
#[derive(Debug)]
  143         -
struct HttpEnumPayload2RequestSerializer;
  144         -
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpEnumPayload2RequestSerializer {
         143  +
struct ContentTypeParametersRequestSerializer;
         144  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ContentTypeParametersRequestSerializer {
  145    145   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  146    146   
    fn serialize_input(
  147    147   
        &self,
  148    148   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  149    149   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  150    150   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  151    151   
        let input = input
  152         -
            .downcast::<crate::operation::http_enum_payload2::HttpEnumPayload2Input>()
         152  +
            .downcast::<crate::operation::content_type_parameters::ContentTypeParametersInput>()
  153    153   
            .expect("correct type");
  154    154   
        let _header_serialization_settings = _cfg
  155    155   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  156    156   
            .cloned()
  157    157   
            .unwrap_or_default();
  158    158   
        let mut request_builder = {
  159    159   
            fn uri_base(
  160         -
                _input: &crate::operation::http_enum_payload2::HttpEnumPayload2Input,
         160  +
                _input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
  161    161   
                output: &mut ::std::string::String,
  162    162   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  163    163   
                use ::std::fmt::Write as _;
  164         -
                ::std::write!(output, "/EnumPayload2").expect("formatting should succeed");
         164  +
                ::std::write!(output, "/").expect("formatting should succeed");
  165    165   
                ::std::result::Result::Ok(())
  166    166   
            }
  167    167   
            #[allow(clippy::unnecessary_wraps)]
  168    168   
            fn update_http_builder(
  169         -
                input: &crate::operation::http_enum_payload2::HttpEnumPayload2Input,
         169  +
                input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
  170    170   
                builder: ::http::request::Builder,
  171    171   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  172    172   
                let mut uri = ::std::string::String::new();
  173    173   
                uri_base(input, &mut uri)?;
  174    174   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  175    175   
            }
  176    176   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  177         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "text/plain");
         177  +
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
         178  +
            builder = _header_serialization_settings.set_default_header(
         179  +
                builder,
         180  +
                ::http::header::HeaderName::from_static("x-amz-target"),
         181  +
                "JsonRpc10.ContentTypeParameters",
         182  +
            );
  178    183   
            builder
  179    184   
        };
  180         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_http_enum_payload2_input::ser_payload_http_payload(
  181         -
            input.payload,
         185  +
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_content_type_parameters::ser_content_type_parameters_input(
         186  +
            &input,
  182    187   
        )?);
  183    188   
        if let Some(content_length) = body.content_length() {
  184    189   
            let content_length = content_length.to_string();
  185    190   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  186    191   
        }
  187    192   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  188    193   
    }
  189    194   
}
  190    195   
#[derive(Debug)]
  191         -
struct HttpEnumPayload2EndpointParamsInterceptor;
         196  +
struct ContentTypeParametersEndpointParamsInterceptor;
  192    197   
  193         -
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpEnumPayload2EndpointParamsInterceptor {
         198  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ContentTypeParametersEndpointParamsInterceptor {
  194    199   
    fn name(&self) -> &'static str {
  195         -
        "HttpEnumPayload2EndpointParamsInterceptor"
         200  +
        "ContentTypeParametersEndpointParamsInterceptor"
  196    201   
    }
  197    202   
  198    203   
    fn read_before_execution(
  199    204   
        &self,
  200    205   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  201    206   
            '_,
  202    207   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  203    208   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  204    209   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  205    210   
        >,
  206    211   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  207    212   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  208    213   
        let _input = context
  209    214   
            .input()
  210         -
            .downcast_ref::<HttpEnumPayload2Input>()
  211         -
            .ok_or("failed to downcast to HttpEnumPayload2Input")?;
         215  +
            .downcast_ref::<ContentTypeParametersInput>()
         216  +
            .ok_or("failed to downcast to ContentTypeParametersInput")?;
  212    217   
  213    218   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  214    219   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  215    220   
        })?;
  216    221   
        cfg.interceptor_state()
  217    222   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  218    223   
        ::std::result::Result::Ok(())
  219    224   
    }
  220    225   
}
  221         -
#[allow(unreachable_code, unused_variables)]
  222         -
#[cfg(test)]
  223         -
mod http_enum_payload2_test {
  224    226   
  225         -
    /// Test ID: RestJsonEnumPayloadRequest2
  226         -
    #[::tokio::test]
  227         -
    #[::tracing_test::traced_test]
  228         -
    async fn rest_json_enum_payload_request2_request() {
  229         -
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  230         -
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  231         -
  232         -
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  233         -
        let result = client
  234         -
            .http_enum_payload2()
  235         -
            .set_payload(::std::option::Option::Some(
  236         -
                "enumvalue".parse::<crate::types::StringEnum>().expect("static value validated to member"),
  237         -
            ))
  238         -
            .send()
  239         -
            .await;
  240         -
        let _ = dbg!(result);
  241         -
        let http_request = request_receiver.expect_request();
  242         -
        let expected_headers = [("Content-Type", "text/plain")];
  243         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  244         -
        let body = http_request.body().bytes().expect("body should be strict");
  245         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  246         -
            body,
  247         -
            "enumvalue",
  248         -
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  249         -
        ));
  250         -
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  251         -
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  252         -
        ::pretty_assertions::assert_eq!(uri.path(), "/EnumPayload2", "path was incorrect");
  253         -
    }
  254         -
    /// Test ID: RestJsonEnumPayloadResponse2
  255         -
    #[::tokio::test]
  256         -
    #[::tracing_test::traced_test]
  257         -
    async fn rest_json_enum_payload_response2_response() {
  258         -
        let expected_output = crate::operation::http_enum_payload2::HttpEnumPayload2Output::builder()
  259         -
            .set_payload(::std::option::Option::Some(
  260         -
                "enumvalue".parse::<crate::types::StringEnum>().expect("static value validated to member"),
  261         -
            ))
  262         -
            .build();
  263         -
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  264         -
            ::http::response::Builder::new()
  265         -
                .header("Content-Type", "text/plain")
  266         -
                .status(200)
  267         -
                .body(::aws_smithy_types::body::SdkBody::from("enumvalue"))
  268         -
                .unwrap(),
  269         -
        )
  270         -
        .unwrap();
  271         -
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  272         -
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  273         -
  274         -
        let op = crate::operation::http_enum_payload2::HttpEnumPayload2::new();
  275         -
        let config = op.config().expect("the operation has config");
  276         -
        let de = config
  277         -
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  278         -
            .expect("the config must have a deserializer");
  279         -
  280         -
        let parsed = de.deserialize_streaming(&mut http_response);
  281         -
        let parsed = parsed.unwrap_or_else(|| {
  282         -
            let http_response =
  283         -
                http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
  284         -
            de.deserialize_nonstreaming(&http_response)
  285         -
        });
  286         -
        let parsed = parsed
  287         -
            .expect("should be successful response")
  288         -
            .downcast::<crate::operation::http_enum_payload2::HttpEnumPayload2Output>()
  289         -
            .unwrap();
  290         -
        ::pretty_assertions::assert_eq!(parsed.payload, expected_output.payload, "Unexpected value for `payload`");
  291         -
    }
  292         -
    /// Upper case error modeled lower case
  293         -
    /// Test ID: ServiceLevelErrorClient
  294         -
    #[::tokio::test]
  295         -
    #[::tracing_test::traced_test]
  296         -
    async fn service_level_error_client_response() {
  297         -
        let expected_output = crate::types::error::ExtraError::builder().build();
  298         -
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  299         -
            ::http::response::Builder::new()
  300         -
                .header("X-Amzn-Errortype", "ExtraError")
  301         -
                .status(500)
  302         -
                .body(::aws_smithy_types::body::SdkBody::from(""))
  303         -
                .unwrap(),
  304         -
        )
  305         -
        .unwrap();
  306         -
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  307         -
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  308         -
  309         -
        let op = crate::operation::http_enum_payload2::HttpEnumPayload2::new();
  310         -
        let config = op.config().expect("the operation has config");
  311         -
        let de = config
  312         -
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  313         -
            .expect("the config must have a deserializer");
  314         -
  315         -
        let parsed = de.deserialize_streaming(&mut http_response);
  316         -
        let parsed = parsed.unwrap_or_else(|| {
  317         -
            let http_response =
  318         -
                http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
  319         -
            de.deserialize_nonstreaming(&http_response)
  320         -
        });
  321         -
        let parsed = parsed.expect_err("should be error response");
  322         -
        let parsed: &crate::operation::http_enum_payload2::HttpEnumPayload2Error =
  323         -
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  324         -
        if let crate::operation::http_enum_payload2::HttpEnumPayload2Error::ExtraError(parsed) = parsed {
  325         -
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  326         -
        } else {
  327         -
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  328         -
        }
  329         -
    }
  330         -
}
  331         -
  332         -
/// Error type for the `HttpEnumPayload2Error` operation.
         227  +
/// Error type for the `ContentTypeParametersError` operation.
  333    228   
#[non_exhaustive]
  334    229   
#[derive(::std::fmt::Debug)]
  335         -
pub enum HttpEnumPayload2Error {
  336         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
  337         -
    ValidationError(crate::types::error::ValidationError),
  338         -
    #[allow(missing_docs)] // documentation missing in model
  339         -
    ExtraError(crate::types::error::ExtraError),
         230  +
pub enum ContentTypeParametersError {
  340    231   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  341    232   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  342    233   
    variable wildcard pattern and check `.code()`:
  343    234   
     \
  344    235   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  345    236   
     \
  346         -
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-HttpEnumPayload2Error) for what information is available for the error.")]
         237  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ContentTypeParametersError) for what information is available for the error.")]
  347    238   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  348    239   
}
  349         -
impl HttpEnumPayload2Error {
  350         -
    /// Creates the `HttpEnumPayload2Error::Unhandled` variant from any error type.
         240  +
impl ContentTypeParametersError {
         241  +
    /// Creates the `ContentTypeParametersError::Unhandled` variant from any error type.
  351    242   
    pub fn unhandled(
  352    243   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  353    244   
    ) -> Self {
  354    245   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  355    246   
            source: err.into(),
  356    247   
            meta: ::std::default::Default::default(),
  357    248   
        })
  358    249   
    }
  359    250   
  360         -
    /// Creates the `HttpEnumPayload2Error::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         251  +
    /// Creates the `ContentTypeParametersError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  361    252   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  362    253   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  363    254   
            source: err.clone().into(),
  364    255   
            meta: err,
  365    256   
        })
  366    257   
    }
  367    258   
    ///
  368    259   
    /// Returns error metadata, which includes the error code, message,
  369    260   
    /// request ID, and potentially additional information.
  370    261   
    ///
  371    262   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  372    263   
        match self {
  373         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  374         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  375    264   
            Self::Unhandled(e) => &e.meta,
  376    265   
        }
  377    266   
    }
  378         -
    /// Returns `true` if the error kind is `HttpEnumPayload2Error::ValidationError`.
  379         -
    pub fn is_validation_error(&self) -> bool {
  380         -
        matches!(self, Self::ValidationError(_))
  381         -
    }
  382         -
    /// Returns `true` if the error kind is `HttpEnumPayload2Error::ExtraError`.
  383         -
    pub fn is_extra_error(&self) -> bool {
  384         -
        matches!(self, Self::ExtraError(_))
  385         -
    }
  386    267   
}
  387         -
impl ::std::error::Error for HttpEnumPayload2Error {
         268  +
impl ::std::error::Error for ContentTypeParametersError {
  388    269   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  389    270   
        match self {
  390         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  391         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  392    271   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  393    272   
        }
  394    273   
    }
  395    274   
}
  396         -
impl ::std::fmt::Display for HttpEnumPayload2Error {
         275  +
impl ::std::fmt::Display for ContentTypeParametersError {
  397    276   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  398    277   
        match self {
  399         -
            Self::ValidationError(_inner) => _inner.fmt(f),
  400         -
            Self::ExtraError(_inner) => _inner.fmt(f),
  401    278   
            Self::Unhandled(_inner) => {
  402    279   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  403    280   
                    write!(f, "unhandled error ({code})")
  404    281   
                } else {
  405    282   
                    f.write_str("unhandled error")
  406    283   
                }
  407    284   
            }
  408    285   
        }
  409    286   
    }
  410    287   
}
  411         -
impl ::aws_smithy_types::retry::ProvideErrorKind for HttpEnumPayload2Error {
         288  +
impl ::aws_smithy_types::retry::ProvideErrorKind for ContentTypeParametersError {
  412    289   
    fn code(&self) -> ::std::option::Option<&str> {
  413    290   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  414    291   
    }
  415    292   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  416    293   
        ::std::option::Option::None
  417    294   
    }
  418    295   
}
  419         -
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for HttpEnumPayload2Error {
         296  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ContentTypeParametersError {
  420    297   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  421    298   
        match self {
  422         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  423         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  424    299   
            Self::Unhandled(_inner) => &_inner.meta,
  425    300   
        }
  426    301   
    }
  427    302   
}
  428         -
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for HttpEnumPayload2Error {
         303  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ContentTypeParametersError {
  429    304   
    fn create_unhandled_error(
  430    305   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  431    306   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  432    307   
    ) -> Self {
  433    308   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  434    309   
            source,
  435    310   
            meta: meta.unwrap_or_default(),
  436    311   
        })
  437    312   
    }
  438    313   
}
  439    314   
  440         -
pub use crate::operation::http_enum_payload2::_http_enum_payload2_output::HttpEnumPayload2Output;
         315  +
pub use crate::operation::content_type_parameters::_content_type_parameters_output::ContentTypeParametersOutput;
  441    316   
  442         -
pub use crate::operation::http_enum_payload2::_http_enum_payload2_input::HttpEnumPayload2Input;
         317  +
pub use crate::operation::content_type_parameters::_content_type_parameters_input::ContentTypeParametersInput;
  443    318   
  444         -
mod _http_enum_payload2_input;
         319  +
mod _content_type_parameters_input;
  445    320   
  446         -
mod _http_enum_payload2_output;
         321  +
mod _content_type_parameters_output;
  447    322   
  448    323   
/// Builders
  449    324   
pub mod builders;

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/content_type_parameters/_content_type_parameters_input.rs

@@ -0,1 +0,50 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct ContentTypeParametersInput {
           6  +
    #[allow(missing_docs)] // documentation missing in model
           7  +
    pub value: ::std::option::Option<i32>,
           8  +
}
           9  +
impl ContentTypeParametersInput {
          10  +
    #[allow(missing_docs)] // documentation missing in model
          11  +
    pub fn value(&self) -> ::std::option::Option<i32> {
          12  +
        self.value
          13  +
    }
          14  +
}
          15  +
impl ContentTypeParametersInput {
          16  +
    /// Creates a new builder-style object to manufacture [`ContentTypeParametersInput`](crate::operation::content_type_parameters::ContentTypeParametersInput).
          17  +
    pub fn builder() -> crate::operation::content_type_parameters::builders::ContentTypeParametersInputBuilder {
          18  +
        crate::operation::content_type_parameters::builders::ContentTypeParametersInputBuilder::default()
          19  +
    }
          20  +
}
          21  +
          22  +
/// A builder for [`ContentTypeParametersInput`](crate::operation::content_type_parameters::ContentTypeParametersInput).
          23  +
#[non_exhaustive]
          24  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          25  +
pub struct ContentTypeParametersInputBuilder {
          26  +
    pub(crate) value: ::std::option::Option<i32>,
          27  +
}
          28  +
impl ContentTypeParametersInputBuilder {
          29  +
    #[allow(missing_docs)] // documentation missing in model
          30  +
    pub fn value(mut self, input: i32) -> Self {
          31  +
        self.value = ::std::option::Option::Some(input);
          32  +
        self
          33  +
    }
          34  +
    #[allow(missing_docs)] // documentation missing in model
          35  +
    pub fn set_value(mut self, input: ::std::option::Option<i32>) -> Self {
          36  +
        self.value = input;
          37  +
        self
          38  +
    }
          39  +
    #[allow(missing_docs)] // documentation missing in model
          40  +
    pub fn get_value(&self) -> &::std::option::Option<i32> {
          41  +
        &self.value
          42  +
    }
          43  +
    /// Consumes the builder and constructs a [`ContentTypeParametersInput`](crate::operation::content_type_parameters::ContentTypeParametersInput).
          44  +
    pub fn build(
          45  +
        self,
          46  +
    ) -> ::std::result::Result<crate::operation::content_type_parameters::ContentTypeParametersInput, ::aws_smithy_types::error::operation::BuildError>
          47  +
    {
          48  +
        ::std::result::Result::Ok(crate::operation::content_type_parameters::ContentTypeParametersInput { value: self.value })
          49  +
    }
          50  +
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/content_type_parameters/_content_type_parameters_output.rs

@@ -0,1 +0,22 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct ContentTypeParametersOutput {}
           6  +
impl ContentTypeParametersOutput {
           7  +
    /// Creates a new builder-style object to manufacture [`ContentTypeParametersOutput`](crate::operation::content_type_parameters::ContentTypeParametersOutput).
           8  +
    pub fn builder() -> crate::operation::content_type_parameters::builders::ContentTypeParametersOutputBuilder {
           9  +
        crate::operation::content_type_parameters::builders::ContentTypeParametersOutputBuilder::default()
          10  +
    }
          11  +
}
          12  +
          13  +
/// A builder for [`ContentTypeParametersOutput`](crate::operation::content_type_parameters::ContentTypeParametersOutput).
          14  +
#[non_exhaustive]
          15  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          16  +
pub struct ContentTypeParametersOutputBuilder {}
          17  +
impl ContentTypeParametersOutputBuilder {
          18  +
    /// Consumes the builder and constructs a [`ContentTypeParametersOutput`](crate::operation::content_type_parameters::ContentTypeParametersOutput).
          19  +
    pub fn build(self) -> crate::operation::content_type_parameters::ContentTypeParametersOutput {
          20  +
        crate::operation::content_type_parameters::ContentTypeParametersOutput {}
          21  +
    }
          22  +
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/operation/content_type_parameters/builders.rs

Renamed from tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/http_enum_payload2/builders.rs

@@ -1,1 +124,125 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub use crate::operation::http_enum_payload2::_http_enum_payload2_output::HttpEnumPayload2OutputBuilder;
           2  +
pub use crate::operation::content_type_parameters::_content_type_parameters_output::ContentTypeParametersOutputBuilder;
    3      3   
    4         -
pub use crate::operation::http_enum_payload2::_http_enum_payload2_input::HttpEnumPayload2InputBuilder;
           4  +
pub use crate::operation::content_type_parameters::_content_type_parameters_input::ContentTypeParametersInputBuilder;
    5      5   
    6         -
impl crate::operation::http_enum_payload2::builders::HttpEnumPayload2InputBuilder {
           6  +
impl crate::operation::content_type_parameters::builders::ContentTypeParametersInputBuilder {
    7      7   
    /// Sends a request with this input using the given client.
    8      8   
    pub async fn send_with(
    9      9   
        self,
   10     10   
        client: &crate::Client,
   11     11   
    ) -> ::std::result::Result<
   12         -
        crate::operation::http_enum_payload2::HttpEnumPayload2Output,
          12  +
        crate::operation::content_type_parameters::ContentTypeParametersOutput,
   13     13   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14         -
            crate::operation::http_enum_payload2::HttpEnumPayload2Error,
          14  +
            crate::operation::content_type_parameters::ContentTypeParametersError,
   15     15   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     16   
        >,
   17     17   
    > {
   18         -
        let mut fluent_builder = client.http_enum_payload2();
          18  +
        let mut fluent_builder = client.content_type_parameters();
   19     19   
        fluent_builder.inner = self;
   20     20   
        fluent_builder.send().await
   21     21   
    }
   22     22   
}
   23         -
/// Fluent builder constructing a request to `HttpEnumPayload2`.
          23  +
/// Fluent builder constructing a request to `ContentTypeParameters`.
   24     24   
///
          25  +
/// The example tests how servers must support requests containing a `Content-Type` header with parameters.
   25     26   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
   26         -
pub struct HttpEnumPayload2FluentBuilder {
          27  +
pub struct ContentTypeParametersFluentBuilder {
   27     28   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28         -
    inner: crate::operation::http_enum_payload2::builders::HttpEnumPayload2InputBuilder,
          29  +
    inner: crate::operation::content_type_parameters::builders::ContentTypeParametersInputBuilder,
   29     30   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     31   
}
   31     32   
impl
   32     33   
    crate::client::customize::internal::CustomizableSend<
   33         -
        crate::operation::http_enum_payload2::HttpEnumPayload2Output,
   34         -
        crate::operation::http_enum_payload2::HttpEnumPayload2Error,
   35         -
    > for HttpEnumPayload2FluentBuilder
          34  +
        crate::operation::content_type_parameters::ContentTypeParametersOutput,
          35  +
        crate::operation::content_type_parameters::ContentTypeParametersError,
          36  +
    > for ContentTypeParametersFluentBuilder
   36     37   
{
   37     38   
    fn send(
   38     39   
        self,
   39     40   
        config_override: crate::config::Builder,
   40     41   
    ) -> crate::client::customize::internal::BoxFuture<
   41     42   
        crate::client::customize::internal::SendResult<
   42         -
            crate::operation::http_enum_payload2::HttpEnumPayload2Output,
   43         -
            crate::operation::http_enum_payload2::HttpEnumPayload2Error,
          43  +
            crate::operation::content_type_parameters::ContentTypeParametersOutput,
          44  +
            crate::operation::content_type_parameters::ContentTypeParametersError,
   44     45   
        >,
   45     46   
    > {
   46     47   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   47     48   
    }
   48     49   
}
   49         -
impl HttpEnumPayload2FluentBuilder {
   50         -
    /// Creates a new `HttpEnumPayload2FluentBuilder`.
          50  +
impl ContentTypeParametersFluentBuilder {
          51  +
    /// Creates a new `ContentTypeParametersFluentBuilder`.
   51     52   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   52     53   
        Self {
   53     54   
            handle,
   54     55   
            inner: ::std::default::Default::default(),
   55     56   
            config_override: ::std::option::Option::None,
   56     57   
        }
   57     58   
    }
   58         -
    /// Access the HttpEnumPayload2 as a reference.
   59         -
    pub fn as_input(&self) -> &crate::operation::http_enum_payload2::builders::HttpEnumPayload2InputBuilder {
          59  +
    /// Access the ContentTypeParameters as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::content_type_parameters::builders::ContentTypeParametersInputBuilder {
   60     61   
        &self.inner
   61     62   
    }
   62     63   
    /// Sends the request and returns the response.
   63     64   
    ///
   64     65   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   65     66   
    /// can be matched against.
   66     67   
    ///
   67     68   
    /// By default, any retryable failures will be retried twice. Retry behavior
   68     69   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   69     70   
    /// set when configuring the client.
   70     71   
    pub async fn send(
   71     72   
        self,
   72     73   
    ) -> ::std::result::Result<
   73         -
        crate::operation::http_enum_payload2::HttpEnumPayload2Output,
          74  +
        crate::operation::content_type_parameters::ContentTypeParametersOutput,
   74     75   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75         -
            crate::operation::http_enum_payload2::HttpEnumPayload2Error,
          76  +
            crate::operation::content_type_parameters::ContentTypeParametersError,
   76     77   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   77     78   
        >,
   78     79   
    > {
   79     80   
        let input = self
   80     81   
            .inner
   81     82   
            .build()
   82     83   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   83         -
        let runtime_plugins = crate::operation::http_enum_payload2::HttpEnumPayload2::operation_runtime_plugins(
          84  +
        let runtime_plugins = crate::operation::content_type_parameters::ContentTypeParameters::operation_runtime_plugins(
   84     85   
            self.handle.runtime_plugins.clone(),
   85     86   
            &self.handle.conf,
   86     87   
            self.config_override,
   87     88   
        );
   88         -
        crate::operation::http_enum_payload2::HttpEnumPayload2::orchestrate(&runtime_plugins, input).await
          89  +
        crate::operation::content_type_parameters::ContentTypeParameters::orchestrate(&runtime_plugins, input).await
   89     90   
    }
   90     91   
   91     92   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   92     93   
    pub fn customize(
   93     94   
        self,
   94     95   
    ) -> crate::client::customize::CustomizableOperation<
   95         -
        crate::operation::http_enum_payload2::HttpEnumPayload2Output,
   96         -
        crate::operation::http_enum_payload2::HttpEnumPayload2Error,
          96  +
        crate::operation::content_type_parameters::ContentTypeParametersOutput,
          97  +
        crate::operation::content_type_parameters::ContentTypeParametersError,
   97     98   
        Self,
   98     99   
    > {
   99    100   
        crate::client::customize::CustomizableOperation::new(self)
  100    101   
    }
  101    102   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    103   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    104   
        self
  104    105   
    }
  105    106   
  106    107   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    108   
        self.config_override = config_override;
  108    109   
        self
  109    110   
    }
  110    111   
    #[allow(missing_docs)] // documentation missing in model
  111         -
    pub fn payload(mut self, input: crate::types::StringEnum) -> Self {
  112         -
        self.inner = self.inner.payload(input);
         112  +
    pub fn value(mut self, input: i32) -> Self {
         113  +
        self.inner = self.inner.value(input);
  113    114   
        self
  114    115   
    }
  115    116   
    #[allow(missing_docs)] // documentation missing in model
  116         -
    pub fn set_payload(mut self, input: ::std::option::Option<crate::types::StringEnum>) -> Self {
  117         -
        self.inner = self.inner.set_payload(input);
         117  +
    pub fn set_value(mut self, input: ::std::option::Option<i32>) -> Self {
         118  +
        self.inner = self.inner.set_value(input);
  118    119   
        self
  119    120   
    }
  120    121   
    #[allow(missing_docs)] // documentation missing in model
  121         -
    pub fn get_payload(&self) -> &::std::option::Option<crate::types::StringEnum> {
  122         -
        self.inner.get_payload()
         122  +
    pub fn get_value(&self) -> &::std::option::Option<i32> {
         123  +
        self.inner.get_value()
  123    124   
    }
  124    125   
}

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

@@ -1,1 +91,95 @@
   16     16   
}
   17     17   
   18     18   
pub fn parse_http_error_metadata(
   19     19   
    _response_status: u16,
   20     20   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21     21   
    response_body: &[u8],
   22     22   
) -> Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23     23   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24     24   
}
   25     25   
          26  +
pub(crate) mod shape_content_type_parameters;
          27  +
   26     28   
pub(crate) mod shape_empty_input_and_empty_output;
   27     29   
   28     30   
pub(crate) mod shape_endpoint_operation;
   29     31   
   30     32   
pub(crate) mod shape_endpoint_with_host_label_operation;
   31     33   
   32     34   
pub(crate) mod shape_greeting_with_errors;
   33     35   
   34     36   
pub(crate) mod shape_host_with_path_operation;
   35     37   
   36     38   
pub(crate) mod shape_json_unions;
   37     39   
   38     40   
pub(crate) mod shape_no_input_and_no_output;
   39     41   
   40     42   
pub(crate) mod shape_no_input_and_output;
   41     43   
   42     44   
pub(crate) mod shape_operation_with_defaults;
   43     45   
   44     46   
pub(crate) mod shape_operation_with_nested_structure;
   45     47   
   46     48   
pub(crate) mod shape_operation_with_required_members;
   47     49   
   48     50   
pub(crate) mod shape_put_with_content_encoding;
   49     51   
   50     52   
pub(crate) mod shape_simple_scalar_properties;
   51     53   
   52     54   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   53     55   
    if data.is_empty() {
   54     56   
        b"{}"
   55     57   
    } else {
   56     58   
        data
   57     59   
    }
   58     60   
}
   59     61   
   60     62   
pub(crate) mod shape_complex_error;
   61     63   
          64  +
pub(crate) mod shape_content_type_parameters_input;
          65  +
   62     66   
pub(crate) mod shape_endpoint_with_host_label_operation_input;
   63     67   
   64     68   
pub(crate) mod shape_foo_error;
   65     69   
   66     70   
pub(crate) mod shape_greeting_with_errors_input;
   67     71   
   68     72   
pub(crate) mod shape_invalid_greeting;
   69     73   
   70     74   
pub(crate) mod shape_json_unions_input;
   71     75   

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

@@ -0,1 +0,42 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub fn de_content_type_parameters_http_error(
           4  +
    _response_status: u16,
           5  +
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
           6  +
    _response_body: &[u8],
           7  +
) -> std::result::Result<
           8  +
    crate::operation::content_type_parameters::ContentTypeParametersOutput,
           9  +
    crate::operation::content_type_parameters::ContentTypeParametersError,
          10  +
> {
          11  +
    #[allow(unused_mut)]
          12  +
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
          13  +
        .map_err(crate::operation::content_type_parameters::ContentTypeParametersError::unhandled)?;
          14  +
    let generic = generic_builder.build();
          15  +
    Err(crate::operation::content_type_parameters::ContentTypeParametersError::generic(generic))
          16  +
}
          17  +
          18  +
#[allow(clippy::unnecessary_wraps)]
          19  +
pub fn de_content_type_parameters_http_response(
          20  +
    _response_status: u16,
          21  +
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
          22  +
    _response_body: &[u8],
          23  +
) -> std::result::Result<
          24  +
    crate::operation::content_type_parameters::ContentTypeParametersOutput,
          25  +
    crate::operation::content_type_parameters::ContentTypeParametersError,
          26  +
> {
          27  +
    Ok({
          28  +
        #[allow(unused_mut)]
          29  +
        let mut output = crate::operation::content_type_parameters::builders::ContentTypeParametersOutputBuilder::default();
          30  +
        output.build()
          31  +
    })
          32  +
}
          33  +
          34  +
pub fn ser_content_type_parameters_input(
          35  +
    input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
          36  +
) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          37  +
    let mut out = String::new();
          38  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          39  +
    crate::protocol_serde::shape_content_type_parameters_input::ser_content_type_parameters_input_input(&mut object, input)?;
          40  +
    object.finish();
          41  +
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          42  +
}

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

@@ -0,1 +0,13 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_content_type_parameters_input_input(
           3  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
           4  +
    input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
           5  +
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    if let Some(var_1) = &input.value {
           7  +
        object.key("value").number(
           8  +
            #[allow(clippy::useless_conversion)]
           9  +
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
          10  +
        );
          11  +
    }
          12  +
    Ok(())
          13  +
}

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

@@ -77,77 +148,150 @@
   97     97   
    fn validate_config(handle: &Handle) -> Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
   98     98   
        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
   99     99   
        handle
  100    100   
            .runtime_plugins
  101    101   
            .apply_client_configuration(&mut cfg)?
  102    102   
            .validate_base_client_config(&cfg)?;
  103    103   
        Ok(())
  104    104   
    }
  105    105   
}
  106    106   
         107  +
mod content_type_parameters;
         108  +
  107    109   
/// Operation customization and supporting types.
  108    110   
///
  109    111   
/// The underlying HTTP requests made during an operation can be customized
  110    112   
/// by calling the `customize()` method on the builder returned from a client
  111    113   
/// operation call. For example, this can be used to add an additional HTTP header:
  112    114   
///
  113    115   
/// ```ignore
  114    116   
/// # async fn wrapper() -> ::std::result::Result<(), json_rpc11::Error> {
  115    117   
/// # let client: json_rpc11::Client = unimplemented!();
  116    118   
/// use ::http::header::{HeaderName, HeaderValue};
  117    119   
///
  118         -
/// let result = client.datetime_offsets()
         120  +
/// let result = client.content_type_parameters()
  119    121   
///     .customize()
  120    122   
///     .mutate_request(|req| {
  121    123   
///         // Add `x-example-header` with value
  122    124   
///         req.headers_mut()
  123    125   
///             .insert(
  124    126   
///                 HeaderName::from_static("x-example-header"),
  125    127   
///                 HeaderValue::from_static("1"),
  126    128   
///             );
  127    129   
///     })
  128    130   
///     .send()

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

@@ -0,1 +0,12 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
impl super::Client {
           3  +
    /// Constructs a fluent builder for the [`ContentTypeParameters`](crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder) operation.
           4  +
    ///
           5  +
    /// - The fluent builder is configurable:
           6  +
    ///   - [`value(i32)`](crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder::value) / [`set_value(Option<i32>)`](crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder::set_value):<br>required: **false**<br>(undocumented)<br>
           7  +
    /// - On success, responds with [`ContentTypeParametersOutput`](crate::operation::content_type_parameters::ContentTypeParametersOutput)
           8  +
    /// - On failure, responds with [`SdkError<ContentTypeParametersError>`](crate::operation::content_type_parameters::ContentTypeParametersError)
           9  +
    pub fn content_type_parameters(&self) -> crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder {
          10  +
        crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder::new(self.handle.clone())
          11  +
    }
          12  +
}

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

@@ -33,33 +92,115 @@
   53     53   
        match self {
   54     54   
            Self::ComplexError(inner) => inner.meta(),
   55     55   
            Self::ErrorWithMembers(inner) => inner.meta(),
   56     56   
            Self::ErrorWithoutMembers(inner) => inner.meta(),
   57     57   
            Self::FooError(inner) => inner.meta(),
   58     58   
            Self::InvalidGreeting(inner) => inner.meta(),
   59     59   
            Self::Unhandled(inner) => &inner.meta,
   60     60   
        }
   61     61   
    }
   62     62   
}
          63  +
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::content_type_parameters::ContentTypeParametersError, R>> for Error
          64  +
where
          65  +
    R: Send + Sync + std::fmt::Debug + 'static,
          66  +
{
          67  +
    fn from(
          68  +
        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::content_type_parameters::ContentTypeParametersError, R>,
          69  +
    ) -> Self {
          70  +
        match err {
          71  +
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
          72  +
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
          73  +
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
          74  +
                source: err.into(),
          75  +
            }),
          76  +
        }
          77  +
    }
          78  +
}
          79  +
impl From<crate::operation::content_type_parameters::ContentTypeParametersError> for Error {
          80  +
    fn from(err: crate::operation::content_type_parameters::ContentTypeParametersError) -> Self {
          81  +
        match err {
          82  +
            crate::operation::content_type_parameters::ContentTypeParametersError::Unhandled(inner) => Error::Unhandled(inner),
          83  +
        }
          84  +
    }
          85  +
}
   63     86   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::datetime_offsets::DatetimeOffsetsError, R>> for Error
   64     87   
where
   65     88   
    R: Send + Sync + std::fmt::Debug + 'static,
   66     89   
{
   67     90   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::datetime_offsets::DatetimeOffsetsError, R>) -> Self {
   68     91   
        match err {
   69     92   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
   70     93   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
   71     94   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
   72     95   
                source: err.into(),

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

@@ -1,1 +32,35 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/// Types for the `ContentTypeParameters` operation.
           4  +
pub mod content_type_parameters;
           5  +
    3      6   
/// Types for the `DatetimeOffsets` operation.
    4      7   
pub mod datetime_offsets;
    5      8   
    6      9   
/// Types for the `EmptyOperation` operation.
    7     10   
pub mod empty_operation;
    8     11   
    9     12   
/// Types for the `EndpointOperation` operation.
   10     13   
pub mod endpoint_operation;
   11     14   
   12     15   
/// Types for the `EndpointWithHostLabelOperation` operation.

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

Renamed from tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/malformed_content_type_with_body2.rs

@@ -1,1 +378,330 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Orchestration and serialization glue logic for `MalformedContentTypeWithBody2`.
           2  +
/// Orchestration and serialization glue logic for `ContentTypeParameters`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5         -
pub struct MalformedContentTypeWithBody2;
    6         -
impl MalformedContentTypeWithBody2 {
    7         -
    /// Creates a new `MalformedContentTypeWithBody2`
           5  +
pub struct ContentTypeParameters;
           6  +
impl ContentTypeParameters {
           7  +
    /// Creates a new `ContentTypeParameters`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
   11     11   
    pub(crate) async fn orchestrate(
   12     12   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13         -
        input: crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Input,
          13  +
        input: crate::operation::content_type_parameters::ContentTypeParametersInput,
   14     14   
    ) -> ::std::result::Result<
   15         -
        crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Output,
          15  +
        crate::operation::content_type_parameters::ContentTypeParametersOutput,
   16     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17         -
            crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Error,
          17  +
            crate::operation::content_type_parameters::ContentTypeParametersError,
   18     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     19   
        >,
   20     20   
    > {
   21     21   
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
   22     22   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
   23     23   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   24     24   
        >| {
   25     25   
            err.map_service_error(|err| {
   26         -
                err.downcast::<crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Error>()
          26  +
                err.downcast::<crate::operation::content_type_parameters::ContentTypeParametersError>()
   27     27   
                    .expect("correct error type")
   28     28   
            })
   29     29   
        };
   30     30   
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
   31     31   
            .await
   32     32   
            .map_err(map_err)?;
   33     33   
        let output = context.finalize().map_err(map_err)?;
   34     34   
        ::std::result::Result::Ok(
   35     35   
            output
   36         -
                .downcast::<crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Output>()
          36  +
                .downcast::<crate::operation::content_type_parameters::ContentTypeParametersOutput>()
   37     37   
                .expect("correct output type"),
   38     38   
        )
   39     39   
    }
   40     40   
   41     41   
    pub(crate) async fn orchestrate_with_stop_point(
   42     42   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   43         -
        input: crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Input,
          43  +
        input: crate::operation::content_type_parameters::ContentTypeParametersInput,
   44     44   
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
   45     45   
    ) -> ::std::result::Result<
   46     46   
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
   47     47   
        ::aws_smithy_runtime_api::client::result::SdkError<
   48     48   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
   49     49   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   50     50   
        >,
   51     51   
    > {
   52     52   
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
   53     53   
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
   54         -
            "restjsonprotocol",
   55         -
            "MalformedContentTypeWithBody2",
          54  +
            "jsonprotocol",
          55  +
            "ContentTypeParameters",
   56     56   
            input,
   57     57   
            runtime_plugins,
   58     58   
            stop_point,
   59     59   
        )
   60     60   
        .await
   61     61   
    }
   62     62   
   63     63   
    pub(crate) fn operation_runtime_plugins(
   64     64   
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   65     65   
        client_config: &crate::config::Config,
   66     66   
        config_override: ::std::option::Option<crate::config::Builder>,
   67     67   
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
   68     68   
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
   69     69   
        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
   70     70   
            ::aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID,
   71     71   
        ]));
   72     72   
        if let ::std::option::Option::Some(config_override) = config_override {
   73     73   
            for plugin in config_override.runtime_plugins.iter().cloned() {
   74     74   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   75     75   
            }
   76     76   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   77     77   
                config_override,
   78     78   
                client_config.config.clone(),
   79     79   
                &client_config.runtime_components,
   80     80   
            ));
   81     81   
        }
   82     82   
        runtime_plugins
   83     83   
    }
   84     84   
}
   85         -
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for MalformedContentTypeWithBody2 {
          85  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ContentTypeParameters {
   86     86   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   87         -
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("MalformedContentTypeWithBody2");
          87  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ContentTypeParameters");
   88     88   
   89     89   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   90         -
            MalformedContentTypeWithBody2RequestSerializer,
          90  +
            ContentTypeParametersRequestSerializer,
   91     91   
        ));
   92     92   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   93         -
            MalformedContentTypeWithBody2ResponseDeserializer,
          93  +
            ContentTypeParametersResponseDeserializer,
   94     94   
        ));
   95     95   
   96     96   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
   97     97   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
   98     98   
        ));
   99     99   
  100    100   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  101         -
            "MalformedContentTypeWithBody2",
  102         -
            "restjsonprotocol",
         101  +
            "ContentTypeParameters",
         102  +
            "jsonprotocol",
  103    103   
        ));
  104    104   
  105    105   
        ::std::option::Option::Some(cfg.freeze())
  106    106   
    }
  107    107   
  108    108   
    fn runtime_components(
  109    109   
        &self,
  110    110   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  111    111   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  112    112   
        #[allow(unused_mut)]
  113         -
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("MalformedContentTypeWithBody2")
         113  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ContentTypeParameters")
  114    114   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  115         -
            .with_interceptor(MalformedContentTypeWithBody2EndpointParamsInterceptor)
         115  +
            .with_interceptor(ContentTypeParametersEndpointParamsInterceptor)
  116    116   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  117         -
                crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Error,
         117  +
                crate::operation::content_type_parameters::ContentTypeParametersError,
  118    118   
            >::new())
  119    119   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  120         -
                crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Error,
         120  +
                crate::operation::content_type_parameters::ContentTypeParametersError,
  121    121   
            >::new());
  122    122   
  123    123   
        ::std::borrow::Cow::Owned(rcb)
  124    124   
    }
  125    125   
}
  126    126   
  127    127   
#[derive(Debug)]
  128         -
struct MalformedContentTypeWithBody2ResponseDeserializer;
  129         -
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedContentTypeWithBody2ResponseDeserializer {
         128  +
struct ContentTypeParametersResponseDeserializer;
         129  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ContentTypeParametersResponseDeserializer {
  130    130   
    fn deserialize_nonstreaming(
  131    131   
        &self,
  132    132   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  133    133   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  134    134   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  135    135   
        let headers = response.headers();
  136    136   
        let body = response.body().bytes().expect("body loaded");
  137    137   
        #[allow(unused_mut)]
  138    138   
        let mut force_error = false;
  139    139   
  140    140   
        let parse_result = if !success && status != 200 || force_error {
  141         -
            crate::protocol_serde::shape_malformed_content_type_with_body2::de_malformed_content_type_with_body2_http_error(status, headers, body)
         141  +
            crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_error(status, headers, body)
  142    142   
        } else {
  143         -
            crate::protocol_serde::shape_malformed_content_type_with_body2::de_malformed_content_type_with_body2_http_response(status, headers, body)
         143  +
            crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_response(status, headers, body)
  144    144   
        };
  145    145   
        crate::protocol_serde::type_erase_result(parse_result)
  146    146   
    }
  147    147   
}
  148    148   
#[derive(Debug)]
  149         -
struct MalformedContentTypeWithBody2RequestSerializer;
  150         -
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedContentTypeWithBody2RequestSerializer {
         149  +
struct ContentTypeParametersRequestSerializer;
         150  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ContentTypeParametersRequestSerializer {
  151    151   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  152    152   
    fn serialize_input(
  153    153   
        &self,
  154    154   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  155    155   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  156    156   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  157    157   
        let input = input
  158         -
            .downcast::<crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Input>()
         158  +
            .downcast::<crate::operation::content_type_parameters::ContentTypeParametersInput>()
  159    159   
            .expect("correct type");
  160    160   
        let _header_serialization_settings = _cfg
  161    161   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  162    162   
            .cloned()
  163    163   
            .unwrap_or_default();
  164    164   
        let mut request_builder = {
  165    165   
            fn uri_base(
  166         -
                _input: &crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Input,
         166  +
                _input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
  167    167   
                output: &mut ::std::string::String,
  168    168   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  169    169   
                use ::std::fmt::Write as _;
  170         -
                ::std::write!(output, "/MalformedContentTypeWithBody").expect("formatting should succeed");
         170  +
                ::std::write!(output, "/").expect("formatting should succeed");
  171    171   
                ::std::result::Result::Ok(())
  172    172   
            }
  173    173   
            #[allow(clippy::unnecessary_wraps)]
  174    174   
            fn update_http_builder(
  175         -
                input: &crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Input,
         175  +
                input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
  176    176   
                builder: ::http::request::Builder,
  177    177   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  178    178   
                let mut uri = ::std::string::String::new();
  179    179   
                uri_base(input, &mut uri)?;
  180    180   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  181    181   
            }
  182    182   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  183         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
         183  +
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.1");
         184  +
            builder = _header_serialization_settings.set_default_header(
         185  +
                builder,
         186  +
                ::http::header::HeaderName::from_static("x-amz-target"),
         187  +
                "JsonProtocol.ContentTypeParameters",
         188  +
            );
  184    189   
            builder
  185    190   
        };
  186         -
        let body = ::aws_smithy_types::body::SdkBody::from(
  187         -
            crate::protocol_serde::shape_malformed_content_type_with_body2::ser_malformed_content_type_with_body2_input(&input)?,
  188         -
        );
         191  +
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_content_type_parameters::ser_content_type_parameters_input(
         192  +
            &input,
         193  +
        )?);
  189    194   
        if let Some(content_length) = body.content_length() {
  190    195   
            let content_length = content_length.to_string();
  191    196   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  192    197   
        }
  193    198   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  194    199   
    }
  195    200   
}
  196    201   
#[derive(Debug)]
  197         -
struct MalformedContentTypeWithBody2EndpointParamsInterceptor;
         202  +
struct ContentTypeParametersEndpointParamsInterceptor;
  198    203   
  199         -
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedContentTypeWithBody2EndpointParamsInterceptor {
         204  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ContentTypeParametersEndpointParamsInterceptor {
  200    205   
    fn name(&self) -> &'static str {
  201         -
        "MalformedContentTypeWithBody2EndpointParamsInterceptor"
         206  +
        "ContentTypeParametersEndpointParamsInterceptor"
  202    207   
    }
  203    208   
  204    209   
    fn read_before_execution(
  205    210   
        &self,
  206    211   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  207    212   
            '_,
  208    213   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  209    214   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  210    215   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  211    216   
        >,
  212    217   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  213    218   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  214    219   
        let _input = context
  215    220   
            .input()
  216         -
            .downcast_ref::<MalformedContentTypeWithBody2Input>()
  217         -
            .ok_or("failed to downcast to MalformedContentTypeWithBody2Input")?;
         221  +
            .downcast_ref::<ContentTypeParametersInput>()
         222  +
            .ok_or("failed to downcast to ContentTypeParametersInput")?;
  218    223   
  219    224   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  220    225   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  221    226   
        })?;
  222    227   
        cfg.interceptor_state()
  223    228   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  224    229   
        ::std::result::Result::Ok(())
  225    230   
    }
  226    231   
}
  227         -
#[allow(unreachable_code, unused_variables)]
  228         -
#[cfg(test)]
  229         -
mod malformed_content_type_with_body2_test {
  230         -
  231         -
    /// Upper case error modeled lower case
  232         -
    /// Test ID: ServiceLevelErrorClient
  233         -
    #[::tokio::test]
  234         -
    #[::tracing_test::traced_test]
  235         -
    async fn service_level_error_client_response() {
  236         -
        let expected_output = crate::types::error::ExtraError::builder().build();
  237         -
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  238         -
            ::http::response::Builder::new()
  239         -
                .header("X-Amzn-Errortype", "ExtraError")
  240         -
                .status(500)
  241         -
                .body(::aws_smithy_types::body::SdkBody::from(""))
  242         -
                .unwrap(),
  243         -
        )
  244         -
        .unwrap();
  245         -
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  246         -
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  247         -
  248         -
        let op = crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2::new();
  249         -
        let config = op.config().expect("the operation has config");
  250         -
        let de = config
  251         -
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  252         -
            .expect("the config must have a deserializer");
  253    232   
  254         -
        let parsed = de.deserialize_streaming(&mut http_response);
  255         -
        let parsed = parsed.unwrap_or_else(|| {
  256         -
            let http_response =
  257         -
                http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
  258         -
            de.deserialize_nonstreaming(&http_response)
  259         -
        });
  260         -
        let parsed = parsed.expect_err("should be error response");
  261         -
        let parsed: &crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Error =
  262         -
            parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
  263         -
        if let crate::operation::malformed_content_type_with_body2::MalformedContentTypeWithBody2Error::ExtraError(parsed) = parsed {
  264         -
            ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
  265         -
        } else {
  266         -
            panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
  267         -
        }
  268         -
    }
  269         -
}
  270         -
  271         -
/// Error type for the `MalformedContentTypeWithBody2Error` operation.
         233  +
/// Error type for the `ContentTypeParametersError` operation.
  272    234   
#[non_exhaustive]
  273    235   
#[derive(::std::fmt::Debug)]
  274         -
pub enum MalformedContentTypeWithBody2Error {
  275         -
    #[allow(missing_docs)] // documentation missing in model
  276         -
    ExtraError(crate::types::error::ExtraError),
         236  +
pub enum ContentTypeParametersError {
  277    237   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  278    238   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  279    239   
    variable wildcard pattern and check `.code()`:
  280    240   
     \
  281    241   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  282    242   
     \
  283         -
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-MalformedContentTypeWithBody2Error) for what information is available for the error.")]
         243  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ContentTypeParametersError) for what information is available for the error.")]
  284    244   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  285    245   
}
  286         -
impl MalformedContentTypeWithBody2Error {
  287         -
    /// Creates the `MalformedContentTypeWithBody2Error::Unhandled` variant from any error type.
         246  +
impl ContentTypeParametersError {
         247  +
    /// Creates the `ContentTypeParametersError::Unhandled` variant from any error type.
  288    248   
    pub fn unhandled(
  289    249   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  290    250   
    ) -> Self {
  291    251   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  292    252   
            source: err.into(),
  293    253   
            meta: ::std::default::Default::default(),
  294    254   
        })
  295    255   
    }
  296    256   
  297         -
    /// Creates the `MalformedContentTypeWithBody2Error::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         257  +
    /// Creates the `ContentTypeParametersError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  298    258   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  299    259   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  300    260   
            source: err.clone().into(),
  301    261   
            meta: err,
  302    262   
        })
  303    263   
    }
  304    264   
    ///
  305    265   
    /// Returns error metadata, which includes the error code, message,
  306    266   
    /// request ID, and potentially additional information.
  307    267   
    ///
  308    268   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  309    269   
        match self {
  310         -
            Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  311    270   
            Self::Unhandled(e) => &e.meta,
  312    271   
        }
  313    272   
    }
  314         -
    /// Returns `true` if the error kind is `MalformedContentTypeWithBody2Error::ExtraError`.
  315         -
    pub fn is_extra_error(&self) -> bool {
  316         -
        matches!(self, Self::ExtraError(_))
  317         -
    }
  318    273   
}
  319         -
impl ::std::error::Error for MalformedContentTypeWithBody2Error {
         274  +
impl ::std::error::Error for ContentTypeParametersError {
  320    275   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  321    276   
        match self {
  322         -
            Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
  323    277   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  324    278   
        }
  325    279   
    }
  326    280   
}
  327         -
impl ::std::fmt::Display for MalformedContentTypeWithBody2Error {
         281  +
impl ::std::fmt::Display for ContentTypeParametersError {
  328    282   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  329    283   
        match self {
  330         -
            Self::ExtraError(_inner) => _inner.fmt(f),
  331    284   
            Self::Unhandled(_inner) => {
  332    285   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  333    286   
                    write!(f, "unhandled error ({code})")
  334    287   
                } else {
  335    288   
                    f.write_str("unhandled error")
  336    289   
                }
  337    290   
            }
  338    291   
        }
  339    292   
    }
  340    293   
}
  341         -
impl ::aws_smithy_types::retry::ProvideErrorKind for MalformedContentTypeWithBody2Error {
         294  +
impl ::aws_smithy_types::retry::ProvideErrorKind for ContentTypeParametersError {
  342    295   
    fn code(&self) -> ::std::option::Option<&str> {
  343    296   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  344    297   
    }
  345    298   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  346    299   
        ::std::option::Option::None
  347    300   
    }
  348    301   
}
  349         -
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for MalformedContentTypeWithBody2Error {
         302  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ContentTypeParametersError {
  350    303   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  351    304   
        match self {
  352         -
            Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  353    305   
            Self::Unhandled(_inner) => &_inner.meta,
  354    306   
        }
  355    307   
    }
  356    308   
}
  357         -
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for MalformedContentTypeWithBody2Error {
         309  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ContentTypeParametersError {
  358    310   
    fn create_unhandled_error(
  359    311   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  360    312   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  361    313   
    ) -> Self {
  362    314   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  363    315   
            source,
  364    316   
            meta: meta.unwrap_or_default(),
  365    317   
        })
  366    318   
    }
  367    319   
}
  368    320   
  369         -
pub use crate::operation::malformed_content_type_with_body2::_malformed_content_type_with_body2_output::MalformedContentTypeWithBody2Output;
         321  +
pub use crate::operation::content_type_parameters::_content_type_parameters_output::ContentTypeParametersOutput;
  370    322   
  371         -
pub use crate::operation::malformed_content_type_with_body2::_malformed_content_type_with_body2_input::MalformedContentTypeWithBody2Input;
         323  +
pub use crate::operation::content_type_parameters::_content_type_parameters_input::ContentTypeParametersInput;
  372    324   
  373         -
mod _malformed_content_type_with_body2_input;
         325  +
mod _content_type_parameters_input;
  374    326   
  375         -
mod _malformed_content_type_with_body2_output;
         327  +
mod _content_type_parameters_output;
  376    328   
  377    329   
/// Builders
  378    330   
pub mod builders;