Server Test

Server Test

rev. ee474c7509d7728618c23068f3741e8e5b339ef9

Files changed:

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_get_server_statistics_output.rs

@@ -0,1 +0,34 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_get_server_statistics_output_output_output(
           4  +
    value: &crate::output::GetServerStatisticsOutput,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_get_server_statistics_output::ser_get_server_statistics_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
          12  +
    object.finish();
          13  +
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
          15  +
}
          16  +
          17  +
/* JsonSerializerGenerator.kt:358 */
          18  +
pub fn ser_get_server_statistics_output_output(
          19  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          20  +
    input: &crate::output::GetServerStatisticsOutput,
          21  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* SerializerUtil.kt:42 */
          23  +
    {
          24  +
        /* JsonSerializerGenerator.kt:432 */
          25  +
        object.key("calls_count").number(
          26  +
            #[allow(clippy::useless_conversion)]
          27  +
            ::aws_smithy_types::Number::NegInt((input.calls_count).into()),
          28  +
        );
          29  +
        /* SerializerUtil.kt:42 */
          30  +
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
          32  +
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
          34  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_get_storage.rs

@@ -0,1 +0,222 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
           3  +
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
           5  +
pub async fn de_get_storage_http_request<B>(
           6  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           7  +
) -> std::result::Result<
           8  +
    crate::input::GetStorageInput,
           9  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          10  +
>
          11  +
where
          12  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          13  +
    B::Data: Send,
          14  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          15  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          16  +
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
          18  +
    Ok({
          19  +
        /* RustType.kt:534 */
          20  +
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
          22  +
        let mut input = crate::input::get_storage_input::Builder::default();
          23  +
        /* RustType.kt:534 */
          24  +
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
          26  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          27  +
            uri, headers, body, ..
          28  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:856 */
          30  +
        if let Some(value) =
          31  +
            crate::protocol_serde::shape_get_storage_input::de_passcode_header(&headers)?
          32  +
        {
          33  +
            input = input.set_passcode(value)
          34  +
        }
          35  +
        /* ServerHttpBoundProtocolGenerator.kt:1134 */
          36  +
        let input_string = uri.path();
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1146 */
          38  +
        let (input_string, (_, m1)) =
          39  +
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
          40  +
                ::nom::sequence::preceded(
          41  +
                    ::nom::bytes::complete::tag("/"),
          42  +
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("pokedex"),
          43  +
                ),
          44  +
                ::nom::sequence::preceded(
          45  +
                    ::nom::bytes::complete::tag("/"),
          46  +
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
          47  +
                        ::nom::bytes::complete::take_until("/"),
          48  +
                        ::nom::combinator::rest,
          49  +
                    )),
          50  +
                ),
          51  +
            ))(input_string)?;
          52  +
        debug_assert_eq!("", input_string);
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:1157 */
          54  +
        input = input.set_user(crate::protocol_serde::shape_get_storage_input::de_user(m1)?);
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
          56  +
        input.build()?
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
          58  +
    })
          59  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
          60  +
}
          61  +
          62  +
/* RustType.kt:534 */
          63  +
#[allow(clippy::unnecessary_wraps)]
          64  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
          65  +
pub fn ser_get_storage_http_response(
          66  +
    #[allow(unused_variables)] output: crate::output::GetStorageOutput,
          67  +
) -> std::result::Result<
          68  +
    ::aws_smithy_legacy_http_server::response::Response,
          69  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          70  +
> {
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
          72  +
    Ok({
          73  +
        /* RustType.kt:534 */
          74  +
        #[allow(unused_mut)]
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          76  +
        let mut builder = ::http::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
          78  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          79  +
            builder,
          80  +
            ::http::header::CONTENT_TYPE,
          81  +
            "application/json",
          82  +
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
          84  +
        let http_status: u16 = 200;
          85  +
        builder = builder.status(http_status);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
          87  +
        let payload =
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_get_storage_output::ser_get_storage_output_output_output(&output)?
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:699 */
          91  +
        let content_length = payload.len();
          92  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          93  +
            builder,
          94  +
            ::http::header::CONTENT_LENGTH,
          95  +
            content_length,
          96  +
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:603 */
          98  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
         100  +
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
         102  +
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
         104  +
}
         105  +
         106  +
/* RustType.kt:534 */
         107  +
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:471 */
         109  +
pub fn ser_get_storage_http_error(
         110  +
    error: &crate::error::GetStorageError,
         111  +
) -> std::result::Result<
         112  +
    ::aws_smithy_legacy_http_server::response::Response,
         113  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         114  +
> {
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:476 */
         116  +
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:492 */
         118  +
        match error {
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
         120  +
            crate::error::GetStorageError::ResourceNotFoundException(output) => {
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
         122  +
                let payload = crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception_error(output)?;
         123  +
                /* RustType.kt:534 */
         124  +
                #[allow(unused_mut)]
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         126  +
                let mut builder = ::http::Response::builder();
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
         128  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         129  +
                    builder,
         130  +
                    ::http::header::CONTENT_TYPE,
         131  +
                    "application/json",
         132  +
                );
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
         134  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         135  +
                    builder,
         136  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         137  +
                    "ResourceNotFoundException",
         138  +
                );
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
         140  +
                let content_length = payload.len();
         141  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         142  +
                    builder,
         143  +
                    ::http::header::CONTENT_LENGTH,
         144  +
                    content_length,
         145  +
                );
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
         147  +
                builder
         148  +
                    .status(404)
         149  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
         151  +
            }
         152  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
         153  +
            crate::error::GetStorageError::StorageAccessNotAuthorized(output) => {
         154  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
         155  +
                let payload = crate::protocol_serde::shape_storage_access_not_authorized::ser_storage_access_not_authorized_error(output)?;
         156  +
                /* RustType.kt:534 */
         157  +
                #[allow(unused_mut)]
         158  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         159  +
                let mut builder = ::http::Response::builder();
         160  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
         161  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         162  +
                    builder,
         163  +
                    ::http::header::CONTENT_TYPE,
         164  +
                    "application/json",
         165  +
                );
         166  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
         167  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         168  +
                    builder,
         169  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         170  +
                    "StorageAccessNotAuthorized",
         171  +
                );
         172  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
         173  +
                let content_length = payload.len();
         174  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         175  +
                    builder,
         176  +
                    ::http::header::CONTENT_LENGTH,
         177  +
                    content_length,
         178  +
                );
         179  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
         180  +
                builder
         181  +
                    .status(401)
         182  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         183  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
         184  +
            }
         185  +
            /* ServerHttpBoundProtocolGenerator.kt:500 */
         186  +
            crate::error::GetStorageError::ValidationException(output) => {
         187  +
                /* ServerHttpBoundProtocolGenerator.kt:501 */
         188  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         189  +
                /* RustType.kt:534 */
         190  +
                #[allow(unused_mut)]
         191  +
                /* ServerHttpBoundProtocolGenerator.kt:511 */
         192  +
                let mut builder = ::http::Response::builder();
         193  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
         194  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         195  +
                    builder,
         196  +
                    ::http::header::CONTENT_TYPE,
         197  +
                    "application/json",
         198  +
                );
         199  +
                /* ServerHttpBoundProtocolGenerator.kt:633 */
         200  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         201  +
                    builder,
         202  +
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         203  +
                    "ValidationException",
         204  +
                );
         205  +
                /* ServerHttpBoundProtocolGenerator.kt:699 */
         206  +
                let content_length = payload.len();
         207  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         208  +
                    builder,
         209  +
                    ::http::header::CONTENT_LENGTH,
         210  +
                    content_length,
         211  +
                );
         212  +
                /* ServerHttpBoundProtocolGenerator.kt:528 */
         213  +
                builder
         214  +
                    .status(400)
         215  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         216  +
                /* ServerHttpBoundProtocolGenerator.kt:500 */
         217  +
            } /* ServerHttpBoundProtocolGenerator.kt:492 */
         218  +
        }
         219  +
        /* ServerHttpBoundProtocolGenerator.kt:476 */
         220  +
    })
         221  +
    /* ServerHttpBoundProtocolGenerator.kt:471 */
         222  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_get_storage_input.rs

@@ -0,1 +0,30 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:159 */
           3  +
pub(crate) fn de_passcode_header(
           4  +
    header_map: &::aws_smithy_runtime_api::http::Headers,
           5  +
) -> ::std::result::Result<
           6  +
    ::std::option::Option<::std::string::String>,
           7  +
    ::aws_smithy_legacy_http::header::ParseError,
           8  +
> {
           9  +
    /* HttpBindingGenerator.kt:166 */
          10  +
    let headers = header_map.get_all("passcode");
          11  +
    /* HttpBindingGenerator.kt:398 */
          12  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
          13  +
    /* HttpBindingGenerator.kt:159 */
          14  +
}
          15  +
          16  +
/* ServerHttpBoundProtocolGenerator.kt:1453 */
          17  +
pub fn de_user(
          18  +
    value: &str,
          19  +
) -> std::result::Result<
          20  +
    ::std::string::String,
          21  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          22  +
