Server Test

Server Test

rev. 7254d43655ed63111c94f599437f2b0d3f55446e (ignoring whitespace)

Files changed:

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

@@ -1,1 +0,562 @@
    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         -
    /// [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput) using modelled bindings.
    5         -
    pub struct ResponseCodeDefaultOperationInputFuture {
    6         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeDefaultOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
           4  +
    /// [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput) using modelled bindings.
           5  +
    pub struct TypeComplexityOperationInputFuture {
           6  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TypeComplexityOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
    7      7   
    }
    8      8   
}
    9      9   
   10         -
impl std::future::Future for ResponseCodeDefaultOperationInputFuture {
          10  +
impl std::future::Future for TypeComplexityOperationInputFuture {
   11     11   
    type Output = Result<
   12         -
        crate::input::ResponseCodeDefaultOperationInput,
          12  +
        crate::input::TypeComplexityOperationInput,
   13     13   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::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::rest_json_1::RestJson1,
   28     28   
        B,
   29         -
    > for crate::input::ResponseCodeDefaultOperationInput
          29  +
    > for crate::input::TypeComplexityOperationInput
   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::rest_json_1::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::rest_json_1::runtime_error::RuntimeError;
   40         -
    type Future = ResponseCodeDefaultOperationInputFuture;
          40  +
    type Future = TypeComplexityOperationInputFuture;
   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_JSON,
   47     47   
            ) {
   48     48   
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   49     49   
            }
   50         -
            crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_request(request)
          50  +
            crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation_http_request(request)
   51     51   
                            .await
   52     52   
        };
   53     53   
        use ::futures_util::future::TryFutureExt;
   54     54   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   55     55   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
   56     56   
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
   57     57   
                    });
   58         -
        ResponseCodeDefaultOperationInputFuture {
          58  +
        TypeComplexityOperationInputFuture {
   59     59   
            inner: Box::pin(fut),
   60     60   
        }
   61     61   
    }
   62     62   
}
   63     63   
impl
   64     64   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
   65     65   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
   66         -
    > for crate::output::ResponseCodeDefaultOperationOutput
          66  +
    > for crate::output::TypeComplexityOperationOutput
   67     67   
{
   68     68   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   69         -
        match crate::protocol_serde::shape_response_code_default_operation::ser_response_code_default_operation_http_response(self) {
          69  +
        match crate::protocol_serde::shape_type_complexity_operation::ser_type_complexity_operation_http_response(self) {
   70     70   
                        Ok(response) => response,
   71     71   
                        Err(e) => {
   72     72   
                            ::tracing::error!(error = %e, "failed to serialize response");
   73     73   
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
   74     74   
                        }
   75     75   
                    }
   76     76   
    }
   77     77   
}
   78     78   
   79         -
#[allow(unreachable_code, unused_variables)]
   80         -
#[cfg(test)]
   81         -
mod response_code_default_operation_test {
   82         -
   83         -
    /// Test ID: ResponseCodeDefaultOperation
   84         -
    #[::tokio::test]
   85         -
    #[::tracing_test::traced_test]
   86         -
    async fn response_code_default_operation_response() {
   87         -
        let output = crate::output::ResponseCodeDefaultOperationOutput {};
   88         -
        use ::aws_smithy_legacy_http_server::response::IntoResponse;
   89         -
        let http_response = output.into_response();
   90         -
        ::pretty_assertions::assert_eq!(
   91         -
            ::http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
   92         -
            http_response.status()
   93         -
        );
   94         -
    }
   95         -
}
   96         -
   97     79   
::pin_project_lite::pin_project! {
   98     80   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
   99         -
    /// [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput) using modelled bindings.
  100         -
    pub struct ResponseCodeHttpFallbackOperationInputFuture {
  101         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeHttpFallbackOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
          81  +
    /// [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput) using modelled bindings.
          82  +
    pub struct RequiredInnerShapeOperationInputFuture {
          83  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RequiredInnerShapeOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  102     84   
    }
  103     85   
}
  104     86   
  105         -
impl std::future::Future for ResponseCodeHttpFallbackOperationInputFuture {
          87  +
impl std::future::Future for RequiredInnerShapeOperationInputFuture {
  106     88   
    type Output = Result<
  107         -
        crate::input::ResponseCodeHttpFallbackOperationInput,
          89  +
        crate::input::RequiredInnerShapeOperationInput,
  108     90   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  109     91   
    >;
  110     92   
  111     93   
    fn poll(
  112     94   
        self: std::pin::Pin<&mut Self>,
  113     95   
        cx: &mut std::task::Context<'_>,
  114     96   
    ) -> std::task::Poll<Self::Output> {
  115     97   
        let this = self.project();
  116     98   
        this.inner.as_mut().poll(cx)
  117     99   
    }
  118    100   
}
  119    101   
  120    102   
impl<B>
  121    103   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  122    104   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  123    105   
        B,
  124         -
    > for crate::input::ResponseCodeHttpFallbackOperationInput
         106  +
    > for crate::input::RequiredInnerShapeOperationInput
  125    107   
where
  126    108   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  127    109   
    B: 'static,
  128    110   
  129    111   
    B::Data: Send,
  130    112   
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  131    113   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  132    114   
{
  133    115   
    type Rejection =
  134    116   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  135         -
    type Future = ResponseCodeHttpFallbackOperationInputFuture;
         117  +
    type Future = RequiredInnerShapeOperationInputFuture;
  136    118   
  137    119   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  138    120   
        let fut = async move {
  139    121   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  140    122   
                request.headers(),
  141    123   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  142    124   
            ) {
  143    125   
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  144    126   
            }
  145         -
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_request(request)
         127  +
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_request(request)
  146    128   
                            .await
  147    129   
        };
  148    130   
        use ::futures_util::future::TryFutureExt;
  149    131   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  150    132   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  151    133   
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
  152    134   
                    });
  153         -
        ResponseCodeHttpFallbackOperationInputFuture {
         135  +
        RequiredInnerShapeOperationInputFuture {
  154    136   
            inner: Box::pin(fut),
  155    137   
        }
  156    138   
    }
  157    139   
}
  158    140   
impl
  159    141   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  160    142   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  161         -
    > for crate::output::ResponseCodeHttpFallbackOperationOutput
         143  +
    > for crate::output::RequiredInnerShapeOperationOutput
  162    144   
{
  163    145   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  164         -
        match crate::protocol_serde::shape_response_code_http_fallback_operation::ser_response_code_http_fallback_operation_http_response(self) {
         146  +
        match crate::protocol_serde::shape_required_inner_shape_operation::ser_required_inner_shape_operation_http_response(self) {
  165    147   
                        Ok(response) => response,
  166    148   
                        Err(e) => {
  167    149   
                            ::tracing::error!(error = %e, "failed to serialize response");
  168    150   
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  169    151   
                        }
  170    152   
                    }
  171    153   
    }
  172    154   
}
  173         -
  174         -
#[allow(unreachable_code, unused_variables)]
  175         -
#[cfg(test)]
  176         -
mod response_code_http_fallback_operation_test {
  177         -
  178         -
    /// Test ID: ResponseCodeHttpFallbackOperation
  179         -
    #[::tokio::test]
  180         -
    #[::tracing_test::traced_test]
  181         -
    async fn response_code_http_fallback_operation_response() {
  182         -
        let output = crate::output::ResponseCodeHttpFallbackOperationOutput {};
  183         -
        use ::aws_smithy_legacy_http_server::response::IntoResponse;
  184         -
        let http_response = output.into_response();
  185         -
        ::pretty_assertions::assert_eq!(
  186         -
            ::http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
  187         -
            http_response.status()
  188         -
        );
  189         -
        let expected_headers = [("Content-Length", "2")];
  190         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  191         -
            http_response.headers(),
  192         -
            expected_headers,
  193         -
        ));
         155  +
impl
         156  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         157  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         158  +
    > for crate::error::RequiredInnerShapeOperationError
         159  +
{
         160  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         161  +
        match crate::protocol_serde::shape_required_inner_shape_operation::ser_required_inner_shape_operation_http_error(&self) {
         162  +
            Ok(mut response) => {
         163  +
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
         164  +
                response
         165  +
            },
         166  +
            Err(e) => {
         167  +
                ::tracing::error!(error = %e, "failed to serialize response");
         168  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
         169  +
            }
         170  +
        }
  194    171   
    }
  195    172   
}
  196    173   
  197    174   
::pin_project_lite::pin_project! {
  198    175   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  199         -
    /// [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput) using modelled bindings.
  200         -
    pub struct ResponseCodeRequiredOperationInputFuture {
  201         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeRequiredOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
         176  +
    /// [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput) using modelled bindings.
         177  +
    pub struct RequiredHeaderCollectionOperationInputFuture {
         178  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RequiredHeaderCollectionOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  202    179   
    }
  203    180   
}
  204    181   
  205         -
impl std::future::Future for ResponseCodeRequiredOperationInputFuture {
         182  +
impl std::future::Future for RequiredHeaderCollectionOperationInputFuture {
  206    183   
    type Output = Result<
  207         -
        crate::input::ResponseCodeRequiredOperationInput,
         184  +
        crate::input::RequiredHeaderCollectionOperationInput,
  208    185   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  209    186   
    >;
  210    187   
  211    188   
    fn poll(
  212    189   
        self: std::pin::Pin<&mut Self>,
  213    190   
        cx: &mut std::task::Context<'_>,
  214    191   
    ) -> std::task::Poll<Self::Output> {
  215    192   
        let this = self.project();
  216    193   
        this.inner.as_mut().poll(cx)
  217    194   
    }
  218    195   
}
  219    196   
  220    197   
impl<B>
  221    198   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  222    199   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  223    200   
        B,
  224         -
    > for crate::input::ResponseCodeRequiredOperationInput
         201  +
    > for crate::input::RequiredHeaderCollectionOperationInput
  225    202   
where
  226    203   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  227    204   
    B: 'static,
  228    205   
  229    206   
    B::Data: Send,
  230    207   
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  231    208   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  232    209   
{
  233    210   
    type Rejection =
  234    211   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  235         -
    type Future = ResponseCodeRequiredOperationInputFuture;
         212  +
    type Future = RequiredHeaderCollectionOperationInputFuture;
  236    213   
  237    214   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  238    215   
        let fut = async move {
  239    216   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  240    217   
                request.headers(),
  241    218   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  242    219   
            ) {
  243    220   
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  244    221   
            }
  245         -
            crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_request(request)
         222  +
            crate::protocol_serde::shape_required_header_collection_operation::de_required_header_collection_operation_http_request(request)
  246    223   
                            .await
  247    224   
        };
  248    225   
        use ::futures_util::future::TryFutureExt;
  249    226   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  250    227   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  251    228   
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
  252    229   
                    });
  253         -
        ResponseCodeRequiredOperationInputFuture {
         230  +
        RequiredHeaderCollectionOperationInputFuture {
  254    231   
            inner: Box::pin(fut),
  255    232   
        }
  256    233   
    }
  257    234   
}
  258    235   
impl
  259    236   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  260    237   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  261         -
    > for crate::output::ResponseCodeRequiredOperationOutput
         238  +
    > for crate::output::RequiredHeaderCollectionOperationOutput
  262    239   
{
  263    240   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  264         -
        match crate::protocol_serde::shape_response_code_required_operation::ser_response_code_required_operation_http_response(self) {
         241  +
        match crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_http_response(self) {
  265    242   
                        Ok(response) => response,
  266    243   
                        Err(e) => {
  267    244   
                            ::tracing::error!(error = %e, "failed to serialize response");
  268    245   
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  269    246   
                        }
  270    247   
                    }
  271    248   
    }
  272    249   
}
  273         -
  274         -
#[allow(unreachable_code, unused_variables)]
  275         -
#[cfg(test)]
  276         -
mod response_code_required_operation_test {
  277         -
  278         -
    /// Test ID: ResponseCodeRequiredOperation
  279         -
    #[::tokio::test]
  280         -
    #[::tracing_test::traced_test]
  281         -
    async fn response_code_required_operation_response() {
  282         -
        let output = crate::output::ResponseCodeRequiredOperationOutput { response_code: 201 };
  283         -
        use ::aws_smithy_legacy_http_server::response::IntoResponse;
  284         -
        let http_response = output.into_response();
  285         -
        ::pretty_assertions::assert_eq!(
  286         -
            ::http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
  287         -
            http_response.status()
  288         -
        );
  289         -
        let expected_headers = [("Content-Length", "2")];
  290         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  291         -
            http_response.headers(),
  292         -
            expected_headers,
  293         -
        ));
         250  +
