Server Test

Server Test

rev. ee474c7509d7728618c23068f3741e8e5b339ef9 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,562 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
::pin_project_lite::pin_project! {
           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>>
           7  +
    }
           8  +
}
           9  +
          10  +
impl std::future::Future for ResponseCodeDefaultOperationInputFuture {
          11  +
    type Output = Result<
          12  +
        crate::input::ResponseCodeDefaultOperationInput,
          13  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
          14  +
    >;
          15  +
          16  +
    fn poll(
          17  +
        self: std::pin::Pin<&mut Self>,
          18  +
        cx: &mut std::task::Context<'_>,
          19  +
    ) -> std::task::Poll<Self::Output> {
          20  +
        let this = self.project();
          21  +
        this.inner.as_mut().poll(cx)
          22  +
    }
          23  +
}
          24  +
          25  +
impl<B>
          26  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
          27  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
          28  +
        B,
          29  +
    > for crate::input::ResponseCodeDefaultOperationInput
          30  +
where
          31  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          32  +
    B: 'static,
          33  +
          34  +
    B::Data: Send,
          35  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          36  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          37  +
{
          38  +
    type Rejection =
          39  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
          40  +
    type Future = ResponseCodeDefaultOperationInputFuture;
          41  +
          42  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
          43  +
        let fut = async move {
          44  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
          45  +
                request.headers(),
          46  +
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
          47  +
            ) {
          48  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
          49  +
            }
          50  +
            crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_request(request)
          51  +
                            .await
          52  +
        };
          53  +
        use ::futures_util::future::TryFutureExt;
          54  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
          55  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
          56  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
          57  +
                    });
          58  +
        ResponseCodeDefaultOperationInputFuture {
          59  +
            inner: Box::pin(fut),
          60  +
        }
          61  +
    }
          62  +
}
          63  +
impl
          64  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
          65  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
          66  +
    > for crate::output::ResponseCodeDefaultOperationOutput
          67  +
{
          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) {
          70  +
                        Ok(response) => response,
          71  +
                        Err(e) => {
          72  +
                            ::tracing::error!(error = %e, "failed to serialize response");
          73  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
          74  +
                        }
          75  +
                    }
          76  +
    }
          77  +
}
          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  +
::pin_project_lite::pin_project! {
          98  +
    /// 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>>
         102  +
    }
         103  +
}
         104  +
         105  +
impl std::future::Future for ResponseCodeHttpFallbackOperationInputFuture {
         106  +
    type Output = Result<
         107  +
        crate::input::ResponseCodeHttpFallbackOperationInput,
         108  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         109  +
    >;
         110  +
         111  +
    fn poll(
         112  +
        self: std::pin::Pin<&mut Self>,
         113  +
        cx: &mut std::task::Context<'_>,
         114  +
    ) -> std::task::Poll<Self::Output> {
         115  +
        let this = self.project();
         116  +
        this.inner.as_mut().poll(cx)
         117  +
    }
         118  +
}
         119  +
         120  +
impl<B>
         121  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         122  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         123  +
        B,
         124  +
    > for crate::input::ResponseCodeHttpFallbackOperationInput
         125  +
where
         126  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
         127  +
    B: 'static,
         128  +
         129  +
    B::Data: Send,
         130  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         131  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
         132  +
{
         133  +
    type Rejection =
         134  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         135  +
    type Future = ResponseCodeHttpFallbackOperationInputFuture;
         136  +
         137  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         138  +
        let fut = async move {
         139  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
         140  +
                request.headers(),
         141  +
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
         142  +
            ) {
         143  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         144  +
            }
         145  +
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_request(request)
         146  +
                            .await
         147  +
        };
         148  +
        use ::futures_util::future::TryFutureExt;
         149  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         150  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
         151  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         152  +
                    });
         153  +
        ResponseCodeHttpFallbackOperationInputFuture {
         154  +
            inner: Box::pin(fut),
         155  +
        }
         156  +
    }
         157  +
}
         158  +