> {
          23  +
    /* ServerHttpBoundProtocolGenerator.kt:1463 */
          24  +
    let value = ::percent_encoding::percent_decode_str(value)
          25  +
        .decode_utf8()?
          26  +
        .into_owned();
          27  +
    /* ServerHttpBoundProtocolGenerator.kt:1525 */
          28  +
    Ok(value)
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1453 */
          30  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_get_storage_output.rs

@@ -0,1 +0,46 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_get_storage_output_output_output(
           4  +
    value: &crate::output::GetStorageOutput,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_get_storage_output::ser_get_storage_output_output(
          11  +
        &mut object,
          12  +
        value,
          13  +
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
          15  +
    object.finish();
          16  +
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
          18  +
}
          19  +
          20  +
/* JsonSerializerGenerator.kt:358 */
          21  +
pub fn ser_get_storage_output_output(
          22  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          23  +
    input: &crate::output::GetStorageOutput,
          24  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
          26  +
    {
          27  +
        /* JsonSerializerGenerator.kt:484 */
          28  +
        let mut array_1 = object.key("collection").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
          30  +
        for item_2 in &input.collection {
          31  +
            /* SerializerUtil.kt:42 */
          32  +
            {
          33  +
                /* JsonSerializerGenerator.kt:423 */
          34  +
                array_1.value().string(item_2.as_str());
          35  +
                /* SerializerUtil.kt:42 */
          36  +
            }
          37  +
            /* JsonSerializerGenerator.kt:524 */
          38  +
        }
          39  +
        /* JsonSerializerGenerator.kt:486 */
          40  +
        array_1.finish();
          41  +
        /* SerializerUtil.kt:42 */
          42  +
    }
          43  +
    /* JsonSerializerGenerator.kt:372 */
          44  +
    Ok(())
          45  +
    /* JsonSerializerGenerator.kt:358 */
          46  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_invalid_pokeball_error.rs

@@ -0,1 +0,34 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_invalid_pokeball_error_error(
           4  +
    value: &crate::error::InvalidPokeballError,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error(
          11  +
        &mut object,
          12  +
        value,
          13  +
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
          15  +
    object.finish();
          16  +
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
          18  +
}
          19  +
          20  +
/* JsonSerializerGenerator.kt:358 */
          21  +
pub fn ser_invalid_pokeball_error(
          22  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          23  +
    input: &crate::error::InvalidPokeballError,
          24  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
          26  +
    {
          27  +
        /* JsonSerializerGenerator.kt:423 */
          28  +
        object.key("pokeball").string(input.pokeball.as_str());
          29  +
        /* SerializerUtil.kt:42 */
          30  +
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
          32  +
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
          34  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_master_ball_unsuccessful.rs

@@ -0,1 +0,104 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_master_ball_unsuccessful_error(
           4  +
    value: &crate::error::MasterBallUnsuccessful,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful(
          11  +
        &mut object,
          12  +
        value,
          13  +
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
          15  +
    object.finish();
          16  +
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
          18  +
}
          19  +
          20  +
/* JsonSerializerGenerator.kt:358 */
          21  +
pub fn ser_master_ball_unsuccessful(
          22  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          23  +
    input: &crate::error::MasterBallUnsuccessful,
          24  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
          26  +
    if let Some(var_1) = &input.message {
          27  +
        /* JsonSerializerGenerator.kt:423 */
          28  +
        object.key("message").string(var_1.as_str());
          29  +
        /* JsonSerializerGenerator.kt:382 */
          30  +
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
          32  +
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
          34  +
}
          35  +
          36  +
/* JsonParserGenerator.kt:148 */
          37  +
pub(crate) fn de_master_ball_unsuccessful_json_err(
          38  +
    value: &[u8],
          39  +
    mut builder: crate::error::master_ball_unsuccessful::Builder,
          40  +
) -> ::std::result::Result<
          41  +
    crate::error::master_ball_unsuccessful::Builder,
          42  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
          43  +
> {
          44  +
    /* JsonParserGenerator.kt:153 */
          45  +
    let mut tokens_owned =
          46  +
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
          47  +
            .peekable();
          48  +
    let tokens = &mut tokens_owned;
          49  +
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          50  +
    /* JsonParserGenerator.kt:684 */
          51  +
    loop {
          52  +
        /* JsonParserGenerator.kt:685 */
          53  +
        match tokens.next().transpose()? {
          54  +
            /* JsonParserGenerator.kt:686 */
          55  +
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          56  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          57  +
                /* JsonParserGenerator.kt:260 */
          58  +
                match key.to_unescaped()?.as_ref() {
          59  +
                    /* JsonParserGenerator.kt:262 */
          60  +
                    "message" => {
          61  +
                        /* JsonParserGenerator.kt:272 */
          62  +
                        builder = builder.set_message(
          63  +
                            /* JsonParserGenerator.kt:354 */
          64  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
          65  +
                                tokens.next(),
          66  +
                            )?
          67  +
                            .map(|s|
          68  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          69  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          70  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          71  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
          72  +
                        );
          73  +
                        /* JsonParserGenerator.kt:262 */
          74  +
                    }
          75  +
                    /* JsonParserGenerator.kt:290 */
          76  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          77  +
                }
          78  +
                /* JsonParserGenerator.kt:686 */
          79  +
            }
          80  +
            /* JsonParserGenerator.kt:695 */
          81  +
            other => {
          82  +
                return Err(
          83  +
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
          84  +
                        "expected object key or end object, found: {other:?}"
          85  +
                    )),
          86  +
                )
          87  +
            } /* JsonParserGenerator.kt:685 */
          88  +
        }
          89  +
        /* JsonParserGenerator.kt:684 */
          90  +
    }
          91  +
    /* JsonParserGenerator.kt:250 */
          92  +
    if tokens.next().is_some() {
          93  +
        /* JsonParserGenerator.kt:251 */
          94  +
        return Err(
          95  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          96  +
                "found more JSON tokens after completing parsing",
          97  +
            ),
          98  +
        );
          99  +
        /* JsonParserGenerator.kt:250 */
         100  +
    }
         101  +
    /* JsonParserGenerator.kt:163 */
         102  +
    Ok(builder)
         103  +
    /* JsonParserGenerator.kt:148 */
         104  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_resource_not_found_exception.rs

@@ -0,1 +0,34 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_resource_not_found_exception_error(
           4  +
    value: &crate::error::ResourceNotFoundException,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_resource_not_found_exception::ser_resource_not_found_exception(
          11  +
        &mut object,
          12  +
        value,
          13  +
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
          15  +
    object.finish();
          16  +
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
          18  +
}
          19  +
          20  +
/* JsonSerializerGenerator.kt:358 */
          21  +
pub fn ser_resource_not_found_exception(
          22  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          23  +
    input: &crate::error::ResourceNotFoundException,
          24  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
          26  +
    {
          27  +
        /* JsonSerializerGenerator.kt:423 */
          28  +
        object.key("message").string(input.message.as_str());
          29  +
        /* SerializerUtil.kt:42 */
          30  +
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
          32  +
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
          34  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_storage_access_not_authorized.rs

@@ -0,1 +0,28 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_storage_access_not_authorized_error(
           4  +
    value: &crate::error::StorageAccessNotAuthorized,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_storage_access_not_authorized::ser_storage_access_not_authorized(
          11  +
        &mut object,
          12  +
        value,
          13  +
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
          15  +
    object.finish();
          16  +
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
          18  +
}
          19  +
          20  +
/* JsonSerializerGenerator.kt:358 */
          21  +
pub fn ser_storage_access_not_authorized(
          22  +
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          23  +
    #[allow(unused_variables)] input: &crate::error::StorageAccessNotAuthorized,
          24  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:372 */
          26  +
    Ok(())
          27  +
    /* JsonSerializerGenerator.kt:358 */
          28  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_stream_pokemon_radio.rs

@@ -0,1 +0,75 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:534 */
           3  +
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:408 */
           5  +
pub async fn de_stream_pokemon_radio_http_request<B>(
           6  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           7  +
) -> std::result::Result<
           8  +
    crate::input::StreamPokemonRadioInput,
           9  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          10  +
>
          11  +
where
          12  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          13  +
    B::Data: Send,
          14  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          15  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          16  +
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:424 */
          18  +
    Ok({
          19  +
        /* RustType.kt:534 */
          20  +
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:759 */
          22  +
        let mut input = crate::input::stream_pokemon_radio_input::Builder::default();
          23  +
        /* RustType.kt:534 */
          24  +
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:764 */
          26  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          27  +
            uri, headers, body, ..
          28  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:873 */
          30  +
        ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          31  +
            &headers, None,
          32  +
        )?;
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:896 */
          34  +
        input.build()
          35  +
        /* ServerHttpBoundProtocolGenerator.kt:424 */
          36  +
    })
          37  +
    /* ServerHttpBoundProtocolGenerator.kt:408 */
          38  +
}
          39  +
          40  +
/* RustType.kt:534 */
          41  +
#[allow(clippy::unnecessary_wraps)]
          42  +
/* ServerHttpBoundProtocolGenerator.kt:445 */
          43  +
pub fn ser_stream_pokemon_radio_http_response(
          44  +
    #[allow(unused_variables)] output: crate::output::StreamPokemonRadioOutput,
          45  +
) -> std::result::Result<
          46  +
    ::aws_smithy_legacy_http_server::response::Response,
          47  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          48  +
> {
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:457 */
          50  +
    Ok({
          51  +
        /* RustType.kt:534 */
          52  +
        #[allow(unused_mut)]
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:547 */
          54  +
        let mut builder = ::http::Response::builder();
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:633 */
          56  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          57  +
            builder,
          58  +
            ::http::header::CONTENT_TYPE,
          59  +
            "application/octet-stream",
          60  +
        );
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:718 */
          62  +
        let http_status: u16 = 200;
          63  +
        builder = builder.status(http_status);
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
          65  +
        let body = ::aws_smithy_legacy_http_server::body::boxed(::aws_smithy_legacy_http_server::body::Body::wrap_stream(
          66  +
            /* ServerProtocolLoader.kt:42 */::aws_smithy_legacy_http::futures_stream_adapter::FuturesStreamCompatByteStream::new(
          67  +
                /* HttpBoundProtocolPayloadGenerator.kt:348 */crate::protocol_serde::shape_stream_pokemon_radio_output::ser_data_http_payload( output.data)?
          68  +
            /* ServerProtocolLoader.kt:42 */)
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */));
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:611 */
          71  +
        builder.body(body)?
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:457 */
          73  +
    })
          74  +
    /* ServerHttpBoundProtocolGenerator.kt:445 */
          75  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_stream_pokemon_radio_output.rs

@@ -0,1 +0,15 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:309 */
           3  +
pub fn ser_data_http_payload(
           4  +
    payload: ::aws_smithy_types::byte_stream::ByteStream,
           5  +
) -> ::std::result::Result<
           6  +
    ::aws_smithy_types::byte_stream::ByteStream,
           7  +
    ::aws_smithy_types::error::operation::BuildError,
           8  +
> {
           9  +
    /* HttpBoundProtocolPayloadGenerator.kt:343 */
          10  +
    Ok(
          11  +
        /* HttpBoundProtocolPayloadGenerator.kt:372 */
          12  +
        payload, /* HttpBoundProtocolPayloadGenerator.kt:343 */
          13  +
    )
          14  +
    /* HttpBoundProtocolPayloadGenerator.kt:309 */
          15  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_throttling_error.rs

@@ -0,1 +0,25 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_throttling_error_error(
           4  +
    value: &crate::error::ThrottlingError,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_throttling_error::ser_throttling_error(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
          12  +
    object.finish();
          13  +
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
          15  +
}
          16  +
          17  +
/* JsonSerializerGenerator.kt:358 */
          18  +
pub fn ser_throttling_error(
          19  +
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          20  +
    #[allow(unused_variables)] input: &crate::error::ThrottlingError,
          21  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
          23  +
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
          25  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_unsupported_region_error.rs

@@ -0,1 +0,34 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_unsupported_region_error_error(
           4  +
    value: &crate::error::UnsupportedRegionError,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_unsupported_region_error::ser_unsupported_region_error(
          11  +
        &mut object,
          12  +
        value,
          13  +
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
          15  +
    object.finish();
          16  +
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
          18  +
}
          19  +
          20  +
/* JsonSerializerGenerator.kt:358 */
          21  +
pub fn ser_unsupported_region_error(
          22  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          23  +
    input: &crate::error::UnsupportedRegionError,
          24  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
          26  +
    {
          27  +
        /* JsonSerializerGenerator.kt:423 */
          28  +
        object.key("region").string(input.region.as_str());
          29  +
        /* SerializerUtil.kt:42 */
          30  +
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
          32  +
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
          34  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -0,1 +0,58 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
           3  +
pub fn ser_validation_exception_error(
           4  +
    value: &crate::error::ValidationException,
           5  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
           7  +
    let mut out = ::std::string::String::new();
           8  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
          10  +
    crate::protocol_serde::shape_validation_exception::ser_validation_exception(
          11  +
        &mut object,
          12  +
        value,
          13  +
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
          15  +
    object.finish();
          16  +
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
          18  +
}
          19  +
          20  +
/* JsonSerializerGenerator.kt:358 */
          21  +
pub fn ser_validation_exception(
          22  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          23  +
    input: &crate::error::ValidationException,
          24  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
          26  +
    if let Some(var_1) = &input.field_list {
          27  +
        /* JsonSerializerGenerator.kt:484 */
          28  +
        let mut array_2 = object.key("fieldList").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
          30  +
        for item_3 in var_1 {
          31  +
            /* SerializerUtil.kt:42 */
          32  +
            {
          33  +
                /* JsonSerializerGenerator.kt:495 */
          34  +
                #[allow(unused_mut)]
          35  +
                /* JsonSerializerGenerator.kt:496 */
          36  +
                let mut object_4 = array_2.value().start_object();
          37  +
                /* JsonSerializerGenerator.kt:375 */
          38  +
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          39  +
                /* JsonSerializerGenerator.kt:515 */
          40  +
                object_4.finish();
          41  +
                /* SerializerUtil.kt:42 */
          42  +
            }
          43  +
            /* JsonSerializerGenerator.kt:524 */
          44  +
        }
          45  +
        /* JsonSerializerGenerator.kt:486 */
          46  +
        array_2.finish();
          47  +
        /* JsonSerializerGenerator.kt:382 */
          48  +
    }
          49  +
    /* SerializerUtil.kt:42 */
          50  +
    {
          51  +
        /* JsonSerializerGenerator.kt:423 */
          52  +
        object.key("message").string(input.message.as_str());
          53  +
        /* SerializerUtil.kt:42 */
          54  +
    }
          55  +
    /* JsonSerializerGenerator.kt:372 */
          56  +
    Ok(())
          57  +
    /* JsonSerializerGenerator.kt:358 */
          58  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_validation_exception_field.rs

@@ -0,1 +0,22 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
           3  +
pub fn ser_validation_exception_field(
           4  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
           5  +
    input: &crate::model::ValidationExceptionField,
           6  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* SerializerUtil.kt:42 */
           8  +
    {
           9  +
        /* JsonSerializerGenerator.kt:423 */
          10  +
        object.key("path").string(input.path.as_str());
          11  +
        /* SerializerUtil.kt:42 */
          12  +
    }
          13  +
    /* SerializerUtil.kt:42 */
          14  +
    {
          15  +
        /* JsonSerializerGenerator.kt:423 */
          16  +
        object.key("message").string(input.message.as_str());
          17  +
        /* SerializerUtil.kt:42 */
          18  +
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
          20  +
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
          22  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/src/service.rs

@@ -0,1 +0,2005 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerServiceGenerator.kt:795 */
           3  +
/// The service builder for [`PokemonService`].
           4  +
///
           5  +
/// Constructed via [`PokemonService::builder`].
           6  +
pub struct PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
           7  +
    capture_pokemon: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
           8  +
    check_health: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
           9  +
    do_nothing: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
          10  +
    get_pokemon_species: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
          11  +
    get_server_statistics: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
          12  +
    get_storage: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
          13  +
    stream_pokemon_radio: Option<::aws_smithy_legacy_http_server::routing::Route<Body>>,
          14  +
    layer: L,
          15  +
    http_plugin: HttpPl,
          16  +
    model_plugin: ModelPl,
          17  +
}
          18  +
          19  +
impl<Body, L, HttpPl, ModelPl> PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
          20  +
    /// Sets the [`CapturePokemon`](crate::operation_shape::CapturePokemon) operation.
          21  +
    ///
          22  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
          23  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
          24  +
    ///
          25  +
    /// # Example
          26  +
    ///
          27  +
    /// ```no_run
          28  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
          29  +
    ///
          30  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
          31  +
    ///
          32  +
    /// async fn handler(input: input::CapturePokemonInput) -> Result<output::CapturePokemonOutput, error::CapturePokemonError> {
          33  +
    ///     todo!()
          34  +
    /// }
          35  +
    ///
          36  +
    /// let config = PokemonServiceConfig::builder().build();
          37  +
    /// let app = PokemonService::builder(config)
          38  +
    ///     .capture_pokemon(handler)
          39  +
    ///     /* Set other handlers */
          40  +
    ///     .build()
          41  +
    ///     .unwrap();
          42  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
          43  +
    /// ```
          44  +
    ///
          45  +
                    pub fn capture_pokemon<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
          46  +
                    where
          47  +
                        HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::CapturePokemon, HandlerExtractors>,
          48  +
          49  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
          50  +
                            PokemonService<L>,
          51  +
                            crate::operation_shape::CapturePokemon,
          52  +
                            ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::CapturePokemon, HandlerType>
          53  +
                        >,
          54  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
          55  +
                            PokemonService<L>,
          56  +
                            crate::operation_shape::CapturePokemon,
          57  +
                            ModelPl::Output
          58  +
                        >,
          59  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
          60  +
                            PokemonService<L>,
          61  +
                            crate::operation_shape::CapturePokemon,
          62  +
                            <
          63  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
          64  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
          65  +
                                    PokemonService<L>,
          66  +
                                    crate::operation_shape::CapturePokemon,
          67  +
                                    ModelPl::Output
          68  +
                                >
          69  +
                            >::Output
          70  +
                        >,
          71  +
          72  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
          73  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
          74  +
          75  +
                    {
          76  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
          77  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
          78  +
        let svc = crate::operation_shape::CapturePokemon::from_handler(handler);
          79  +
        let svc = self.model_plugin.apply(svc);
          80  +
        let svc =
          81  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
          82  +
                .apply(svc);
          83  +
        let svc = self.http_plugin.apply(svc);
          84  +
        self.capture_pokemon_custom(svc)
          85  +
    }
          86  +
          87  +
    /// Sets the [`CapturePokemon`](crate::operation_shape::CapturePokemon) operation.
          88  +
    ///
          89  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
          90  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
          91  +
    ///
          92  +
    /// # Example
          93  +
    ///
          94  +
    /// ```no_run
          95  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
          96  +
    ///
          97  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
          98  +
    ///
          99  +
    /// async fn handler(input: input::CapturePokemonInput) -> Result<output::CapturePokemonOutput, error::CapturePokemonError> {
         100  +
    ///     todo!()
         101  +
    /// }
         102  +
    ///
         103  +
    /// let config = PokemonServiceConfig::builder().build();
         104  +
    /// let svc = ::tower::util::service_fn(handler);
         105  +
    /// let app = PokemonService::builder(config)
         106  +
    ///     .capture_pokemon_service(svc)
         107  +
    ///     /* Set other handlers */
         108  +
    ///     .build()
         109  +
    ///     .unwrap();
         110  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         111  +
    /// ```
         112  +
    ///
         113  +
                    pub fn capture_pokemon_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
         114  +
                    where
         115  +
                        S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::CapturePokemon, ServiceExtractors>,
         116  +
         117  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         118  +
                            PokemonService<L>,
         119  +
                            crate::operation_shape::CapturePokemon,
         120  +
                            ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::CapturePokemon, S>
         121  +
                        >,
         122  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         123  +
                            PokemonService<L>,
         124  +
                            crate::operation_shape::CapturePokemon,
         125  +
                            ModelPl::Output
         126  +
                        >,
         127  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         128  +
                            PokemonService<L>,
         129  +
                            crate::operation_shape::CapturePokemon,
         130  +
                            <
         131  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         132  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         133  +
                                    PokemonService<L>,
         134  +
                                    crate::operation_shape::CapturePokemon,
         135  +
                                    ModelPl::Output
         136  +
                                >
         137  +
                            >::Output
         138  +
                        >,
         139  +
         140  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         141  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         142  +
         143  +
                    {
         144  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         145  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         146  +
        let svc = crate::operation_shape::CapturePokemon::from_service(service);
         147  +
        let svc = self.model_plugin.apply(svc);
         148  +
        let svc =
         149  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         150  +
                .apply(svc);
         151  +
        let svc = self.http_plugin.apply(svc);
         152  +
        self.capture_pokemon_custom(svc)
         153  +
    }
         154  +
         155  +
    /// Sets the [`CapturePokemon`](crate::operation_shape::CapturePokemon) to a custom [`Service`](tower::Service).
         156  +
    /// not constrained by the Smithy contract.
         157  +
    fn capture_pokemon_custom<S>(mut self, svc: S) -> Self
         158  +
    where
         159  +
        S: ::tower::Service<
         160  +
                ::http::Request<Body>,
         161  +
                Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
         162  +
                Error = ::std::convert::Infallible,
         163  +
            > + Clone
         164  +
            + Send
         165  +
            + 'static,
         166  +
        S::Future: Send + 'static,
         167  +
    {
         168  +
        self.capture_pokemon = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
         169  +
        self
         170  +
    }
         171  +
         172  +
    /// Sets the [`CheckHealth`](crate::operation_shape::CheckHealth) operation.
         173  +
    ///
         174  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         175  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         176  +
    ///
         177  +
    /// # Example
         178  +
    ///
         179  +
    /// ```no_run
         180  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         181  +
    ///
         182  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         183  +
    ///
         184  +
    /// async fn handler(input: input::CheckHealthInput) -> output::CheckHealthOutput {
         185  +
    ///     todo!()
         186  +
    /// }
         187  +
    ///
         188  +
    /// let config = PokemonServiceConfig::builder().build();
         189  +
    /// let app = PokemonService::builder(config)
         190  +
    ///     .check_health(handler)
         191  +
    ///     /* Set other handlers */
         192  +
    ///     .build()
         193  +
    ///     .unwrap();
         194  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         195  +
    /// ```
         196  +
    ///
         197  +
                    pub fn check_health<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
         198  +
                    where
         199  +
                        HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::CheckHealth, HandlerExtractors>,
         200  +
         201  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         202  +
                            PokemonService<L>,
         203  +
                            crate::operation_shape::CheckHealth,
         204  +
                            ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::CheckHealth, HandlerType>
         205  +
                        >,
         206  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         207  +
                            PokemonService<L>,
         208  +
                            crate::operation_shape::CheckHealth,
         209  +
                            ModelPl::Output
         210  +
                        >,
         211  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         212  +
                            PokemonService<L>,
         213  +
                            crate::operation_shape::CheckHealth,
         214  +
                            <
         215  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         216  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         217  +
                                    PokemonService<L>,
         218  +
                                    crate::operation_shape::CheckHealth,
         219  +
                                    ModelPl::Output
         220  +
                                >
         221  +
                            >::Output
         222  +
                        >,
         223  +
         224  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         225  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         226  +
         227  +
                    {
         228  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         229  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         230  +
        let svc = crate::operation_shape::CheckHealth::from_handler(handler);
         231  +
        let svc = self.model_plugin.apply(svc);
         232  +
        let svc =
         233  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         234  +
                .apply(svc);
         235  +
        let svc = self.http_plugin.apply(svc);
         236  +
        self.check_health_custom(svc)
         237  +
    }
         238  +
         239  +
    /// Sets the [`CheckHealth`](crate::operation_shape::CheckHealth) operation.
         240  +
    ///
         241  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         242  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         243  +
    ///
         244  +
    /// # Example
         245  +
    ///
         246  +
    /// ```no_run
         247  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         248  +
    ///
         249  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         250  +
    ///
         251  +
    /// async fn handler(input: input::CheckHealthInput) -> Result<output::CheckHealthOutput, std::convert::Infallible> {
         252  +
    ///     todo!()
         253  +
    /// }
         254  +
    ///
         255  +
    /// let config = PokemonServiceConfig::builder().build();
         256  +
    /// let svc = ::tower::util::service_fn(handler);
         257  +
    /// let app = PokemonService::builder(config)
         258  +
    ///     .check_health_service(svc)
         259  +
    ///     /* Set other handlers */
         260  +
    ///     .build()
         261  +
    ///     .unwrap();
         262  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         263  +
    /// ```
         264  +
    ///
         265  +
                    pub fn check_health_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
         266  +
                    where
         267  +
                        S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::CheckHealth, ServiceExtractors>,
         268  +
         269  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         270  +
                            PokemonService<L>,
         271  +
                            crate::operation_shape::CheckHealth,
         272  +
                            ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::CheckHealth, S>
         273  +
                        >,
         274  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         275  +
                            PokemonService<L>,
         276  +
                            crate::operation_shape::CheckHealth,
         277  +
                            ModelPl::Output
         278  +
                        >,
         279  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         280  +
                            PokemonService<L>,
         281  +
                            crate::operation_shape::CheckHealth,
         282  +
                            <
         283  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         284  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         285  +
                                    PokemonService<L>,
         286  +
                                    crate::operation_shape::CheckHealth,
         287  +
                                    ModelPl::Output
         288  +
                                >
         289  +
                            >::Output
         290  +
                        >,
         291  +
         292  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         293  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         294  +
         295  +
                    {
         296  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         297  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         298  +
        let svc = crate::operation_shape::CheckHealth::from_service(service);
         299  +
        let svc = self.model_plugin.apply(svc);
         300  +
        let svc =
         301  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         302  +
                .apply(svc);
         303  +
        let svc = self.http_plugin.apply(svc);
         304  +
        self.check_health_custom(svc)
         305  +
    }
         306  +
         307  +
    /// Sets the [`CheckHealth`](crate::operation_shape::CheckHealth) to a custom [`Service`](tower::Service).
         308  +
    /// not constrained by the Smithy contract.
         309  +
    fn check_health_custom<S>(mut self, svc: S) -> Self
         310  +
    where
         311  +
        S: ::tower::Service<
         312  +
                ::http::Request<Body>,
         313  +
                Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
         314  +
                Error = ::std::convert::Infallible,
         315  +
            > + Clone
         316  +
            + Send
         317  +
            + 'static,
         318  +
        S::Future: Send + 'static,
         319  +
    {
         320  +
        self.check_health = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
         321  +
        self
         322  +
    }
         323  +
         324  +
    /// Sets the [`DoNothing`](crate::operation_shape::DoNothing) operation.
         325  +
    ///
         326  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         327  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         328  +
    ///
         329  +
    /// # Example
         330  +
    ///
         331  +
    /// ```no_run
         332  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         333  +
    ///
         334  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         335  +
    ///
         336  +
    /// async fn handler(input: input::DoNothingInput) -> output::DoNothingOutput {
         337  +
    ///     todo!()
         338  +
    /// }
         339  +
    ///
         340  +
    /// let config = PokemonServiceConfig::builder().build();
         341  +
    /// let app = PokemonService::builder(config)
         342  +
    ///     .do_nothing(handler)
         343  +
    ///     /* Set other handlers */
         344  +
    ///     .build()
         345  +
    ///     .unwrap();
         346  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         347  +
    /// ```
         348  +
    ///
         349  +
                    pub fn do_nothing<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
         350  +
                    where
         351  +
                        HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::DoNothing, HandlerExtractors>,
         352  +
         353  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         354  +
                            PokemonService<L>,
         355  +
                            crate::operation_shape::DoNothing,
         356  +
                            ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::DoNothing, HandlerType>
         357  +
                        >,
         358  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         359  +
                            PokemonService<L>,
         360  +
                            crate::operation_shape::DoNothing,
         361  +
                            ModelPl::Output
         362  +
                        >,
         363  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         364  +
                            PokemonService<L>,
         365  +
                            crate::operation_shape::DoNothing,
         366  +
                            <
         367  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         368  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         369  +
                                    PokemonService<L>,
         370  +
                                    crate::operation_shape::DoNothing,
         371  +
                                    ModelPl::Output
         372  +
                                >
         373  +
                            >::Output
         374  +
                        >,
         375  +
         376  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         377  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         378  +
         379  +
                    {
         380  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         381  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         382  +
        let svc = crate::operation_shape::DoNothing::from_handler(handler);
         383  +
        let svc = self.model_plugin.apply(svc);
         384  +
        let svc =
         385  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         386  +
                .apply(svc);
         387  +
        let svc = self.http_plugin.apply(svc);
         388  +
        self.do_nothing_custom(svc)
         389  +
    }
         390  +
         391  +
    /// Sets the [`DoNothing`](crate::operation_shape::DoNothing) operation.
         392  +
    ///
         393  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         394  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         395  +
    ///
         396  +
    /// # Example
         397  +
    ///
         398  +
    /// ```no_run
         399  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         400  +
    ///
         401  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         402  +
    ///
         403  +
    /// async fn handler(input: input::DoNothingInput) -> Result<output::DoNothingOutput, std::convert::Infallible> {
         404  +
    ///     todo!()
         405  +
    /// }
         406  +
    ///
         407  +
    /// let config = PokemonServiceConfig::builder().build();
         408  +
    /// let svc = ::tower::util::service_fn(handler);
         409  +
    /// let app = PokemonService::builder(config)
         410  +
    ///     .do_nothing_service(svc)
         411  +
    ///     /* Set other handlers */
         412  +
    ///     .build()
         413  +
    ///     .unwrap();
         414  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         415  +
    /// ```
         416  +
    ///
         417  +
                    pub fn do_nothing_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
         418  +
                    where
         419  +
                        S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::DoNothing, ServiceExtractors>,
         420  +
         421  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         422  +
                            PokemonService<L>,
         423  +
                            crate::operation_shape::DoNothing,
         424  +
                            ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::DoNothing, S>
         425  +
                        >,
         426  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         427  +
                            PokemonService<L>,
         428  +
                            crate::operation_shape::DoNothing,
         429  +
                            ModelPl::Output
         430  +
                        >,
         431  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         432  +
                            PokemonService<L>,
         433  +
                            crate::operation_shape::DoNothing,
         434  +
                            <
         435  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         436  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         437  +
                                    PokemonService<L>,
         438  +
                                    crate::operation_shape::DoNothing,
         439  +
                                    ModelPl::Output
         440  +
                                >
         441  +
                            >::Output
         442  +
                        >,
         443  +
         444  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         445  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         446  +
         447  +
                    {
         448  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         449  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         450  +
        let svc = crate::operation_shape::DoNothing::from_service(service);
         451  +
        let svc = self.model_plugin.apply(svc);
         452  +
        let svc =
         453  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         454  +
                .apply(svc);
         455  +
        let svc = self.http_plugin.apply(svc);
         456  +
        self.do_nothing_custom(svc)
         457  +
    }
         458  +
         459  +
    /// Sets the [`DoNothing`](crate::operation_shape::DoNothing) to a custom [`Service`](tower::Service).
         460  +
    /// not constrained by the Smithy contract.
         461  +
    fn do_nothing_custom<S>(mut self, svc: S) -> Self
         462  +
    where
         463  +
        S: ::tower::Service<
         464  +
                ::http::Request<Body>,
         465  +
                Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
         466  +
                Error = ::std::convert::Infallible,
         467  +
            > + Clone
         468  +
            + Send
         469  +
            + 'static,
         470  +
        S::Future: Send + 'static,
         471  +
    {
         472  +
        self.do_nothing = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
         473  +
        self
         474  +
    }
         475  +
         476  +
    /// Sets the [`GetPokemonSpecies`](crate::operation_shape::GetPokemonSpecies) operation.
         477  +
    ///
         478  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         479  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         480  +
    ///
         481  +
    /// # Example
         482  +
    ///
         483  +
    /// ```no_run
         484  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         485  +
    ///
         486  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         487  +
    ///
         488  +
    /// async fn handler(input: input::GetPokemonSpeciesInput) -> Result<output::GetPokemonSpeciesOutput, error::GetPokemonSpeciesError> {
         489  +
    ///     todo!()
         490  +
    /// }
         491  +
    ///
         492  +
    /// let config = PokemonServiceConfig::builder().build();
         493  +
    /// let app = PokemonService::builder(config)
         494  +
    ///     .get_pokemon_species(handler)
         495  +
    ///     /* Set other handlers */
         496  +
    ///     .build()
         497  +
    ///     .unwrap();
         498  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         499  +
    /// ```
         500  +
    ///
         501  +
                    pub fn get_pokemon_species<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
         502  +
                    where
         503  +
                        HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::GetPokemonSpecies, HandlerExtractors>,
         504  +
         505  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         506  +
                            PokemonService<L>,
         507  +
                            crate::operation_shape::GetPokemonSpecies,
         508  +
                            ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::GetPokemonSpecies, HandlerType>
         509  +
                        >,
         510  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         511  +
                            PokemonService<L>,
         512  +
                            crate::operation_shape::GetPokemonSpecies,
         513  +
                            ModelPl::Output
         514  +
                        >,
         515  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         516  +
                            PokemonService<L>,
         517  +
                            crate::operation_shape::GetPokemonSpecies,
         518  +
                            <
         519  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         520  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         521  +
                                    PokemonService<L>,
         522  +
                                    crate::operation_shape::GetPokemonSpecies,
         523  +
                                    ModelPl::Output
         524  +
                                >
         525  +
                            >::Output
         526  +
                        >,
         527  +
         528  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         529  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         530  +
         531  +
                    {
         532  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         533  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         534  +
        let svc = crate::operation_shape::GetPokemonSpecies::from_handler(handler);
         535  +
        let svc = self.model_plugin.apply(svc);
         536  +
        let svc =
         537  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         538  +
                .apply(svc);
         539  +
        let svc = self.http_plugin.apply(svc);
         540  +
        self.get_pokemon_species_custom(svc)
         541  +
    }
         542  +
         543  +
    /// Sets the [`GetPokemonSpecies`](crate::operation_shape::GetPokemonSpecies) operation.
         544  +
    ///
         545  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         546  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         547  +
    ///
         548  +
    /// # Example
         549  +
    ///
         550  +
    /// ```no_run
         551  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         552  +
    ///
         553  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         554  +
    ///
         555  +
    /// async fn handler(input: input::GetPokemonSpeciesInput) -> Result<output::GetPokemonSpeciesOutput, error::GetPokemonSpeciesError> {
         556  +
    ///     todo!()
         557  +
    /// }
         558  +
    ///
         559  +
    /// let config = PokemonServiceConfig::builder().build();
         560  +
    /// let svc = ::tower::util::service_fn(handler);
         561  +
    /// let app = PokemonService::builder(config)
         562  +
    ///     .get_pokemon_species_service(svc)
         563  +
    ///     /* Set other handlers */
         564  +
    ///     .build()
         565  +
    ///     .unwrap();
         566  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         567  +
    /// ```
         568  +
    ///
         569  +
                    pub fn get_pokemon_species_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
         570  +
                    where
         571  +
                        S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::GetPokemonSpecies, ServiceExtractors>,
         572  +
         573  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         574  +
                            PokemonService<L>,
         575  +
                            crate::operation_shape::GetPokemonSpecies,
         576  +
                            ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::GetPokemonSpecies, S>
         577  +
                        >,
         578  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         579  +
                            PokemonService<L>,
         580  +
                            crate::operation_shape::GetPokemonSpecies,
         581  +
                            ModelPl::Output
         582  +
                        >,
         583  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         584  +
                            PokemonService<L>,
         585  +
                            crate::operation_shape::GetPokemonSpecies,
         586  +
                            <
         587  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         588  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         589  +
                                    PokemonService<L>,
         590  +
                                    crate::operation_shape::GetPokemonSpecies,
         591  +
                                    ModelPl::Output
         592  +
                                >
         593  +
                            >::Output
         594  +
                        >,
         595  +
         596  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         597  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         598  +
         599  +
                    {
         600  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         601  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         602  +
        let svc = crate::operation_shape::GetPokemonSpecies::from_service(service);
         603  +
        let svc = self.model_plugin.apply(svc);
         604  +
        let svc =
         605  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         606  +
                .apply(svc);
         607  +
        let svc = self.http_plugin.apply(svc);
         608  +
        self.get_pokemon_species_custom(svc)
         609  +
    }
         610  +
         611  +
    /// Sets the [`GetPokemonSpecies`](crate::operation_shape::GetPokemonSpecies) to a custom [`Service`](tower::Service).
         612  +
    /// not constrained by the Smithy contract.
         613  +
    fn get_pokemon_species_custom<S>(mut self, svc: S) -> Self
         614  +
    where
         615  +
        S: ::tower::Service<
         616  +
                ::http::Request<Body>,
         617  +
                Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
         618  +
                Error = ::std::convert::Infallible,
         619  +
            > + Clone
         620  +
            + Send
         621  +
            + 'static,
         622  +
        S::Future: Send + 'static,
         623  +
    {
         624  +
        self.get_pokemon_species = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
         625  +
        self
         626  +
    }
         627  +
         628  +
    /// Sets the [`GetServerStatistics`](crate::operation_shape::GetServerStatistics) operation.
         629  +
    ///
         630  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         631  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         632  +
    ///
         633  +
    /// # Example
         634  +
    ///
         635  +
    /// ```no_run
         636  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         637  +
    ///
         638  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         639  +
    ///
         640  +
    /// async fn handler(input: input::GetServerStatisticsInput) -> output::GetServerStatisticsOutput {
         641  +
    ///     todo!()
         642  +
    /// }
         643  +
    ///
         644  +
    /// let config = PokemonServiceConfig::builder().build();
         645  +
    /// let app = PokemonService::builder(config)
         646  +
    ///     .get_server_statistics(handler)
         647  +
    ///     /* Set other handlers */
         648  +
    ///     .build()
         649  +
    ///     .unwrap();
         650  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         651  +
    /// ```
         652  +
    ///
         653  +
                    pub fn get_server_statistics<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
         654  +
                    where
         655  +
                        HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::GetServerStatistics, HandlerExtractors>,
         656  +
         657  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         658  +
                            PokemonService<L>,
         659  +
                            crate::operation_shape::GetServerStatistics,
         660  +
                            ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::GetServerStatistics, HandlerType>
         661  +
                        >,
         662  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         663  +
                            PokemonService<L>,
         664  +
                            crate::operation_shape::GetServerStatistics,
         665  +
                            ModelPl::Output
         666  +
                        >,
         667  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         668  +
                            PokemonService<L>,
         669  +
                            crate::operation_shape::GetServerStatistics,
         670  +
                            <
         671  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         672  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         673  +
                                    PokemonService<L>,
         674  +
                                    crate::operation_shape::GetServerStatistics,
         675  +
                                    ModelPl::Output
         676  +
                                >
         677  +
                            >::Output
         678  +
                        >,
         679  +
         680  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         681  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         682  +
         683  +
                    {
         684  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         685  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         686  +
        let svc = crate::operation_shape::GetServerStatistics::from_handler(handler);
         687  +
        let svc = self.model_plugin.apply(svc);
         688  +
        let svc =
         689  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         690  +
                .apply(svc);
         691  +
        let svc = self.http_plugin.apply(svc);
         692  +
        self.get_server_statistics_custom(svc)
         693  +
    }
         694  +
         695  +
    /// Sets the [`GetServerStatistics`](crate::operation_shape::GetServerStatistics) operation.
         696  +
    ///
         697  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         698  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         699  +
    ///
         700  +
    /// # Example
         701  +
    ///
         702  +
    /// ```no_run
         703  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         704  +
    ///
         705  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         706  +
    ///
         707  +
    /// async fn handler(input: input::GetServerStatisticsInput) -> Result<output::GetServerStatisticsOutput, std::convert::Infallible> {
         708  +
    ///     todo!()
         709  +
    /// }
         710  +
    ///
         711  +
    /// let config = PokemonServiceConfig::builder().build();
         712  +
    /// let svc = ::tower::util::service_fn(handler);
         713  +
    /// let app = PokemonService::builder(config)
         714  +
    ///     .get_server_statistics_service(svc)
         715  +
    ///     /* Set other handlers */
         716  +
    ///     .build()
         717  +
    ///     .unwrap();
         718  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         719  +
    /// ```
         720  +
    ///
         721  +
                    pub fn get_server_statistics_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
         722  +
                    where
         723  +
                        S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::GetServerStatistics, ServiceExtractors>,
         724  +
         725  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         726  +
                            PokemonService<L>,
         727  +
                            crate::operation_shape::GetServerStatistics,
         728  +
                            ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::GetServerStatistics, S>
         729  +
                        >,
         730  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         731  +
                            PokemonService<L>,
         732  +
                            crate::operation_shape::GetServerStatistics,
         733  +
                            ModelPl::Output
         734  +
                        >,
         735  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         736  +
                            PokemonService<L>,
         737  +
                            crate::operation_shape::GetServerStatistics,
         738  +
                            <
         739  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         740  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         741  +
                                    PokemonService<L>,
         742  +
                                    crate::operation_shape::GetServerStatistics,
         743  +
                                    ModelPl::Output
         744  +
                                >
         745  +
                            >::Output
         746  +
                        >,
         747  +
         748  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         749  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         750  +
         751  +
                    {
         752  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         753  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         754  +
        let svc = crate::operation_shape::GetServerStatistics::from_service(service);
         755  +
        let svc = self.model_plugin.apply(svc);
         756  +
        let svc =
         757  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         758  +
                .apply(svc);
         759  +
        let svc = self.http_plugin.apply(svc);
         760  +
        self.get_server_statistics_custom(svc)
         761  +
    }
         762  +
         763  +
    /// Sets the [`GetServerStatistics`](crate::operation_shape::GetServerStatistics) to a custom [`Service`](tower::Service).
         764  +
    /// not constrained by the Smithy contract.
         765  +
    fn get_server_statistics_custom<S>(mut self, svc: S) -> Self
         766  +
    where
         767  +
        S: ::tower::Service<
         768  +
                ::http::Request<Body>,
         769  +
                Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
         770  +
                Error = ::std::convert::Infallible,
         771  +
            > + Clone
         772  +
            + Send
         773  +
            + 'static,
         774  +
        S::Future: Send + 'static,
         775  +
    {
         776  +
        self.get_server_statistics =
         777  +
            Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
         778  +
        self
         779  +
    }
         780  +
         781  +
    /// Sets the [`GetStorage`](crate::operation_shape::GetStorage) operation.
         782  +
    ///
         783  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         784  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         785  +
    ///
         786  +
    /// # Example
         787  +
    ///
         788  +
    /// ```no_run
         789  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         790  +
    ///
         791  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         792  +
    ///
         793  +
    /// async fn handler(input: input::GetStorageInput) -> Result<output::GetStorageOutput, error::GetStorageError> {
         794  +
    ///     todo!()
         795  +
    /// }
         796  +
    ///
         797  +
    /// let config = PokemonServiceConfig::builder().build();
         798  +
    /// let app = PokemonService::builder(config)
         799  +
    ///     .get_storage(handler)
         800  +
    ///     /* Set other handlers */
         801  +
    ///     .build()
         802  +
    ///     .unwrap();
         803  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         804  +
    /// ```
         805  +
    ///
         806  +
                    pub fn get_storage<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
         807  +
                    where
         808  +
                        HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::GetStorage, HandlerExtractors>,
         809  +
         810  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         811  +
                            PokemonService<L>,
         812  +
                            crate::operation_shape::GetStorage,
         813  +
                            ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::GetStorage, HandlerType>
         814  +
                        >,
         815  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         816  +
                            PokemonService<L>,
         817  +
                            crate::operation_shape::GetStorage,
         818  +
                            ModelPl::Output
         819  +
                        >,
         820  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         821  +
                            PokemonService<L>,
         822  +
                            crate::operation_shape::GetStorage,
         823  +
                            <
         824  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         825  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         826  +
                                    PokemonService<L>,
         827  +
                                    crate::operation_shape::GetStorage,
         828  +
                                    ModelPl::Output
         829  +
                                >
         830  +
                            >::Output
         831  +
                        >,
         832  +
         833  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         834  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         835  +
         836  +
                    {
         837  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         838  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         839  +
        let svc = crate::operation_shape::GetStorage::from_handler(handler);
         840  +
        let svc = self.model_plugin.apply(svc);
         841  +
        let svc =
         842  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         843  +
                .apply(svc);
         844  +
        let svc = self.http_plugin.apply(svc);
         845  +
        self.get_storage_custom(svc)
         846  +
    }
         847  +
         848  +
    /// Sets the [`GetStorage`](crate::operation_shape::GetStorage) operation.
         849  +
    ///
         850  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         851  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         852  +
    ///
         853  +
    /// # Example
         854  +
    ///
         855  +
    /// ```no_run
         856  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         857  +
    ///
         858  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         859  +
    ///
         860  +
    /// async fn handler(input: input::GetStorageInput) -> Result<output::GetStorageOutput, error::GetStorageError> {
         861  +
    ///     todo!()
         862  +
    /// }
         863  +
    ///
         864  +
    /// let config = PokemonServiceConfig::builder().build();
         865  +
    /// let svc = ::tower::util::service_fn(handler);
         866  +
    /// let app = PokemonService::builder(config)
         867  +
    ///     .get_storage_service(svc)
         868  +
    ///     /* Set other handlers */
         869  +
    ///     .build()
         870  +
    ///     .unwrap();
         871  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         872  +
    /// ```
         873  +
    ///
         874  +
                    pub fn get_storage_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
         875  +
                    where
         876  +
                        S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::GetStorage, ServiceExtractors>,
         877  +
         878  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         879  +
                            PokemonService<L>,
         880  +
                            crate::operation_shape::GetStorage,
         881  +
                            ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::GetStorage, S>
         882  +
                        >,
         883  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         884  +
                            PokemonService<L>,
         885  +
                            crate::operation_shape::GetStorage,
         886  +
                            ModelPl::Output
         887  +
                        >,
         888  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         889  +
                            PokemonService<L>,
         890  +
                            crate::operation_shape::GetStorage,
         891  +
                            <
         892  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         893  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         894  +
                                    PokemonService<L>,
         895  +
                                    crate::operation_shape::GetStorage,
         896  +
                                    ModelPl::Output
         897  +
                                >
         898  +
                            >::Output
         899  +
                        >,
         900  +
         901  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         902  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         903  +
         904  +
                    {
         905  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         906  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         907  +
        let svc = crate::operation_shape::GetStorage::from_service(service);
         908  +
        let svc = self.model_plugin.apply(svc);
         909  +
        let svc =
         910  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         911  +
                .apply(svc);
         912  +
        let svc = self.http_plugin.apply(svc);
         913  +
        self.get_storage_custom(svc)
         914  +
    }
         915  +
         916  +
    /// Sets the [`GetStorage`](crate::operation_shape::GetStorage) to a custom [`Service`](tower::Service).
         917  +
    /// not constrained by the Smithy contract.
         918  +
    fn get_storage_custom<S>(mut self, svc: S) -> Self
         919  +
    where
         920  +
        S: ::tower::Service<
         921  +
                ::http::Request<Body>,
         922  +
                Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
         923  +
                Error = ::std::convert::Infallible,
         924  +
            > + Clone
         925  +
            + Send
         926  +
            + 'static,
         927  +
        S::Future: Send + 'static,
         928  +
    {
         929  +
        self.get_storage = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
         930  +
        self
         931  +
    }
         932  +
         933  +
    /// Sets the [`StreamPokemonRadio`](crate::operation_shape::StreamPokemonRadio) operation.
         934  +
    ///
         935  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
         936  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
         937  +
    ///
         938  +
    /// # Example
         939  +
    ///
         940  +
    /// ```no_run
         941  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         942  +
    ///
         943  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
         944  +
    ///
         945  +
    /// async fn handler(input: input::StreamPokemonRadioInput) -> output::StreamPokemonRadioOutput {
         946  +
    ///     todo!()
         947  +
    /// }
         948  +
    ///
         949  +
    /// let config = PokemonServiceConfig::builder().build();
         950  +
    /// let app = PokemonService::builder(config)
         951  +
    ///     .stream_pokemon_radio(handler)
         952  +
    ///     /* Set other handlers */
         953  +
    ///     .build()
         954  +
    ///     .unwrap();
         955  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
         956  +
    /// ```
         957  +
    ///
         958  +
                    pub fn stream_pokemon_radio<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
         959  +
                    where
         960  +
                        HandlerType: ::aws_smithy_legacy_http_server::operation::Handler<crate::operation_shape::StreamPokemonRadio, HandlerExtractors>,
         961  +
         962  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         963  +
                            PokemonService<L>,
         964  +
                            crate::operation_shape::StreamPokemonRadio,
         965  +
                            ::aws_smithy_legacy_http_server::operation::IntoService<crate::operation_shape::StreamPokemonRadio, HandlerType>
         966  +
                        >,
         967  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
         968  +
                            PokemonService<L>,
         969  +
                            crate::operation_shape::StreamPokemonRadio,
         970  +
                            ModelPl::Output
         971  +
                        >,
         972  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
         973  +
                            PokemonService<L>,
         974  +
                            crate::operation_shape::StreamPokemonRadio,
         975  +
                            <
         976  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
         977  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
         978  +
                                    PokemonService<L>,
         979  +
                                    crate::operation_shape::StreamPokemonRadio,
         980  +
                                    ModelPl::Output
         981  +
                                >
         982  +
                            >::Output
         983  +
                        >,
         984  +
         985  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         986  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         987  +
         988  +
                    {
         989  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
         990  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
         991  +
        let svc = crate::operation_shape::StreamPokemonRadio::from_handler(handler);
         992  +
        let svc = self.model_plugin.apply(svc);
         993  +
        let svc =
         994  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
         995  +
                .apply(svc);
         996  +
        let svc = self.http_plugin.apply(svc);
         997  +
        self.stream_pokemon_radio_custom(svc)
         998  +
    }
         999  +
        1000  +
    /// Sets the [`StreamPokemonRadio`](crate::operation_shape::StreamPokemonRadio) operation.
        1001  +
    ///
        1002  +
    /// This should be an async function satisfying the [`Handler`](::aws_smithy_legacy_http_server::operation::Handler) trait.
        1003  +
    /// See the [operation module documentation](::aws_smithy_legacy_http_server::operation) for more information.
        1004  +
    ///
        1005  +
    /// # Example
        1006  +
    ///
        1007  +
    /// ```no_run
        1008  +
    /// use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
        1009  +
    ///
        1010  +
    /// use pokemon_service_server_sdk_http0x::{input, output, error};
        1011  +
    ///
        1012  +
    /// async fn handler(input: input::StreamPokemonRadioInput) -> Result<output::StreamPokemonRadioOutput, std::convert::Infallible> {
        1013  +
    ///     todo!()
        1014  +
    /// }
        1015  +
    ///
        1016  +
    /// let config = PokemonServiceConfig::builder().build();
        1017  +
    /// let svc = ::tower::util::service_fn(handler);
        1018  +
    /// let app = PokemonService::builder(config)
        1019  +
    ///     .stream_pokemon_radio_service(svc)
        1020  +
    ///     /* Set other handlers */
        1021  +
    ///     .build()
        1022  +
    ///     .unwrap();
        1023  +
    /// # let app: PokemonService<::aws_smithy_legacy_http_server::routing::RoutingService<::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<::aws_smithy_legacy_http_server::routing::Route>, ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1>> = app;
        1024  +
    /// ```
        1025  +
    ///
        1026  +
                    pub fn stream_pokemon_radio_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
        1027  +
                    where
        1028  +
                        S: ::aws_smithy_legacy_http_server::operation::OperationService<crate::operation_shape::StreamPokemonRadio, ServiceExtractors>,
        1029  +
        1030  +
                        ModelPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
        1031  +
                            PokemonService<L>,
        1032  +
                            crate::operation_shape::StreamPokemonRadio,
        1033  +
                            ::aws_smithy_legacy_http_server::operation::Normalize<crate::operation_shape::StreamPokemonRadio, S>
        1034  +
                        >,
        1035  +
                        ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_legacy_http_server::plugin::Plugin<
        1036  +
                            PokemonService<L>,
        1037  +
                            crate::operation_shape::StreamPokemonRadio,
        1038  +
                            ModelPl::Output
        1039  +
                        >,
        1040  +
                        HttpPl: ::aws_smithy_legacy_http_server::plugin::Plugin<
        1041  +
                            PokemonService<L>,
        1042  +
                            crate::operation_shape::StreamPokemonRadio,
        1043  +
                            <
        1044  +
                                ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
        1045  +
                                as ::aws_smithy_legacy_http_server::plugin::Plugin<
        1046  +
                                    PokemonService<L>,
        1047  +
                                    crate::operation_shape::StreamPokemonRadio,
        1048  +
                                    ModelPl::Output
        1049  +
                                >
        1050  +
                            >::Output
        1051  +
                        >,
        1052  +
        1053  +
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
        1054  +
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
        1055  +
        1056  +
                    {
        1057  +
        use ::aws_smithy_legacy_http_server::operation::OperationShapeExt;
        1058  +
        use ::aws_smithy_legacy_http_server::plugin::Plugin;
        1059  +
        let svc = crate::operation_shape::StreamPokemonRadio::from_service(service);
        1060  +
        let svc = self.model_plugin.apply(svc);
        1061  +
        let svc =
        1062  +
            ::aws_smithy_legacy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
        1063  +
                .apply(svc);
        1064  +
        let svc = self.http_plugin.apply(svc);
        1065  +
        self.stream_pokemon_radio_custom(svc)
        1066  +
    }
        1067  +
        1068  +
    /// Sets the [`StreamPokemonRadio`](crate::operation_shape::StreamPokemonRadio) to a custom [`Service`](tower::Service).
        1069  +
    /// not constrained by the Smithy contract.
        1070  +
    fn stream_pokemon_radio_custom<S>(mut self, svc: S) -> Self
        1071  +
    where
        1072  +
        S: ::tower::Service<
        1073  +
                ::http::Request<Body>,
        1074  +
                Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
        1075  +
                Error = ::std::convert::Infallible,
        1076  +
            > + Clone
        1077  +
            + Send
        1078  +
            + 'static,
        1079  +
        S::Future: Send + 'static,
        1080  +
    {
        1081  +
        self.stream_pokemon_radio = Some(::aws_smithy_legacy_http_server::routing::Route::new(svc));
        1082  +
        self
        1083  +
    }
        1084  +
}
        1085  +
        1086  +
impl<Body, L, HttpPl, ModelPl> PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
        1087  +
    /// Constructs a [`PokemonService`] from the arguments provided to the builder.
        1088  +
    ///
        1089  +
    /// Forgetting to register a handler for one or more operations will result in an error.
        1090  +
    ///
        1091  +
    /// Check out [`PokemonServiceBuilder::build_unchecked`] if you'd prefer the service to return status code 500 when an
        1092  +
    /// unspecified route is requested.
        1093  +
    pub fn build(
        1094  +
        self,
        1095  +
    ) -> ::std::result::Result<
        1096  +
        PokemonService<
        1097  +
            ::aws_smithy_legacy_http_server::routing::RoutingService<
        1098  +
                ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<L::Service>,
        1099  +
                ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1100  +
            >,
        1101  +
        >,
        1102  +
        MissingOperationsError,
        1103  +
    >
        1104  +
    where
        1105  +
        L: ::tower::Layer<::aws_smithy_legacy_http_server::routing::Route<Body>>,
        1106  +
    {
        1107  +
        let router = {
        1108  +
            use ::aws_smithy_legacy_http_server::operation::OperationShape;
        1109  +
            let mut missing_operation_names = std::collections::HashMap::new();
        1110  +
            if self.capture_pokemon.is_none() {
        1111  +
                missing_operation_names.insert(
        1112  +
                    crate::operation_shape::CapturePokemon::ID,
        1113  +
                    ".capture_pokemon()",
        1114  +
                );
        1115  +
            }
        1116  +
            if self.check_health.is_none() {
        1117  +
                missing_operation_names
        1118  +
                    .insert(crate::operation_shape::CheckHealth::ID, ".check_health()");
        1119  +
            }
        1120  +
            if self.do_nothing.is_none() {
        1121  +
                missing_operation_names
        1122  +
                    .insert(crate::operation_shape::DoNothing::ID, ".do_nothing()");
        1123  +
            }
        1124  +
            if self.get_pokemon_species.is_none() {
        1125  +
                missing_operation_names.insert(
        1126  +
                    crate::operation_shape::GetPokemonSpecies::ID,
        1127  +
                    ".get_pokemon_species()",
        1128  +
                );
        1129  +
            }
        1130  +
            if self.get_server_statistics.is_none() {
        1131  +
                missing_operation_names.insert(
        1132  +
                    crate::operation_shape::GetServerStatistics::ID,
        1133  +
                    ".get_server_statistics()",
        1134  +
                );
        1135  +
            }
        1136  +
            if self.get_storage.is_none() {
        1137  +
                missing_operation_names
        1138  +
                    .insert(crate::operation_shape::GetStorage::ID, ".get_storage()");
        1139  +
            }
        1140  +
            if self.stream_pokemon_radio.is_none() {
        1141  +
                missing_operation_names.insert(
        1142  +
                    crate::operation_shape::StreamPokemonRadio::ID,
        1143  +
                    ".stream_pokemon_radio()",
        1144  +
                );
        1145  +
            }
        1146  +
            if !missing_operation_names.is_empty() {
        1147  +
                return Err(MissingOperationsError {
        1148  +
                    operation_names2setter_methods: missing_operation_names,
        1149  +
                });
        1150  +
            }
        1151  +
            let unexpected_error_msg = "this should never panic since we are supposed to check beforehand that a handler has been registered for this operation; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues";
        1152  +
        1153  +
            ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter::from_iter([
        1154  +
                (
        1155  +
                    request_specs::capture_pokemon(),
        1156  +
                    self.capture_pokemon.expect(unexpected_error_msg),
        1157  +
                ),
        1158  +
                (
        1159  +
                    request_specs::check_health(),
        1160  +
                    self.check_health.expect(unexpected_error_msg),
        1161  +
                ),
        1162  +
                (
        1163  +
                    request_specs::do_nothing(),
        1164  +
                    self.do_nothing.expect(unexpected_error_msg),
        1165  +
                ),
        1166  +
                (
        1167  +
                    request_specs::get_pokemon_species(),
        1168  +
                    self.get_pokemon_species.expect(unexpected_error_msg),
        1169  +
                ),
        1170  +
                (
        1171  +
                    request_specs::get_server_statistics(),
        1172  +
                    self.get_server_statistics.expect(unexpected_error_msg),
        1173  +
                ),
        1174  +
                (
        1175  +
                    request_specs::get_storage(),
        1176  +
                    self.get_storage.expect(unexpected_error_msg),
        1177  +
                ),
        1178  +
                (
        1179  +
                    request_specs::stream_pokemon_radio(),
        1180  +
                    self.stream_pokemon_radio.expect(unexpected_error_msg),
        1181  +
                ),
        1182  +
            ])
        1183  +
        };
        1184  +
        let svc = ::aws_smithy_legacy_http_server::routing::RoutingService::new(router);
        1185  +
        let svc = svc.map(|s| s.layer(self.layer));
        1186  +
        Ok(PokemonService { svc })
        1187  +
    }
        1188  +
        1189  +
    /// Constructs a [`PokemonService`] from the arguments provided to the builder.
        1190  +
    /// Operations without a handler default to returning 500 Internal Server Error to the caller.
        1191  +
    ///
        1192  +
    /// Check out [`PokemonServiceBuilder::build`] if you'd prefer the builder to fail if one or more operations do
        1193  +
    /// not have a registered handler.
        1194  +
    pub fn build_unchecked(self) -> PokemonService<L::Service>
        1195  +
    where
        1196  +
        Body: Send + 'static,
        1197  +
        L: ::tower::Layer<
        1198  +
            ::aws_smithy_legacy_http_server::routing::RoutingService<
        1199  +
                ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<
        1200  +
                    ::aws_smithy_legacy_http_server::routing::Route<Body>,
        1201  +
                >,
        1202  +
                ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1203  +
            >,
        1204  +
        >,
        1205  +
    {
        1206  +
        let router =
        1207  +
            ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter::from_iter([
        1208  +
                (
        1209  +
                    request_specs::capture_pokemon(),
        1210  +
                    self.capture_pokemon.unwrap_or_else(|| {
        1211  +
                        let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
        1212  +
                            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1213  +
                        >::default();
        1214  +
                        ::aws_smithy_legacy_http_server::routing::Route::new(svc)
        1215  +
                    }),
        1216  +
                ),
        1217  +
                (
        1218  +
                    request_specs::check_health(),
        1219  +
                    self.check_health.unwrap_or_else(|| {
        1220  +
                        let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
        1221  +
                            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1222  +
                        >::default();
        1223  +
                        ::aws_smithy_legacy_http_server::routing::Route::new(svc)
        1224  +
                    }),
        1225  +
                ),
        1226  +
                (
        1227  +
                    request_specs::do_nothing(),
        1228  +
                    self.do_nothing.unwrap_or_else(|| {
        1229  +
                        let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
        1230  +
                            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1231  +
                        >::default();
        1232  +
                        ::aws_smithy_legacy_http_server::routing::Route::new(svc)
        1233  +
                    }),
        1234  +
                ),
        1235  +
                (
        1236  +
                    request_specs::get_pokemon_species(),
        1237  +
                    self.get_pokemon_species.unwrap_or_else(|| {
        1238  +
                        let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
        1239  +
                            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1240  +
                        >::default();
        1241  +
                        ::aws_smithy_legacy_http_server::routing::Route::new(svc)
        1242  +
                    }),
        1243  +
                ),
        1244  +
                (
        1245  +
                    request_specs::get_server_statistics(),
        1246  +
                    self.get_server_statistics.unwrap_or_else(|| {
        1247  +
                        let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
        1248  +
                            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1249  +
                        >::default();
        1250  +
                        ::aws_smithy_legacy_http_server::routing::Route::new(svc)
        1251  +
                    }),
        1252  +
                ),
        1253  +
                (
        1254  +
                    request_specs::get_storage(),
        1255  +
                    self.get_storage.unwrap_or_else(|| {
        1256  +
                        let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
        1257  +
                            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1258  +
                        >::default();
        1259  +
                        ::aws_smithy_legacy_http_server::routing::Route::new(svc)
        1260  +
                    }),
        1261  +
                ),
        1262  +
                (
        1263  +
                    request_specs::stream_pokemon_radio(),
        1264  +
                    self.stream_pokemon_radio.unwrap_or_else(|| {
        1265  +
                        let svc = ::aws_smithy_legacy_http_server::operation::MissingFailure::<
        1266  +
                            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1267  +
                        >::default();
        1268  +
                        ::aws_smithy_legacy_http_server::routing::Route::new(svc)
        1269  +
                    }),
        1270  +
                ),
        1271  +
            ]);
        1272  +
        let svc = self
        1273  +
            .layer
        1274  +
            .layer(::aws_smithy_legacy_http_server::routing::RoutingService::new(router));
        1275  +
        PokemonService { svc }
        1276  +
    }
        1277  +
}
        1278  +
        1279  +
/// The error encountered when calling the [`PokemonServiceBuilder::build`] method if one or more operation handlers are not
        1280  +
/// specified.
        1281  +
#[derive(Debug)]
        1282  +
pub struct MissingOperationsError {
        1283  +
    operation_names2setter_methods:
        1284  +
        std::collections::HashMap<::aws_smithy_legacy_http_server::shape_id::ShapeId, &'static str>,
        1285  +
}
        1286  +
        1287  +
impl std::fmt::Display for MissingOperationsError {
        1288  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1289  +
        write!(
        1290  +
            f,
        1291  +
            "You must specify a handler for all operations attached to `PokemonService`.\n\
        1292  +
                            We are missing handlers for the following operations:\n",
        1293  +
        )?;
        1294  +
        for operation_name in self.operation_names2setter_methods.keys() {
        1295  +
            writeln!(f, "- {}", operation_name.absolute())?;
        1296  +
        }
        1297  +
        1298  +
        writeln!(f, "\nUse the dedicated methods on `PokemonServiceBuilder` to register the missing handlers:")?;
        1299  +
        for setter_name in self.operation_names2setter_methods.values() {
        1300  +
            writeln!(f, "- {}", setter_name)?;
        1301  +
        }
        1302  +
        Ok(())
        1303  +
    }
        1304  +
}
        1305  +
        1306  +
impl std::error::Error for MissingOperationsError {}
        1307  +
        1308  +
mod request_specs {
        1309  +
    pub(super) fn capture_pokemon(
        1310  +
    ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
        1311  +
        ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
        1312  +
                    ::http::Method::POST,
        1313  +
                    ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
        1314  +
                        ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
        1315  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
        1316  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("capture-pokemon-event")),
        1317  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Label,
        1318  +
]),
        1319  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
        1320  +
])
        1321  +
                        )
        1322  +
                    ),
        1323  +
                )
        1324  +
    }
        1325  +
    pub(super) fn check_health(
        1326  +
    ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
        1327  +
        ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
        1328  +
                    ::http::Method::GET,
        1329  +
                    ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
        1330  +
                        ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
        1331  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
        1332  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("ping")),
        1333  +
]),
        1334  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
        1335  +
])
        1336  +
                        )
        1337  +
                    ),
        1338  +
                )
        1339  +
    }
        1340  +
    pub(super) fn do_nothing() -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec
        1341  +
    {
        1342  +
        ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
        1343  +
                    ::http::Method::GET,
        1344  +
                    ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
        1345  +
                        ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
        1346  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
        1347  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("do-nothing")),
        1348  +
]),
        1349  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
        1350  +
])
        1351  +
                        )
        1352  +
                    ),
        1353  +
                )
        1354  +
    }
        1355  +
    pub(super) fn get_pokemon_species(
        1356  +
    ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
        1357  +
        ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
        1358  +
                    ::http::Method::GET,
        1359  +
                    ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
        1360  +
                        ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
        1361  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
        1362  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("pokemon-species")),
        1363  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Label,
        1364  +
]),
        1365  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
        1366  +
])
        1367  +
                        )
        1368  +
                    ),
        1369  +
                )
        1370  +
    }
        1371  +
    pub(super) fn get_server_statistics(
        1372  +
    ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
        1373  +
        ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
        1374  +
                    ::http::Method::GET,
        1375  +
                    ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
        1376  +
                        ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
        1377  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
        1378  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("stats")),
        1379  +
]),
        1380  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
        1381  +
])
        1382  +
                        )
        1383  +
                    ),
        1384  +
                )
        1385  +
    }
        1386  +
    pub(super) fn get_storage(
        1387  +
    ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
        1388  +
        ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
        1389  +
                    ::http::Method::GET,
        1390  +
                    ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
        1391  +
                        ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
        1392  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
        1393  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("pokedex")),
        1394  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Label,
        1395  +
]),
        1396  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
        1397  +
])
        1398  +
                        )
        1399  +
                    ),
        1400  +
                )
        1401  +
    }
        1402  +
    pub(super) fn stream_pokemon_radio(
        1403  +
    ) -> ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec {
        1404  +
        ::aws_smithy_legacy_http_server::routing::request_spec::RequestSpec::new(
        1405  +
                    ::http::Method::GET,
        1406  +
                    ::aws_smithy_legacy_http_server::routing::request_spec::UriSpec::new(
        1407  +
                        ::aws_smithy_legacy_http_server::routing::request_spec::PathAndQuerySpec::new(
        1408  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
        1409  +
    ::aws_smithy_legacy_http_server::routing::request_spec::PathSegment::Literal(String::from("radio")),
        1410  +
]),
        1411  +
                            ::aws_smithy_legacy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
        1412  +
])
        1413  +
                        )
        1414  +
                    ),
        1415  +
                )
        1416  +
    }
        1417  +
}
        1418  +
        1419  +
