Server Test

Server Test

rev. 7254d43655ed63111c94f599437f2b0d3f55446e

Files changed:

tmp-codegen-diff/codegen-server-test/naming_test_ops-http0x/rust-server-codegen/src/operation.rs

@@ -1,1 +302,412 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
::pin_project_lite::pin_project! {
    3      3   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    4         -
    /// [`RpcEchoInput`](crate::input::RpcEchoInput) using modelled bindings.
    5         -
    pub struct RpcEchoInputFuture {
    6         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RpcEchoInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
           4  +
    /// [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput) using modelled bindings.
           5  +
    pub struct ReservedWordsAsMembersInputFuture {
           6  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ReservedWordsAsMembersInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
    7      7   
    }
    8      8   
}
    9      9   
   10         -
impl std::future::Future for RpcEchoInputFuture {
          10  +
impl std::future::Future for ReservedWordsAsMembersInputFuture {
   11     11   
    type Output = Result<
   12         -
        crate::input::RpcEchoInput,
          12  +
        crate::input::ReservedWordsAsMembersInput,
   13     13   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
   14     14   
    >;
   15     15   
   16     16   
    fn poll(
   17     17   
        self: std::pin::Pin<&mut Self>,
   18     18   
        cx: &mut std::task::Context<'_>,
   19     19   
    ) -> std::task::Poll<Self::Output> {
   20     20   
        let this = self.project();
   21     21   
        this.inner.as_mut().poll(cx)
   22     22   
    }
   23     23   
}
   24     24   
   25     25   
impl<B>
   26     26   
    ::aws_smithy_legacy_http_server::request::FromRequest<
   27     27   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
   28     28   
        B,
   29         -
    > for crate::input::RpcEchoInput
          29  +
    > for crate::input::ReservedWordsAsMembersInput
   30     30   
where
   31     31   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   32     32   
    B: 'static,
   33     33   
   34     34   
    B::Data: Send,
   35     35   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
   36     36   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   37     37   
{
   38     38   
    type Rejection =
   39     39   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
   40         -
    type Future = RpcEchoInputFuture;
          40  +
    type Future = ReservedWordsAsMembersInputFuture;
   41     41   
   42     42   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   43     43   
        let fut = async move {
   44     44   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
   45     45   
                request.headers(),
   46     46   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
   47     47   
            ) {
   48     48   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
   49     49   
            }
   50         -
            crate::protocol_serde::shape_rpc_echo::de_rpc_echo_http_request(request).await
          50  +
            crate::protocol_serde::shape_reserved_words_as_members::de_reserved_words_as_members_http_request(request)
          51  +
                            .await
   51     52   
        };
   52     53   
        use ::futures_util::future::TryFutureExt;
   53     54   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
   54     55   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
   55     56   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
   56     57   
                    });
   57         -
        RpcEchoInputFuture {
          58  +
        ReservedWordsAsMembersInputFuture {
   58     59   
            inner: Box::pin(fut),
   59     60   
        }
   60     61   
    }
   61     62   
}
   62     63   
impl
   63     64   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
   64     65   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
   65         -
    > for crate::output::RpcEchoOutput
          66  +
    > for crate::output::ReservedWordsAsMembersOutput
   66     67   
{
   67     68   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   68         -
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_response(self) {
   69         -
            Ok(response) => response,
   70         -
            Err(e) => {
   71         -
                ::tracing::error!(error = %e, "failed to serialize response");
   72         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
   73         -
            }
   74         -
        }
          69  +
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_response(self) {
          70  +
                        Ok(response) => response,
          71  +
                        Err(e) => {
          72  +
                            ::tracing::error!(error = %e, "failed to serialize response");
          73  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
          74  +
                        }
          75  +
                    }
   75     76   
    }
   76     77   
}
   77     78   
impl
   78     79   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
   79     80   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
   80         -
    > for crate::error::RPCEchoError
          81  +
    > for crate::error::ReservedWordsAsMembersError
   81     82   
{
   82     83   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   83         -
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_error(&self) {
          84  +
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_error(&self) {
   84     85   
            Ok(mut response) => {
   85         -
                response.extensions_mut().insert(
   86         -
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
   87         -
                        self.name(),
   88         -
                    ),
   89         -
                );
          86  +
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
   90     87   
                response
   91         -
            }
          88  +
            },
   92     89   
            Err(e) => {
   93     90   
                ::tracing::error!(error = %e, "failed to serialize response");
   94     91   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
   95     92   
            }
   96     93   
        }
   97     94   
    }
   98     95   
}
   99     96   
          97  +
#[allow(unreachable_code, unused_variables)]
          98  +
#[cfg(test)]
          99  +
mod reserved_words_as_members_test {
         100  +
         101  +
    /// Test ID: reserved_words
         102  +
    #[::tokio::test]
         103  +
    #[::tracing_test::traced_test]
         104  +
    async fn reserved_words_request() {
         105  +
        #[allow(unused_mut)]
         106  +
        let mut http_request = ::http::Request::builder()
         107  +
            .uri("/")
         108  +
            .method("POST")
         109  +
            .header("Content-Type", "application/x-amz-json-1.1")
         110  +
            .header("X-Amz-Target", "Config.ReservedWordsAsMembers")
         111  +
            .body(::aws_smithy_legacy_http_server::body::Body::from(
         112  +
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         113  +
                    "{\"as\": 5, \"async\": true}".as_bytes(),
         114  +
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
         115  +
                )),
         116  +
            ))
         117  +
            .unwrap();
         118  +
        #[allow(unused_mut)]
         119  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
         120  +
        let config = crate::service::ConfigConfig::builder().build();
         121  +
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
         122  +
            .reserved_words_as_members(move |input: crate::input::ReservedWordsAsMembersInput| {
         123  +
                let sender = sender.clone();
         124  +
                async move {
         125  +
                    let result = {
         126  +
                        let expected = crate::input::ReservedWordsAsMembersInput {
         127  +
                            r#as: ::std::option::Option::Some(5),
         128  +
                            r#async: ::std::option::Option::Some(true),
         129  +
                            r#enum: ::std::option::Option::None,
         130  +
                            self_: ::std::option::Option::None,
         131  +
                            crate_: ::std::option::Option::None,
         132  +
                            super_: ::std::option::Option::None,
         133  +
                            build_value: ::std::option::Option::None,
         134  +
                            default_value: ::std::option::Option::None,
         135  +
                            send: ::std::option::Option::None,
         136  +
                        };
         137  +
                        ::pretty_assertions::assert_eq!(input, expected);
         138  +
                        let output = crate::output::ReservedWordsAsMembersOutput {};
         139  +
                        Ok(output)
         140  +
                    };
         141  +
                    sender.send(()).await.expect("receiver dropped early");
         142  +
                    result
         143  +
                }
         144  +
            })
         145  +
            .build_unchecked();
         146  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
         147  +
            .await
         148  +
            .expect("unable to make an HTTP request");
         149  +
        assert!(
         150  +
            receiver.recv().await.is_some(),
         151  +
            "we expected operation handler to be invoked but it was not entered"
         152  +
        );
         153  +
    }
         154  +
}
         155  +
  100    156   
::pin_project_lite::pin_project! {
  101    157   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  102         -
    /// [`MatchInput`](crate::input::MatchInput) using modelled bindings.
  103         -
    pub struct MatchInputFuture {
  104         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MatchInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         158  +
    /// [`StructureNamePunningInput`](crate::input::StructureNamePunningInput) using modelled bindings.
         159  +
    pub struct StructureNamePunningInputFuture {
         160  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StructureNamePunningInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  105    161   
    }
  106    162   
}
  107    163   
  108         -
impl std::future::Future for MatchInputFuture {
         164  +
impl std::future::Future for StructureNamePunningInputFuture {
  109    165   
    type Output = Result<
  110         -
        crate::input::MatchInput,
         166  +
        crate::input::StructureNamePunningInput,
  111    167   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  112    168   
    >;
  113    169   
  114    170   
    fn poll(
  115    171   
        self: std::pin::Pin<&mut Self>,
  116    172   
        cx: &mut std::task::Context<'_>,
  117    173   
    ) -> std::task::Poll<Self::Output> {
  118    174   
        let this = self.project();
  119    175   
        this.inner.as_mut().poll(cx)
  120    176   
    }
  121    177   
}
  122    178   
  123    179   
impl<B>
  124    180   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  125    181   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  126    182   
        B,
  127         -
    > for crate::input::MatchInput
         183  +
    > for crate::input::StructureNamePunningInput
  128    184   
where
  129    185   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  130    186   
    B: 'static,
  131    187   
  132    188   
    B::Data: Send,
  133    189   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  134    190   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  135    191   
{
  136    192   
    type Rejection =
  137    193   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  138         -
    type Future = MatchInputFuture;
         194  +
    type Future = StructureNamePunningInputFuture;
  139    195   
  140    196   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  141    197   
        let fut = async move {
  142    198   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  143    199   
                request.headers(),
  144    200   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  145    201   
            ) {
  146    202   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  147    203   
            }
  148         -
            crate::protocol_serde::shape_match::de_match_http_request(request).await
         204  +
            crate::protocol_serde::shape_structure_name_punning::de_structure_name_punning_http_request(request)
         205  +
                            .await
  149    206   
        };
  150    207   
        use ::futures_util::future::TryFutureExt;
  151    208   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  152    209   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  153    210   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  154    211   
                    });
  155         -
        MatchInputFuture {
         212  +
        StructureNamePunningInputFuture {
  156    213   
            inner: Box::pin(fut),
  157    214   
        }
  158    215   
    }
  159    216   
}
  160    217   
impl
  161    218   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  162    219   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  163         -
    > for crate::output::MatchOutput
         220  +
    > for crate::output::StructureNamePunningOutput
  164    221   
{
  165    222   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  166         -
        match crate::protocol_serde::shape_match::ser_match_http_response(self) {
  167         -
            Ok(response) => response,
  168         -
            Err(e) => {
  169         -
                ::tracing::error!(error = %e, "failed to serialize response");
  170         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  171         -
            }
  172         -
        }
         223  +
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_response(self) {
         224  +
                        Ok(response) => response,
         225  +
                        Err(e) => {
         226  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         227  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         228  +
                        }
         229  +
                    }
  173    230   
    }
  174    231   
}
  175         -