impl
         251  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         252  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         253  +
    > for crate::error::RequiredHeaderCollectionOperationError
         254  +
{
         255  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         256  +
        match crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_http_error(&self) {
         257  +
            Ok(mut response) => {
         258  +
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
         259  +
                response
         260  +
            },
         261  +
            Err(e) => {
         262  +
                ::tracing::error!(error = %e, "failed to serialize response");
         263  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
         264  +
            }
         265  +
        }
  294    266   
    }
  295    267   
}
  296    268   
  297    269   
::pin_project_lite::pin_project! {
  298    270   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  299         -
    /// [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput) using modelled bindings.
  300         -
    pub struct RequiredHeaderCollectionOperationInputFuture {
  301         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RequiredHeaderCollectionOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
         271  +
    /// [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput) using modelled bindings.
         272  +
    pub struct ResponseCodeRequiredOperationInputFuture {
         273  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeRequiredOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  302    274   
    }
  303    275   
}
  304    276   
  305         -
impl std::future::Future for RequiredHeaderCollectionOperationInputFuture {
         277  +
impl std::future::Future for ResponseCodeRequiredOperationInputFuture {
  306    278   
    type Output = Result<
  307         -
        crate::input::RequiredHeaderCollectionOperationInput,
         279  +
        crate::input::ResponseCodeRequiredOperationInput,
  308    280   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  309    281   
    >;
  310    282   
  311    283   
    fn poll(
  312    284   
        self: std::pin::Pin<&mut Self>,
  313    285   
        cx: &mut std::task::Context<'_>,
  314    286   
    ) -> std::task::Poll<Self::Output> {
  315    287   
        let this = self.project();
  316    288   
        this.inner.as_mut().poll(cx)
  317    289   
    }
  318    290   
}
  319    291   
  320    292   
impl<B>
  321    293   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  322    294   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  323    295   
        B,
  324         -
    > for crate::input::RequiredHeaderCollectionOperationInput
         296  +
    > for crate::input::ResponseCodeRequiredOperationInput
  325    297   
where
  326    298   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  327    299   
    B: 'static,
  328    300   
  329    301   
    B::Data: Send,
  330    302   
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  331    303   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  332    304   
{
  333    305   
    type Rejection =
  334    306   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  335         -
    type Future = RequiredHeaderCollectionOperationInputFuture;
         307  +
    type Future = ResponseCodeRequiredOperationInputFuture;
  336    308   
  337    309   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  338    310   
        let fut = async move {
  339    311   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  340    312   
                request.headers(),
  341    313   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  342    314   
            ) {
  343    315   
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  344    316   
            }
  345         -
            crate::protocol_serde::shape_required_header_collection_operation::de_required_header_collection_operation_http_request(request)
         317  +
            crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_request(request)
  346    318   
                            .await
  347    319   
        };
  348    320   
        use ::futures_util::future::TryFutureExt;
  349    321   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  350    322   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  351    323   
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
  352    324   
                    });
  353         -
        RequiredHeaderCollectionOperationInputFuture {
         325  +
        ResponseCodeRequiredOperationInputFuture {
  354    326   
            inner: Box::pin(fut),
  355    327   
        }
  356    328   
    }
  357    329   
}
  358    330   
impl
  359    331   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  360    332   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  361         -
    > for crate::output::RequiredHeaderCollectionOperationOutput
         333  +
    > for crate::output::ResponseCodeRequiredOperationOutput
  362    334   
{
  363    335   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  364         -
        match crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_http_response(self) {
         336  +
        match crate::protocol_serde::shape_response_code_required_operation::ser_response_code_required_operation_http_response(self) {
  365    337   
                        Ok(response) => response,
  366    338   
                        Err(e) => {
  367    339   
                            ::tracing::error!(error = %e, "failed to serialize response");
  368    340   
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  369    341   
                        }
  370    342   
                    }
  371    343   
    }
  372    344   
}
  373         -
impl
  374         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  375         -
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  376         -
    > for crate::error::RequiredHeaderCollectionOperationError
  377         -
{
  378         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  379         -
        match crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_http_error(&self) {
  380         -
            Ok(mut response) => {
  381         -
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
  382         -
                response
  383         -
            },
  384         -
            Err(e) => {
  385         -
                ::tracing::error!(error = %e, "failed to serialize response");
  386         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  387         -
            }
  388         -
        }
         345  +
         346  +
#[allow(unreachable_code, unused_variables)]
         347  +
#[cfg(test)]
         348  +
mod response_code_required_operation_test {
         349  +
         350  +
    /// Test ID: ResponseCodeRequiredOperation
         351  +
    #[::tokio::test]
         352  +
    #[::tracing_test::traced_test]
         353  +
    async fn response_code_required_operation_response() {
         354  +
        let output = crate::output::ResponseCodeRequiredOperationOutput { response_code: 201 };
         355  +
        use ::aws_smithy_legacy_http_server::response::IntoResponse;
         356  +
        let http_response = output.into_response();
         357  +
        ::pretty_assertions::assert_eq!(
         358  +
            ::http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
         359  +
            http_response.status()
         360  +
        );
         361  +
        let expected_headers = [("Content-Length", "2")];
         362  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
         363  +
            http_response.headers(),
         364  +
            expected_headers,
         365  +
        ));
  389    366   
    }
  390    367   
}
  391    368   
  392    369   
::pin_project_lite::pin_project! {
  393    370   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  394         -
    /// [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput) using modelled bindings.
  395         -
    pub struct RequiredInnerShapeOperationInputFuture {
  396         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RequiredInnerShapeOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
         371  +
    /// [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput) using modelled bindings.
         372  +
    pub struct ResponseCodeHttpFallbackOperationInputFuture {
         373  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeHttpFallbackOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  397    374   
    }
  398    375   
}
  399    376   
  400         -
impl std::future::Future for RequiredInnerShapeOperationInputFuture {
         377  +
impl std::future::Future for ResponseCodeHttpFallbackOperationInputFuture {
  401    378   
    type Output = Result<
  402         -
        crate::input::RequiredInnerShapeOperationInput,
         379  +
        crate::input::ResponseCodeHttpFallbackOperationInput,
  403    380   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  404    381   
    >;
  405    382   
  406    383   
    fn poll(
  407    384   
        self: std::pin::Pin<&mut Self>,
  408    385   
        cx: &mut std::task::Context<'_>,
  409    386   
    ) -> std::task::Poll<Self::Output> {
  410    387   
        let this = self.project();
  411    388   
        this.inner.as_mut().poll(cx)
  412    389   
    }
  413    390   
}
  414    391   
  415    392   
impl<B>
  416    393   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  417    394   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  418    395   
        B,
  419         -
    > for crate::input::RequiredInnerShapeOperationInput
         396  +
    > for crate::input::ResponseCodeHttpFallbackOperationInput
  420    397   
where
  421    398   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  422    399   
    B: 'static,
  423    400   
  424    401   
    B::Data: Send,
  425    402   
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  426    403   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  427    404   
{
  428    405   
    type Rejection =
  429    406   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  430         -
    type Future = RequiredInnerShapeOperationInputFuture;
         407  +
    type Future = ResponseCodeHttpFallbackOperationInputFuture;
  431    408   
  432    409   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  433    410   
        let fut = async move {
  434    411   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  435    412   
                request.headers(),
  436    413   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  437    414   
            ) {
  438    415   
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  439    416   
            }
  440         -
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_request(request)
         417  +
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_request(request)
  441    418   
                            .await
  442    419   
        };
  443    420   
        use ::futures_util::future::TryFutureExt;
  444    421   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  445    422   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  446    423   
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
  447    424   
                    });
  448         -
        RequiredInnerShapeOperationInputFuture {
         425  +
        ResponseCodeHttpFallbackOperationInputFuture {
  449    426   
            inner: Box::pin(fut),
  450    427   
        }
  451    428   
    }
  452    429   
}
  453    430   
impl
  454    431   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  455    432   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  456         -
    > for crate::output::RequiredInnerShapeOperationOutput
         433  +
    > for crate::output::ResponseCodeHttpFallbackOperationOutput
  457    434   
{
  458    435   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  459         -
        match crate::protocol_serde::shape_required_inner_shape_operation::ser_required_inner_shape_operation_http_response(self) {
         436  +
        match crate::protocol_serde::shape_response_code_http_fallback_operation::ser_response_code_http_fallback_operation_http_response(self) {
  460    437   
                        Ok(response) => response,
  461    438   
                        Err(e) => {
  462    439   
                            ::tracing::error!(error = %e, "failed to serialize response");
  463    440   
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  464    441   
                        }
  465    442   
                    }
  466    443   
    }
  467    444   
}
  468         -
impl
  469         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  470         -
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  471         -
    > for crate::error::RequiredInnerShapeOperationError
  472         -
{
  473         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  474         -
        match crate::protocol_serde::shape_required_inner_shape_operation::ser_required_inner_shape_operation_http_error(&self) {
  475         -
            Ok(mut response) => {
  476         -
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
  477         -
                response
  478         -
            },
  479         -
            Err(e) => {
  480         -
                ::tracing::error!(error = %e, "failed to serialize response");
  481         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  482         -
            }
  483         -
        }
         445  +
         446  +
#[allow(unreachable_code, unused_variables)]
         447  +
#[cfg(test)]
         448  +
mod response_code_http_fallback_operation_test {
         449  +
         450  +
    /// Test ID: ResponseCodeHttpFallbackOperation
         451  +
    #[::tokio::test]
         452  +
    #[::tracing_test::traced_test]
         453  +
    async fn response_code_http_fallback_operation_response() {
         454  +
        let output = crate::output::ResponseCodeHttpFallbackOperationOutput {};
         455  +
        use ::aws_smithy_legacy_http_server::response::IntoResponse;
         456  +
        let http_response = output.into_response();
         457  +
        ::pretty_assertions::assert_eq!(
         458  +
            ::http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
         459  +
            http_response.status()
         460  +
        );
         461  +
        let expected_headers = [("Content-Length", "2")];
         462  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
         463  +
            http_response.headers(),
         464  +
            expected_headers,
         465  +
        ));
  484    466   
    }
  485    467   
}
  486    468   
  487    469   
::pin_project_lite::pin_project! {
  488    470   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  489         -
    /// [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput) using modelled bindings.
  490         -
    pub struct TypeComplexityOperationInputFuture {
  491         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TypeComplexityOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
         471  +
    /// [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput) using modelled bindings.
         472  +
    pub struct ResponseCodeDefaultOperationInputFuture {
         473  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeDefaultOperationInput, ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  492    474   
    }
  493    475   
}
  494    476   
  495         -
impl std::future::Future for TypeComplexityOperationInputFuture {
         477  +
impl std::future::Future for ResponseCodeDefaultOperationInputFuture {
  496    478   
    type Output = Result<
  497         -
        crate::input::TypeComplexityOperationInput,
         479  +
        crate::input::ResponseCodeDefaultOperationInput,
  498    480   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  499    481   
    >;
  500    482   
  501    483   
    fn poll(
  502    484   
        self: std::pin::Pin<&mut Self>,
  503    485   
        cx: &mut std::task::Context<'_>,
  504    486   
    ) -> std::task::Poll<Self::Output> {
  505    487   
        let this = self.project();
  506    488   
        this.inner.as_mut().poll(cx)
  507    489   
    }
  508    490   
}
  509    491   
  510    492   
impl<B>
  511    493   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  512    494   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  513    495   
        B,
  514         -
    > for crate::input::TypeComplexityOperationInput
         496  +
    > for crate::input::ResponseCodeDefaultOperationInput
  515    497   
where
  516    498   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  517    499   
    B: 'static,
  518    500   
  519    501   
    B::Data: Send,
  520    502   
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  521    503   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  522    504   
{
  523    505   
    type Rejection =
  524    506   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  525         -
    type Future = TypeComplexityOperationInputFuture;
         507  +
    type Future = ResponseCodeDefaultOperationInputFuture;
  526    508   
  527    509   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  528    510   
        let fut = async move {
  529    511   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  530    512   
                request.headers(),
  531    513   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  532    514   
            ) {
  533    515   
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  534    516   
            }
  535         -
            crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation_http_request(request)
         517  +
            crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_request(request)
  536    518   
                            .await
  537    519   
        };
  538    520   
        use ::futures_util::future::TryFutureExt;
  539    521   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  540    522   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  541    523   
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
  542    524   
                    });
  543         -
        TypeComplexityOperationInputFuture {
         525  +
        ResponseCodeDefaultOperationInputFuture {
  544    526   
            inner: Box::pin(fut),
  545    527   
        }
  546    528   
    }
  547    529   
}
  548    530   