/// The Pokémon Service allows you to retrieve information about Pokémon species.
        1420  +
///
        1421  +
/// See the [root](crate) documentation for more information.
        1422  +
#[derive(Clone)]
        1423  +
pub struct PokemonService<
        1424  +
    S = ::aws_smithy_legacy_http_server::routing::RoutingService<
        1425  +
        ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<
        1426  +
            ::aws_smithy_legacy_http_server::routing::Route<
        1427  +
                ::aws_smithy_legacy_http_server::body::BoxBody,
        1428  +
            >,
        1429  +
        >,
        1430  +
        ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1431  +
    >,
        1432  +
> {
        1433  +
    // This is the router wrapped by layers.
        1434  +
    svc: S,
        1435  +
}
        1436  +
        1437  +
impl PokemonService<()> {
        1438  +
    /// Constructs a builder for [`PokemonService`].
        1439  +
    /// You must specify a configuration object holding any plugins and layers that should be applied
        1440  +
    /// to the operations in this service.
        1441  +
    pub fn builder<
        1442  +
        Body,
        1443  +
        L,
        1444  +
        HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
        1445  +
        ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
        1446  +
    >(
        1447  +
        config: PokemonServiceConfig<L, HttpPl, ModelPl>,
        1448  +
    ) -> PokemonServiceBuilder<Body, L, HttpPl, ModelPl> {
        1449  +
        PokemonServiceBuilder {
        1450  +
            capture_pokemon: None,
        1451  +
            check_health: None,
        1452  +
            do_nothing: None,
        1453  +
            get_pokemon_species: None,
        1454  +
            get_server_statistics: None,
        1455  +
            get_storage: None,
        1456  +
            stream_pokemon_radio: None,
        1457  +
            layer: config.layers,
        1458  +
            http_plugin: config.http_plugins,
        1459  +
            model_plugin: config.model_plugins,
        1460  +
        }
        1461  +
    }
        1462  +
        1463  +
    /// Constructs a builder for [`PokemonService`].
        1464  +
    /// You must specify what plugins should be applied to the operations in this service.
        1465  +
    ///
        1466  +
    /// Use [`PokemonService::builder_without_plugins`] if you don't need to apply plugins.
        1467  +
    ///
        1468  +
    /// Check out [`HttpPlugins`](::aws_smithy_legacy_http_server::plugin::HttpPlugins) and
        1469  +
    /// [`ModelPlugins`](::aws_smithy_legacy_http_server::plugin::ModelPlugins) if you need to apply
        1470  +
    /// multiple plugins.
        1471  +
    #[deprecated(
        1472  +
        since = "0.57.0",
        1473  +
        note = "please use the `builder` constructor and register plugins on the `PokemonServiceConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
        1474  +
    )]
        1475  +
    pub fn builder_with_plugins<
        1476  +
        Body,
        1477  +
        HttpPl: ::aws_smithy_legacy_http_server::plugin::HttpMarker,
        1478  +
        ModelPl: ::aws_smithy_legacy_http_server::plugin::ModelMarker,
        1479  +
    >(
        1480  +
        http_plugin: HttpPl,
        1481  +
        model_plugin: ModelPl,
        1482  +
    ) -> PokemonServiceBuilder<Body, ::tower::layer::util::Identity, HttpPl, ModelPl> {
        1483  +
        PokemonServiceBuilder {
        1484  +
            capture_pokemon: None,
        1485  +
            check_health: None,
        1486  +
            do_nothing: None,
        1487  +
            get_pokemon_species: None,
        1488  +
            get_server_statistics: None,
        1489  +
            get_storage: None,
        1490  +
            stream_pokemon_radio: None,
        1491  +
            layer: ::tower::layer::util::Identity::new(),
        1492  +
            http_plugin,
        1493  +
            model_plugin,
        1494  +
        }
        1495  +
    }
        1496  +
        1497  +
    /// Constructs a builder for [`PokemonService`].
        1498  +
    ///
        1499  +
    /// Use [`PokemonService::builder_with_plugins`] if you need to specify plugins.
        1500  +
    #[deprecated(
        1501  +
        since = "0.57.0",
        1502  +
        note = "please use the `builder` constructor instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
        1503  +
    )]
        1504  +
    pub fn builder_without_plugins<Body>() -> PokemonServiceBuilder<
        1505  +
        Body,
        1506  +
        ::tower::layer::util::Identity,
        1507  +
        ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
        1508  +
        ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
        1509  +
    > {
        1510  +
        Self::builder_with_plugins(
        1511  +
            ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
        1512  +
            ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
        1513  +
        )
        1514  +
    }
        1515  +
}
        1516  +
        1517  +