impl
         159  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         160  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         161  +
    > for crate::output::ResponseCodeHttpFallbackOperationOutput
         162  +
{
         163  +
    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) {
         165  +
                        Ok(response) => response,
         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  +
                    }
         171  +
    }
         172  +
}
         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  +
        ));
         194  +
    }
         195  +
}
         196  +
         197  +
::pin_project_lite::pin_project! {
         198  +
    /// 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>>
         202  +
    }
         203  +
}
         204  +
         205  +
impl std::future::Future for ResponseCodeRequiredOperationInputFuture {
         206  +
    type Output = Result<
         207  +
        crate::input::ResponseCodeRequiredOperationInput,
         208  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         209  +
    >;
         210  +
         211  +
    fn poll(
         212  +
        self: std::pin::Pin<&mut Self>,
         213  +
        cx: &mut std::task::Context<'_>,
         214  +
    ) -> std::task::Poll<Self::Output> {
         215  +
        let this = self.project();
         216  +
        this.inner.as_mut().poll(cx)
         217  +
    }
         218  +
}
         219  +
         220  +
impl<B>
         221  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         222  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         223  +
        B,
         224  +
    > for crate::input::ResponseCodeRequiredOperationInput
         225  +
where
         226  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
         227  +
    B: 'static,
         228  +
         229  +
    B::Data: Send,
         230  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         231  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
         232  +
{
         233  +
    type Rejection =
         234  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         235  +
    type Future = ResponseCodeRequiredOperationInputFuture;
         236  +
         237  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         238  +
        let fut = async move {
         239  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
         240  +
                request.headers(),
         241  +
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
         242  +
            ) {
         243  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         244  +
            }
         245  +
            crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_request(request)
         246  +
                            .await
         247  +
        };
         248  +
        use ::futures_util::future::TryFutureExt;
         249  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         250  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
         251  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         252  +
                    });
         253  +
        ResponseCodeRequiredOperationInputFuture {
         254  +
            inner: Box::pin(fut),
         255  +
        }
         256  +
    }
         257  +
}
         258  +
impl
         259  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         260  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         261  +
    > for crate::output::ResponseCodeRequiredOperationOutput
         262  +
{
         263  +
    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) {
         265  +
                        Ok(response) => response,
         266  +
                        Err(e) => {
         267  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         268  +
                            ::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  +
                        }
         270  +
                    }
         271  +
    }
         272  +
}
         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  +
        ));
         294  +
    }
         295  +
}
         296  +
         297  +
::pin_project_lite::pin_project! {
         298  +
    /// 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>>
         302  +
    }
         303  +
}
         304  +
         305  +
impl std::future::Future for RequiredHeaderCollectionOperationInputFuture {
         306  +
    type Output = Result<
         307  +
        crate::input::RequiredHeaderCollectionOperationInput,
         308  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         309  +
    >;
         310  +
         311  +
    fn poll(
         312  +
        self: std::pin::Pin<&mut Self>,
         313  +
        cx: &mut std::task::Context<'_>,
         314  +
    ) -> std::task::Poll<Self::Output> {
         315  +
        let this = self.project();
         316  +
        this.inner.as_mut().poll(cx)
         317  +
    }
         318  +
}
         319  +
         320  +
impl<B>
         321  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         322  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         323  +
        B,
         324  +
    > for crate::input::RequiredHeaderCollectionOperationInput
         325  +
where
         326  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
         327  +
    B: 'static,
         328  +
         329  +
    B::Data: Send,
         330  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         331  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
         332  +
{
         333  +
    type Rejection =
         334  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         335  +
    type Future = RequiredHeaderCollectionOperationInputFuture;
         336  +
         337  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         338  +
        let fut = async move {
         339  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
         340  +
                request.headers(),
         341  +
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
         342  +
            ) {
         343  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         344  +
            }
         345  +
            crate::protocol_serde::shape_required_header_collection_operation::de_required_header_collection_operation_http_request(request)
         346  +
                            .await
         347  +
        };
         348  +
        use ::futures_util::future::TryFutureExt;
         349  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         350  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
         351  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         352  +
                    });
         353  +
        RequiredHeaderCollectionOperationInputFuture {
         354  +
            inner: Box::pin(fut),
         355  +
        }
         356  +
    }
         357  +
}
         358  +