impl
  549    531   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  550    532   
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
  551         -
    > for crate::output::TypeComplexityOperationOutput
         533  +
    > for crate::output::ResponseCodeDefaultOperationOutput
  552    534   
{
  553    535   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  554         -
        match crate::protocol_serde::shape_type_complexity_operation::ser_type_complexity_operation_http_response(self) {
         536  +
        match crate::protocol_serde::shape_response_code_default_operation::ser_response_code_default_operation_http_response(self) {
  555    537   
                        Ok(response) => response,
  556    538   
                        Err(e) => {
  557    539   
                            ::tracing::error!(error = %e, "failed to serialize response");
  558    540   
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  559    541   
                        }
  560    542   
                    }
  561    543   
    }
  562    544   
}
         545  +
         546  +
#[allow(unreachable_code, unused_variables)]
         547  +
#[cfg(test)]
         548  +
mod response_code_default_operation_test {
         549  +
         550  +
    /// Test ID: ResponseCodeDefaultOperation
         551  +
    #[::tokio::test]
         552  +
    #[::tracing_test::traced_test]
         553  +
    async fn response_code_default_operation_response() {
         554  +
        let output = crate::output::ResponseCodeDefaultOperationOutput {};
         555  +
        use ::aws_smithy_legacy_http_server::response::IntoResponse;
         556  +
        let http_response = output.into_response();
         557  +
        ::pretty_assertions::assert_eq!(
         558  +
            ::http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
         559  +
            http_response.status()
         560  +
        );
         561  +
    }
         562  +
}

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

@@ -1,1 +245,245 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// This operation tests that the response code defaults to 200 when no other code is set.
    4         -
pub struct ResponseCodeDefaultOperation;
           3  +
/// An operation whose shapes generate complex Rust types. See https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity.
           4  +
pub struct TypeComplexityOperation;
    5      5   
    6         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ResponseCodeDefaultOperation {
           6  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for TypeComplexityOperation {
    7      7   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
    8      8   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
    9         -
            "aws.protocoltests.misc#ResponseCodeDefaultOperation",
           9  +
            "aws.protocoltests.misc#TypeComplexityOperation",
   10     10   
            "aws.protocoltests.misc",
   11         -
            "ResponseCodeDefaultOperation",
          11  +
            "TypeComplexityOperation",
   12     12   
        );
   13     13   
   14         -
    type Input = crate::input::ResponseCodeDefaultOperationInput;
   15         -
    type Output = crate::output::ResponseCodeDefaultOperationOutput;
          14  +
    type Input = crate::input::TypeComplexityOperationInput;
          15  +
    type Output = crate::output::TypeComplexityOperationOutput;
   16     16   
    type Error = std::convert::Infallible;
   17     17   
}
   18     18   
   19     19   
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
   20         -
    for ResponseCodeDefaultOperation
          20  +
    for TypeComplexityOperation
   21     21   
{
   22     22   
    type RequestFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt<
   23     23   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   24     24   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::uri::MakeUri<
   25     25   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   26     26   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   27     27   
        >,
   28     28   
    >;
   29     29   
    type ResponseFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt<
   30     30   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   31     31   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   32     32   
    >;
   33     33   
   34     34   
    fn request_fmt() -> Self::RequestFmt {
   35     35   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   36     36   
    }
   37     37   
   38     38   
    fn response_fmt() -> Self::ResponseFmt {
   39     39   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   40     40   
    }
   41     41   
}
   42     42   
   43         -
/// This operation tests that the response code defaults to `@http`'s code.
   44         -
pub struct ResponseCodeHttpFallbackOperation;
          43  +
/// This operation tests that (de)serializing required values from a nested shape works correctly.
          44  +
pub struct RequiredInnerShapeOperation;
   45     45   
   46         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape
   47         -
    for ResponseCodeHttpFallbackOperation
   48         -
{
          46  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for RequiredInnerShapeOperation {
   49     47   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   50     48   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
   51         -
            "aws.protocoltests.misc#ResponseCodeHttpFallbackOperation",
          49  +
            "aws.protocoltests.misc#RequiredInnerShapeOperation",
   52     50   
            "aws.protocoltests.misc",
   53         -
            "ResponseCodeHttpFallbackOperation",
          51  +
            "RequiredInnerShapeOperation",
   54     52   
        );
   55     53   
   56         -
    type Input = crate::input::ResponseCodeHttpFallbackOperationInput;
   57         -
    type Output = crate::output::ResponseCodeHttpFallbackOperationOutput;
   58         -
    type Error = std::convert::Infallible;
          54  +
    type Input = crate::input::RequiredInnerShapeOperationInput;
          55  +
    type Output = crate::output::RequiredInnerShapeOperationOutput;
          56  +
    type Error = crate::error::RequiredInnerShapeOperationError;
   59     57   
}
   60     58   
   61     59   
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
   62         -
    for ResponseCodeHttpFallbackOperation
          60  +
    for RequiredInnerShapeOperation
   63     61   
{
   64     62   
    type RequestFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt<
   65     63   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   66     64   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::uri::MakeUri<
   67     65   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   68     66   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   69     67   
        >,
   70     68   
    >;
   71     69   
    type ResponseFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt<
   72     70   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   73     71   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   74     72   
    >;
   75     73   
   76     74   
    fn request_fmt() -> Self::RequestFmt {
   77     75   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   78     76   
    }
   79     77   
   80     78   
    fn response_fmt() -> Self::ResponseFmt {
   81     79   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   82     80   
    }
   83     81   
}
   84     82   
   85         -
/// This operation tests that `@httpResponseCode` is `@required` and is used over `@http's` code.
   86         -
pub struct ResponseCodeRequiredOperation;
          83  +
#[allow(missing_docs)] // documentation missing in model
          84  +
pub struct RequiredHeaderCollectionOperation;
   87     85   
   88         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ResponseCodeRequiredOperation {
          86  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape
          87  +
    for RequiredHeaderCollectionOperation
          88  +
{
   89     89   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   90     90   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
   91         -
            "aws.protocoltests.misc#ResponseCodeRequiredOperation",
          91  +
            "aws.protocoltests.misc#RequiredHeaderCollectionOperation",
   92     92   
            "aws.protocoltests.misc",
   93         -
            "ResponseCodeRequiredOperation",
          93  +
            "RequiredHeaderCollectionOperation",
   94     94   
        );
   95     95   
   96         -
    type Input = crate::input::ResponseCodeRequiredOperationInput;
   97         -
    type Output = crate::output::ResponseCodeRequiredOperationOutput;
   98         -
    type Error = std::convert::Infallible;
          96  +
    type Input = crate::input::RequiredHeaderCollectionOperationInput;
          97  +
    type Output = crate::output::RequiredHeaderCollectionOperationOutput;
          98  +
    type Error = crate::error::RequiredHeaderCollectionOperationError;
   99     99   
}
  100    100   
  101    101   
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
  102         -
    for ResponseCodeRequiredOperation
         102  +
    for RequiredHeaderCollectionOperation
  103    103   
{
  104    104   
    type RequestFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt<
  105    105   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  106    106   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::uri::MakeUri<
  107    107   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  108    108   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  109    109   
        >,
  110    110   
    >;
  111    111   
    type ResponseFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt<
  112    112   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  113    113   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  114    114   
    >;
  115    115   
  116    116   
    fn request_fmt() -> Self::RequestFmt {
  117    117   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  118    118   
    }
  119    119   
  120    120   
    fn response_fmt() -> Self::ResponseFmt {
  121    121   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  122    122   
    }
  123    123   
}
  124    124   
  125         -
#[allow(missing_docs)] // documentation missing in model
  126         -
pub struct RequiredHeaderCollectionOperation;
         125  +
/// This operation tests that `@httpResponseCode` is `@required` and is used over `@http's` code.
         126  +
pub struct ResponseCodeRequiredOperation;
  127    127   
  128         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape
  129         -
    for RequiredHeaderCollectionOperation
  130         -
{
         128  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ResponseCodeRequiredOperation {
  131    129   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  132    130   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  133         -
            "aws.protocoltests.misc#RequiredHeaderCollectionOperation",
         131  +
            "aws.protocoltests.misc#ResponseCodeRequiredOperation",
  134    132   
            "aws.protocoltests.misc",
  135         -
            "RequiredHeaderCollectionOperation",
         133  +
            "ResponseCodeRequiredOperation",
  136    134   
        );
  137    135   
  138         -
    type Input = crate::input::RequiredHeaderCollectionOperationInput;
  139         -
    type Output = crate::output::RequiredHeaderCollectionOperationOutput;
  140         -
    type Error = crate::error::RequiredHeaderCollectionOperationError;
         136  +
    type Input = crate::input::ResponseCodeRequiredOperationInput;
         137  +
    type Output = crate::output::ResponseCodeRequiredOperationOutput;
         138  +
    type Error = std::convert::Infallible;
  141    139   
}
  142    140   
  143    141   
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
  144         -
    for RequiredHeaderCollectionOperation
         142  +
    for ResponseCodeRequiredOperation
  145    143   
{
  146    144   
    type RequestFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt<
  147    145   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  148    146   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::uri::MakeUri<
  149    147   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  150    148   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  151    149   
        >,
  152    150   
    >;
  153    151   
    type ResponseFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt<
  154    152   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  155    153   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  156    154   
    >;
  157    155   
  158    156   
    fn request_fmt() -> Self::RequestFmt {
  159    157   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  160    158   
    }
  161    159   
  162    160   
    fn response_fmt() -> Self::ResponseFmt {
  163    161   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  164    162   
    }
  165    163   
}
  166    164   
  167         -
/// This operation tests that (de)serializing required values from a nested shape works correctly.
  168         -
pub struct RequiredInnerShapeOperation;
         165  +
/// This operation tests that the response code defaults to `@http`'s code.
         166  +
pub struct ResponseCodeHttpFallbackOperation;
  169    167   
  170         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for RequiredInnerShapeOperation {
         168  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape
         169  +
    for ResponseCodeHttpFallbackOperation
         170  +
{
  171    171   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  172    172   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  173         -
            "aws.protocoltests.misc#RequiredInnerShapeOperation",
         173  +
            "aws.protocoltests.misc#ResponseCodeHttpFallbackOperation",
  174    174   
            "aws.protocoltests.misc",
  175         -
            "RequiredInnerShapeOperation",
         175  +
            "ResponseCodeHttpFallbackOperation",
  176    176   
        );
  177    177   
  178         -
    type Input = crate::input::RequiredInnerShapeOperationInput;
  179         -
    type Output = crate::output::RequiredInnerShapeOperationOutput;
  180         -
    type Error = crate::error::RequiredInnerShapeOperationError;
         178  +
    type Input = crate::input::ResponseCodeHttpFallbackOperationInput;
         179  +
    type Output = crate::output::ResponseCodeHttpFallbackOperationOutput;
         180  +
    type Error = std::convert::Infallible;
  181    181   
}
  182    182   
  183    183   
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
  184         -
    for RequiredInnerShapeOperation
         184  +
    for ResponseCodeHttpFallbackOperation
  185    185   
{
  186    186   
    type RequestFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt<
  187    187   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  188    188   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::uri::MakeUri<
  189    189   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  190    190   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  191    191   
        >,
  192    192   
    >;
  193    193   
    type ResponseFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt<
  194    194   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  195    195   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  196    196   
    >;
  197    197   
  198    198   
    fn request_fmt() -> Self::RequestFmt {
  199    199   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  200    200   
    }
  201    201   
  202    202   
    fn response_fmt() -> Self::ResponseFmt {
  203    203   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  204    204   
    }
  205    205   
}
  206    206   
  207         -
/// An operation whose shapes generate complex Rust types. See https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity.
  208         -
pub struct TypeComplexityOperation;
         207  +