impl<S> PokemonService<S> {
        1518  +
    /// Converts [`PokemonService`] into a [`MakeService`](tower::make::MakeService).
        1519  +
    pub fn into_make_service(
        1520  +
        self,
        1521  +
    ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeService<Self> {
        1522  +
        ::aws_smithy_legacy_http_server::routing::IntoMakeService::new(self)
        1523  +
    }
        1524  +
        1525  +
    /// Converts [`PokemonService`] into a [`MakeService`](tower::make::MakeService) with [`ConnectInfo`](::aws_smithy_legacy_http_server::request::connect_info::ConnectInfo).
        1526  +
    pub fn into_make_service_with_connect_info<C>(
        1527  +
        self,
        1528  +
    ) -> ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo<Self, C> {
        1529  +
        ::aws_smithy_legacy_http_server::routing::IntoMakeServiceWithConnectInfo::new(self)
        1530  +
    }
        1531  +
}
        1532  +
        1533  +
impl<S>
        1534  +
    PokemonService<
        1535  +
        ::aws_smithy_legacy_http_server::routing::RoutingService<
        1536  +
            ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<S>,
        1537  +
            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1538  +
        >,
        1539  +
    >
        1540  +
{
        1541  +
    /// Applies a [`Layer`](::tower::Layer) uniformly to all routes.
        1542  +
    #[deprecated(
        1543  +
        since = "0.57.0",
        1544  +
        note = "please add layers to the `PokemonServiceConfig` object instead; see https://github.com/smithy-lang/smithy-rs/discussions/3096"
        1545  +
    )]
        1546  +
    pub fn layer<L>(
        1547  +
        self,
        1548  +
        layer: &L,
        1549  +
    ) -> PokemonService<
        1550  +
        ::aws_smithy_legacy_http_server::routing::RoutingService<
        1551  +
            ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<L::Service>,
        1552  +
            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1553  +
        >,
        1554  +
    >
        1555  +
    where
        1556  +
        L: ::tower::Layer<S>,
        1557  +
    {
        1558  +
        PokemonService {
        1559  +
            svc: self.svc.map(|s| s.layer(layer)),
        1560  +
        }
        1561  +
    }
        1562  +
        1563  +
    /// Applies [`Route::new`](::aws_smithy_legacy_http_server::routing::Route::new) to all routes.
        1564  +
    ///
        1565  +
    /// This has the effect of erasing all types accumulated via layers.
        1566  +
    pub fn boxed<B>(
        1567  +
        self,
        1568  +
    ) -> PokemonService<
        1569  +
        ::aws_smithy_legacy_http_server::routing::RoutingService<
        1570  +
            ::aws_smithy_legacy_http_server::protocol::rest::router::RestRouter<
        1571  +
                ::aws_smithy_legacy_http_server::routing::Route<B>,
        1572  +
            >,
        1573  +
            ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1,
        1574  +
        >,
        1575  +
    >
        1576  +
    where
        1577  +
        S: ::tower::Service<
        1578  +
            ::http::Request<B>,
        1579  +
            Response = ::http::Response<::aws_smithy_legacy_http_server::body::BoxBody>,
        1580  +
            Error = std::convert::Infallible,
        1581  +
        >,
        1582  +
        S: Clone + Send + 'static,
        1583  +
        S::Future: Send + 'static,
        1584  +
    {
        1585  +
        self.layer(&::tower::layer::layer_fn(
        1586  +
            ::aws_smithy_legacy_http_server::routing::Route::new,
        1587  +
        ))
        1588  +
    }
        1589  +
}
        1590  +
        1591  +