impl
         359  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         360  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         361  +
    > for crate::output::RequiredHeaderCollectionOperationOutput
         362  +
{
         363  +
    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) {
         365  +
                        Ok(response) => response,
         366  +
                        Err(e) => {
         367  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         368  +
                            ::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  +
                        }
         370  +
                    }
         371  +
    }
         372  +
}
         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  +
        }
         389  +
    }
         390  +
}
         391  +
         392  +
::pin_project_lite::pin_project! {
         393  +
    /// 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>>
         397  +
    }
         398  +
}
         399  +
         400  +
impl std::future::Future for RequiredInnerShapeOperationInputFuture {
         401  +
    type Output = Result<
         402  +
        crate::input::RequiredInnerShapeOperationInput,
         403  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         404  +
    >;
         405  +
         406  +
    fn poll(
         407  +
        self: std::pin::Pin<&mut Self>,
         408  +
        cx: &mut std::task::Context<'_>,
         409  +
    ) -> std::task::Poll<Self::Output> {
         410  +
        let this = self.project();
         411  +
        this.inner.as_mut().poll(cx)
         412  +
    }
         413  +
}
         414  +
         415  +
impl<B>
         416  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         417  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         418  +
        B,
         419  +
    > for crate::input::RequiredInnerShapeOperationInput
         420  +
where
         421  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
         422  +
    B: 'static,
         423  +
         424  +
    B::Data: Send,
         425  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         426  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
         427  +
{
         428  +
    type Rejection =
         429  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         430  +
    type Future = RequiredInnerShapeOperationInputFuture;
         431  +
         432  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         433  +
        let fut = async move {
         434  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
         435  +
                request.headers(),
         436  +
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
         437  +
            ) {
         438  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         439  +
            }
         440  +
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_request(request)
         441  +
                            .await
         442  +
        };
         443  +
        use ::futures_util::future::TryFutureExt;
         444  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         445  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
         446  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         447  +
                    });
         448  +
        RequiredInnerShapeOperationInputFuture {
         449  +
            inner: Box::pin(fut),
         450  +
        }
         451  +
    }
         452  +
}
         453  +
impl
         454  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         455  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         456  +
    > for crate::output::RequiredInnerShapeOperationOutput
         457  +
{
         458  +
    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) {
         460  +
                        Ok(response) => response,
         461  +
                        Err(e) => {
         462  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         463  +
                            ::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  +
                        }
         465  +
                    }
         466  +
    }
         467  +
}
         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  +
        }
         484  +
    }
         485  +
}
         486  +
         487  +
::pin_project_lite::pin_project! {
         488  +
    /// 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>>
         492  +
    }
         493  +
}
         494  +
         495  +
impl std::future::Future for TypeComplexityOperationInputFuture {
         496  +
    type Output = Result<
         497  +
        crate::input::TypeComplexityOperationInput,
         498  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         499  +
    >;
         500  +
         501  +
    fn poll(
         502  +
        self: std::pin::Pin<&mut Self>,
         503  +
        cx: &mut std::task::Context<'_>,
         504  +
    ) -> std::task::Poll<Self::Output> {
         505  +
        let this = self.project();
         506  +
        this.inner.as_mut().poll(cx)
         507  +
    }
         508  +
}
         509  +
         510  +
impl<B>
         511  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         512  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         513  +
        B,
         514  +
    > for crate::input::TypeComplexityOperationInput
         515  +
where
         516  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
         517  +
    B: 'static,
         518  +
         519  +
    B::Data: Send,
         520  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         521  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
         522  +
{
         523  +
    type Rejection =
         524  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         525  +
    type Future = TypeComplexityOperationInputFuture;
         526  +
         527  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         528  +
        let fut = async move {
         529  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
         530  +
                request.headers(),
         531  +
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
         532  +
            ) {
         533  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         534  +
            }
         535  +
            crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation_http_request(request)
         536  +
                            .await
         537  +
        };
         538  +
        use ::futures_util::future::TryFutureExt;
         539  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         540  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
         541  +
                        ::aws_smithy_legacy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e)
         542  +
                    });
         543  +
        TypeComplexityOperationInputFuture {
         544  +
            inner: Box::pin(fut),
         545  +
        }
         546  +
    }
         547  +
}
         548  +