/// This operation tests that the response code defaults to 200 when no other code is set.
         208  +
pub struct ResponseCodeDefaultOperation;
  209    209   
  210         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for TypeComplexityOperation {
         210  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for ResponseCodeDefaultOperation {
  211    211   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  212    212   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  213         -
            "aws.protocoltests.misc#TypeComplexityOperation",
         213  +
            "aws.protocoltests.misc#ResponseCodeDefaultOperation",
  214    214   
            "aws.protocoltests.misc",
  215         -
            "TypeComplexityOperation",
         215  +
            "ResponseCodeDefaultOperation",
  216    216   
        );
  217    217   
  218         -
    type Input = crate::input::TypeComplexityOperationInput;
  219         -
    type Output = crate::output::TypeComplexityOperationOutput;
         218  +
    type Input = crate::input::ResponseCodeDefaultOperationInput;
         219  +
    type Output = crate::output::ResponseCodeDefaultOperationOutput;
  220    220   
    type Error = std::convert::Infallible;
  221    221   
}
  222    222   
  223    223   
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
  224         -
    for TypeComplexityOperation
         224  +
    for ResponseCodeDefaultOperation
  225    225   
{
  226    226   
    type RequestFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt<
  227    227   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  228    228   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::uri::MakeUri<
  229    229   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  230    230   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  231    231   
        >,
  232    232   
    >;
  233    233   
    type ResponseFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt<
  234    234   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,

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

@@ -1,1 +262,240 @@
    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         -
#[derive(
    4         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5         -
)]
    6         -
pub struct ResponseCodeDefaultOperationOutput {}
    7         -
impl ResponseCodeDefaultOperationOutput {
    8         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationOutput`](crate::output::ResponseCodeDefaultOperationOutput).
    9         -
    pub fn builder() -> crate::output::response_code_default_operation_output::Builder {
   10         -
        crate::output::response_code_default_operation_output::Builder::default()
           3  +
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           4  +
pub struct TypeComplexityOperationOutput {
           5  +
    #[allow(missing_docs)] // documentation missing in model
           6  +
    pub list: ::std::option::Option<
           7  +
        ::std::vec::Vec<
           8  +
            ::std::vec::Vec<
           9  +
                ::std::vec::Vec<
          10  +
                    ::std::collections::HashMap<
          11  +
                        ::std::string::String,
          12  +
                        crate::model::EmptyStructure,
          13  +
                    >,
          14  +
                >,
          15  +
            >,
          16  +
        >,
          17  +
    >,
          18  +
}
          19  +
impl TypeComplexityOperationOutput {
          20  +
    #[allow(missing_docs)] // documentation missing in model
          21  +
    pub fn list(
          22  +
        &self,
          23  +
    ) -> ::std::option::Option<
          24  +
        &[::std::vec::Vec<
          25  +
            ::std::vec::Vec<
          26  +
                ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
          27  +
            >,
          28  +
        >],
          29  +
    > {
          30  +
        self.list.as_deref()
   11     31   
    }
   12     32   
}
   13         -
   14         -
#[allow(missing_docs)] // documentation missing in model
   15         -
#[derive(
   16         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   17         -
)]
   18         -
pub struct ResponseCodeHttpFallbackOperationOutput {}
   19         -
impl ResponseCodeHttpFallbackOperationOutput {
   20         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationOutput`](crate::output::ResponseCodeHttpFallbackOperationOutput).
   21         -
    pub fn builder() -> crate::output::response_code_http_fallback_operation_output::Builder {
   22         -
        crate::output::response_code_http_fallback_operation_output::Builder::default()
          33  +
impl TypeComplexityOperationOutput {
          34  +
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
          35  +
    pub fn builder() -> crate::output::type_complexity_operation_output::Builder {
          36  +
        crate::output::type_complexity_operation_output::Builder::default()
   23     37   
    }
   24     38   
}
   25     39   
   26     40   
#[allow(missing_docs)] // documentation missing in model
   27         -
#[derive(
   28         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   29         -
)]
   30         -
pub struct ResponseCodeRequiredOperationOutput {
          41  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
          42  +
pub struct RequiredInnerShapeOperationOutput {
   31     43   
    #[allow(missing_docs)] // documentation missing in model
   32         -
    pub response_code: i32,
          44  +
    pub inner: ::std::option::Option<crate::model::InnerShape>,
   33     45   
}
   34         -
impl ResponseCodeRequiredOperationOutput {
          46  +
impl RequiredInnerShapeOperationOutput {
   35     47   
    #[allow(missing_docs)] // documentation missing in model
   36         -
    pub fn response_code(&self) -> i32 {
   37         -
        self.response_code
          48  +
    pub fn inner(&self) -> ::std::option::Option<&crate::model::InnerShape> {
          49  +
        self.inner.as_ref()
   38     50   
    }
   39     51   
}
   40         -
impl ResponseCodeRequiredOperationOutput {
   41         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
   42         -
    pub fn builder() -> crate::output::response_code_required_operation_output::Builder {
   43         -
        crate::output::response_code_required_operation_output::Builder::default()
          52  +
impl RequiredInnerShapeOperationOutput {
          53  +
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
          54  +
    pub fn builder() -> crate::output::required_inner_shape_operation_output::Builder {
          55  +
        crate::output::required_inner_shape_operation_output::Builder::default()
   44     56   
    }
   45     57   
}
   46     58   
   47     59   
#[allow(missing_docs)] // documentation missing in model
   48     60   
#[derive(
   49     61   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   50     62   
)]
   51     63   
pub struct RequiredHeaderCollectionOperationOutput {
   52     64   
    #[allow(missing_docs)] // documentation missing in model
   53     65   
    pub required_header_list: ::std::vec::Vec<::std::string::String>,
   54     66   
    #[allow(missing_docs)] // documentation missing in model
   55     67   
    pub required_header_set: crate::model::HeaderSet,
   56     68   
}
   57     69   
impl RequiredHeaderCollectionOperationOutput {
   58     70   
    #[allow(missing_docs)] // documentation missing in model
   59     71   
    pub fn required_header_list(&self) -> &[::std::string::String] {
   60     72   
        use std::ops::Deref;
   61     73   
        self.required_header_list.deref()
   62     74   
    }
   63     75   
    #[allow(missing_docs)] // documentation missing in model
   64     76   
    pub fn required_header_set(&self) -> &crate::model::HeaderSet {
   65     77   
        &self.required_header_set
   66     78   
    }
   67     79   
}
   68     80   
impl RequiredHeaderCollectionOperationOutput {
   69     81   
    /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationOutput`](crate::output::RequiredHeaderCollectionOperationOutput).
   70     82   
    pub fn builder() -> crate::output::required_header_collection_operation_output::Builder {
   71     83   
        crate::output::required_header_collection_operation_output::Builder::default()
   72     84   
    }
   73     85   
}
   74     86   
   75     87   
#[allow(missing_docs)] // documentation missing in model
   76         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   77         -
pub struct RequiredInnerShapeOperationOutput {
          88  +
#[derive(
          89  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          90  +
)]
          91  +
pub struct ResponseCodeRequiredOperationOutput {
   78     92   
    #[allow(missing_docs)] // documentation missing in model
   79         -
    pub inner: ::std::option::Option<crate::model::InnerShape>,
          93  +
    pub response_code: i32,
   80     94   
}
   81         -
impl RequiredInnerShapeOperationOutput {
          95  +
impl ResponseCodeRequiredOperationOutput {
   82     96   
    #[allow(missing_docs)] // documentation missing in model
   83         -
    pub fn inner(&self) -> ::std::option::Option<&crate::model::InnerShape> {
   84         -
        self.inner.as_ref()
          97  +
    pub fn response_code(&self) -> i32 {
          98  +
        self.response_code
   85     99   
    }
   86    100   
}
   87         -
impl RequiredInnerShapeOperationOutput {
   88         -
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
   89         -
    pub fn builder() -> crate::output::required_inner_shape_operation_output::Builder {
   90         -
        crate::output::required_inner_shape_operation_output::Builder::default()
         101  +
impl ResponseCodeRequiredOperationOutput {
         102  +
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
         103  +
    pub fn builder() -> crate::output::response_code_required_operation_output::Builder {
         104  +
        crate::output::response_code_required_operation_output::Builder::default()
   91    105   
    }
   92    106   
}
   93    107   
   94    108   
#[allow(missing_docs)] // documentation missing in model
   95         -
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   96         -
pub struct TypeComplexityOperationOutput {
   97         -
    #[allow(missing_docs)] // documentation missing in model
   98         -
    pub list: ::std::option::Option<
         109  +
#[derive(
         110  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         111  +
)]
         112  +
pub struct ResponseCodeHttpFallbackOperationOutput {}
         113  +
impl ResponseCodeHttpFallbackOperationOutput {
         114  +
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationOutput`](crate::output::ResponseCodeHttpFallbackOperationOutput).
         115  +
    pub fn builder() -> crate::output::response_code_http_fallback_operation_output::Builder {
         116  +
        crate::output::response_code_http_fallback_operation_output::Builder::default()
         117  +
    }
         118  +
}
         119  +
         120  +
#[allow(missing_docs)] // documentation missing in model
         121  +
#[derive(
         122  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         123  +
)]
         124  +
pub struct ResponseCodeDefaultOperationOutput {}
         125  +
impl ResponseCodeDefaultOperationOutput {
         126  +
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationOutput`](crate::output::ResponseCodeDefaultOperationOutput).
         127  +
    pub fn builder() -> crate::output::response_code_default_operation_output::Builder {
         128  +
        crate::output::response_code_default_operation_output::Builder::default()
         129  +
    }
         130  +
}
         131  +
/// See [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
         132  +
pub mod type_complexity_operation_output {
         133  +
         134  +
    impl ::std::convert::From<Builder> for crate::output::TypeComplexityOperationOutput {
         135  +
        fn from(builder: Builder) -> Self {
         136  +
            builder.build()
         137  +
        }
         138  +
    }
         139  +
    /// A builder for [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
         140  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         141  +
    pub struct Builder {
         142  +
        pub(crate) list: ::std::option::Option<
   99    143   
            ::std::vec::Vec<
  100    144   
                ::std::vec::Vec<
  101    145   
                    ::std::vec::Vec<
  102    146   
                        ::std::collections::HashMap<
  103    147   
                            ::std::string::String,
  104    148   
                            crate::model::EmptyStructure,
  105    149   
                        >,
  106    150   
                    >,
  107    151   
                >,
  108    152   
            >,
  109    153   
        >,
  110         -
}
  111         -
impl TypeComplexityOperationOutput {
         154  +
    }
         155  +
    impl Builder {
  112    156   
        #[allow(missing_docs)] // documentation missing in model
  113    157   
        pub fn list(
  114         -
        &self,
  115         -
    ) -> ::std::option::Option<
  116         -
        &[::std::vec::Vec<
         158  +
            mut self,
         159  +
            input: ::std::option::Option<
  117    160   
                ::std::vec::Vec<
  118         -
                ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
         161  +
                    ::std::vec::Vec<
         162  +
                        ::std::vec::Vec<
         163  +
                            ::std::collections::HashMap<
         164  +
                                ::std::string::String,
         165  +
                                crate::model::EmptyStructure,
  119    166   
                            >,
  120         -
        >],
  121         -
    > {
  122         -
        self.list.as_deref()
  123         -
    }
  124         -
}
  125         -
impl TypeComplexityOperationOutput {
  126         -
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
  127         -
    pub fn builder() -> crate::output::type_complexity_operation_output::Builder {
  128         -
        crate::output::type_complexity_operation_output::Builder::default()
  129         -
    }
  130         -
}
  131         -
/// See [`ResponseCodeDefaultOperationOutput`](crate::output::ResponseCodeDefaultOperationOutput).
  132         -
pub mod response_code_default_operation_output {
  133         -
  134         -
    impl ::std::convert::From<Builder> for crate::output::ResponseCodeDefaultOperationOutput {
  135         -
        fn from(builder: Builder) -> Self {
  136         -
            builder.build()
  137         -
        }
         167  +
                        >,
         168  +
                    >,
         169  +
                >,
         170  +
            >,
         171  +
        ) -> Self {
         172  +
            self.list = input;
         173  +
            self
  138    174   
        }
  139         -
    /// A builder for [`ResponseCodeDefaultOperationOutput`](crate::output::ResponseCodeDefaultOperationOutput).
  140         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  141         -
    pub struct Builder {}
  142         -
    impl Builder {
  143         -
        /// Consumes the builder and constructs a [`ResponseCodeDefaultOperationOutput`](crate::output::ResponseCodeDefaultOperationOutput).
  144         -
        pub fn build(self) -> crate::output::ResponseCodeDefaultOperationOutput {
         175  +
        /// Consumes the builder and constructs a [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
         176  +
        pub fn build(self) -> crate::output::TypeComplexityOperationOutput {
  145    177   
            self.build_enforcing_all_constraints()
  146    178   
        }
  147         -
        fn build_enforcing_all_constraints(
  148         -
            self,
  149         -
        ) -> crate::output::ResponseCodeDefaultOperationOutput {
  150         -
            crate::output::ResponseCodeDefaultOperationOutput {}
         179  +
        fn build_enforcing_all_constraints(self) -> crate::output::TypeComplexityOperationOutput {
         180  +
            crate::output::TypeComplexityOperationOutput { list: self.list }
  151    181   
        }
  152    182   
    }
  153    183   
}
  154         -
/// See [`ResponseCodeHttpFallbackOperationOutput`](crate::output::ResponseCodeHttpFallbackOperationOutput).
  155         -
pub mod response_code_http_fallback_operation_output {
         184  +
/// See [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
         185  +
pub mod required_inner_shape_operation_output {
  156    186   
  157         -
    impl ::std::convert::From<Builder> for crate::output::ResponseCodeHttpFallbackOperationOutput {
         187  +
    impl ::std::convert::From<Builder> for crate::output::RequiredInnerShapeOperationOutput {
  158    188   
        fn from(builder: Builder) -> Self {
  159    189   
            builder.build()
  160    190   
        }
  161    191   
    }
  162         -
    /// A builder for [`ResponseCodeHttpFallbackOperationOutput`](crate::output::ResponseCodeHttpFallbackOperationOutput).
  163         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  164         -
    pub struct Builder {}
  165         -
    impl Builder {
  166         -
        /// Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationOutput`](crate::output::ResponseCodeHttpFallbackOperationOutput).
  167         -
        pub fn build(self) -> crate::output::ResponseCodeHttpFallbackOperationOutput {
  168         -
            self.build_enforcing_all_constraints()
  169         -
        }
  170         -
        fn build_enforcing_all_constraints(
  171         -
            self,
  172         -
        ) -> crate::output::ResponseCodeHttpFallbackOperationOutput {
  173         -
            crate::output::ResponseCodeHttpFallbackOperationOutput {}
  174         -
        }
  175         -
    }
  176         -
}
  177         -