impl<S, R> ::tower::Service<R> for PokemonService<S>
        1592  +
where
        1593  +
    S: ::tower::Service<R>,
        1594  +
{
        1595  +
    type Response = S::Response;
        1596  +
    type Error = S::Error;
        1597  +
    type Future = S::Future;
        1598  +
        1599  +
    fn poll_ready(
        1600  +
        &mut self,
        1601  +
        cx: &mut std::task::Context,
        1602  +
    ) -> std::task::Poll<::std::result::Result<(), Self::Error>> {
        1603  +
        self.svc.poll_ready(cx)
        1604  +
    }
        1605  +
        1606  +
    fn call(&mut self, request: R) -> Self::Future {
        1607  +
        self.svc.call(request)
        1608  +
    }
        1609  +
}
        1610  +
        1611  +
/// An enumeration of all [operations](https://smithy.io/2.0/spec/service-types.html#operation) in PokemonService.
        1612  +
#[allow(clippy::enum_variant_names)]
        1613  +
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
        1614  +
pub enum Operation {
        1615  +
    CapturePokemon,
        1616  +
    CheckHealth,
        1617  +
    DoNothing,
        1618  +
    GetPokemonSpecies,
        1619  +
    GetServerStatistics,
        1620  +
    GetStorage,
        1621  +
    StreamPokemonRadio,
        1622  +
}
        1623  +
        1624  +