impl
         549  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         550  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
         551  +
    > for crate::output::TypeComplexityOperationOutput
         552  +
{
         553  +
    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) {
         555  +
                        Ok(response) => response,
         556  +
                        Err(e) => {
         557  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         558  +
                            ::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  +
                        }
         560  +
                    }
         561  +
    }
         562  +
}

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

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

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

@@ -0,1 +0,394 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           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()
          11  +
    }
          12  +
}
          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()
          23  +
    }
          24  +
}
          25  +
          26  +
#[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 {
          31  +
    #[allow(missing_docs)] // documentation missing in model
          32  +
    pub response_code: i32,
          33  +
}
          34  +
impl ResponseCodeRequiredOperationOutput {
          35  +
    #[allow(missing_docs)] // documentation missing in model
          36  +
    pub fn response_code(&self) -> i32 {
          37  +
        self.response_code
          38  +
    }
          39  +
}
          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()
          44  +
    }
          45  +
}
          46  +
          47  +
#[allow(missing_docs)] // documentation missing in model
          48  +
#[derive(
          49  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          50  +
)]
          51  +
pub struct RequiredHeaderCollectionOperationOutput {
          52  +
    #[allow(missing_docs)] // documentation missing in model
          53  +
    pub required_header_list: ::std::vec::Vec<::std::string::String>,
          54  +
    #[allow(missing_docs)] // documentation missing in model
          55  +
    pub required_header_set: crate::model::HeaderSet,
          56  +
}
          57  +
impl RequiredHeaderCollectionOperationOutput {
          58  +
    #[allow(missing_docs)] // documentation missing in model
          59  +
    pub fn required_header_list(&self) -> &[::std::string::String] {
          60  +
        use std::ops::Deref;
          61  +
        self.required_header_list.deref()
          62  +
    }
          63  +
    #[allow(missing_docs)] // documentation missing in model
          64  +
    pub fn required_header_set(&self) -> &crate::model::HeaderSet {
          65  +
        &self.required_header_set
          66  +
    }
          67  +
}
          68  +