/// See [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
  178         -
pub mod response_code_required_operation_output {
  179         -
  180         -
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  181         -
    /// Holds one variant for each of the ways the builder can fail.
  182         -
    #[non_exhaustive]
  183         -
    #[allow(clippy::enum_variant_names)]
  184         -
    pub enum ConstraintViolation {
  185         -
        /// `response_code` was not provided but it is required when building `ResponseCodeRequiredOperationOutput`.
  186         -
        MissingResponseCode,
  187         -
    }
  188         -
    impl ::std::fmt::Display for ConstraintViolation {
  189         -
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  190         -
            match self {
  191         -
                ConstraintViolation::MissingResponseCode => write!(f, "`response_code` was not provided but it is required when building `ResponseCodeRequiredOperationOutput`"),
  192         -
            }
  193         -
        }
  194         -
    }
  195         -
    impl ::std::error::Error for ConstraintViolation {}
  196         -
    impl ::std::convert::TryFrom<Builder> for crate::output::ResponseCodeRequiredOperationOutput {
  197         -
        type Error = ConstraintViolation;
  198         -
  199         -
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  200         -
            builder.build()
  201         -
        }
  202         -
    }
  203         -
    /// A builder for [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
         192  +
    /// A builder for [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
  204    193   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  205    194   
    pub struct Builder {
  206         -
        pub(crate) response_code: ::std::option::Option<i32>,
         195  +
        pub(crate) inner: ::std::option::Option<crate::model::InnerShape>,
  207    196   
    }
  208    197   
    impl Builder {
  209    198   
        #[allow(missing_docs)] // documentation missing in model
  210         -
        pub fn response_code(mut self, input: i32) -> Self {
  211         -
            self.response_code = Some(input);
         199  +
        pub fn inner(mut self, input: ::std::option::Option<crate::model::InnerShape>) -> Self {
         200  +
            self.inner = input;
  212    201   
            self
  213    202   
        }
  214         -
        /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
  215         -
        ///
  216         -
        /// The builder fails to construct a [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput) if a [`ConstraintViolation`] occurs.
  217         -
        ///
  218         -
        pub fn build(
  219         -
            self,
  220         -
        ) -> Result<crate::output::ResponseCodeRequiredOperationOutput, ConstraintViolation>
  221         -
        {
         203  +
        /// Consumes the builder and constructs a [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
         204  +
        pub fn build(self) -> crate::output::RequiredInnerShapeOperationOutput {
  222    205   
            self.build_enforcing_all_constraints()
  223    206   
        }
  224    207   
        fn build_enforcing_all_constraints(
  225    208   
            self,
  226         -
        ) -> Result<crate::output::ResponseCodeRequiredOperationOutput, ConstraintViolation>
  227         -
        {
  228         -
            Ok(crate::output::ResponseCodeRequiredOperationOutput {
  229         -
                response_code: self
  230         -
                    .response_code
  231         -
                    .ok_or(ConstraintViolation::MissingResponseCode)?,
  232         -
            })
         209  +
        ) -> crate::output::RequiredInnerShapeOperationOutput {
         210  +
            crate::output::RequiredInnerShapeOperationOutput { inner: self.inner }
  233    211   
        }
  234    212   
    }
  235    213   
}
  236    214   
/// See [`RequiredHeaderCollectionOperationOutput`](crate::output::RequiredHeaderCollectionOperationOutput).
  237    215   
pub mod required_header_collection_operation_output {
  238    216   
  239    217   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  240    218   
    /// Holds one variant for each of the ways the builder can fail.
  241    219   
    #[non_exhaustive]
  242    220   
    #[allow(clippy::enum_variant_names)]
@@ -282,260 +394,394 @@
  302    280   
                required_header_list: self
  303    281   
                    .required_header_list
  304    282   
                    .ok_or(ConstraintViolation::MissingRequiredHeaderList)?,
  305    283   
                required_header_set: self
  306    284   
                    .required_header_set
  307    285   
                    .ok_or(ConstraintViolation::MissingRequiredHeaderSet)?,
  308    286   
            })
  309    287   
        }
  310    288   
    }
  311    289   
}
  312         -
/// See [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
  313         -