impl Operation {
        1625  +
    /// Returns the [operations](https://smithy.io/2.0/spec/service-types.html#operation) [`ShapeId`](::aws_smithy_legacy_http_server::shape_id::ShapeId).
        1626  +
    pub fn shape_id(&self) -> ::aws_smithy_legacy_http_server::shape_id::ShapeId {
        1627  +
        match self {
        1628  +
            Operation::CapturePokemon => ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
        1629  +
                "com.aws.example#CapturePokemon",
        1630  +
                "com.aws.example",
        1631  +
                "CapturePokemon",
        1632  +
            ),
        1633  +
            Operation::CheckHealth => ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
        1634  +
                "com.aws.example#CheckHealth",
        1635  +
                "com.aws.example",
        1636  +
                "CheckHealth",
        1637  +
            ),
        1638  +
            Operation::DoNothing => ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
        1639  +
                "com.aws.example#DoNothing",
        1640  +
                "com.aws.example",
        1641  +
                "DoNothing",
        1642  +
            ),
        1643  +
            Operation::GetPokemonSpecies => {
        1644  +
                ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
        1645  +
                    "com.aws.example#GetPokemonSpecies",
        1646  +
                    "com.aws.example",
        1647  +
                    "GetPokemonSpecies",
        1648  +
                )
        1649  +
            }
        1650  +
            Operation::GetServerStatistics => {
        1651  +
                ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
        1652  +
                    "com.aws.example#GetServerStatistics",
        1653  +
                    "com.aws.example",
        1654  +
                    "GetServerStatistics",
        1655  +
                )
        1656  +
            }
        1657  +
            Operation::GetStorage => ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
        1658  +
                "com.aws.example#GetStorage",
        1659  +
                "com.aws.example",
        1660  +
                "GetStorage",
        1661  +
            ),
        1662  +
            Operation::StreamPokemonRadio => {
        1663  +
                ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
        1664  +
                    "com.aws.example#StreamPokemonRadio",
        1665  +
                    "com.aws.example",
        1666  +
                    "StreamPokemonRadio",
        1667  +
                )
        1668  +
            }
        1669  +
        }
        1670  +
    }
        1671  +
}
        1672  +