impl
  176         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  177         -
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  178         -
    > for crate::error::MatchError
  179         -
{
  180         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  181         -
        match crate::protocol_serde::shape_match::ser_match_http_error(&self) {
  182         -
            Ok(mut response) => {
  183         -
                response.extensions_mut().insert(
  184         -
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
  185         -
                        self.name(),
  186         -
                    ),
  187         -
                );
  188         -
                response
  189         -
            }
  190         -
            Err(e) => {
  191         -
                ::tracing::error!(error = %e, "failed to serialize response");
  192         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  193         -
            }
  194         -
        }
         232  +
         233  +
#[allow(unreachable_code, unused_variables)]
         234  +
#[cfg(test)]
         235  +
mod structure_name_punning_test {
         236  +
         237  +
    /// Test ID: structure_punning
         238  +
    #[::tokio::test]
         239  +
    #[::tracing_test::traced_test]
         240  +
    async fn structure_punning_request() {
         241  +
        #[allow(unused_mut)]
         242  +
        let mut http_request = ::http::Request::builder()
         243  +
            .uri("/")
         244  +
            .method("POST")
         245  +
            .header("Content-Type", "application/x-amz-json-1.1")
         246  +
            .header("X-Amz-Target", "Config.StructureNamePunning")
         247  +
            .body(::aws_smithy_legacy_http_server::body::Body::from(
         248  +
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         249  +
                    "{\"regular_string\": \"hello!\"}".as_bytes(),
         250  +
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
         251  +
                )),
         252  +
            ))
         253  +
            .unwrap();
         254  +
        #[allow(unused_mut)]
         255  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
         256  +
        let config = crate::service::ConfigConfig::builder().build();
         257  +
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
         258  +
            .structure_name_punning(move |input: crate::input::StructureNamePunningInput| {
         259  +
                let sender = sender.clone();
         260  +
                async move {
         261  +
                    let result = {
         262  +
                        let expected = crate::input::StructureNamePunningInput {
         263  +
                            regular_string: ::std::option::Option::Some("hello!".to_owned()),
         264  +
                            punned_vec: ::std::option::Option::None,
         265  +
                        };
         266  +
                        ::pretty_assertions::assert_eq!(input, expected);
         267  +
                        let output = crate::output::StructureNamePunningOutput {};
         268  +
                        output
         269  +
                    };
         270  +
                    sender.send(()).await.expect("receiver dropped early");
         271  +
                    result
         272  +
                }
         273  +
            })
         274  +
            .build_unchecked();
         275  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
         276  +
            .await
         277  +
            .expect("unable to make an HTTP request");
         278  +
        assert!(
         279  +
            receiver.recv().await.is_some(),
         280  +
            "we expected operation handler to be invoked but it was not entered"
         281  +
        );
  195    282   
    }
  196    283   
}
  197    284   
  198    285   
::pin_project_lite::pin_project! {
  199    286   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  200         -
    /// [`OptionInput`](crate::input::OptionInput) using modelled bindings.
  201         -
    pub struct OptionInputFuture {
  202         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OptionInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         287  +
    /// [`ErrCollisionsInput`](crate::input::ErrCollisionsInput) using modelled bindings.
         288  +
    pub struct ErrCollisionsInputFuture {
         289  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ErrCollisionsInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  203    290   
    }
  204    291   
}
  205    292   
  206         -
impl std::future::Future for OptionInputFuture {
         293  +
impl std::future::Future for ErrCollisionsInputFuture {
  207    294   
    type Output = Result<
  208         -
        crate::input::OptionInput,
         295  +
        crate::input::ErrCollisionsInput,
  209    296   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  210    297   
    >;
  211    298   
  212    299   
    fn poll(
  213    300   
        self: std::pin::Pin<&mut Self>,
  214    301   
        cx: &mut std::task::Context<'_>,
  215    302   
    ) -> std::task::Poll<Self::Output> {
  216    303   
        let this = self.project();
  217    304   
        this.inner.as_mut().poll(cx)
  218    305   
    }
  219    306   
}
  220    307   
  221    308   
impl<B>
  222    309   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  223    310   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  224    311   
        B,
  225         -
    > for crate::input::OptionInput
         312  +
    > for crate::input::ErrCollisionsInput
  226    313   
where
  227    314   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  228    315   
    B: 'static,
  229    316   
  230    317   
    B::Data: Send,
  231    318   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  232    319   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  233    320   
{
  234    321   
    type Rejection =
  235    322   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  236         -
    type Future = OptionInputFuture;
         323  +
    type Future = ErrCollisionsInputFuture;
  237    324   
  238    325   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  239    326   
        let fut = async move {
  240    327   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  241    328   
                request.headers(),
  242    329   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  243    330   
            ) {
  244    331   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  245    332   
            }
  246         -
            crate::protocol_serde::shape_option::de_option_http_request(request).await
         333  +
            crate::protocol_serde::shape_err_collisions::de_err_collisions_http_request(request)
         334  +
                .await
  247    335   
        };
  248    336   
        use ::futures_util::future::TryFutureExt;
  249    337   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  250    338   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  251    339   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  252    340   
                    });
  253         -
        OptionInputFuture {
         341  +
        ErrCollisionsInputFuture {
  254    342   
            inner: Box::pin(fut),
  255    343   
        }
  256    344   
    }
  257    345   
}
  258    346   
impl
  259    347   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  260    348   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  261         -
    > for crate::output::OptionOutput
         349  +
    > for crate::output::ErrCollisionsOutput
  262    350   
{
  263    351   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  264         -
        match crate::protocol_serde::shape_option::ser_option_http_response(self) {
         352  +
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_response(self) {
  265    353   
            Ok(response) => response,
  266    354   
            Err(e) => {
  267    355   
                ::tracing::error!(error = %e, "failed to serialize response");
  268    356   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  269    357   
            }
  270    358   
        }
  271    359   
    }
  272    360   
}
         361  +
impl
         362  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         363  +
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
         364  +
    > for crate::error::ErrCollisionsError
         365  +
{
         366  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         367  +
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_error(&self) {
         368  +
            Ok(mut response) => {
         369  +
                response.extensions_mut().insert(
         370  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         371  +
                        self.name(),
         372  +
                    ),
         373  +
                );
         374  +
                response
         375  +
            }
         376  +
            Err(e) => {
         377  +
                ::tracing::error!(error = %e, "failed to serialize response");
         378  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         379  +
            }
         380  +
        }
         381  +
    }
         382  +
}
  273    383   
  274    384   
::pin_project_lite::pin_project! {
  275    385   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  276    386   
    /// [`ResultInput`](crate::input::ResultInput) using modelled bindings.
  277    387   
    pub struct ResultInputFuture {
  278    388   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResultInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  279    389   
    }
  280    390   
}
  281    391   
  282    392   
impl std::future::Future for ResultInputFuture {
@@ -322,432 +730,0 @@
  342    452   
            Err(e) => {
  343    453   
                ::tracing::error!(error = %e, "failed to serialize response");
  344    454   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  345    455   
            }
  346    456   
        }
  347    457   
    }
  348    458   
}
  349    459   
  350    460   
::pin_project_lite::pin_project! {
  351    461   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  352         -
    /// [`ErrCollisionsInput`](crate::input::ErrCollisionsInput) using modelled bindings.
  353         -
    pub struct ErrCollisionsInputFuture {
  354         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ErrCollisionsInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         462  +
    /// [`OptionInput`](crate::input::OptionInput) using modelled bindings.
         463  +
    pub struct OptionInputFuture {
         464  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OptionInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  355    465   
    }
  356    466   
}
  357    467   
  358         -
impl std::future::Future for ErrCollisionsInputFuture {
         468  +
impl std::future::Future for OptionInputFuture {
  359    469   
    type Output = Result<
  360         -
        crate::input::ErrCollisionsInput,
         470  +
        crate::input::OptionInput,
  361    471   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  362    472   
    >;
  363    473   
  364    474   
    fn poll(
  365    475   
        self: std::pin::Pin<&mut Self>,
  366    476   
        cx: &mut std::task::Context<'_>,
  367    477   
    ) -> std::task::Poll<Self::Output> {
  368    478   
        let this = self.project();
  369    479   
        this.inner.as_mut().poll(cx)
  370    480   
    }
  371    481   
}
  372    482   
  373    483   
impl<B>
  374    484   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  375    485   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  376    486   
        B,
  377         -
    > for crate::input::ErrCollisionsInput
         487  +
    > for crate::input::OptionInput
  378    488   
where
  379    489   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  380    490   
    B: 'static,
  381    491   
  382    492   
    B::Data: Send,
  383    493   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  384    494   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  385    495   
{
  386    496   
    type Rejection =
  387    497   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  388         -
    type Future = ErrCollisionsInputFuture;
         498  +
    type Future = OptionInputFuture;
  389    499   
  390    500   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  391    501   
        let fut = async move {
  392    502   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  393    503   
                request.headers(),
  394    504   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  395    505   
            ) {
  396    506   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  397    507   
            }
  398         -
            crate::protocol_serde::shape_err_collisions::de_err_collisions_http_request(request)
  399         -
                .await
         508  +
            crate::protocol_serde::shape_option::de_option_http_request(request).await
  400    509   
        };
  401    510   
        use ::futures_util::future::TryFutureExt;
  402    511   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  403    512   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  404    513   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  405    514   
                    });
  406         -
        ErrCollisionsInputFuture {
         515  +
        OptionInputFuture {
  407    516   
            inner: Box::pin(fut),
  408    517   
        }
  409    518   
    }
  410    519   
}
  411    520   