pub mod required_inner_shape_operation_output {
         290  +
/// See [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
         291  +
pub mod response_code_required_operation_output {
  314    292   
  315         -
    impl ::std::convert::From<Builder> for crate::output::RequiredInnerShapeOperationOutput {
  316         -
        fn from(builder: Builder) -> Self {
         293  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         294  +
    /// Holds one variant for each of the ways the builder can fail.
         295  +
    #[non_exhaustive]
         296  +
    #[allow(clippy::enum_variant_names)]
         297  +
    pub enum ConstraintViolation {
         298  +
        /// `response_code` was not provided but it is required when building `ResponseCodeRequiredOperationOutput`.
         299  +
        MissingResponseCode,
         300  +
    }
         301  +
    impl ::std::fmt::Display for ConstraintViolation {
         302  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         303  +
            match self {
         304  +
                ConstraintViolation::MissingResponseCode => write!(f, "`response_code` was not provided but it is required when building `ResponseCodeRequiredOperationOutput`"),
         305  +
            }
         306  +
        }
         307  +
    }
         308  +
    impl ::std::error::Error for ConstraintViolation {}
         309  +
    impl ::std::convert::TryFrom<Builder> for crate::output::ResponseCodeRequiredOperationOutput {
         310  +
        type Error = ConstraintViolation;
         311  +
         312  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  317    313   
            builder.build()
  318    314   
        }
  319    315   
    }
  320         -
    /// A builder for [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
         316  +
    /// A builder for [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
  321    317   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  322    318   
    pub struct Builder {
  323         -
        pub(crate) inner: ::std::option::Option<crate::model::InnerShape>,
         319  +
        pub(crate) response_code: ::std::option::Option<i32>,
  324    320   
    }
  325    321   
    impl Builder {
  326    322   
        #[allow(missing_docs)] // documentation missing in model
  327         -
        pub fn inner(mut self, input: ::std::option::Option<crate::model::InnerShape>) -> Self {
  328         -
            self.inner = input;
         323  +
        pub fn response_code(mut self, input: i32) -> Self {
         324  +
            self.response_code = Some(input);
  329    325   
            self
  330    326   
        }
  331         -
        /// Consumes the builder and constructs a [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
  332         -
        pub fn build(self) -> crate::output::RequiredInnerShapeOperationOutput {
         327  +
        /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
         328  +
        ///
         329  +
        /// The builder fails to construct a [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput) if a [`ConstraintViolation`] occurs.
         330  +
        ///
         331  +
        pub fn build(
         332  +
            self,
         333  +
        ) -> Result<crate::output::ResponseCodeRequiredOperationOutput, ConstraintViolation>
         334  +
        {
  333    335   
            self.build_enforcing_all_constraints()
  334    336   
        }
  335    337   
        fn build_enforcing_all_constraints(
  336    338   
            self,
  337         -
        ) -> crate::output::RequiredInnerShapeOperationOutput {
  338         -
            crate::output::RequiredInnerShapeOperationOutput { inner: self.inner }
         339  +
        ) -> Result<crate::output::ResponseCodeRequiredOperationOutput, ConstraintViolation>
         340  +
        {
         341  +
            Ok(crate::output::ResponseCodeRequiredOperationOutput {
         342  +
                response_code: self
         343  +
                    .response_code
         344  +
                    .ok_or(ConstraintViolation::MissingResponseCode)?,
         345  +
            })
  339    346   
        }
  340    347   
    }
  341    348   
}
  342         -
/// See [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
  343         -
pub mod type_complexity_operation_output {
         349  +
/// See [`ResponseCodeHttpFallbackOperationOutput`](crate::output::ResponseCodeHttpFallbackOperationOutput).
         350  +
pub mod response_code_http_fallback_operation_output {
  344    351   
  345         -
    impl ::std::convert::From<Builder> for crate::output::TypeComplexityOperationOutput {
         352  +
    impl ::std::convert::From<Builder> for crate::output::ResponseCodeHttpFallbackOperationOutput {
  346    353   
        fn from(builder: Builder) -> Self {
  347    354   
            builder.build()
  348    355   
        }
  349    356   
    }
  350         -
    /// A builder for [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
         357  +
    /// A builder for [`ResponseCodeHttpFallbackOperationOutput`](crate::output::ResponseCodeHttpFallbackOperationOutput).
  351    358   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  352         -
    pub struct Builder {
  353         -
        pub(crate) list: ::std::option::Option<
  354         -
            ::std::vec::Vec<
  355         -
                ::std::vec::Vec<
  356         -
                    ::std::vec::Vec<
  357         -
                        ::std::collections::HashMap<
  358         -
                            ::std::string::String,
  359         -
                            crate::model::EmptyStructure,
  360         -
                        >,
  361         -
                    >,
  362         -
                >,
  363         -
            >,
  364         -
        >,
  365         -
    }
         359  +
    pub struct Builder {}
  366    360   
    impl Builder {
  367         -
        #[allow(missing_docs)] // documentation missing in model
  368         -
        pub fn list(
  369         -
            mut self,
  370         -
            input: ::std::option::Option<
  371         -
                ::std::vec::Vec<
  372         -
                    ::std::vec::Vec<
  373         -
                        ::std::vec::Vec<
  374         -
                            ::std::collections::HashMap<
  375         -
                                ::std::string::String,
  376         -
                                crate::model::EmptyStructure,
  377         -
                            >,
  378         -
                        >,
  379         -
                    >,
  380         -
                >,
  381         -
            >,
  382         -
        ) -> Self {
  383         -
            self.list = input;
  384         -
            self
         361  +
        /// Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationOutput`](crate::output::ResponseCodeHttpFallbackOperationOutput).
         362  +
        pub fn build(self) -> crate::output::ResponseCodeHttpFallbackOperationOutput {
         363  +
            self.build_enforcing_all_constraints()
  385    364   
        }
  386         -
        /// Consumes the builder and constructs a [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
  387         -
        pub fn build(self) -> crate::output::TypeComplexityOperationOutput {
         365  +
        fn build_enforcing_all_constraints(
         366  +
            self,
         367  +
        ) -> crate::output::ResponseCodeHttpFallbackOperationOutput {
         368  +
            crate::output::ResponseCodeHttpFallbackOperationOutput {}
         369  +
        }
         370  +
    }
         371  +
}
         372  +
/// See [`ResponseCodeDefaultOperationOutput`](crate::output::ResponseCodeDefaultOperationOutput).
         373  +
pub mod response_code_default_operation_output {
         374  +
         375  +
    impl ::std::convert::From<Builder> for crate::output::ResponseCodeDefaultOperationOutput {
         376  +
        fn from(builder: Builder) -> Self {
         377  +
            builder.build()
         378  +
        }
         379  +
    }
         380  +
    /// A builder for [`ResponseCodeDefaultOperationOutput`](crate::output::ResponseCodeDefaultOperationOutput).
         381  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         382  +
    pub struct Builder {}
         383  +
    impl Builder {
         384  +
        /// Consumes the builder and constructs a [`ResponseCodeDefaultOperationOutput`](crate::output::ResponseCodeDefaultOperationOutput).
         385  +
        pub fn build(self) -> crate::output::ResponseCodeDefaultOperationOutput {
  388    386   
            self.build_enforcing_all_constraints()
  389    387   
        }
  390         -
        fn build_enforcing_all_constraints(self) -> crate::output::TypeComplexityOperationOutput {
  391         -
            crate::output::TypeComplexityOperationOutput { list: self.list }
         388  +
        fn build_enforcing_all_constraints(
         389  +
            self,
         390  +
        ) -> crate::output::ResponseCodeDefaultOperationOutput {
         391  +
            crate::output::ResponseCodeDefaultOperationOutput {}
  392    392   
        }
  393    393   
    }
  394    394   
}

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

@@ -1,1 +32,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/// Error type for the `RequiredInnerShapeOperation` operation.
           4  +
/// Each variant represents an error that can occur for the `RequiredInnerShapeOperation` operation.
           5  +
#[derive(::std::fmt::Debug)]
           6  +
pub enum RequiredInnerShapeOperationError {
           7  +
    /// 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.
           8  +
    ValidationException(crate::error::ValidationException),
           9  +
}
          10  +
impl ::std::fmt::Display for RequiredInnerShapeOperationError {
          11  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          12  +
        match &self {
          13  +
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.fmt(f),
          14  +
        }
          15  +
    }
          16  +
}
          17  +
impl RequiredInnerShapeOperationError {
          18  +
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::ValidationException`.
          19  +
    pub fn is_validation_exception(&self) -> bool {
          20  +
        matches!(
          21  +
            &self,
          22  +
            RequiredInnerShapeOperationError::ValidationException(_)
          23  +
        )
          24  +
    }
          25  +
    /// Returns the error name string by matching the correct variant.
          26  +
    pub fn name(&self) -> &'static str {
          27  +
        match &self {
          28  +
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.name(),
          29  +
        }
          30  +
    }
          31  +
}
          32  +
impl ::std::error::Error for RequiredInnerShapeOperationError {
          33  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
          34  +
        match &self {
          35  +
            RequiredInnerShapeOperationError::ValidationException(_inner) => Some(_inner),
          36  +
        }
          37  +
    }
          38  +
}
          39  +
impl ::std::convert::From<crate::error::ValidationException>
          40  +
    for crate::error::RequiredInnerShapeOperationError
          41  +
{
          42  +
    fn from(
          43  +
        variant: crate::error::ValidationException,
          44  +
    ) -> crate::error::RequiredInnerShapeOperationError {
          45  +
        Self::ValidationException(variant)
          46  +
    }
          47  +
}
          48  +
    3     49   
/// Error type for the `RequiredHeaderCollectionOperation` operation.
    4     50   
/// Each variant represents an error that can occur for the `RequiredHeaderCollectionOperation` operation.
    5     51   
#[derive(::std::fmt::Debug)]
    6     52   
pub enum RequiredHeaderCollectionOperationError {
    7     53   
    /// 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.
    8     54   
    ValidationException(crate::error::ValidationException),
    9     55   
}
   10     56   
impl ::std::fmt::Display for RequiredHeaderCollectionOperationError {
   11     57   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   12     58   
        match &self {
@@ -62,108 +168,167 @@
   82    128   
        Ok(())
   83    129   
    }
   84    130   
}
   85    131   
impl ::std::error::Error for ValidationException {}
   86    132   
impl ValidationException {
   87    133   
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
   88    134   
    pub fn builder() -> crate::error::validation_exception::Builder {
   89    135   
        crate::error::validation_exception::Builder::default()
   90    136   
    }
   91    137   
}
   92         -
   93         -
/// Error type for the `RequiredInnerShapeOperation` operation.
   94         -
/// Each variant represents an error that can occur for the `RequiredInnerShapeOperation` operation.
   95         -
#[derive(::std::fmt::Debug)]
   96         -
pub enum RequiredInnerShapeOperationError {
   97         -
    /// 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.
   98         -
    ValidationException(crate::error::ValidationException),
   99         -
}
  100         -
impl ::std::fmt::Display for RequiredInnerShapeOperationError {
  101         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  102         -
        match &self {
  103         -
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.fmt(f),
  104         -
        }
  105         -
    }
  106         -
}
  107         -
impl RequiredInnerShapeOperationError {
  108         -
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::ValidationException`.
  109         -
    pub fn is_validation_exception(&self) -> bool {
  110         -
        matches!(
  111         -
            &self,
  112         -
            RequiredInnerShapeOperationError::ValidationException(_)
  113         -
        )
  114         -
    }
  115         -
    /// Returns the error name string by matching the correct variant.
  116         -
    pub fn name(&self) -> &'static str {
  117         -
        match &self {
  118         -
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.name(),
  119         -
        }
  120         -
    }
  121         -
}
  122         -
impl ::std::error::Error for RequiredInnerShapeOperationError {
  123         -
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  124         -
        match &self {
  125         -
            RequiredInnerShapeOperationError::ValidationException(_inner) => Some(_inner),
  126         -
        }
  127         -
    }
  128         -
}
  129         -
impl ::std::convert::From<crate::error::ValidationException>
  130         -
    for crate::error::RequiredInnerShapeOperationError
  131         -
{
  132         -
    fn from(
  133         -
        variant: crate::error::ValidationException,
  134         -
    ) -> crate::error::RequiredInnerShapeOperationError {
  135         -
        Self::ValidationException(variant)
  136         -
    }
  137         -
}
  138         -
  139    138   
/// See [`ValidationException`](crate::error::ValidationException).
  140    139   
pub mod validation_exception {
  141    140   
  142    141   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  143    142   
    /// Holds one variant for each of the ways the builder can fail.
  144    143   
    #[non_exhaustive]
  145    144   
    #[allow(clippy::enum_variant_names)]
  146    145   
    pub enum ConstraintViolation {
  147    146   
        /// `message` was not provided but it is required when building `ValidationException`.
  148    147   
        MissingMessage,

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/input.rs

@@ -1,1 +235,354 @@
    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         -
#[derive(
    4         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5         -
)]
    6         -
pub struct ResponseCodeDefaultOperationInput {}
    7         -
impl ResponseCodeDefaultOperationInput {
    8         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
    9         -
    pub fn builder() -> crate::input::response_code_default_operation_input::Builder {
   10         -
        crate::input::response_code_default_operation_input::Builder::default()
   11         -
    }
           3  +
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           4  +
pub struct TypeComplexityOperationInput {
           5  +
    #[allow(missing_docs)] // documentation missing in model
           6  +
    pub list: ::std::option::Option<
           7  +
        ::std::vec::Vec<
           8  +
            ::std::vec::Vec<
           9  +
                ::std::vec::Vec<
          10  +
                    ::std::collections::HashMap<
          11  +
                        ::std::string::String,
          12  +
                        crate::model::EmptyStructure,
          13  +
                    >,
          14  +
                >,
          15  +
            >,
          16  +
        >,
          17  +
    >,
   12     18   
}
   13         -
impl crate::constrained::Constrained for crate::input::ResponseCodeDefaultOperationInput {
   14         -
    type Unconstrained = crate::input::response_code_default_operation_input::Builder;
          19  +
impl TypeComplexityOperationInput {
          20  +
    #[allow(missing_docs)] // documentation missing in model
          21  +
    pub fn list(
          22  +
        &self,
          23  +
    ) -> ::std::option::Option<
          24  +
        &[::std::vec::Vec<
          25  +
            ::std::vec::Vec<
          26  +
                ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
          27  +
            >,
          28  +
        >],
          29  +
    > {
          30  +
        self.list.as_deref()
          31  +
    }
   15     32   
}
   16         -
   17         -
#[allow(missing_docs)] // documentation missing in model
   18         -
#[derive(
   19         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   20         -
)]
   21         -
pub struct ResponseCodeHttpFallbackOperationInput {}
   22         -
impl ResponseCodeHttpFallbackOperationInput {
   23         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
   24         -
    pub fn builder() -> crate::input::response_code_http_fallback_operation_input::Builder {
   25         -
        crate::input::response_code_http_fallback_operation_input::Builder::default()
          33  +
impl TypeComplexityOperationInput {
          34  +
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
          35  +
    pub fn builder() -> crate::input::type_complexity_operation_input::Builder {
          36  +
        crate::input::type_complexity_operation_input::Builder::default()
   26     37   
    }
   27     38   
}
   28         -
impl crate::constrained::Constrained for crate::input::ResponseCodeHttpFallbackOperationInput {
   29         -
    type Unconstrained = crate::input::response_code_http_fallback_operation_input::Builder;
          39  +
impl crate::constrained::Constrained for crate::input::TypeComplexityOperationInput {
          40  +
    type Unconstrained = crate::input::type_complexity_operation_input::Builder;
   30     41   
}
   31     42   
   32     43   
#[allow(missing_docs)] // documentation missing in model
   33         -
#[derive(
   34         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   35         -
)]
   36         -
pub struct ResponseCodeRequiredOperationInput {}
   37         -
impl ResponseCodeRequiredOperationInput {
   38         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
   39         -
    pub fn builder() -> crate::input::response_code_required_operation_input::Builder {
   40         -
        crate::input::response_code_required_operation_input::Builder::default()
          44  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
          45  +
pub struct RequiredInnerShapeOperationInput {
          46  +
    #[allow(missing_docs)] // documentation missing in model
          47  +
    pub inner: ::std::option::Option<crate::model::InnerShape>,
          48  +
}
          49  +
impl RequiredInnerShapeOperationInput {
          50  +
    #[allow(missing_docs)] // documentation missing in model
          51  +
    pub fn inner(&self) -> ::std::option::Option<&crate::model::InnerShape> {
          52  +
        self.inner.as_ref()
   41     53   
    }
   42     54   
}
   43         -
impl crate::constrained::Constrained for crate::input::ResponseCodeRequiredOperationInput {
   44         -
    type Unconstrained = crate::input::response_code_required_operation_input::Builder;
          55  +
impl RequiredInnerShapeOperationInput {
          56  +
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
          57  +
    pub fn builder() -> crate::input::required_inner_shape_operation_input::Builder {
          58  +
        crate::input::required_inner_shape_operation_input::Builder::default()
          59  +
    }
          60  +
}
          61  +
impl crate::constrained::Constrained for crate::input::RequiredInnerShapeOperationInput {
          62  +
    type Unconstrained = crate::input::required_inner_shape_operation_input::Builder;
   45     63   
}
   46     64   
   47     65   
#[allow(missing_docs)] // documentation missing in model
   48     66   
#[derive(
   49     67   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   50     68   
)]
   51     69   
pub struct RequiredHeaderCollectionOperationInput {
   52     70   
    #[allow(missing_docs)] // documentation missing in model
   53     71   
    pub required_header_list: ::std::vec::Vec<::std::string::String>,
   54     72   
    #[allow(missing_docs)] // documentation missing in model
   55     73   
    pub required_header_set: crate::model::HeaderSet,
   56     74   
}
   57     75   
impl RequiredHeaderCollectionOperationInput {
   58     76   
    #[allow(missing_docs)] // documentation missing in model
   59     77   
    pub fn required_header_list(&self) -> &[::std::string::String] {
   60     78   
        use std::ops::Deref;
   61     79   
        self.required_header_list.deref()
   62     80   
    }
   63     81   
    #[allow(missing_docs)] // documentation missing in model
   64     82   
    pub fn required_header_set(&self) -> &crate::model::HeaderSet {
   65     83   
        &self.required_header_set
   66     84   
    }
   67     85   
}
   68     86   
impl RequiredHeaderCollectionOperationInput {
   69     87   
    /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput).
   70     88   
    pub fn builder() -> crate::input::required_header_collection_operation_input::Builder {
   71     89   
        crate::input::required_header_collection_operation_input::Builder::default()
   72     90   
    }
   73     91   
}
   74     92   
impl crate::constrained::Constrained for crate::input::RequiredHeaderCollectionOperationInput {
   75     93   
    type Unconstrained = crate::input::required_header_collection_operation_input::Builder;
   76     94   
}
   77     95   
   78     96   
#[allow(missing_docs)] // documentation missing in model
   79         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   80         -
pub struct RequiredInnerShapeOperationInput {
   81         -
    #[allow(missing_docs)] // documentation missing in model
   82         -
    pub inner: ::std::option::Option<crate::model::InnerShape>,
   83         -
}
   84         -
impl RequiredInnerShapeOperationInput {
   85         -
    #[allow(missing_docs)] // documentation missing in model
   86         -
    pub fn inner(&self) -> ::std::option::Option<&crate::model::InnerShape> {
   87         -
        self.inner.as_ref()
          97  +
#[derive(
          98  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          99  +
)]
         100  +
pub struct ResponseCodeRequiredOperationInput {}
         101  +
impl ResponseCodeRequiredOperationInput {
         102  +
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         103  +
    pub fn builder() -> crate::input::response_code_required_operation_input::Builder {
         104  +
        crate::input::response_code_required_operation_input::Builder::default()
   88    105   
    }
   89    106   
}
   90         -
impl RequiredInnerShapeOperationInput {
   91         -
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
   92         -
    pub fn builder() -> crate::input::required_inner_shape_operation_input::Builder {
   93         -
        crate::input::required_inner_shape_operation_input::Builder::default()
         107  +
impl crate::constrained::Constrained for crate::input::ResponseCodeRequiredOperationInput {
         108  +
    type Unconstrained = crate::input::response_code_required_operation_input::Builder;
         109  +
}
         110  +
         111  +
#[allow(missing_docs)] // documentation missing in model
         112  +
#[derive(
         113  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         114  +
)]
         115  +
pub struct ResponseCodeHttpFallbackOperationInput {}
         116  +
impl ResponseCodeHttpFallbackOperationInput {
         117  +
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
         118  +
    pub fn builder() -> crate::input::response_code_http_fallback_operation_input::Builder {
         119  +
        crate::input::response_code_http_fallback_operation_input::Builder::default()
   94    120   
    }
   95    121   
}
   96         -
impl crate::constrained::Constrained for crate::input::RequiredInnerShapeOperationInput {
   97         -
    type Unconstrained = crate::input::required_inner_shape_operation_input::Builder;
         122  +
impl crate::constrained::Constrained for crate::input::ResponseCodeHttpFallbackOperationInput {
         123  +
    type Unconstrained = crate::input::response_code_http_fallback_operation_input::Builder;
   98    124   
}
   99    125   
  100    126   
#[allow(missing_docs)] // documentation missing in model
  101         -
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
  102         -
pub struct TypeComplexityOperationInput {
  103         -
    #[allow(missing_docs)] // documentation missing in model
  104         -
    pub list: ::std::option::Option<
         127  +
#[derive(
         128  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         129  +
)]
         130  +
pub struct ResponseCodeDefaultOperationInput {}
         131  +
impl ResponseCodeDefaultOperationInput {
         132  +
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
         133  +
    pub fn builder() -> crate::input::response_code_default_operation_input::Builder {
         134  +
        crate::input::response_code_default_operation_input::Builder::default()
         135  +
    }
         136  +
}
         137  +
impl crate::constrained::Constrained for crate::input::ResponseCodeDefaultOperationInput {
         138  +
    type Unconstrained = crate::input::response_code_default_operation_input::Builder;
         139  +
}
         140  +
/// See [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
         141  +
pub mod type_complexity_operation_input {
         142  +
         143  +
    impl ::std::convert::From<Builder> for crate::input::TypeComplexityOperationInput {
         144  +
        fn from(builder: Builder) -> Self {
         145  +
            builder.build()
         146  +
        }
         147  +
    }
         148  +
    /// A builder for [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
         149  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         150  +
    pub struct Builder {
         151  +
        pub(crate) list: ::std::option::Option<
  105    152   
            ::std::vec::Vec<
  106    153   
                ::std::vec::Vec<
  107    154   
                    ::std::vec::Vec<
  108    155   
                        ::std::collections::HashMap<
  109    156   
                            ::std::string::String,
  110    157   
                            crate::model::EmptyStructure,
  111    158   
                        >,
  112    159   
                    >,
  113    160   
                >,
  114    161   
            >,
  115    162   
        >,
  116         -
}
  117         -
impl TypeComplexityOperationInput {
         163  +
    }
         164  +
    impl Builder {
  118    165   
        #[allow(missing_docs)] // documentation missing in model
  119    166   
        pub fn list(
  120         -
        &self,
  121         -
    ) -> ::std::option::Option<
  122         -
        &[::std::vec::Vec<
         167  +
            mut self,
         168  +
            input: ::std::option::Option<
  123    169   
                ::std::vec::Vec<
  124         -
                ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
         170  +
                    ::std::vec::Vec<
         171  +
                        ::std::vec::Vec<
         172  +
                            ::std::collections::HashMap<
         173  +
                                ::std::string::String,
         174  +
                                crate::model::EmptyStructure,
  125    175   
                            >,
  126         -
        >],
  127         -
    > {
  128         -
        self.list.as_deref()
         176  +
                        >,
         177  +
                    >,
         178  +
                >,
         179  +
            >,
         180  +
        ) -> Self {
         181  +
            self.list = input;
         182  +
            self
         183  +
        }
         184  +
        #[allow(missing_docs)] // documentation missing in model
         185  +
        pub(crate) fn set_list(
         186  +
            mut self,
         187  +
            input: Option<
         188  +
                impl ::std::convert::Into<
         189  +
                    ::std::vec::Vec<
         190  +
                        ::std::vec::Vec<
         191  +
                            ::std::vec::Vec<
         192  +
                                ::std::collections::HashMap<
         193  +
                                    ::std::string::String,
         194  +
                                    crate::model::EmptyStructure,
         195  +
                                >,
         196  +
                            >,
         197  +
                        >,
         198  +
                    >,
         199  +
                >,
         200  +
            >,
         201  +
        ) -> Self {
         202  +
            self.list = input.map(|v| v.into());
         203  +
            self
         204  +
        }
         205  +
        /// Consumes the builder and constructs a [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
         206  +
        pub fn build(self) -> crate::input::TypeComplexityOperationInput {
         207  +
            self.build_enforcing_all_constraints()
         208  +
        }
         209  +
        fn build_enforcing_all_constraints(self) -> crate::input::TypeComplexityOperationInput {
         210  +
            crate::input::TypeComplexityOperationInput { list: self.list }
  129    211   
        }
  130         -
}
  131         -
impl TypeComplexityOperationInput {
  132         -
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
  133         -
    pub fn builder() -> crate::input::type_complexity_operation_input::Builder {
  134         -
        crate::input::type_complexity_operation_input::Builder::default()
  135    212   
    }
  136    213   
}
  137         -
impl crate::constrained::Constrained for crate::input::TypeComplexityOperationInput {
  138         -
    type Unconstrained = crate::input::type_complexity_operation_input::Builder;
  139         -
}
  140         -
/// See [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
  141         -
pub mod response_code_default_operation_input {
         214  +
/// See [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
         215  +
pub mod required_inner_shape_operation_input {
  142    216   
  143         -
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeDefaultOperationInput {
  144         -
        fn from(builder: Builder) -> Self {
  145         -
            builder.build()
         217  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         218  +
    /// Holds one variant for each of the ways the builder can fail.
         219  +
    #[non_exhaustive]
         220  +
    #[allow(clippy::enum_variant_names)]
         221  +
    pub enum ConstraintViolation {
         222  +
        /// Constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`.
         223  +
        #[doc(hidden)]
         224  +
        Inner(crate::model::inner_shape::ConstraintViolation),
  146    225   
    }
         226  +
    impl ::std::fmt::Display for ConstraintViolation {
         227  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         228  +
            match self {
         229  +
                ConstraintViolation::Inner(_) => write!(f, "constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`"),
  147    230   
            }
  148         -
    /// A builder for [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
  149         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  150         -
    pub struct Builder {}
  151         -
    impl Builder {
  152         -
        /// Consumes the builder and constructs a [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
  153         -
        pub fn build(self) -> crate::input::ResponseCodeDefaultOperationInput {
  154         -
            self.build_enforcing_all_constraints()
  155    231   
        }
  156         -
        fn build_enforcing_all_constraints(
         232  +
    }
         233  +
    impl ::std::error::Error for ConstraintViolation {}
         234  +
    impl ConstraintViolation {
         235  +
        pub(crate) fn as_validation_exception_field(
  157    236   
            self,
  158         -
        ) -> crate::input::ResponseCodeDefaultOperationInput {
  159         -
            crate::input::ResponseCodeDefaultOperationInput {}
         237  +
            path: ::std::string::String,
         238  +
        ) -> crate::model::ValidationExceptionField {
         239  +
            match self {
         240  +
                ConstraintViolation::Inner(inner) => {
         241  +
                    inner.as_validation_exception_field(path + "/inner")
  160    242   
                }
  161    243   
            }
  162         -
}
  163         -
/// See [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
  164         -
pub mod response_code_http_fallback_operation_input {
  165         -
  166         -
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeHttpFallbackOperationInput {
  167         -
        fn from(builder: Builder) -> Self {
  168         -
            builder.build()
  169    244   
        }
  170    245   
    }
  171         -
    /// A builder for [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
  172         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  173         -
    pub struct Builder {}
  174         -
    impl Builder {
  175         -
        /// Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
  176         -
        pub fn build(self) -> crate::input::ResponseCodeHttpFallbackOperationInput {
  177         -
            self.build_enforcing_all_constraints()
         246  +
    impl ::std::convert::From<ConstraintViolation>
         247  +
        for ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection
         248  +
    {
         249  +
        fn from(constraint_violation: ConstraintViolation) -> Self {
         250  +
            let first_validation_exception_field =
         251  +
                constraint_violation.as_validation_exception_field("".to_owned());
         252  +
            let validation_exception = crate::error::ValidationException {
         253  +
                message: format!(
         254  +
                    "1 validation error detected. {}",
         255  +
                    &first_validation_exception_field.message
         256  +
                ),
         257  +
                field_list: Some(vec![first_validation_exception_field]),
         258  +
            };
         259  +
            Self::ConstraintViolation(
         260  +
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
         261  +
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
         262  +
                            )
         263  +
        }
  178    264   
    }
  179         -
        fn build_enforcing_all_constraints(
  180         -
            self,
  181         -
        ) -> crate::input::ResponseCodeHttpFallbackOperationInput {
  182         -
            crate::input::ResponseCodeHttpFallbackOperationInput {}
         265  +
    impl ::std::convert::From<Builder>
         266  +
        for crate::constrained::MaybeConstrained<crate::input::RequiredInnerShapeOperationInput>
         267  +
    {
         268  +
        fn from(builder: Builder) -> Self {
         269  +
            Self::Unconstrained(builder)
  183    270   
        }
  184    271   
    }
  185         -
}
  186         -
/// See [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
  187         -
pub mod response_code_required_operation_input {
         272  +
    impl ::std::convert::TryFrom<Builder> for crate::input::RequiredInnerShapeOperationInput {
         273  +
        type Error = ConstraintViolation;
  188    274   
  189         -
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeRequiredOperationInput {
  190         -
        fn from(builder: Builder) -> Self {
         275  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  191    276   
            builder.build()
  192    277   
        }
  193    278   
    }
  194         -
    /// A builder for [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         279  +
    /// A builder for [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
  195    280   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  196         -
    pub struct Builder {}
         281  +
    pub struct Builder {
         282  +
        pub(crate) inner:
         283  +
            ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::InnerShape>>,
         284  +
    }
  197    285   
    impl Builder {
  198         -
        /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
  199         -
        pub fn build(self) -> crate::input::ResponseCodeRequiredOperationInput {
         286  +
        #[allow(missing_docs)] // documentation missing in model
         287  +
        pub fn inner(mut self, input: ::std::option::Option<crate::model::InnerShape>) -> Self {
         288  +
            self.inner = input.map(crate::constrained::MaybeConstrained::Constrained);
         289  +
            self
         290  +
        }
         291  +
        #[allow(missing_docs)] // documentation missing in model
         292  +
        pub(crate) fn set_inner(
         293  +
            mut self,
         294  +
            input: Option<
         295  +
                impl ::std::convert::Into<
         296  +
                    crate::constrained::MaybeConstrained<crate::model::InnerShape>,
         297  +
                >,
         298  +
            >,
         299  +
        ) -> Self {
         300  +
            self.inner = input.map(|v| v.into());
         301  +
            self
         302  +
        }
         303  +
        /// Consumes the builder and constructs a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
         304  +
        ///
         305  +
        /// The builder fails to construct a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput) if a [`ConstraintViolation`] occurs.
         306  +
        ///
         307  +
        pub fn build(
         308  +
            self,
         309  +
        ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
  200    310   
            self.build_enforcing_all_constraints()
  201    311   
        }
  202    312   
        fn build_enforcing_all_constraints(
  203    313   
            self,
  204         -
        ) -> crate::input::ResponseCodeRequiredOperationInput {
  205         -
            crate::input::ResponseCodeRequiredOperationInput {}
         314  +
        ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
         315  +
            Ok(crate::input::RequiredInnerShapeOperationInput {
         316  +
                inner: self
         317  +
                    .inner
         318  +
                    .map(|v| match v {
         319  +
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
         320  +
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
         321  +
                    })
         322  +
                    .map(|res| res.map_err(ConstraintViolation::Inner))
         323  +
                    .transpose()?,
         324  +
            })
  206    325   
        }
  207    326   
    }
  208    327   
}
  209    328   
/// See [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput).
  210    329   
pub mod required_header_collection_operation_input {
  211    330   
  212    331   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  213    332   
    /// Holds one variant for each of the ways the builder can fail.
  214    333   
    #[non_exhaustive]
  215    334   
    #[allow(clippy::enum_variant_names)]
@@ -331,450 +548,548 @@
  351    470   
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
  352    471   
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
  353    472   
                    })
  354    473   
                    .map(|res| res.map_err(ConstraintViolation::RequiredHeaderSet))
  355    474   
                    .transpose()?
  356    475   
                    .ok_or(ConstraintViolation::MissingRequiredHeaderSet)?,
  357    476   
            })
  358    477   
        }
  359    478   
    }
  360    479   
}
  361         -
/// See [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
  362         -
pub mod required_inner_shape_operation_input {
         480  +
/// See [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         481  +
pub mod response_code_required_operation_input {
  363    482   
  364         -
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  365         -
    /// Holds one variant for each of the ways the builder can fail.
  366         -
    #[non_exhaustive]
  367         -
    #[allow(clippy::enum_variant_names)]
  368         -
    pub enum ConstraintViolation {
  369         -
        /// Constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`.
  370         -
        #[doc(hidden)]
  371         -
        Inner(crate::model::inner_shape::ConstraintViolation),
  372         -
    }
  373         -
    impl ::std::fmt::Display for ConstraintViolation {
  374         -
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  375         -
            match self {
  376         -
                ConstraintViolation::Inner(_) => write!(f, "constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`"),
         483  +
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeRequiredOperationInput {
         484  +
        fn from(builder: Builder) -> Self {
         485  +
            builder.build()
  377    486   
        }
  378    487   
    }
         488  +
    /// A builder for [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         489  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         490  +
    pub struct Builder {}
         491  +
    impl Builder {
         492  +
        /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         493  +
        pub fn build(self) -> crate::input::ResponseCodeRequiredOperationInput {
         494  +
            self.build_enforcing_all_constraints()
  379    495   
        }
  380         -
    impl ::std::error::Error for ConstraintViolation {}
  381         -
    impl ConstraintViolation {
  382         -
        pub(crate) fn as_validation_exception_field(
         496  +
        fn build_enforcing_all_constraints(
  383    497   
            self,
  384         -
            path: ::std::string::String,
  385         -
        ) -> crate::model::ValidationExceptionField {
  386         -
            match self {
  387         -
                ConstraintViolation::Inner(inner) => {
  388         -
                    inner.as_validation_exception_field(path + "/inner")
  389         -
                }
  390         -
            }
  391         -
        }
  392         -
    }
  393         -
    impl ::std::convert::From<ConstraintViolation>
  394         -
        for ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection
  395         -
    {
  396         -
        fn from(constraint_violation: ConstraintViolation) -> Self {
  397         -
            let first_validation_exception_field =
  398         -
                constraint_violation.as_validation_exception_field("".to_owned());
  399         -
            let validation_exception = crate::error::ValidationException {
  400         -
                message: format!(
  401         -
                    "1 validation error detected. {}",
  402         -
                    &first_validation_exception_field.message
  403         -
                ),
  404         -
                field_list: Some(vec![first_validation_exception_field]),
  405         -
            };
  406         -
            Self::ConstraintViolation(
  407         -
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
  408         -
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
  409         -
                            )
  410         -
        }
  411         -
    }
  412         -
    impl ::std::convert::From<Builder>
  413         -
        for crate::constrained::MaybeConstrained<crate::input::RequiredInnerShapeOperationInput>
  414         -
    {
  415         -
        fn from(builder: Builder) -> Self {
  416         -
            Self::Unconstrained(builder)
         498  +
        ) -> crate::input::ResponseCodeRequiredOperationInput {
         499  +
            crate::input::ResponseCodeRequiredOperationInput {}
  417    500   
        }
  418    501   
    }
  419         -
    impl ::std::convert::TryFrom<Builder> for crate::input::RequiredInnerShapeOperationInput {
  420         -
        type Error = ConstraintViolation;
         502  +
}
         503  +
/// See [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
         504  +
pub mod response_code_http_fallback_operation_input {
  421    505   
  422         -
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         506  +
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeHttpFallbackOperationInput {
         507  +
        fn from(builder: Builder) -> Self {
  423    508   
            builder.build()
  424    509   
        }
  425    510   
    }
  426         -
    /// A builder for [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
         511  +
    /// A builder for [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
  427    512   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  428         -
    pub struct Builder {
  429         -
        pub(crate) inner:
  430         -
            ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::InnerShape>>,
  431         -
    }
         513  +
    pub struct Builder {}
  432    514   
    impl Builder {
  433         -
        #[allow(missing_docs)] // documentation missing in model
  434         -
        pub fn inner(mut self, input: ::std::option::Option<crate::model::InnerShape>) -> Self {
  435         -
            self.inner = input.map(crate::constrained::MaybeConstrained::Constrained);
  436         -
            self
  437         -
        }
  438         -
        #[allow(missing_docs)] // documentation missing in model
  439         -
        pub(crate) fn set_inner(
  440         -
            mut self,
  441         -
            input: Option<
  442         -
                impl ::std::convert::Into<
  443         -
                    crate::constrained::MaybeConstrained<crate::model::InnerShape>,
  444         -
                >,
  445         -
            >,
  446         -
        ) -> Self {
  447         -
            self.inner = input.map(|v| v.into());
  448         -
            self
  449         -
        }
  450         -
        /// Consumes the builder and constructs a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
  451         -
        ///
  452         -
        /// The builder fails to construct a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput) if a [`ConstraintViolation`] occurs.
  453         -
        ///
  454         -
        pub fn build(
  455         -
            self,
  456         -
        ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
         515  +
        /// Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
         516  +
        pub fn build(self) -> crate::input::ResponseCodeHttpFallbackOperationInput {
  457    517   
            self.build_enforcing_all_constraints()
  458    518   
        }
  459    519   
        fn build_enforcing_all_constraints(
  460    520   
            self,
  461         -
        ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
  462         -
            Ok(crate::input::RequiredInnerShapeOperationInput {
  463         -
                inner: self
  464         -
                    .inner
  465         -
                    .map(|v| match v {
  466         -
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
  467         -
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
  468         -
                    })
  469         -
                    .map(|res| res.map_err(ConstraintViolation::Inner))
  470         -
                    .transpose()?,
  471         -
            })
         521  +
        ) -> crate::input::ResponseCodeHttpFallbackOperationInput {
         522  +
            crate::input::ResponseCodeHttpFallbackOperationInput {}
  472    523   
        }
  473    524   
    }
  474    525   
}
  475         -
/// See [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
  476         -
pub mod type_complexity_operation_input {
         526  +
/// See [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
         527  +
pub mod response_code_default_operation_input {
  477    528   
  478         -
    impl ::std::convert::From<Builder> for crate::input::TypeComplexityOperationInput {
         529  +
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeDefaultOperationInput {
  479    530   
        fn from(builder: Builder) -> Self {
  480    531   
            builder.build()
  481    532   
        }
  482    533   
    }
  483         -
    /// A builder for [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
         534  +
    /// A builder for [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
  484    535   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  485         -
    pub struct Builder {
  486         -
        pub(crate) list: ::std::option::Option<
  487         -
            ::std::vec::Vec<
  488         -
                ::std::vec::Vec<
  489         -
                    ::std::vec::Vec<
  490         -
                        ::std::collections::HashMap<
  491         -
                            ::std::string::String,
  492         -
                            crate::model::EmptyStructure,
  493         -
                        >,
  494         -
                    >,
  495         -
                >,
  496         -
            >,
  497         -
        >,
  498         -
    }
         536  +
    pub struct Builder {}
  499    537   
    impl Builder {
  500         -
        #[allow(missing_docs)] // documentation missing in model
  501         -
        pub fn list(
  502         -
            mut self,
  503         -
            input: ::std::option::Option<
  504         -
                ::std::vec::Vec<
  505         -
                    ::std::vec::Vec<
  506         -
                        ::std::vec::Vec<
  507         -
                            ::std::collections::HashMap<
  508         -
                                ::std::string::String,
  509         -
                                crate::model::EmptyStructure,
  510         -
                            >,
  511         -
                        >,
  512         -
                    >,
  513         -
                >,
  514         -
            >,
  515         -
        ) -> Self {
  516         -
            self.list = input;
  517         -
            self
  518         -
        }
  519         -
        #[allow(missing_docs)] // documentation missing in model
  520         -
        pub(crate) fn set_list(
  521         -
            mut self,
  522         -
            input: Option<
  523         -
                impl ::std::convert::Into<
  524         -
                    ::std::vec::Vec<
  525         -
                        ::std::vec::Vec<
  526         -
                            ::std::vec::Vec<
  527         -
                                ::std::collections::HashMap<
  528         -
                                    ::std::string::String,
  529         -
                                    crate::model::EmptyStructure,
  530         -
                                >,
  531         -
                            >,
  532         -
                        >,
  533         -
                    >,
  534         -
                >,
  535         -
            >,
  536         -
        ) -> Self {
  537         -
            self.list = input.map(|v| v.into());
  538         -
            self
  539         -
        }
  540         -
        /// Consumes the builder and constructs a [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
  541         -
        pub fn build(self) -> crate::input::TypeComplexityOperationInput {
         538  +
        /// Consumes the builder and constructs a [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
         539  +
        pub fn build(self) -> crate::input::ResponseCodeDefaultOperationInput {
  542    540   
            self.build_enforcing_all_constraints()
  543    541   
        }
  544         -
        fn build_enforcing_all_constraints(self) -> crate::input::TypeComplexityOperationInput {
  545         -
            crate::input::TypeComplexityOperationInput { list: self.list }
         542  +
        fn build_enforcing_all_constraints(
         543  +
            self,
         544  +
        ) -> crate::input::ResponseCodeDefaultOperationInput {
         545  +
            crate::input::ResponseCodeDefaultOperationInput {}
  546    546   
        }
  547    547   
    }
  548    548   
}