impl<L>
        1673  +
    ::aws_smithy_legacy_http_server::service::ContainsOperation<
        1674  +
        crate::operation_shape::CapturePokemon,
        1675  +
    > for PokemonService<L>
        1676  +
{
        1677  +
    const VALUE: Operation = Operation::CapturePokemon;
        1678  +
}
        1679  +
impl<L>
        1680  +
    ::aws_smithy_legacy_http_server::service::ContainsOperation<crate::operation_shape::CheckHealth>
        1681  +
    for PokemonService<L>
        1682  +
{
        1683  +
    const VALUE: Operation = Operation::CheckHealth;
        1684  +
}
        1685  +
impl<L>
        1686  +
    ::aws_smithy_legacy_http_server::service::ContainsOperation<crate::operation_shape::DoNothing>
        1687  +
    for PokemonService<L>
        1688  +
{
        1689  +
    const VALUE: Operation = Operation::DoNothing;
        1690  +
}
        1691  +
impl<L>
        1692  +
    ::aws_smithy_legacy_http_server::service::ContainsOperation<
        1693  +
        crate::operation_shape::GetPokemonSpecies,
        1694  +
    > for PokemonService<L>
        1695  +
{
        1696  +
    const VALUE: Operation = Operation::GetPokemonSpecies;
        1697  +
}
        1698  +
impl<L>
        1699  +
    ::aws_smithy_legacy_http_server::service::ContainsOperation<
        1700  +
        crate::operation_shape::GetServerStatistics,
        1701  +
    > for PokemonService<L>
        1702  +
{
        1703  +
    const VALUE: Operation = Operation::GetServerStatistics;
        1704  +
}
        1705  +
impl<L>
        1706  +
    ::aws_smithy_legacy_http_server::service::ContainsOperation<crate::operation_shape::GetStorage>
        1707  +
    for PokemonService<L>
        1708  +
{
        1709  +
    const VALUE: Operation = Operation::GetStorage;
        1710  +
}
        1711  +
impl<L>
        1712  +
    ::aws_smithy_legacy_http_server::service::ContainsOperation<
        1713  +
        crate::operation_shape::StreamPokemonRadio,
        1714  +
    > for PokemonService<L>
        1715  +
{
        1716  +
    const VALUE: Operation = Operation::StreamPokemonRadio;
        1717  +
}
        1718  +
        1719  +
impl<S> ::aws_smithy_legacy_http_server::service::ServiceShape for PokemonService<S> {
        1720  +
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
        1721  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
        1722  +
            "com.aws.example#PokemonService",
        1723  +
            "com.aws.example",
        1724  +
            "PokemonService",
        1725  +
        );
        1726  +
        1727  +
    const VERSION: Option<&'static str> = Some("2024-03-18");
        1728  +
        1729  +
    type Protocol = ::aws_smithy_legacy_http_server::protocol::rest_json_1::RestJson1;
        1730  +
        1731  +
    type Operations = Operation;
        1732  +
}
        1733  +
/* ServiceConfigGenerator.kt:178 */
        1734  +
/// Configuration for the [`PokemonService`]. This is the central place where to register and
        1735  +
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
        1736  +
///
        1737  +
/// ```rust,no_run
        1738  +
/// # use pokemon_service_server_sdk_http0x::PokemonServiceConfig;
        1739  +
/// # use ::aws_smithy_legacy_http_server::plugin::IdentityPlugin;
        1740  +
/// # use ::tower::layer::util::Identity;
        1741  +
/// # let authentication_plugin = IdentityPlugin;
        1742  +
/// # let authorization_plugin = IdentityPlugin;
        1743  +
/// # let server_request_id_provider_layer = Identity::new();
        1744  +
/// let config = PokemonServiceConfig::builder()
        1745  +
///     // Layers get executed first...
        1746  +
///     .layer(server_request_id_provider_layer)
        1747  +
///     // ...then HTTP plugins...
        1748  +
///     .http_plugin(authentication_plugin)
        1749  +
///     // ...and right after deserialization, model plugins.
        1750  +
///     .model_plugin(authorization_plugin)
        1751  +
///     .build();
        1752  +
/// ```
        1753  +
///
        1754  +
/// See the [`plugin`] system for details.
        1755  +
///
        1756  +
/// [`plugin`]: ::aws_smithy_legacy_http_server::plugin
        1757  +
#[derive(::std::fmt::Debug)]
        1758  +
pub struct PokemonServiceConfig<L, H, M> {
        1759  +
    layers: L,
        1760  +
    http_plugins: H,
        1761  +
    model_plugins: M,
        1762  +
}
        1763  +
        1764  +
impl PokemonServiceConfig<(), (), ()> {
        1765  +
    /// Returns a builder to construct the configuration.
        1766  +
    pub fn builder() -> PokemonServiceConfigBuilder<
        1767  +
        ::tower::layer::util::Identity,
        1768  +
        ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
        1769  +
        ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
        1770  +
    > {
        1771  +
        PokemonServiceConfigBuilder {
        1772  +
            layers: ::tower::layer::util::Identity::new(),
        1773  +
            http_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
        1774  +
            model_plugins: ::aws_smithy_legacy_http_server::plugin::IdentityPlugin,
        1775  +
        }
        1776  +
    }
        1777  +
}
        1778  +
        1779  +