impl
  412    521   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  413    522   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  414         -
    > for crate::output::ErrCollisionsOutput
         523  +
    > for crate::output::OptionOutput
  415    524   
{
  416    525   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  417         -
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_response(self) {
         526  +
        match crate::protocol_serde::shape_option::ser_option_http_response(self) {
  418    527   
            Ok(response) => response,
  419    528   
            Err(e) => {
  420    529   
                ::tracing::error!(error = %e, "failed to serialize response");
  421    530   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  422    531   
            }
  423    532   
        }
  424    533   
    }
  425    534   
}
  426         -
impl
  427         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  428         -
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  429         -
    > for crate::error::ErrCollisionsError
  430         -
{
  431         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  432         -
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_error(&self) {
  433         -
            Ok(mut response) => {
  434         -
                response.extensions_mut().insert(
  435         -
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
  436         -
                        self.name(),
  437         -
                    ),
  438         -
                );
  439         -
                response
  440         -
            }
  441         -
            Err(e) => {
  442         -
                ::tracing::error!(error = %e, "failed to serialize response");
  443         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  444         -
            }
  445         -
        }
  446         -
    }
  447         -
}
  448    535   
  449    536   
::pin_project_lite::pin_project! {
  450    537   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  451         -
    /// [`StructureNamePunningInput`](crate::input::StructureNamePunningInput) using modelled bindings.
  452         -
    pub struct StructureNamePunningInputFuture {
  453         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StructureNamePunningInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         538  +
    /// [`MatchInput`](crate::input::MatchInput) using modelled bindings.
         539  +
    pub struct MatchInputFuture {
         540  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MatchInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  454    541   
    }
  455    542   
}
  456    543   
  457         -
impl std::future::Future for StructureNamePunningInputFuture {
         544  +
impl std::future::Future for MatchInputFuture {
  458    545   
    type Output = Result<
  459         -
        crate::input::StructureNamePunningInput,
         546  +
        crate::input::MatchInput,
  460    547   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  461    548   
    >;
  462    549   
  463    550   
    fn poll(
  464    551   
        self: std::pin::Pin<&mut Self>,
  465    552   
        cx: &mut std::task::Context<'_>,
  466    553   
    ) -> std::task::Poll<Self::Output> {
  467    554   
        let this = self.project();
  468    555   
        this.inner.as_mut().poll(cx)
  469    556   
    }
  470    557   
}
  471    558   
  472    559   
impl<B>
  473    560   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  474    561   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  475    562   
        B,
  476         -
    > for crate::input::StructureNamePunningInput
         563  +
    > for crate::input::MatchInput
  477    564   
where
  478    565   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  479    566   
    B: 'static,
  480    567   
  481    568   
    B::Data: Send,
  482    569   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  483    570   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  484    571   
{
  485    572   
    type Rejection =
  486    573   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  487         -
    type Future = StructureNamePunningInputFuture;
         574  +
    type Future = MatchInputFuture;
  488    575   
  489    576   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  490    577   
        let fut = async move {
  491    578   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  492    579   
                request.headers(),
  493    580   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  494    581   
            ) {
  495    582   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  496    583   
            }
  497         -
            crate::protocol_serde::shape_structure_name_punning::de_structure_name_punning_http_request(request)
  498         -
                            .await
         584  +
            crate::protocol_serde::shape_match::de_match_http_request(request).await
  499    585   
        };
  500    586   
        use ::futures_util::future::TryFutureExt;
  501    587   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  502    588   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  503    589   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  504    590   
                    });
  505         -
        StructureNamePunningInputFuture {
         591  +
        MatchInputFuture {
  506    592   
            inner: Box::pin(fut),
  507    593   
        }
  508    594   
    }
  509    595   
}
  510    596   
impl
  511    597   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  512    598   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  513         -
    > for crate::output::StructureNamePunningOutput
         599  +
    > for crate::output::MatchOutput
  514    600   
{
  515    601   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  516         -
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_response(self) {
  517         -
                        Ok(response) => response,
  518         -
                        Err(e) => {
  519         -
                            ::tracing::error!(error = %e, "failed to serialize response");
  520         -
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  521         -
                        }
  522         -
                    }
         602  +
        match crate::protocol_serde::shape_match::ser_match_http_response(self) {
         603  +
            Ok(response) => response,
         604  +
            Err(e) => {
         605  +
                ::tracing::error!(error = %e, "failed to serialize response");
         606  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         607  +
            }
         608  +
        }
  523    609   
    }
  524    610   
}
  525         -
  526         -
#[allow(unreachable_code, unused_variables)]
  527         -
#[cfg(test)]
  528         -
mod structure_name_punning_test {
  529         -
  530         -
    /// Test ID: structure_punning
  531         -
    #[::tokio::test]
  532         -
    #[::tracing_test::traced_test]
  533         -
    async fn structure_punning_request() {
  534         -
        #[allow(unused_mut)]
  535         -
        let mut http_request = ::http::Request::builder()
  536         -
            .uri("/")
  537         -
            .method("POST")
  538         -
            .header("Content-Type", "application/x-amz-json-1.1")
  539         -
            .header("X-Amz-Target", "Config.StructureNamePunning")
  540         -
            .body(::aws_smithy_legacy_http_server::body::Body::from(
  541         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  542         -
                    "{\"regular_string\": \"hello!\"}".as_bytes(),
  543         -
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  544         -
                )),
  545         -
            ))
  546         -
            .unwrap();
  547         -
        #[allow(unused_mut)]
  548         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  549         -
        let config = crate::service::ConfigConfig::builder().build();
  550         -
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
  551         -
            .structure_name_punning(move |input: crate::input::StructureNamePunningInput| {
  552         -
                let sender = sender.clone();
  553         -
                async move {
  554         -
                    let result = {
  555         -
                        let expected = crate::input::StructureNamePunningInput {
  556         -
                            regular_string: ::std::option::Option::Some("hello!".to_owned()),
  557         -
                            punned_vec: ::std::option::Option::None,
  558         -
                        };
  559         -
                        ::pretty_assertions::assert_eq!(input, expected);
  560         -
                        let output = crate::output::StructureNamePunningOutput {};
  561         -
                        output
  562         -
                    };
  563         -
                    sender.send(()).await.expect("receiver dropped early");
  564         -
                    result
  565         -
                }
  566         -
            })
  567         -
            .build_unchecked();
  568         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  569         -
            .await
  570         -
            .expect("unable to make an HTTP request");
  571         -
        assert!(
  572         -
            receiver.recv().await.is_some(),
  573         -
            "we expected operation handler to be invoked but it was not entered"
  574         -
        );
         611  +
impl
         612  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         613  +
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
         614  +
    > for crate::error::MatchError
         615  +
{
         616  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         617  +
        match crate::protocol_serde::shape_match::ser_match_http_error(&self) {
         618  +
            Ok(mut response) => {
         619  +
                response.extensions_mut().insert(
         620  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         621  +
                        self.name(),
         622  +
                    ),
         623  +
                );
         624  +
                response
         625  +
            }
         626  +
            Err(e) => {
         627  +
                ::tracing::error!(error = %e, "failed to serialize response");
         628  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         629  +
            }
         630  +
        }
  575    631   
    }
  576    632   
}
  577    633   
  578    634   
::pin_project_lite::pin_project! {
  579    635   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  580         -
    /// [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput) using modelled bindings.
  581         -
    pub struct ReservedWordsAsMembersInputFuture {
  582         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ReservedWordsAsMembersInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         636  +
    /// [`RpcEchoInput`](crate::input::RpcEchoInput) using modelled bindings.
         637  +
    pub struct RpcEchoInputFuture {
         638  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RpcEchoInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  583    639   
    }
  584    640   
}
  585    641   
  586         -
impl std::future::Future for ReservedWordsAsMembersInputFuture {
         642  +
impl std::future::Future for RpcEchoInputFuture {
  587    643   
    type Output = Result<
  588         -
        crate::input::ReservedWordsAsMembersInput,
         644  +
        crate::input::RpcEchoInput,
  589    645   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  590    646   
    >;
  591    647   
  592    648   
    fn poll(
  593    649   
        self: std::pin::Pin<&mut Self>,
  594    650   
        cx: &mut std::task::Context<'_>,
  595    651   
    ) -> std::task::Poll<Self::Output> {
  596    652   
        let this = self.project();
  597    653   
        this.inner.as_mut().poll(cx)
  598    654   
    }
  599    655   
}
  600    656   
  601    657   
impl<B>
  602    658   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  603    659   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  604    660   
        B,
  605         -
    > for crate::input::ReservedWordsAsMembersInput
         661  +
    > for crate::input::RpcEchoInput
  606    662   
where
  607    663   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  608    664   
    B: 'static,
  609    665   
  610    666   
    B::Data: Send,
  611    667   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  612    668   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  613    669   
{
  614    670   
    type Rejection =
  615    671   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  616         -
    type Future = ReservedWordsAsMembersInputFuture;
         672  +
    type Future = RpcEchoInputFuture;
  617    673   
  618    674   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  619    675   
        let fut = async move {
  620    676   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  621    677   
                request.headers(),
  622    678   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  623    679   
            ) {
  624    680   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  625    681   
            }
  626         -
            crate::protocol_serde::shape_reserved_words_as_members::de_reserved_words_as_members_http_request(request)
  627         -
                            .await
         682  +
            crate::protocol_serde::shape_rpc_echo::de_rpc_echo_http_request(request).await
  628    683   
        };
  629    684   
        use ::futures_util::future::TryFutureExt;
  630    685   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  631    686   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  632    687   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  633    688   
                    });
  634         -
        ReservedWordsAsMembersInputFuture {
         689  +
        RpcEchoInputFuture {
  635    690   
            inner: Box::pin(fut),
  636    691   
        }
  637    692   
    }
  638    693   
}
  639    694   
impl
  640    695   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  641    696   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  642         -
    > for crate::output::ReservedWordsAsMembersOutput
         697  +
    > for crate::output::RpcEchoOutput
  643    698   
{
  644    699   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  645         -
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_response(self) {
  646         -
                        Ok(response) => response,
  647         -
                        Err(e) => {
  648         -
                            ::tracing::error!(error = %e, "failed to serialize response");
  649         -
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  650         -
                        }
  651         -
                    }
         700  +
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_response(self) {
         701  +
            Ok(response) => response,
         702  +
            Err(e) => {
         703  +
                ::tracing::error!(error = %e, "failed to serialize response");
         704  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         705  +
            }
         706  +
        }
  652    707   
    }
  653    708   
}
  654    709   