impl RequiredHeaderCollectionOperationOutput {
          69  +
    /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationOutput`](crate::output::RequiredHeaderCollectionOperationOutput).
          70  +
    pub fn builder() -> crate::output::required_header_collection_operation_output::Builder {
          71  +
        crate::output::required_header_collection_operation_output::Builder::default()
          72  +
    }
          73  +
}
          74  +
          75  +
#[allow(missing_docs)] // documentation missing in model
          76  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
          77  +
pub struct RequiredInnerShapeOperationOutput {
          78  +
    #[allow(missing_docs)] // documentation missing in model
          79  +
    pub inner: ::std::option::Option<crate::model::InnerShape>,
          80  +
}
          81  +
impl RequiredInnerShapeOperationOutput {
          82  +
    #[allow(missing_docs)] // documentation missing in model
          83  +
    pub fn inner(&self) -> ::std::option::Option<&crate::model::InnerShape> {
          84  +
        self.inner.as_ref()
          85  +
    }
          86  +
}
          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()
          91  +
    }
          92  +
}
          93  +
          94  +
#[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<
          99  +
        ::std::vec::Vec<
         100  +
            ::std::vec::Vec<
         101  +
                ::std::vec::Vec<
         102  +
                    ::std::collections::HashMap<
         103  +
                        ::std::string::String,
         104  +
                        crate::model::EmptyStructure,
         105  +
                    >,
         106  +
                >,
         107  +
            >,
         108  +
        >,
         109  +
    >,
         110  +
}
         111  +
impl TypeComplexityOperationOutput {
         112  +
    #[allow(missing_docs)] // documentation missing in model
         113  +
    pub fn list(
         114  +
        &self,
         115  +
    ) -> ::std::option::Option<
         116  +
        &[::std::vec::Vec<
         117  +
            ::std::vec::Vec<
         118  +
                ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
         119  +
            >,
         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  +
        }
         138  +
    }
         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 {
         145  +
            self.build_enforcing_all_constraints()
         146  +
        }
         147  +
        fn build_enforcing_all_constraints(
         148  +
            self,
         149  +
        ) -> crate::output::ResponseCodeDefaultOperationOutput {
         150  +
            crate::output::ResponseCodeDefaultOperationOutput {}
         151  +
        }
         152  +
    }
         153  +
}
         154  +
/// See [`ResponseCodeHttpFallbackOperationOutput`](crate::output::ResponseCodeHttpFallbackOperationOutput).
         155  +
pub mod response_code_http_fallback_operation_output {
         156  +
         157  +
    impl ::std::convert::From<Builder> for crate::output::ResponseCodeHttpFallbackOperationOutput {
         158  +
        fn from(builder: Builder) -> Self {
         159  +
            builder.build()
         160  +
        }
         161  +
    }
         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).
         204  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         205  +
    pub struct Builder {
         206  +
        pub(crate) response_code: ::std::option::Option<i32>,
         207  +
    }
         208  +
    impl Builder {
         209  +
        #[allow(missing_docs)] // documentation missing in model
         210  +
        pub fn response_code(mut self, input: i32) -> Self {
         211  +
            self.response_code = Some(input);
         212  +
            self
         213  +
        }
         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  +
        {
         222  +
            self.build_enforcing_all_constraints()
         223  +
        }
         224  +
        fn build_enforcing_all_constraints(
         225  +
            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  +
            })
         233  +
        }
         234  +
    }
         235  +
}
         236  +
/// See [`RequiredHeaderCollectionOperationOutput`](crate::output::RequiredHeaderCollectionOperationOutput).
         237  +
pub mod required_header_collection_operation_output {
         238  +
         239  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         240  +
    /// Holds one variant for each of the ways the builder can fail.
         241  +
    #[non_exhaustive]
         242  +
    #[allow(clippy::enum_variant_names)]
         243  +
    pub enum ConstraintViolation {
         244  +
        /// `required_header_list` was not provided but it is required when building `RequiredHeaderCollectionOperationOutput`.
         245  +
        MissingRequiredHeaderList,
         246  +
        /// `required_header_set` was not provided but it is required when building `RequiredHeaderCollectionOperationOutput`.
         247  +
        MissingRequiredHeaderSet,
         248  +
    }
         249  +
    impl ::std::fmt::Display for ConstraintViolation {
         250  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         251  +
            match self {
         252  +
                ConstraintViolation::MissingRequiredHeaderList => write!(f, "`required_header_list` was not provided but it is required when building `RequiredHeaderCollectionOperationOutput`"),
         253  +
                ConstraintViolation::MissingRequiredHeaderSet => write!(f, "`required_header_set` was not provided but it is required when building `RequiredHeaderCollectionOperationOutput`"),
         254  +
            }
         255  +
        }
         256  +
    }
         257  +
    impl ::std::error::Error for ConstraintViolation {}
         258  +
    impl ::std::convert::TryFrom<Builder> for crate::output::RequiredHeaderCollectionOperationOutput {
         259  +
        type Error = ConstraintViolation;
         260  +
         261  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         262  +
            builder.build()
         263  +
        }
         264  +
    }
         265  +
    /// A builder for [`RequiredHeaderCollectionOperationOutput`](crate::output::RequiredHeaderCollectionOperationOutput).
         266  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         267  +
    pub struct Builder {
         268  +
        pub(crate) required_header_list:
         269  +
            ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         270  +
        pub(crate) required_header_set: ::std::option::Option<crate::model::HeaderSet>,
         271  +
    }
         272  +
    impl Builder {
         273  +
        #[allow(missing_docs)] // documentation missing in model
         274  +
        pub fn required_header_list(
         275  +
            mut self,
         276  +
            input: ::std::vec::Vec<::std::string::String>,
         277  +
        ) -> Self {
         278  +
            self.required_header_list = Some(input);
         279  +
            self
         280  +
        }
         281  +
        #[allow(missing_docs)] // documentation missing in model
         282  +
        pub fn required_header_set(mut self, input: crate::model::HeaderSet) -> Self {
         283  +
            self.required_header_set = Some(input);
         284  +
            self
         285  +
        }
         286  +
        /// Consumes the builder and constructs a [`RequiredHeaderCollectionOperationOutput`](crate::output::RequiredHeaderCollectionOperationOutput).
         287  +
        ///
         288  +
        /// The builder fails to construct a [`RequiredHeaderCollectionOperationOutput`](crate::output::RequiredHeaderCollectionOperationOutput) if a [`ConstraintViolation`] occurs.
         289  +
        ///
         290  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         291  +
        pub fn build(
         292  +
            self,
         293  +
        ) -> Result<crate::output::RequiredHeaderCollectionOperationOutput, ConstraintViolation>
         294  +
        {
         295  +
            self.build_enforcing_all_constraints()
         296  +
        }
         297  +
        fn build_enforcing_all_constraints(
         298  +
            self,
         299  +
        ) -> Result<crate::output::RequiredHeaderCollectionOperationOutput, ConstraintViolation>
         300  +
        {
         301  +
            Ok(crate::output::RequiredHeaderCollectionOperationOutput {
         302  +
                required_header_list: self
         303  +
                    .required_header_list
         304  +
                    .ok_or(ConstraintViolation::MissingRequiredHeaderList)?,
         305  +
                required_header_set: self
         306  +
                    .required_header_set
         307  +
                    .ok_or(ConstraintViolation::MissingRequiredHeaderSet)?,
         308  +
            })
         309  +
        }
         310  +
    }
         311  +
}
         312  +
/// See [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
         313  +
pub mod required_inner_shape_operation_output {
         314  +
         315  +
    impl ::std::convert::From<Builder> for crate::output::RequiredInnerShapeOperationOutput {
         316  +
        fn from(builder: Builder) -> Self {
         317  +
            builder.build()
         318  +
        }
         319  +
    }
         320  +
    /// A builder for [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
         321  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         322  +
    pub struct Builder {
         323  +
        pub(crate) inner: ::std::option::Option<crate::model::InnerShape>,
         324  +
    }
         325  +
    impl Builder {
         326  +
        #[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;
         329  +
            self
         330  +
        }
         331  +
        /// Consumes the builder and constructs a [`RequiredInnerShapeOperationOutput`](crate::output::RequiredInnerShapeOperationOutput).
         332  +
        pub fn build(self) -> crate::output::RequiredInnerShapeOperationOutput {
         333  +
            self.build_enforcing_all_constraints()
         334  +
        }
         335  +
        fn build_enforcing_all_constraints(
         336  +
            self,
         337  +
        ) -> crate::output::RequiredInnerShapeOperationOutput {
         338  +
            crate::output::RequiredInnerShapeOperationOutput { inner: self.inner }
         339  +
        }
         340  +
    }
         341  +
}
         342  +
/// See [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
         343  +
pub mod type_complexity_operation_output {
         344  +
         345  +
    impl ::std::convert::From<Builder> for crate::output::TypeComplexityOperationOutput {
         346  +
        fn from(builder: Builder) -> Self {
         347  +
            builder.build()
         348  +
        }
         349  +
    }
         350  +
    /// A builder for [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
         351  +
    #[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  +
    }
         366  +
    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
         385  +
        }
         386  +
        /// Consumes the builder and constructs a [`TypeComplexityOperationOutput`](crate::output::TypeComplexityOperationOutput).
         387  +
        pub fn build(self) -> crate::output::TypeComplexityOperationOutput {
         388  +
            self.build_enforcing_all_constraints()
         389  +
        }
         390  +
        fn build_enforcing_all_constraints(self) -> crate::output::TypeComplexityOperationOutput {
         391  +
            crate::output::TypeComplexityOperationOutput { list: self.list }
         392  +
        }
         393  +
    }
         394  +
}