/// Builder returned by [`PokemonServiceConfig::builder()`].
        1780  +
#[derive(::std::fmt::Debug)]
        1781  +
pub struct PokemonServiceConfigBuilder<L, H, M> {
        1782  +
    pub(crate) layers: L,
        1783  +
    pub(crate) http_plugins: H,
        1784  +
    pub(crate) model_plugins: M,
        1785  +
}
        1786  +
        1787  +
impl<L, H, M> PokemonServiceConfigBuilder<L, H, M> {
        1788  +
    /// Add a [`::tower::Layer`] to the service.
        1789  +
    pub fn layer<NewLayer>(
        1790  +
        self,
        1791  +
        layer: NewLayer,
        1792  +
    ) -> PokemonServiceConfigBuilder<::tower::layer::util::Stack<NewLayer, L>, H, M> {
        1793  +
        PokemonServiceConfigBuilder {
        1794  +
            layers: ::tower::layer::util::Stack::new(layer, self.layers),
        1795  +
            http_plugins: self.http_plugins,
        1796  +
            model_plugins: self.model_plugins,
        1797  +
        }
        1798  +
    }
        1799  +
        1800  +
    /// Add a HTTP [plugin] to the service.
        1801  +
    ///
        1802  +
    /// [plugin]: ::aws_smithy_legacy_http_server::plugin
        1803  +
    // We eagerly require `NewPlugin: HttpMarker`, despite not really needing it, because compiler
        1804  +
    // errors get _substantially_ better if the user makes a mistake.
        1805  +
    pub fn http_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::HttpMarker>(
        1806  +
        self,
        1807  +
        http_plugin: NewPlugin,
        1808  +
    ) -> PokemonServiceConfigBuilder<
        1809  +
        L,
        1810  +
        ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, H>,
        1811  +
        M,
        1812  +
    > {
        1813  +
        PokemonServiceConfigBuilder {
        1814  +
            layers: self.layers,
        1815  +
            http_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
        1816  +
                http_plugin,
        1817  +
                self.http_plugins,
        1818  +
            ),
        1819  +
            model_plugins: self.model_plugins,
        1820  +
        }
        1821  +
    }
        1822  +
        1823  +
    /// Add a model [plugin] to the service.
        1824  +
    ///
        1825  +
    /// [plugin]: ::aws_smithy_legacy_http_server::plugin
        1826  +
    // We eagerly require `NewPlugin: ModelMarker`, despite not really needing it, because compiler
        1827  +
    // errors get _substantially_ better if the user makes a mistake.
        1828  +
    pub fn model_plugin<NewPlugin: ::aws_smithy_legacy_http_server::plugin::ModelMarker>(
        1829  +
        self,
        1830  +
        model_plugin: NewPlugin,
        1831  +
    ) -> PokemonServiceConfigBuilder<
        1832  +
        L,
        1833  +
        H,
        1834  +
        ::aws_smithy_legacy_http_server::plugin::PluginStack<NewPlugin, M>,
        1835  +
    > {
        1836  +
        PokemonServiceConfigBuilder {
        1837  +
            layers: self.layers,
        1838  +
            http_plugins: self.http_plugins,
        1839  +
            model_plugins: ::aws_smithy_legacy_http_server::plugin::PluginStack::new(
        1840  +
                model_plugin,
        1841  +
                self.model_plugins,
        1842  +
            ),
        1843  +
        }
        1844  +
    }
        1845  +
        1846  +
    /// Build the configuration.
        1847  +
    pub fn build(self) -> super::PokemonServiceConfig<L, H, M> {
        1848  +
        super::PokemonServiceConfig {
        1849  +
            layers: self.layers,
        1850  +
            http_plugins: self.http_plugins,
        1851  +
            model_plugins: self.model_plugins,
        1852  +
        }
        1853  +
    }
        1854  +
}
        1855  +
/* ScopeMacroGenerator.kt:81 */
        1856  +
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
        1857  +
///
        1858  +
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
        1859  +
/// of the service and any operations _not_ specified will be placed in the opposing group.
        1860  +
///
        1861  +
/// # Example
        1862  +
///
        1863  +
/// ```rust
        1864  +
/// scope! {
        1865  +
///     /// Includes [`CapturePokemon`], excluding all other operations.
        1866  +
///     struct ScopeA {
        1867  +
///         includes: [CapturePokemon]
        1868  +
///     }
        1869  +
/// }
        1870  +
///
        1871  +
/// scope! {
        1872  +
///     /// Excludes [`CapturePokemon`], excluding all other operations.
        1873  +
///     struct ScopeB {
        1874  +
///         excludes: [CapturePokemon]
        1875  +
///     }
        1876  +
/// }
        1877  +
///
        1878  +
/// # use pokemon_service_server_sdk_http0x::server::plugin::{Plugin, Scoped};
        1879  +
/// # use pokemon_service_server_sdk_http0x::scope;
        1880  +
/// # struct MockPlugin;
        1881  +
/// # impl<S, Op, T> Plugin<S, Op, T> for MockPlugin { type Output = u32; fn apply(&self, input: T) -> u32 { 3 } }
        1882  +
/// # let scoped_a = Scoped::new::<ScopeA>(MockPlugin);
        1883  +
/// # let scoped_b = Scoped::new::<ScopeB>(MockPlugin);
        1884  +
/// # let a = Plugin::<(), pokemon_service_server_sdk_http0x::operation_shape::CapturePokemon, u64>::apply(&scoped_a, 6);
        1885  +
/// # let b = Plugin::<(), pokemon_service_server_sdk_http0x::operation_shape::CapturePokemon, u64>::apply(&scoped_b, 6);
        1886  +
/// # assert_eq!(a, 3_u32);
        1887  +
/// # assert_eq!(b, 6_u64);
        1888  +
/// ```
        1889  +
#[macro_export]
        1890  +
macro_rules! scope {
        1891  +
                    // Completed, render impls
        1892  +
                    (@ $ name: ident, $ contains: ident () ($($ temp: ident)*) ($($ not_member: ident)*)) => {
        1893  +
                        $(
        1894  +
                            impl $ crate::server::plugin::scoped::Membership<$ temp> for $ name {
        1895  +
                                type Contains = $ crate::server::plugin::scoped::$ contains;
        1896  +
                            }
        1897  +
                        )*
        1898  +
                        $(
        1899  +
                            impl $ crate::server::plugin::scoped::Membership<$ not_member> for $ name {
        1900  +
                                type Contains = $ crate::server::plugin::scoped::$ contains;
        1901  +
                            }
        1902  +
                        )*
        1903  +
                    };
        1904  +
                    // All `not_member`s exhausted, move `temp` into `not_member`
        1905  +
                    (@ $ name: ident, $ contains: ident ($($ member: ident)*) ($($ temp: ident)*) ()) => {
        1906  +
                        scope! { @ $ name, $ contains ($($ member)*) () ($($ temp)*) }
        1907  +
                    };
        1908  +
        1909  +
                        // CapturePokemon match found, pop from both `member` and `not_member`
        1910  +
                        (@ $ name: ident, $ contains: ident (CapturePokemon $($ member: ident)*) ($($ temp: ident)*) (CapturePokemon $($ not_member: ident)*)) => {
        1911  +
                            scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
        1912  +
                        };
        1913  +
                        // CapturePokemon match not found, pop from `not_member` into `temp` stack
        1914  +
                        (@ $ name: ident, $ contains: ident (CapturePokemon $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
        1915  +
                            scope! { @ $ name, $ contains (CapturePokemon $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
        1916  +
                        };
        1917  +
        1918  +
                        // CheckHealth match found, pop from both `member` and `not_member`
        1919  +
                        (@ $ name: ident, $ contains: ident (CheckHealth $($ member: ident)*) ($($ temp: ident)*) (CheckHealth $($ not_member: ident)*)) => {
        1920  +
                            scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
        1921  +
                        };
        1922  +
                        // CheckHealth match not found, pop from `not_member` into `temp` stack
        1923  +
                        (@ $ name: ident, $ contains: ident (CheckHealth $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
        1924  +
                            scope! { @ $ name, $ contains (CheckHealth $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
        1925  +
                        };
        1926  +
        1927  +
                        // DoNothing match found, pop from both `member` and `not_member`
        1928  +
                        (@ $ name: ident, $ contains: ident (DoNothing $($ member: ident)*) ($($ temp: ident)*) (DoNothing $($ not_member: ident)*)) => {
        1929  +
                            scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
        1930  +
                        };
        1931  +
                        // DoNothing match not found, pop from `not_member` into `temp` stack
        1932  +
                        (@ $ name: ident, $ contains: ident (DoNothing $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
        1933  +
                            scope! { @ $ name, $ contains (DoNothing $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
        1934  +
                        };
        1935  +
        1936  +
                        // GetPokemonSpecies match found, pop from both `member` and `not_member`
        1937  +
                        (@ $ name: ident, $ contains: ident (GetPokemonSpecies $($ member: ident)*) ($($ temp: ident)*) (GetPokemonSpecies $($ not_member: ident)*)) => {
        1938  +
                            scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
        1939  +
                        };
        1940  +
                        // GetPokemonSpecies match not found, pop from `not_member` into `temp` stack
        1941  +
                        (@ $ name: ident, $ contains: ident (GetPokemonSpecies $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
        1942  +
                            scope! { @ $ name, $ contains (GetPokemonSpecies $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
        1943  +
                        };
        1944  +
        1945  +
                        // GetServerStatistics match found, pop from both `member` and `not_member`
        1946  +
                        (@ $ name: ident, $ contains: ident (GetServerStatistics $($ member: ident)*) ($($ temp: ident)*) (GetServerStatistics $($ not_member: ident)*)) => {
        1947  +
                            scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
        1948  +
                        };
        1949  +
                        // GetServerStatistics match not found, pop from `not_member` into `temp` stack
        1950  +
                        (@ $ name: ident, $ contains: ident (GetServerStatistics $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
        1951  +
                            scope! { @ $ name, $ contains (GetServerStatistics $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
        1952  +
                        };
        1953  +
        1954  +
                        // GetStorage match found, pop from both `member` and `not_member`
        1955  +
                        (@ $ name: ident, $ contains: ident (GetStorage $($ member: ident)*) ($($ temp: ident)*) (GetStorage $($ not_member: ident)*)) => {
        1956  +
                            scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
        1957  +
                        };
        1958  +
                        // GetStorage match not found, pop from `not_member` into `temp` stack
        1959  +
                        (@ $ name: ident, $ contains: ident (GetStorage $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
        1960  +
                            scope! { @ $ name, $ contains (GetStorage $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
        1961  +
                        };
        1962  +
        1963  +
                        // StreamPokemonRadio match found, pop from both `member` and `not_member`
        1964  +
                        (@ $ name: ident, $ contains: ident (StreamPokemonRadio $($ member: ident)*) ($($ temp: ident)*) (StreamPokemonRadio $($ not_member: ident)*)) => {
        1965  +
                            scope! { @ $ name, $ contains ($($ member)*) ($($ temp)*) ($($ not_member)*) }
        1966  +
                        };
        1967  +
                        // StreamPokemonRadio match not found, pop from `not_member` into `temp` stack
        1968  +
                        (@ $ name: ident, $ contains: ident (StreamPokemonRadio $($ member: ident)*) ($($ temp: ident)*) ($ other: ident $($ not_member: ident)*)) => {
        1969  +
                            scope! { @ $ name, $ contains (StreamPokemonRadio $($ member)*) ($ other $($ temp)*) ($($ not_member)*) }
        1970  +
                        };
        1971  +
        1972  +
                    (
        1973  +
                        $(#[$ attrs:meta])*
        1974  +
                        $ vis:vis struct $ name:ident {
        1975  +
                            includes: [$($ include:ident),*]
        1976  +
                        }
        1977  +
                    ) => {
        1978  +
                        use $ crate::operation_shape::*;
        1979  +
                        $ crate::server::scope! {
        1980  +
                            $(#[$ attrs])*
        1981  +
                            $ vis struct $ name {
        1982  +
                                includes: [$($ include),*],
        1983  +
                                excludes: []
        1984  +
                            }
        1985  +
                        }
        1986  +
                        scope! { @ $ name, False ($($ include)*) () (CapturePokemon CheckHealth DoNothing GetPokemonSpecies GetServerStatistics GetStorage StreamPokemonRadio) }
        1987  +
                    };
        1988  +
                    (
        1989  +
                        $(#[$ attrs:meta])*
        1990  +
                        $ vis:vis struct $ name:ident {
        1991  +
                            excludes: [$($ exclude:ident),*]
        1992  +
                        }
        1993  +
                    ) => {
        1994  +
                        use $ crate::operation_shape::*;
        1995  +
        1996  +
                        $ crate::server::scope! {
        1997  +
                            $(#[$ attrs])*
        1998  +
                            $ vis struct $ name {
        1999  +
                                includes: [],
        2000  +
                                excludes: [$($ exclude),*]
        2001  +
                            }
        2002  +
                        }
        2003  +
                        scope! { @ $ name, True ($($ exclude)*) () (CapturePokemon CheckHealth DoNothing GetPokemonSpecies GetServerStatistics GetStorage StreamPokemonRadio) }
        2004  +
                    };
        2005  +
                }