impl
  655    710   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  656    711   
        ::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1,
  657         -
    > for crate::error::ReservedWordsAsMembersError
         712  +
    > for crate::error::RPCEchoError
  658    713   
{
  659    714   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  660         -
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_error(&self) {
         715  +
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_error(&self) {
  661    716   
            Ok(mut response) => {
  662         -
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
         717  +
                response.extensions_mut().insert(
         718  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         719  +
                        self.name(),
         720  +
                    ),
         721  +
                );
  663    722   
                response
  664         -
            },
         723  +
            }
  665    724   
            Err(e) => {
  666    725   
                ::tracing::error!(error = %e, "failed to serialize response");
  667    726   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  668    727   
            }
  669    728   
        }
  670    729   
    }
  671    730   
}
  672         -
  673         -
#[allow(unreachable_code, unused_variables)]
  674         -
#[cfg(test)]
  675         -
mod reserved_words_as_members_test {
  676         -
  677         -
    /// Test ID: reserved_words
  678         -
    #[::tokio::test]
  679         -
    #[::tracing_test::traced_test]
  680         -
    async fn reserved_words_request() {
  681         -
        #[allow(unused_mut)]
  682         -
        let mut http_request = ::http::Request::builder()
  683         -
            .uri("/")
  684         -
            .method("POST")
  685         -
            .header("Content-Type", "application/x-amz-json-1.1")
  686         -
            .header("X-Amz-Target", "Config.ReservedWordsAsMembers")
  687         -
            .body(::aws_smithy_legacy_http_server::body::Body::from(
  688         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  689         -
                    "{\"as\": 5, \"async\": true}".as_bytes(),
  690         -
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  691         -
                )),
  692         -
            ))
  693         -
            .unwrap();
  694         -
        #[allow(unused_mut)]
  695         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  696         -
        let config = crate::service::ConfigConfig::builder().build();
  697         -
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
  698         -
            .reserved_words_as_members(move |input: crate::input::ReservedWordsAsMembersInput| {
  699         -
                let sender = sender.clone();
  700         -
                async move {
  701         -
                    let result = {
  702         -
                        let expected = crate::input::ReservedWordsAsMembersInput {
  703         -
                            r#as: ::std::option::Option::Some(5),
  704         -
                            r#async: ::std::option::Option::Some(true),
  705         -
                            r#enum: ::std::option::Option::None,
  706         -
                            self_: ::std::option::Option::None,
  707         -
                            crate_: ::std::option::Option::None,
  708         -
                            super_: ::std::option::Option::None,
  709         -
                            build_value: ::std::option::Option::None,
  710         -
                            default_value: ::std::option::Option::None,
  711         -
                            send: ::std::option::Option::None,
  712         -
                        };
  713         -
                        ::pretty_assertions::assert_eq!(input, expected);
  714         -
                        let output = crate::output::ReservedWordsAsMembersOutput {};
  715         -
                        Ok(output)
  716         -
                    };
  717         -
                    sender.send(()).await.expect("receiver dropped early");
  718         -
                    result
  719         -
                }
  720         -
            })
  721         -
            .build_unchecked();
  722         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  723         -
            .await
  724         -
            .expect("unable to make an HTTP request");
  725         -
        assert!(
  726         -
            receiver.recv().await.is_some(),
  727         -
            "we expected operation handler to be invoked but it was not entered"
  728         -
        );
  729         -
    }
  730         -
}

tmp-codegen-diff/codegen-server-test/naming_test_ops-http0x/rust-server-codegen/src/operation_shape.rs

@@ -1,1 +209,209 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3         -
pub struct RpcEcho;
           3  +
pub struct ReservedWordsAsMembers;
    4      4   
    5         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for RpcEcho {
           5  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ReservedWordsAsMembers {
    6      6   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
    7      7   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
    8         -
            "crate#RPCEcho",
           8  +
            "crate#ReservedWordsAsMembers",
    9      9   
            "crate",
   10         -
            "RPCEcho",
          10  +
            "ReservedWordsAsMembers",
   11     11   
        );
   12     12   
   13         -
    type Input = crate::input::RpcEchoInput;
   14         -
    type Output = crate::output::RpcEchoOutput;
   15         -
    type Error = crate::error::RPCEchoError;
          13  +
    type Input = crate::input::ReservedWordsAsMembersInput;
          14  +
    type Output = crate::output::ReservedWordsAsMembersOutput;
          15  +
    type Error = crate::error::ReservedWordsAsMembersError;
   16     16   
}
   17     17   
   18         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for RpcEcho {
          18  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
          19  +
    for ReservedWordsAsMembers
          20  +
{
   19     21   
    type RequestFmt =
   20     22   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   21     23   
    type ResponseFmt =
   22     24   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   23     25   
   24     26   
    fn request_fmt() -> Self::RequestFmt {
   25     27   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   26     28   
    }
   27     29   
   28     30   
    fn response_fmt() -> Self::ResponseFmt {
   29     31   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   30     32   
    }
   31     33   
}
   32     34   
   33     35   
#[allow(missing_docs)] // documentation missing in model
   34         -
pub struct Match;
          36  +
pub struct StructureNamePunning;
   35     37   
   36         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Match {
          38  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for StructureNamePunning {
   37     39   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   38         -
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Match", "crate", "Match");
          40  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
          41  +
            "crate#StructureNamePunning",
          42  +
            "crate",
          43  +
            "StructureNamePunning",
          44  +
        );
   39     45   
   40         -
    type Input = crate::input::MatchInput;
   41         -
    type Output = crate::output::MatchOutput;
   42         -
    type Error = crate::error::MatchError;
          46  +
    type Input = crate::input::StructureNamePunningInput;
          47  +
    type Output = crate::output::StructureNamePunningOutput;
          48  +
    type Error = std::convert::Infallible;
   43     49   
}
   44     50   
   45         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Match {
          51  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
          52  +
    for StructureNamePunning
          53  +
{
   46     54   
    type RequestFmt =
   47     55   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   48     56   
    type ResponseFmt =
   49     57   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   50     58   
   51     59   
    fn request_fmt() -> Self::RequestFmt {
   52     60   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   53     61   
    }
   54     62   
   55     63   
    fn response_fmt() -> Self::ResponseFmt {
   56     64   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   57     65   
    }
   58     66   
}
   59     67   
   60     68   
#[allow(missing_docs)] // documentation missing in model
   61         -
pub struct Option;
          69  +
pub struct ErrCollisions;
   62     70   
   63         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Option {
          71  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ErrCollisions {
   64     72   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   65         -
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Option", "crate", "Option");
          73  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
          74  +
            "crate#ErrCollisions",
          75  +
            "crate",
          76  +
            "ErrCollisions",
          77  +
        );
   66     78   
   67         -
    type Input = crate::input::OptionInput;
   68         -
    type Output = crate::output::OptionOutput;
   69         -
    type Error = std::convert::Infallible;
          79  +
    type Input = crate::input::ErrCollisionsInput;
          80  +
    type Output = crate::output::ErrCollisionsOutput;
          81  +
    type Error = crate::error::ErrCollisionsError;
   70     82   
}
   71     83   
   72         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Option {
          84  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for ErrCollisions {
   73     85   
    type RequestFmt =
   74     86   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   75     87   
    type ResponseFmt =
   76     88   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   77     89   
   78     90   
    fn request_fmt() -> Self::RequestFmt {
   79     91   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   80     92   
    }
   81     93   
   82     94   
    fn response_fmt() -> Self::ResponseFmt {
   83     95   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   84     96   
    }
   85     97   
}
   86     98   
   87     99   
#[allow(missing_docs)] // documentation missing in model
   88    100   
pub struct Result;
   89    101   
   90    102   
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Result {
   91    103   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   92    104   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Result", "crate", "Result");
   93    105   
   94    106   
    type Input = crate::input::ResultInput;
   95    107   
    type Output = crate::output::ResultOutput;
   96    108   
    type Error = std::convert::Infallible;
   97    109   
}
   98    110   
   99    111   
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Result {
  100    112   
    type RequestFmt =
  101    113   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  102    114   
    type ResponseFmt =
  103    115   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  104    116   
  105    117   
    fn request_fmt() -> Self::RequestFmt {
  106    118   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  107    119   
    }
  108    120   
  109    121   
    fn response_fmt() -> Self::ResponseFmt {
  110    122   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  111    123   
    }
  112    124   
}
  113    125   
  114    126   
#[allow(missing_docs)] // documentation missing in model
  115         -
pub struct ErrCollisions;
         127  +
pub struct Option;
  116    128   
  117         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ErrCollisions {
         129  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Option {
  118    130   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  119         -
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  120         -
            "crate#ErrCollisions",
  121         -
            "crate",
  122         -
            "ErrCollisions",
  123         -
        );
         131  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Option", "crate", "Option");
  124    132   
  125         -
    type Input = crate::input::ErrCollisionsInput;
  126         -
    type Output = crate::output::ErrCollisionsOutput;
  127         -
    type Error = crate::error::ErrCollisionsError;
         133  +
    type Input = crate::input::OptionInput;
         134  +
    type Output = crate::output::OptionOutput;
         135  +
    type Error = std::convert::Infallible;
  128    136   
}
  129    137   
  130         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for ErrCollisions {
         138  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Option {
  131    139   
    type RequestFmt =
  132    140   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  133    141   
    type ResponseFmt =
  134    142   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  135    143   
  136    144   
    fn request_fmt() -> Self::RequestFmt {
  137    145   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  138    146   
    }
  139    147   
  140    148   
    fn response_fmt() -> Self::ResponseFmt {
  141    149   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  142    150   
    }
  143    151   
}
  144    152   
  145    153   
#[allow(missing_docs)] // documentation missing in model
  146         -
pub struct StructureNamePunning;
         154  +
pub struct Match;
  147    155   
  148         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for StructureNamePunning {
         156  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for Match {
  149    157   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  150         -
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  151         -
            "crate#StructureNamePunning",
  152         -
            "crate",
  153         -
            "StructureNamePunning",
  154         -
        );
         158  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new("crate#Match", "crate", "Match");
  155    159   
  156         -
    type Input = crate::input::StructureNamePunningInput;
  157         -
    type Output = crate::output::StructureNamePunningOutput;
  158         -
    type Error = std::convert::Infallible;
         160  +
    type Input = crate::input::MatchInput;
         161  +
    type Output = crate::output::MatchOutput;
         162  +
    type Error = crate::error::MatchError;
  159    163   
}
  160    164   
  161         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
  162         -
    for StructureNamePunning
  163         -
{
         165  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for Match {
  164    166   
    type RequestFmt =
  165    167   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  166    168   
    type ResponseFmt =
  167    169   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  168    170   
  169    171   
    fn request_fmt() -> Self::RequestFmt {
  170    172   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  171    173   
    }
  172    174   
  173    175   
    fn response_fmt() -> Self::ResponseFmt {
  174    176   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  175    177   
    }
  176    178   
}
  177    179   
  178    180   
#[allow(missing_docs)] // documentation missing in model
  179         -
pub struct ReservedWordsAsMembers;
         181  +
pub struct RpcEcho;
  180    182   
  181         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ReservedWordsAsMembers {
         183  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for RpcEcho {
  182    184   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  183    185   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  184         -
            "crate#ReservedWordsAsMembers",
         186  +
            "crate#RPCEcho",
  185    187   
            "crate",
  186         -
            "ReservedWordsAsMembers",
         188  +
            "RPCEcho",
  187    189   
        );
  188    190   
  189         -
    type Input = crate::input::ReservedWordsAsMembersInput;
  190         -
    type Output = crate::output::ReservedWordsAsMembersOutput;
  191         -
    type Error = crate::error::ReservedWordsAsMembersError;
         191  +
    type Input = crate::input::RpcEchoInput;
         192  +
    type Output = crate::output::RpcEchoOutput;
         193  +
    type Error = crate::error::RPCEchoError;
  192    194   
}
  193    195   
  194         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
  195         -
    for ReservedWordsAsMembers
  196         -
{
         196  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for RpcEcho {
  197    197   
    type RequestFmt =
  198    198   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  199    199   
    type ResponseFmt =
  200    200   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  201    201   
  202    202   
    fn request_fmt() -> Self::RequestFmt {
  203    203   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  204    204   
    }
  205    205   
  206    206   
    fn response_fmt() -> Self::ResponseFmt {

tmp-codegen-diff/codegen-server-test/naming_test_ops-http0x/rust-server-codegen/src/output.rs

@@ -1,1 +249,249 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3      3   
#[derive(
    4      4   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5      5   
)]
    6         -
pub struct RpcEchoOutput {}
    7         -
impl RpcEchoOutput {
    8         -
    /// Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
    9         -
    pub fn builder() -> crate::output::rpc_echo_output::Builder {
   10         -
        crate::output::rpc_echo_output::Builder::default()
           6  +
pub struct ReservedWordsAsMembersOutput {}
           7  +
impl ReservedWordsAsMembersOutput {
           8  +
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
           9  +
    pub fn builder() -> crate::output::reserved_words_as_members_output::Builder {
          10  +
        crate::output::reserved_words_as_members_output::Builder::default()
   11     11   
    }
   12     12   
}
   13     13   
   14     14   
#[allow(missing_docs)] // documentation missing in model
   15     15   
#[derive(
   16     16   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   17     17   
)]
   18         -
pub struct MatchOutput {}
   19         -
impl MatchOutput {
   20         -
    /// Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
   21         -
    pub fn builder() -> crate::output::match_output::Builder {
   22         -
        crate::output::match_output::Builder::default()
          18  +
pub struct StructureNamePunningOutput {}
          19  +
impl StructureNamePunningOutput {
          20  +
    /// Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
          21  +
    pub fn builder() -> crate::output::structure_name_punning_output::Builder {
          22  +
        crate::output::structure_name_punning_output::Builder::default()
   23     23   
    }
   24     24   
}
   25     25   
   26     26   
#[allow(missing_docs)] // documentation missing in model
   27     27   
#[derive(
   28     28   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   29     29   
)]
   30         -
pub struct OptionOutput {}
   31         -
impl OptionOutput {
   32         -
    /// Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
   33         -
    pub fn builder() -> crate::output::option_output::Builder {
   34         -
        crate::output::option_output::Builder::default()
          30  +
pub struct ErrCollisionsOutput {}
          31  +
impl ErrCollisionsOutput {
          32  +
    /// Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
          33  +
    pub fn builder() -> crate::output::err_collisions_output::Builder {
          34  +
        crate::output::err_collisions_output::Builder::default()
   35     35   
    }
   36     36   
}
   37     37   
   38     38   
#[allow(missing_docs)] // documentation missing in model
   39     39   
#[derive(
   40     40   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   41     41   
)]
   42     42   
pub struct ResultOutput {
   43     43   
    #[allow(missing_docs)] // documentation missing in model
   44     44   
    pub pv_member: ::std::option::Option<bool>,
   45     45   
}
   46     46   
impl ResultOutput {
   47     47   
    #[allow(missing_docs)] // documentation missing in model
   48     48   
    pub fn pv_member(&self) -> ::std::option::Option<bool> {
   49     49   
        self.pv_member
   50     50   
    }
   51     51   
}
   52     52   
impl ResultOutput {
   53     53   
    /// Creates a new builder-style object to manufacture [`ResultOutput`](crate::output::ResultOutput).
   54     54   
    pub fn builder() -> crate::output::result_output::Builder {
   55     55   
        crate::output::result_output::Builder::default()
   56     56   
    }
   57     57   
}
   58     58   
   59     59   
#[allow(missing_docs)] // documentation missing in model
   60     60   
#[derive(
   61     61   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   62     62   
)]
   63         -
pub struct ErrCollisionsOutput {}
   64         -
impl ErrCollisionsOutput {
   65         -
    /// Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
   66         -
    pub fn builder() -> crate::output::err_collisions_output::Builder {
   67         -
        crate::output::err_collisions_output::Builder::default()
          63  +
pub struct OptionOutput {}
          64  +
impl OptionOutput {
          65  +
    /// Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
          66  +
    pub fn builder() -> crate::output::option_output::Builder {
          67  +
        crate::output::option_output::Builder::default()
   68     68   
    }
   69     69   
}
   70     70   
   71     71   
#[allow(missing_docs)] // documentation missing in model
   72     72   
#[derive(
   73     73   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   74     74   
)]
   75         -
pub struct StructureNamePunningOutput {}
   76         -
impl StructureNamePunningOutput {
   77         -
    /// Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
   78         -
    pub fn builder() -> crate::output::structure_name_punning_output::Builder {
   79         -
        crate::output::structure_name_punning_output::Builder::default()
          75  +
pub struct MatchOutput {}
          76  +
impl MatchOutput {
          77  +
    /// Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
          78  +
    pub fn builder() -> crate::output::match_output::Builder {
          79  +
        crate::output::match_output::Builder::default()
   80     80   
    }
   81     81   
}
   82     82   
   83     83   
#[allow(missing_docs)] // documentation missing in model
   84     84   
#[derive(
   85     85   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   86     86   
)]
   87         -
pub struct ReservedWordsAsMembersOutput {}
   88         -
impl ReservedWordsAsMembersOutput {
   89         -
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
   90         -
    pub fn builder() -> crate::output::reserved_words_as_members_output::Builder {
   91         -
        crate::output::reserved_words_as_members_output::Builder::default()
          87  +
pub struct RpcEchoOutput {}
          88  +
impl RpcEchoOutput {
          89  +
    /// Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
          90  +
    pub fn builder() -> crate::output::rpc_echo_output::Builder {
          91  +
        crate::output::rpc_echo_output::Builder::default()
   92     92   
    }
   93     93   
}
   94         -
/// See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
   95         -
pub mod rpc_echo_output {
          94  +
/// See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
          95  +
pub mod reserved_words_as_members_output {
   96     96   
   97         -
    impl ::std::convert::From<Builder> for crate::output::RpcEchoOutput {
          97  +
    impl ::std::convert::From<Builder> for crate::output::ReservedWordsAsMembersOutput {
   98     98   
        fn from(builder: Builder) -> Self {
   99     99   
            builder.build()
  100    100   
        }
  101    101   
    }
  102         -
    /// A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         102  +
    /// A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  103    103   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  104    104   
    pub struct Builder {}
  105    105   
    impl Builder {
  106         -
        /// Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
  107         -
        pub fn build(self) -> crate::output::RpcEchoOutput {
         106  +
        /// Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         107  +
        pub fn build(self) -> crate::output::ReservedWordsAsMembersOutput {
  108    108   
            self.build_enforcing_all_constraints()
  109    109   
        }
  110         -
        fn build_enforcing_all_constraints(self) -> crate::output::RpcEchoOutput {
  111         -
            crate::output::RpcEchoOutput {}
         110  +
        fn build_enforcing_all_constraints(self) -> crate::output::ReservedWordsAsMembersOutput {
         111  +
            crate::output::ReservedWordsAsMembersOutput {}
  112    112   
        }
  113    113   
    }
  114    114   
}
  115         -
/// See [`MatchOutput`](crate::output::MatchOutput).
  116         -
pub mod match_output {
         115  +
/// See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         116  +
pub mod structure_name_punning_output {
  117    117   
  118         -
    impl ::std::convert::From<Builder> for crate::output::MatchOutput {
         118  +
    impl ::std::convert::From<Builder> for crate::output::StructureNamePunningOutput {
  119    119   
        fn from(builder: Builder) -> Self {
  120    120   
            builder.build()
  121    121   
        }
  122    122   
    }
  123         -
    /// A builder for [`MatchOutput`](crate::output::MatchOutput).
         123  +
    /// A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  124    124   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  125    125   
    pub struct Builder {}
  126    126   
    impl Builder {
  127         -
        /// Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
  128         -
        pub fn build(self) -> crate::output::MatchOutput {
         127  +
        /// Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         128  +
        pub fn build(self) -> crate::output::StructureNamePunningOutput {
  129    129   
            self.build_enforcing_all_constraints()
  130    130   
        }
  131         -
        fn build_enforcing_all_constraints(self) -> crate::output::MatchOutput {
  132         -
            crate::output::MatchOutput {}
         131  +
        fn build_enforcing_all_constraints(self) -> crate::output::StructureNamePunningOutput {
         132  +
            crate::output::StructureNamePunningOutput {}
  133    133   
        }
  134    134   
    }
  135    135   
}
  136         -
/// See [`OptionOutput`](crate::output::OptionOutput).
  137         -
pub mod option_output {
         136  +
/// See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         137  +
pub mod err_collisions_output {
  138    138   
  139         -
    impl ::std::convert::From<Builder> for crate::output::OptionOutput {
         139  +
    impl ::std::convert::From<Builder> for crate::output::ErrCollisionsOutput {
  140    140   
        fn from(builder: Builder) -> Self {
  141    141   
            builder.build()
  142    142   
        }
  143    143   
    }
  144         -
    /// A builder for [`OptionOutput`](crate::output::OptionOutput).
         144  +
    /// A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  145    145   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  146    146   
    pub struct Builder {}
  147    147   
    impl Builder {
  148         -
        /// Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
  149         -
        pub fn build(self) -> crate::output::OptionOutput {
         148  +
        /// Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         149  +
        pub fn build(self) -> crate::output::ErrCollisionsOutput {
  150    150   
            self.build_enforcing_all_constraints()
  151    151   
        }
  152         -
        fn build_enforcing_all_constraints(self) -> crate::output::OptionOutput {
  153         -
            crate::output::OptionOutput {}
         152  +
        fn build_enforcing_all_constraints(self) -> crate::output::ErrCollisionsOutput {
         153  +
            crate::output::ErrCollisionsOutput {}
  154    154   
        }
  155    155   
    }
  156    156   
}
  157    157   
/// See [`ResultOutput`](crate::output::ResultOutput).
  158    158   
pub mod result_output {
  159    159   
  160    160   
    impl ::std::convert::From<Builder> for crate::output::ResultOutput {
  161    161   
        fn from(builder: Builder) -> Self {
  162    162   
            builder.build()
  163    163   
        }
  164    164   
    }
  165    165   
    /// A builder for [`ResultOutput`](crate::output::ResultOutput).
  166    166   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  167    167   
    pub struct Builder {
  168    168   
        pub(crate) pv_member: ::std::option::Option<bool>,
  169    169   
    }
  170    170   
    impl Builder {
  171    171   
        #[allow(missing_docs)] // documentation missing in model
  172    172   
        pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
  173    173   
            self.pv_member = input;
  174    174   
            self
  175    175   
        }
  176    176   
        /// Consumes the builder and constructs a [`ResultOutput`](crate::output::ResultOutput).
  177    177   
        pub fn build(self) -> crate::output::ResultOutput {
  178    178   
            self.build_enforcing_all_constraints()
  179    179   
        }
  180    180   
        fn build_enforcing_all_constraints(self) -> crate::output::ResultOutput {
  181    181   
            crate::output::ResultOutput {
  182    182   
                pv_member: self.pv_member,
  183    183   
            }
  184    184   
        }
  185    185   
    }
  186    186   
}
  187         -
/// See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  188         -
pub mod err_collisions_output {
         187  +
/// See [`OptionOutput`](crate::output::OptionOutput).
         188  +
pub mod option_output {
  189    189   
  190         -
    impl ::std::convert::From<Builder> for crate::output::ErrCollisionsOutput {
         190  +
    impl ::std::convert::From<Builder> for crate::output::OptionOutput {
  191    191   
        fn from(builder: Builder) -> Self {
  192    192   
            builder.build()
  193    193   
        }
  194    194   
    }
  195         -
    /// A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         195  +
    /// A builder for [`OptionOutput`](crate::output::OptionOutput).
  196    196   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  197    197   
    pub struct Builder {}
  198    198   
    impl Builder {
  199         -
        /// Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  200         -
        pub fn build(self) -> crate::output::ErrCollisionsOutput {
         199  +
        /// Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
         200  +
        pub fn build(self) -> crate::output::OptionOutput {
  201    201   
            self.build_enforcing_all_constraints()
  202    202   
        }
  203         -
        fn build_enforcing_all_constraints(self) -> crate::output::ErrCollisionsOutput {
  204         -
            crate::output::ErrCollisionsOutput {}
         203  +
        fn build_enforcing_all_constraints(self) -> crate::output::OptionOutput {
         204  +
            crate::output::OptionOutput {}
  205    205   
        }
  206    206   
    }
  207    207   
}
  208         -
/// See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  209         -
pub mod structure_name_punning_output {
         208  +
/// See [`MatchOutput`](crate::output::MatchOutput).
         209  +
pub mod match_output {
  210    210   
  211         -
    impl ::std::convert::From<Builder> for crate::output::StructureNamePunningOutput {
         211  +
    impl ::std::convert::From<Builder> for crate::output::MatchOutput {
  212    212   
        fn from(builder: Builder) -> Self {
  213    213   
            builder.build()
  214    214   
        }
  215    215   
    }
  216         -
    /// A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         216  +
    /// A builder for [`MatchOutput`](crate::output::MatchOutput).
  217    217   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  218    218   
    pub struct Builder {}
  219    219   
    impl Builder {
  220         -
        /// Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  221         -
        pub fn build(self) -> crate::output::StructureNamePunningOutput {
         220  +
        /// Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
         221  +
        pub fn build(self) -> crate::output::MatchOutput {
  222    222   
            self.build_enforcing_all_constraints()
  223    223   
        }
  224         -
        fn build_enforcing_all_constraints(self) -> crate::output::StructureNamePunningOutput {
  225         -
            crate::output::StructureNamePunningOutput {}
         224  +
        fn build_enforcing_all_constraints(self) -> crate::output::MatchOutput {
         225  +
            crate::output::MatchOutput {}
  226    226   
        }
  227    227   
    }
  228    228   
}
  229         -
/// See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  230         -
pub mod reserved_words_as_members_output {
         229  +
/// See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         230  +
pub mod rpc_echo_output {
  231    231   
  232         -
    impl ::std::convert::From<Builder> for crate::output::ReservedWordsAsMembersOutput {
         232  +
    impl ::std::convert::From<Builder> for crate::output::RpcEchoOutput {
  233    233   
        fn from(builder: Builder) -> Self {
  234    234   
            builder.build()
  235    235   
        }
  236    236   
    }
  237         -
    /// A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         237  +
    /// A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
  238    238   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  239    239   
    pub struct Builder {}
  240    240   
    impl Builder {
  241         -
        /// Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  242         -
        pub fn build(self) -> crate::output::ReservedWordsAsMembersOutput {
         241  +
        /// Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         242  +
        pub fn build(self) -> crate::output::RpcEchoOutput {
  243    243   
            self.build_enforcing_all_constraints()
  244    244   
        }
  245         -
        fn build_enforcing_all_constraints(self) -> crate::output::ReservedWordsAsMembersOutput {
  246         -
            crate::output::ReservedWordsAsMembersOutput {}
         245  +
        fn build_enforcing_all_constraints(self) -> crate::output::RpcEchoOutput {
         246  +
            crate::output::RpcEchoOutput {}
  247    247   
        }
  248    248   
    }
  249    249   
}

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/error.rs

@@ -1,1 +298,298 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Error type for the `RPCEcho` operation.
    3         -
/// Each variant represents an error that can occur for the `RPCEcho` operation.
           2  +
/// Error type for the `ReservedWordsAsMembers` operation.
           3  +
/// Each variant represents an error that can occur for the `ReservedWordsAsMembers` operation.
    4      4   
#[derive(::std::fmt::Debug)]
    5         -
pub enum RPCEchoError {
           5  +
pub enum ReservedWordsAsMembersError {
    6      6   
    /// 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.
    7      7   
    ValidationException(crate::error::ValidationException),
    8      8   
}
    9         -
impl ::std::fmt::Display for RPCEchoError {
           9  +
impl ::std::fmt::Display for ReservedWordsAsMembersError {
   10     10   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   11     11   
        match &self {
   12         -
            RPCEchoError::ValidationException(_inner) => _inner.fmt(f),
          12  +
            ReservedWordsAsMembersError::ValidationException(_inner) => _inner.fmt(f),
   13     13   
        }
   14     14   
    }
   15     15   
}
   16         -
impl RPCEchoError {
   17         -
    /// Returns `true` if the error kind is `RPCEchoError::ValidationException`.
          16  +
impl ReservedWordsAsMembersError {
          17  +
    /// Returns `true` if the error kind is `ReservedWordsAsMembersError::ValidationException`.
   18     18   
    pub fn is_validation_exception(&self) -> bool {
   19         -
        matches!(&self, RPCEchoError::ValidationException(_))
          19  +
        matches!(&self, ReservedWordsAsMembersError::ValidationException(_))
   20     20   
    }
   21     21   
    /// Returns the error name string by matching the correct variant.
   22     22   
    pub fn name(&self) -> &'static str {
   23     23   
        match &self {
   24         -
            RPCEchoError::ValidationException(_inner) => _inner.name(),
          24  +
            ReservedWordsAsMembersError::ValidationException(_inner) => _inner.name(),
   25     25   
        }
   26     26   
    }
   27     27   
}
   28         -
impl ::std::error::Error for RPCEchoError {
          28  +
impl ::std::error::Error for ReservedWordsAsMembersError {
   29     29   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
   30     30   
        match &self {
   31         -
            RPCEchoError::ValidationException(_inner) => Some(_inner),
          31  +
            ReservedWordsAsMembersError::ValidationException(_inner) => Some(_inner),
   32     32   
        }
   33     33   
    }
   34     34   
}
   35         -
impl ::std::convert::From<crate::error::ValidationException> for crate::error::RPCEchoError {
   36         -
    fn from(variant: crate::error::ValidationException) -> crate::error::RPCEchoError {
          35  +
impl ::std::convert::From<crate::error::ValidationException>
          36  +
    for crate::error::ReservedWordsAsMembersError
          37  +
{
          38  +
    fn from(
          39  +
        variant: crate::error::ValidationException,
          40  +
    ) -> crate::error::ReservedWordsAsMembersError {
   37     41   
        Self::ValidationException(variant)
   38     42   
    }
   39     43   
}
   40     44   
   41         -
/// 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.
   42         -
#[derive(
   43         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   44         -
)]
   45         -
pub struct ValidationException {
   46         -
    /// A summary of the validation failure.
   47         -
    pub message: ::std::string::String,
   48         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
   49         -
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
          45  +
/// Error type for the `ErrCollisions` operation.
          46  +
/// Each variant represents an error that can occur for the `ErrCollisions` operation.
          47  +
#[derive(::std::fmt::Debug)]
          48  +
pub enum ErrCollisionsError {
          49  +
    #[allow(missing_docs)] // documentation missing in model
          50  +
    CollidingError(crate::error::CollidingError),
          51  +
    /// This will be renamed to CollidingError
          52  +
    CollidingException(crate::error::CollidingException),
   50     53   
}
   51         -
impl ValidationException {
   52         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
   53         -
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
   54         -
        self.field_list.as_deref()
          54  +
impl ::std::fmt::Display for ErrCollisionsError {
          55  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          56  +
        match &self {
          57  +
            ErrCollisionsError::CollidingError(_inner) => _inner.fmt(f),
          58  +
            ErrCollisionsError::CollidingException(_inner) => _inner.fmt(f),
          59  +
        }
   55     60   
    }
   56     61   
}
   57         -
impl ValidationException {
   58         -
    /// Returns the error message.
   59         -
    pub fn message(&self) -> &str {
   60         -
        &self.message
          62  +
impl ErrCollisionsError {
          63  +
    /// Returns `true` if the error kind is `ErrCollisionsError::CollidingError`.
          64  +
    pub fn is_colliding_error(&self) -> bool {
          65  +
        matches!(&self, ErrCollisionsError::CollidingError(_))
   61     66   
    }
   62         -
    #[doc(hidden)]
   63         -
    /// Returns the error name.
          67  +
    /// Returns `true` if the error kind is `ErrCollisionsError::CollidingException`.
          68  +
    pub fn is_colliding_exception(&self) -> bool {
          69  +
        matches!(&self, ErrCollisionsError::CollidingException(_))
          70  +
    }
          71  +
    /// Returns the error name string by matching the correct variant.
   64     72   
    pub fn name(&self) -> &'static str {
   65         -
        "ValidationException"
          73  +
        match &self {
          74  +
            ErrCollisionsError::CollidingError(_inner) => _inner.name(),
          75  +
            ErrCollisionsError::CollidingException(_inner) => _inner.name(),
          76  +
        }
   66     77   
    }
   67     78   
}
   68         -
impl ::std::fmt::Display for ValidationException {
   69         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   70         -
        ::std::write!(f, "ValidationException")?;
   71         -
        {
   72         -
            ::std::write!(f, ": {}", &self.message)?;
          79  +
impl ::std::error::Error for ErrCollisionsError {
          80  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
          81  +
        match &self {
          82  +
            ErrCollisionsError::CollidingError(_inner) => Some(_inner),
          83  +
            ErrCollisionsError::CollidingException(_inner) => Some(_inner),
   73     84   
        }
   74         -
        Ok(())
   75     85   
    }
   76     86   
}
   77         -
impl ::std::error::Error for ValidationException {}
   78         -
impl ValidationException {
   79         -
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
   80         -
    pub fn builder() -> crate::error::validation_exception::Builder {
   81         -
        crate::error::validation_exception::Builder::default()
          87  +
impl ::std::convert::From<crate::error::CollidingError> for crate::error::ErrCollisionsError {
          88  +
    fn from(variant: crate::error::CollidingError) -> crate::error::ErrCollisionsError {
          89  +
        Self::CollidingError(variant)
          90  +
    }
          91  +
}
          92  +
impl ::std::convert::From<crate::error::CollidingException> for crate::error::ErrCollisionsError {
          93  +
    fn from(variant: crate::error::CollidingException) -> crate::error::ErrCollisionsError {
          94  +
        Self::CollidingException(variant)
   82     95   
    }
   83     96   
}
   84     97   
   85     98   
/// Error type for the `Match` operation.
   86     99   
/// Each variant represents an error that can occur for the `Match` operation.
   87    100   
#[derive(::std::fmt::Debug)]
   88    101   
pub enum MatchError {
   89    102   
    /// 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.
   90    103   
    ValidationException(crate::error::ValidationException),
   91    104   
}
   92    105   
impl ::std::fmt::Display for MatchError {
   93    106   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   94    107   
        match &self {
   95    108   
            MatchError::ValidationException(_inner) => _inner.fmt(f),
   96    109   
        }
   97    110   
    }
   98    111   
}
   99    112   
impl MatchError {
  100    113   
    /// Returns `true` if the error kind is `MatchError::ValidationException`.
  101    114   
    pub fn is_validation_exception(&self) -> bool {
  102    115   
        matches!(&self, MatchError::ValidationException(_))
  103    116   
    }
  104    117   
    /// Returns the error name string by matching the correct variant.
  105    118   
    pub fn name(&self) -> &'static str {
  106    119   
        match &self {
  107    120   
            MatchError::ValidationException(_inner) => _inner.name(),
  108    121   
        }
  109    122   
    }
  110    123   
}
  111    124   
impl ::std::error::Error for MatchError {
  112    125   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  113    126   
        match &self {
  114    127   
            MatchError::ValidationException(_inner) => Some(_inner),
  115    128   
        }
  116    129   
    }
  117    130   
}
  118    131   
impl ::std::convert::From<crate::error::ValidationException> for crate::error::MatchError {
  119    132   
    fn from(variant: crate::error::ValidationException) -> crate::error::MatchError {
  120    133   
        Self::ValidationException(variant)
  121    134   
    }
  122    135   
}
  123    136   
  124         -
/// Error type for the `ErrCollisions` operation.
  125         -
/// Each variant represents an error that can occur for the `ErrCollisions` operation.
         137  +
/// Error type for the `RPCEcho` operation.
         138  +
/// Each variant represents an error that can occur for the `RPCEcho` operation.
  126    139   
#[derive(::std::fmt::Debug)]
  127         -
pub enum ErrCollisionsError {
  128         -
    #[allow(missing_docs)] // documentation missing in model
  129         -
    CollidingError(crate::error::CollidingError),
  130         -
    /// This will be renamed to CollidingError
  131         -
    CollidingException(crate::error::CollidingException),
         140  +
pub enum RPCEchoError {
         141  +
    /// 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.
         142  +
    ValidationException(crate::error::ValidationException),
  132    143   
}
  133         -
impl ::std::fmt::Display for ErrCollisionsError {
         144  +
impl ::std::fmt::Display for RPCEchoError {
  134    145   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  135    146   
        match &self {
  136         -
            ErrCollisionsError::CollidingError(_inner) => _inner.fmt(f),
  137         -
            ErrCollisionsError::CollidingException(_inner) => _inner.fmt(f),
         147  +
            RPCEchoError::ValidationException(_inner) => _inner.fmt(f),
  138    148   
        }
  139    149   
    }
  140    150   
}
  141         -
impl ErrCollisionsError {
  142         -
    /// Returns `true` if the error kind is `ErrCollisionsError::CollidingError`.
  143         -
    pub fn is_colliding_error(&self) -> bool {
  144         -
        matches!(&self, ErrCollisionsError::CollidingError(_))
  145         -
    }
  146         -
    /// Returns `true` if the error kind is `ErrCollisionsError::CollidingException`.
  147         -
    pub fn is_colliding_exception(&self) -> bool {
  148         -
        matches!(&self, ErrCollisionsError::CollidingException(_))
         151  +
impl RPCEchoError {
         152  +
    /// Returns `true` if the error kind is `RPCEchoError::ValidationException`.
         153  +
    pub fn is_validation_exception(&self) -> bool {
         154  +
        matches!(&self, RPCEchoError::ValidationException(_))
  149    155   
    }
  150    156   
    /// Returns the error name string by matching the correct variant.
  151    157   
    pub fn name(&self) -> &'static str {
  152    158   
        match &self {
  153         -
            ErrCollisionsError::CollidingError(_inner) => _inner.name(),
  154         -
            ErrCollisionsError::CollidingException(_inner) => _inner.name(),
         159  +
            RPCEchoError::ValidationException(_inner) => _inner.name(),
  155    160   
        }
  156    161   
    }
  157    162   
}
  158         -
impl ::std::error::Error for ErrCollisionsError {
         163  +
impl ::std::error::Error for RPCEchoError {
  159    164   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  160    165   
        match &self {
  161         -
            ErrCollisionsError::CollidingError(_inner) => Some(_inner),
  162         -
            ErrCollisionsError::CollidingException(_inner) => Some(_inner),
         166  +
            RPCEchoError::ValidationException(_inner) => Some(_inner),
  163    167   
        }
  164    168   
    }
  165    169   
}
  166         -
impl ::std::convert::From<crate::error::CollidingError> for crate::error::ErrCollisionsError {
  167         -
    fn from(variant: crate::error::CollidingError) -> crate::error::ErrCollisionsError {
  168         -
        Self::CollidingError(variant)
  169         -
    }
  170         -
}
  171         -
impl ::std::convert::From<crate::error::CollidingException> for crate::error::ErrCollisionsError {
  172         -
    fn from(variant: crate::error::CollidingException) -> crate::error::ErrCollisionsError {
  173         -
        Self::CollidingException(variant)
         170  +
impl ::std::convert::From<crate::error::ValidationException> for crate::error::RPCEchoError {
         171  +
    fn from(variant: crate::error::ValidationException) -> crate::error::RPCEchoError {
         172  +
        Self::ValidationException(variant)
  174    173   
    }
  175    174   
}
  176    175   
  177         -
/// This will be renamed to CollidingError
         176  +
/// 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.
  178    177   
#[derive(
  179    178   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  180    179   
)]
  181         -
pub struct CollidingException {}
  182         -
impl CollidingException {
         180  +
pub struct ValidationException {
         181  +
    /// A summary of the validation failure.
         182  +
    pub message: ::std::string::String,
         183  +
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         184  +
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
         185  +
}
         186  +
impl ValidationException {
         187  +
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         188  +
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
         189  +
        self.field_list.as_deref()
         190  +
    }
         191  +
}
         192  +
impl ValidationException {
         193  +
    /// Returns the error message.
         194  +
    pub fn message(&self) -> &str {
         195  +
        &self.message
         196  +
    }
  183    197   
    #[doc(hidden)]
  184    198   
    /// Returns the error name.
  185    199   
    pub fn name(&self) -> &'static str {
  186         -
        "CollidingException"
         200  +
        "ValidationException"
  187    201   
    }
  188    202   
}
  189         -
impl ::std::fmt::Display for CollidingException {
         203  +
impl ::std::fmt::Display for ValidationException {
  190    204   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  191         -
        ::std::write!(f, "CollidingException")?;
         205  +
        ::std::write!(f, "ValidationException")?;
         206  +
        {
         207  +
            ::std::write!(f, ": {}", &self.message)?;
         208  +
        }
  192    209   
        Ok(())
  193    210   
    }
  194    211   
}
  195         -
impl ::std::error::Error for CollidingException {}
  196         -
impl CollidingException {
  197         -
    /// Creates a new builder-style object to manufacture [`CollidingException`](crate::error::CollidingException).
  198         -
    pub fn builder() -> crate::error::colliding_exception::Builder {
  199         -
        crate::error::colliding_exception::Builder::default()
         212  +
impl ::std::error::Error for ValidationException {}
         213  +
impl ValidationException {
         214  +
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
         215  +
    pub fn builder() -> crate::error::validation_exception::Builder {
         216  +
        crate::error::validation_exception::Builder::default()
  200    217   
    }
  201    218   
}
  202    219   
  203    220   
#[allow(missing_docs)] // documentation missing in model
  204    221   
#[derive(
  205    222   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  206    223   
)]
  207    224   
pub struct CollidingError {}
  208    225   
impl CollidingError {
  209    226   
    #[doc(hidden)]
  210    227   
    /// Returns the error name.
  211    228   
    pub fn name(&self) -> &'static str {
  212    229   
        "CollidingError"
  213    230   
    }
  214    231   
}
  215    232   
impl ::std::fmt::Display for CollidingError {
  216    233   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  217    234   
        ::std::write!(f, "CollidingError")?;
  218    235   
        Ok(())
  219    236   
    }
  220    237   
}
  221    238   
impl ::std::error::Error for CollidingError {}
  222    239   
impl CollidingError {
  223    240   
    /// Creates a new builder-style object to manufacture [`CollidingError`](crate::error::CollidingError).
  224    241   
    pub fn builder() -> crate::error::colliding_error::Builder {
  225    242   
        crate::error::colliding_error::Builder::default()
  226    243   
    }
  227    244   
}
  228    245   
  229         -
/// Error type for the `ReservedWordsAsMembers` operation.
  230         -
/// Each variant represents an error that can occur for the `ReservedWordsAsMembers` operation.
  231         -
#[derive(::std::fmt::Debug)]
  232         -
pub enum ReservedWordsAsMembersError {
  233         -
    /// 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.
  234         -
    ValidationException(crate::error::ValidationException),
  235         -
}
  236         -
impl ::std::fmt::Display for ReservedWordsAsMembersError {
  237         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  238         -
        match &self {
  239         -
            ReservedWordsAsMembersError::ValidationException(_inner) => _inner.fmt(f),
  240         -
        }
  241         -
    }
  242         -
}
  243         -
impl ReservedWordsAsMembersError {
  244         -
    /// Returns `true` if the error kind is `ReservedWordsAsMembersError::ValidationException`.
  245         -
    pub fn is_validation_exception(&self) -> bool {
  246         -
        matches!(&self, ReservedWordsAsMembersError::ValidationException(_))
  247         -
    }
  248         -
    /// Returns the error name string by matching the correct variant.
         246  +
/// This will be renamed to CollidingError
         247  +
#[derive(
         248  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         249  +
)]
         250  +
pub struct CollidingException {}
         251  +
impl CollidingException {
         252  +
    #[doc(hidden)]
         253  +
    /// Returns the error name.
  249    254   
    pub fn name(&self) -> &'static str {
  250         -
        match &self {
  251         -
            ReservedWordsAsMembersError::ValidationException(_inner) => _inner.name(),
  252         -
        }
         255  +
        "CollidingException"
  253    256   
    }
  254    257   
}
  255         -
impl ::std::error::Error for ReservedWordsAsMembersError {
  256         -
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  257         -
        match &self {
  258         -
            ReservedWordsAsMembersError::ValidationException(_inner) => Some(_inner),
  259         -
        }
         258  +
impl ::std::fmt::Display for CollidingException {
         259  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         260  +
        ::std::write!(f, "CollidingException")?;
         261  +
        Ok(())
  260    262   
    }
  261    263   
}
  262         -
impl ::std::convert::From<crate::error::ValidationException>
  263         -
    for crate::error::ReservedWordsAsMembersError
  264         -
{
  265         -
    fn from(
  266         -
        variant: crate::error::ValidationException,
  267         -
    ) -> crate::error::ReservedWordsAsMembersError {
  268         -
        Self::ValidationException(variant)
         264  +
impl ::std::error::Error for CollidingException {}
         265  +
impl CollidingException {
         266  +
    /// Creates a new builder-style object to manufacture [`CollidingException`](crate::error::CollidingException).
         267  +
    pub fn builder() -> crate::error::colliding_exception::Builder {
         268  +
        crate::error::colliding_exception::Builder::default()
  269    269   
    }
  270    270   
}
  271    271   
/// See [`ValidationException`](crate::error::ValidationException).
  272    272   
pub mod validation_exception {
  273    273   
  274    274   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  275    275   
    /// Holds one variant for each of the ways the builder can fail.
  276    276   
    #[non_exhaustive]
  277    277   
    #[allow(clippy::enum_variant_names)]
  278    278   
    pub enum ConstraintViolation {
@@ -305,305 +376,376 @@
  325    325   
        fn build_enforcing_all_constraints(
  326    326   
            self,
  327    327   
        ) -> Result<crate::error::ValidationException, ConstraintViolation> {
  328    328   
            Ok(crate::error::ValidationException {
  329    329   
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  330    330   
                field_list: self.field_list,
  331    331   
            })
  332    332   
        }
  333    333   
    }
  334    334   
}
  335         -
/// See [`CollidingException`](crate::error::CollidingException).
  336         -
pub mod colliding_exception {
         335  +
/// See [`CollidingError`](crate::error::CollidingError).
         336  +
pub mod colliding_error {
  337    337   
  338         -
    impl ::std::convert::From<Builder> for crate::error::CollidingException {
         338  +
    impl ::std::convert::From<Builder> for crate::error::CollidingError {
  339    339   
        fn from(builder: Builder) -> Self {
  340    340   
            builder.build()
  341    341   
        }
  342    342   
    }
  343         -
    /// A builder for [`CollidingException`](crate::error::CollidingException).
         343  +
    /// A builder for [`CollidingError`](crate::error::CollidingError).
  344    344   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  345    345   
    pub struct Builder {}
  346    346   
    impl Builder {
  347         -
        /// Consumes the builder and constructs a [`CollidingException`](crate::error::CollidingException).
  348         -
        pub fn build(self) -> crate::error::CollidingException {
         347  +
        /// Consumes the builder and constructs a [`CollidingError`](crate::error::CollidingError).
         348  +
        pub fn build(self) -> crate::error::CollidingError {
  349    349   
            self.build_enforcing_all_constraints()
  350    350   
        }
  351         -
        fn build_enforcing_all_constraints(self) -> crate::error::CollidingException {
  352         -
            crate::error::CollidingException {}
         351  +
        fn build_enforcing_all_constraints(self) -> crate::error::CollidingError {
         352  +
            crate::error::CollidingError {}
  353    353   
        }
  354    354   
    }
  355    355   
}
  356         -
/// See [`CollidingError`](crate::error::CollidingError).
  357         -
pub mod colliding_error {
         356  +
/// See [`CollidingException`](crate::error::CollidingException).
         357  +
pub mod colliding_exception {
  358    358   
  359         -
    impl ::std::convert::From<Builder> for crate::error::CollidingError {
         359  +
    impl ::std::convert::From<Builder> for crate::error::CollidingException {
  360    360   
        fn from(builder: Builder) -> Self {
  361    361   
            builder.build()
  362    362   
        }
  363    363   
    }
  364         -
    /// A builder for [`CollidingError`](crate::error::CollidingError).
         364  +
    /// A builder for [`CollidingException`](crate::error::CollidingException).
  365    365   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  366    366   
    pub struct Builder {}
  367    367   
    impl Builder {
  368         -
        /// Consumes the builder and constructs a [`CollidingError`](crate::error::CollidingError).
  369         -
        pub fn build(self) -> crate::error::CollidingError {
         368  +
        /// Consumes the builder and constructs a [`CollidingException`](crate::error::CollidingException).
         369  +
        pub fn build(self) -> crate::error::CollidingException {
  370    370   
            self.build_enforcing_all_constraints()
  371    371   
        }
  372         -
        fn build_enforcing_all_constraints(self) -> crate::error::CollidingError {
  373         -
            crate::error::CollidingError {}
         372  +
        fn build_enforcing_all_constraints(self) -> crate::error::CollidingException {
         373  +
            crate::error::CollidingException {}
  374    374   
        }
  375    375   
    }
  376    376   
}