Server Test

Server Test

rev. d06a46cae0f385cdae37a9f8264db3469a090ab5 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,5 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
           3  +
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
           4  +
pub use ::aws_smithy_types::Blob;
           5  +
pub use ::aws_smithy_types::DateTime;

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/Cargo.toml

@@ -1,1 +47,55 @@
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-eventstream"
   14     14   
[dependencies.aws-smithy-http]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   16     16   
features = ["event-stream"]
   17     17   
[dependencies.aws-smithy-http-server]
   18     18   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-server"
   19     19   
[dependencies.aws-smithy-json]
   20     20   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
   21     21   
[dependencies.aws-smithy-runtime-api]
   22     22   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          23  +
features = ["http-1x"]
   23     24   
[dependencies.aws-smithy-types]
   24     25   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          26  +
features = ["http-body-1-x"]
          27  +
[dependencies.bytes]
          28  +
version = "1.4.0"
   25     29   
[dependencies.futures-util]
   26     30   
version = "0.3"
   27         -
[dependencies.http]
   28         -
version = "0.2.9"
          31  +
[dependencies.http-1x]
          32  +
version = "1"
          33  +
package = "http"
          34  +
[dependencies.http-body-1x]
          35  +
version = "1"
          36  +
package = "http-body"
   29     37   
[dependencies.mime]
   30     38   
version = "0.3"
   31     39   
[dependencies.pin-project-lite]
   32     40   
version = "0.2"
   33     41   
[dependencies.tower]
   34     42   
version = "0.4"
   35     43   
[dependencies.tracing]
   36     44   
version = "0.1"
   37     45   
[dev-dependencies.hyper]
   38         -
version = "0.14.12"
          46  +
version = "1"
   39     47   
[dev-dependencies.tokio]
   40     48   
version = "1.23.1"
   41     49   
[features]
   42     50   
rt-tokio = ["aws-smithy-types/rt-tokio"]
   43     51   
aws-lambda = ["aws-smithy-http-server/aws-lambda"]
   44     52   
request-id = ["aws-smithy-http-server/request-id"]
   45     53   
default = ["rt-tokio", "request-id"]
   46     54   
   47     55   

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

@@ -19,19 +128,131 @@
   39     39   
)]
   40     40   
//! The [`crate::input`], [`crate::output`], and [`crate::error`]
   41     41   
//! modules provide the types used in each operation.
   42     42   
//!
   43     43   
//! ### Running on Hyper
   44     44   
//!
   45     45   
//! ```rust,no_run
   46     46   
//! # use std::net::SocketAddr;
   47     47   
//! # async fn dummy() {
   48     48   
//! use pokemon_service_awsjson_server_sdk::{PokemonService, PokemonServiceConfig};
          49  +
//! use pokemon_service_awsjson_server_sdk::serve;
          50  +
//! use ::tokio::net::TcpListener;
   49     51   
//!
   50     52   
//! # let app = PokemonService::builder(
   51     53   
//! #     PokemonServiceConfig::builder()
   52     54   
//! #         .build()
   53     55   
//! # ).build_unchecked();
   54         -
//! let server = app.into_make_service();
   55     56   
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
   56     57   
//!     .expect("unable to parse the server bind address and port");
   57         -
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          58  +
//! let listener = TcpListener::bind(bind).await
          59  +
//!     .expect("failed to bind TCP listener");
          60  +
//! serve(listener, app.into_make_service()).await.unwrap();
   58     61   
//! # }
   59     62   
//! ```
   60     63   
//!
   61     64   
//! ### Running on Lambda
   62     65   
//!
   63     66   
//! ```rust,ignore
   64     67   
//! use pokemon_service_awsjson_server_sdk::server::routing::LambdaHandler;
   65     68   
//! use pokemon_service_awsjson_server_sdk::PokemonService;
   66     69   
//!
   67     70   
//! # async fn dummy() {
   68     71   
//! # let app = PokemonService::builder(
   69     72   
//! #     PokemonServiceConfig::builder()
   70     73   
//! #         .build()
   71     74   
//! # ).build_unchecked();
   72     75   
//! let handler = LambdaHandler::new(app);
   73     76   
//! lambda_http::run(handler).await.unwrap();
   74     77   
//! # }
   75     78   
//! ```
   76     79   
//!
   77     80   
//! # Building the PokemonService
   78     81   
//!
   79     82   
//! To construct [`PokemonService`] we use [`PokemonServiceBuilder`] returned by [`PokemonService::builder`].
   80     83   
//!
   81     84   
//! ## Plugins
   82     85   
//!
   83     86   
//! The [`PokemonService::builder`] method, returning [`PokemonServiceBuilder`],
   84     87   
//! accepts a config object on which plugins can be registered.
   85     88   
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
   86     89   
//!
   87     90   
//! ```rust,no_run
   88     91   
//! # use pokemon_service_awsjson_server_sdk::server::plugin::IdentityPlugin as LoggingPlugin;
   89     92   
//! # use pokemon_service_awsjson_server_sdk::server::plugin::IdentityPlugin as MetricsPlugin;
   90         -
//! # use ::hyper::Body;
          93  +
//! # use ::hyper::body::Incoming;
   91     94   
//! use pokemon_service_awsjson_server_sdk::server::plugin::HttpPlugins;
   92     95   
//! use pokemon_service_awsjson_server_sdk::{PokemonService, PokemonServiceConfig, PokemonServiceBuilder};
   93     96   
//!
   94     97   
//! let http_plugins = HttpPlugins::new()
   95     98   
//!         .push(LoggingPlugin)
   96     99   
//!         .push(MetricsPlugin);
   97    100   
//! let config = PokemonServiceConfig::builder().build();
   98         -
//! let builder: PokemonServiceBuilder<Body, _, _, _> = PokemonService::builder(config);
         101  +
//! let builder: PokemonServiceBuilder<::hyper::body::Incoming, _, _, _> = PokemonService::builder(config);
   99    102   
//! ```
  100    103   
//!
  101    104   
//! Check out [`crate::server::plugin`] to learn more about plugins.
  102    105   
//!
  103    106   
//! ## Handlers
  104    107   
//!
  105    108   
//! [`PokemonServiceBuilder`] provides a setter method for each operation in your Smithy model. The setter methods expect an async function as input, matching the signature for the corresponding operation in your Smithy model.
  106    109   
//! We call these async functions **handlers**. This is where your application business logic lives.
  107    110   
//!
  108    111   
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
@@ -135,138 +243,250 @@
  155    158   
//! [`PokemonServiceBuilder::build`] requires you to provide a handler for every single operation in your Smithy model. It will return an error if that is not the case.
  156    159   
//!
  157    160   
//! [`PokemonServiceBuilder::build_unchecked`], instead, does not require exhaustiveness. The server will automatically return 500 Internal Server Error to all requests for operations that do not have a registered handler.
  158    161   
//! [`PokemonServiceBuilder::build_unchecked`] is particularly useful if you are deploying your Smithy service as a collection of Lambda functions, where each Lambda is only responsible for a subset of the operations in the Smithy service (or even a single one!).
  159    162   
//!
  160    163   
//! # Example
  161    164   
//!
  162    165   
//! ```rust,no_run
  163    166   
//! # use std::net::SocketAddr;
  164    167   
//! use pokemon_service_awsjson_server_sdk::{PokemonService, PokemonServiceConfig};
         168  +
//! use pokemon_service_awsjson_server_sdk::serve;
         169  +
//! use ::tokio::net::TcpListener;
  165    170   
//!
  166    171   
//! #[::tokio::main]
  167    172   
//! pub async fn main() {
  168    173   
//!    let config = PokemonServiceConfig::builder().build();
  169    174   
//!    let app = PokemonService::builder(config)
  170    175   
//!        .capture_pokemon(capture_pokemon)
  171    176   
//!        .check_health(check_health)
  172    177   
//!        .do_nothing(do_nothing)
  173    178   
//!        .get_server_statistics(get_server_statistics)
  174    179   
//!        .build()
  175    180   
//!        .expect("failed to build an instance of PokemonService");
  176    181   
//!
  177    182   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  178    183   
//!        .expect("unable to parse the server bind address and port");
  179         -
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         184  +
//!    let listener = TcpListener::bind(bind).await
         185  +
//!        .expect("failed to bind TCP listener");
  180    186   
//!    # let server = async { Ok::<_, ()>(()) };
  181    187   
//!
  182    188   
//!    // Run your service!
  183         -
//!    if let Err(err) = server.await {
         189  +
//!    if let Err(err) = serve(listener, app.into_make_service()).await {
  184    190   
//!        eprintln!("server error: {:?}", err);
  185    191   
//!    }
  186    192   
//! }
  187    193   
//!
  188    194   
//! use pokemon_service_awsjson_server_sdk::{input, output, error};
  189    195   
//!
  190    196   
//! async fn capture_pokemon(input: input::CapturePokemonInput) -> Result<output::CapturePokemonOutput, error::CapturePokemonError> {
  191    197   
//!     todo!()
  192    198   
//! }
  193    199   
//!
  194    200   
//! async fn check_health(input: input::CheckHealthInput) -> output::CheckHealthOutput {
  195    201   
//!     todo!()
  196    202   
//! }
  197    203   
//!
  198    204   
//! async fn do_nothing(input: input::DoNothingInput) -> output::DoNothingOutput {
  199    205   
//!     todo!()
  200    206   
//! }
  201    207   
//!
  202    208   
//! async fn get_server_statistics(input: input::GetServerStatisticsInput) -> output::GetServerStatisticsOutput {
  203    209   
//!     todo!()
  204    210   
//! }
  205    211   
//!
  206    212   
//! ```
  207    213   
//!
  208         -
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         214  +
//! [`serve`]: crate::serve
         215  +
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  209    216   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  210    217   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  211    218   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  212         -
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  213    219   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         220  +
pub use crate::server::serve::serve;
  214    221   
pub use crate::service::{
  215    222   
    MissingOperationsError, PokemonService, PokemonServiceBuilder, PokemonServiceConfig,
  216    223   
    PokemonServiceConfigBuilder,
  217    224   
};
  218    225   
  219    226   
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  220    227   
pub mod server {
  221    228   
    // Re-export all types from the `aws-smithy-http-server` crate.
  222    229   
    pub use ::aws_smithy_http_server::*;
  223    230   
}

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

@@ -11,11 +71,71 @@
   31     31   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   32     32   
    B: 'static,
   33     33   
   34     34   
    B::Data: Send,
   35     35   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   36     36   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   37     37   
{
   38     38   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
   39     39   
    type Future = CheckHealthInputFuture;
   40     40   
   41         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
          41  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
   42     42   
        let fut = async move {
   43     43   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   44     44   
                request.headers(),
   45     45   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_0,
   46     46   
            ) {
   47     47   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
   48     48   
            }
   49     49   
            crate::protocol_serde::shape_check_health::de_check_health_http_request(request).await
   50     50   
        };
   51     51   
        use ::futures_util::future::TryFutureExt;
@@ -87,87 +155,160 @@
  107    107   
  108    108   
impl<B>
  109    109   
    ::aws_smithy_http_server::request::FromRequest<
  110    110   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
  111    111   
        B,
  112    112   
    > for crate::input::CapturePokemonInput
  113    113   
where
  114    114   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  115    115   
    B: 'static,
  116    116   
  117         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
         117  +
    B: ::http_body_1x::Body<Data = ::bytes::Bytes>
         118  +
        + ::std::marker::Send
         119  +
        + ::std::marker::Sync
         120  +
        + 'static,
         121  +
    B::Error: Into<::aws_smithy_types::body::Error> + 'static,
         122  +
  118    123   
    B::Data: Send,
  119    124   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
  120    125   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  121    126   
{
  122    127   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  123    128   
    type Future = CapturePokemonInputFuture;
  124    129   
  125         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         130  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  126    131   
        let fut = async move {
  127    132   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  128    133   
                request.headers(),
  129    134   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_0,
  130    135   
            ) {
  131    136   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  132    137   
            }
  133    138   
            crate::protocol_serde::shape_capture_pokemon::de_capture_pokemon_http_request(request)
  134    139   
                .await
  135    140   
        };
@@ -206,211 +266,271 @@
  226    231   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  227    232   
    B: 'static,
  228    233   
  229    234   
    B::Data: Send,
  230    235   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
  231    236   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  232    237   
{
  233    238   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  234    239   
    type Future = DoNothingInputFuture;
  235    240   
  236         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         241  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  237    242   
        let fut = async move {
  238    243   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  239    244   
                request.headers(),
  240    245   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_0,
  241    246   
            ) {
  242    247   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  243    248   
            }
  244    249   
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request).await
  245    250   
        };
  246    251   
        use ::futures_util::future::TryFutureExt;
@@ -289,294 +349,354 @@
  309    314   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  310    315   
    B: 'static,
  311    316   
  312    317   
    B::Data: Send,
  313    318   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
  314    319   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  315    320   
{
  316    321   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  317    322   
    type Future = GetServerStatisticsInputFuture;
  318    323   
  319         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         324  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  320    325   
        let fut = async move {
  321    326   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  322    327   
                request.headers(),
  323    328   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_0,
  324    329   
            ) {
  325    330   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  326    331   
            }
  327    332   
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_request(request)
  328    333   
                            .await
  329    334   
        };

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_capture_pokemon.rs

@@ -1,1 +188,192 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_capture_pokemon_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::CapturePokemonInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
          11  +
    B: ::http_body_1x::Body<Data = ::bytes::Bytes>
          12  +
        + ::std::marker::Send
          13  +
        + ::std::marker::Sync
          14  +
        + 'static,
          15  +
    B::Error: Into<::aws_smithy_types::body::Error> + 'static,
          16  +
   12     17   
    B::Data: Send,
   13     18   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   14     19   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   15     20   
{
   16     21   
    Ok({
   17     22   
        #[allow(unused_mut)]
   18     23   
        let mut input = crate::input::capture_pokemon_input::Builder::default();
   19     24   
        #[allow(unused_variables)]
   20     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     26   
            uri, headers, body, ..
   22     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     28   
        if let Some(value) = {
   24     29   
            let mut receiver =
   25     30   
                crate::protocol_serde::shape_capture_pokemon_input::de_events_payload(
   26         -
                    &mut body.into().into_inner(),
          31  +
                    &mut ::aws_smithy_types::body::SdkBody::from_body_1_x(body),
   27     32   
                )?;
   28     33   
            if let Some(_initial_event) = receiver
   29     34   
                                                .try_recv_initial(::aws_smithy_http::event_stream::InitialMessageType::Request)
   30     35   
                                                .await
   31     36   
                                                .map_err(
   32     37   
                                                    |ev_error| ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::ConstraintViolation(
   33     38   
                                                        #[allow(clippy::useless_conversion)]
   34     39   
                                                        format!("{ev_error}").into()
   35     40   
                                                    )
   36     41   
                                                )? {
   37     42   
                                                
   38     43   
                                            }
   39     44   
            Some(receiver)
   40     45   
        } {
   41     46   
            input = input.set_events(value)
   42     47   
        }
   43     48   
        input.build()?
   44     49   
    })
   45     50   
}
   46     51   
   47     52   
#[allow(clippy::unnecessary_wraps)]
   48     53   
pub fn ser_capture_pokemon_http_response(
   49     54   
    #[allow(unused_variables)] output: crate::output::CapturePokemonOutput,
   50     55   
) -> std::result::Result<
   51     56   
    ::aws_smithy_http_server::response::Response,
   52     57   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   53     58   
> {
   54     59   
    Ok({
   55     60   
        #[allow(unused_mut)]
   56         -
        let mut builder = ::http::Response::builder();
          61  +
        let mut builder = ::http_1x::Response::builder();
   57     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   58     63   
            builder,
   59         -
            ::http::header::CONTENT_TYPE,
          64  +
            ::http_1x::header::CONTENT_TYPE,
   60     65   
            "application/x-amz-json-1.0",
   61     66   
        );
   62     67   
        let http_status: u16 = 200;
   63     68   
        builder = builder.status(http_status);
   64         -
        let body = ::aws_smithy_http_server::body::boxed(
   65         -
            ::aws_smithy_http_server::body::Body::wrap_stream({
          69  +
        let body =
          70  +
            ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::wrap_stream({
   66     71   
                let error_marshaller =
   67     72   
                    crate::event_stream_serde::CapturePokemonEventsErrorMarshaller::new();
   68     73   
                let marshaller = crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
   69     74   
                let signer = ::aws_smithy_eventstream::frame::NoOpSigner {};
   70     75   
                output
   71     76   
                    .events
   72     77   
                    .into_body_stream(marshaller, error_marshaller, signer)
   73         -
            }),
   74         -
        );
          78  +
            }));
   75     79   
        builder.body(body)?
   76     80   
    })
   77     81   
}
   78     82   
   79     83   
#[allow(clippy::unnecessary_wraps)]
   80     84   
pub fn ser_capture_pokemon_http_error(
   81     85   
    error: &crate::error::CapturePokemonError,
   82     86   
) -> std::result::Result<
   83     87   
    ::aws_smithy_http_server::response::Response,
   84     88   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   85     89   
> {
   86     90   
    Ok({
   87     91   
        match error {
   88     92   
            crate::error::CapturePokemonError::UnsupportedRegionError(output) => {
   89     93   
                let payload = crate::protocol_serde::shape_unsupported_region_error::ser_unsupported_region_error_error(output)?;
   90     94   
                #[allow(unused_mut)]
   91         -
                let mut builder = ::http::Response::builder();
          95  +
                let mut builder = ::http_1x::Response::builder();
   92     96   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93     97   
                    builder,
   94         -
                    ::http::header::CONTENT_TYPE,
          98  +
                    ::http_1x::header::CONTENT_TYPE,
   95     99   
                    "application/x-amz-json-1.0",
   96    100   
                );
   97    101   
                let content_length = payload.len();
   98    102   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   99    103   
                    builder,
  100         -
                    ::http::header::CONTENT_LENGTH,
         104  +
                    ::http_1x::header::CONTENT_LENGTH,
  101    105   
                    content_length,
  102    106   
                );
  103    107   
                builder
  104    108   
                    .status(500)
  105    109   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  106    110   
            }
  107    111   
            crate::error::CapturePokemonError::ThrottlingError(output) => {
  108    112   
                let payload =
  109    113   
                    crate::protocol_serde::shape_throttling_error::ser_throttling_error_error(
  110    114   
                        output,
  111    115   
                    )?;
  112    116   
                #[allow(unused_mut)]
  113         -
                let mut builder = ::http::Response::builder();
         117  +
                let mut builder = ::http_1x::Response::builder();
  114    118   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  115    119   
                    builder,
  116         -
                    ::http::header::CONTENT_TYPE,
         120  +
                    ::http_1x::header::CONTENT_TYPE,
  117    121   
                    "application/x-amz-json-1.0",
  118    122   
                );
  119    123   
                let content_length = payload.len();
  120    124   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  121    125   
                    builder,
  122         -
                    ::http::header::CONTENT_LENGTH,
         126  +
                    ::http_1x::header::CONTENT_LENGTH,
  123    127   
                    content_length,
  124    128   
                );
  125    129   
                builder
  126    130   
                    .status(400)
  127    131   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  128    132   
            }
  129    133   
            crate::error::CapturePokemonError::ValidationException(output) => {
  130    134   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  131    135   
                #[allow(unused_mut)]
  132         -
                let mut builder = ::http::Response::builder();
         136  +
                let mut builder = ::http_1x::Response::builder();
  133    137   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  134    138   
                    builder,
  135         -
                    ::http::header::CONTENT_TYPE,
         139  +
                    ::http_1x::header::CONTENT_TYPE,
  136    140   
                    "application/x-amz-json-1.0",
  137    141   
                );
  138    142   
                let content_length = payload.len();
  139    143   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  140    144   
                    builder,
  141         -
                    ::http::header::CONTENT_LENGTH,
         145  +
                    ::http_1x::header::CONTENT_LENGTH,
  142    146   
                    content_length,
  143    147   
                );
  144    148   
                builder
  145    149   
                    .status(400)
  146    150   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  147    151   
            }
  148    152   
            crate::error::CapturePokemonError::MasterBallUnsuccessful(output) => {
  149    153   
                let payload = crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful_error(output)?;
  150    154   
                #[allow(unused_mut)]
  151         -
                let mut builder = ::http::Response::builder();
         155  +
                let mut builder = ::http_1x::Response::builder();
  152    156   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  153    157   
                    builder,
  154         -
                    ::http::header::CONTENT_TYPE,
         158  +
                    ::http_1x::header::CONTENT_TYPE,
  155    159   
                    "application/x-amz-json-1.0",
  156    160   
                );
  157    161   
                let content_length = payload.len();
  158    162   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  159    163   
                    builder,
  160         -
                    ::http::header::CONTENT_LENGTH,
         164  +
                    ::http_1x::header::CONTENT_LENGTH,
  161    165   
                    content_length,
  162    166   
                );
  163    167   
                builder
  164    168   
                    .status(500)
  165    169   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  166    170   
            }
  167    171   
            crate::error::CapturePokemonError::InvalidPokeballError(output) => {
  168    172   
                let payload = crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error_error(output)?;
  169    173   
                #[allow(unused_mut)]
  170         -
                let mut builder = ::http::Response::builder();
         174  +
                let mut builder = ::http_1x::Response::builder();
  171    175   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  172    176   
                    builder,
  173         -
                    ::http::header::CONTENT_TYPE,
         177  +
                    ::http_1x::header::CONTENT_TYPE,
  174    178   
                    "application/x-amz-json-1.0",
  175    179   
                );
  176    180   
                let content_length = payload.len();
  177    181   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  178    182   
                    builder,
  179         -
                    ::http::header::CONTENT_LENGTH,
         183  +
                    ::http_1x::header::CONTENT_LENGTH,
  180    184   
                    content_length,
  181    185   
                );
  182    186   
                builder
  183    187   
                    .status(400)
  184    188   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  185    189   
            }
  186    190   
        }
  187    191   
    })
  188    192   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_check_health.rs

@@ -1,1 +53,53 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_check_health_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::CheckHealthInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::check_health_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_check_health_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::CheckHealthOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload = "";
   44     44   
        let content_length = payload.len();
   45     45   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47         -
            ::http::header::CONTENT_LENGTH,
          47  +
            ::http_1x::header::CONTENT_LENGTH,
   48     48   
            content_length,
   49     49   
        );
   50     50   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   51     51   
        builder.body(body)?
   52     52   
    })
   53     53   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_do_nothing.rs

@@ -1,1 +56,56 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_do_nothing_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::DoNothingInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::do_nothing_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_do_nothing_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::DoNothingOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload =
   44     44   
            crate::protocol_serde::shape_do_nothing_output::ser_do_nothing_output_output_output(
   45     45   
                &output,
   46     46   
            )?;
   47     47   
        let content_length = payload.len();
   48     48   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     49   
            builder,
   50         -
            ::http::header::CONTENT_LENGTH,
          50  +
            ::http_1x::header::CONTENT_LENGTH,
   51     51   
            content_length,
   52     52   
        );
   53     53   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   54     54   
        builder.body(body)?
   55     55   
    })
   56     56   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/protocol_serde/shape_get_server_statistics.rs

@@ -1,1 +55,55 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_get_server_statistics_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::GetServerStatisticsInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::get_server_statistics_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_get_server_statistics_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::GetServerStatisticsOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload =
   44     44   
            crate::protocol_serde::shape_get_server_statistics_output::ser_get_server_statistics_output_output_output(&output)?
   45     45   
        ;
   46     46   
        let content_length = payload.len();
   47     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49         -
            ::http::header::CONTENT_LENGTH,
          49  +
            ::http_1x::header::CONTENT_LENGTH,
   50     50   
            content_length,
   51     51   
        );
   52     52   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   53     53   
        builder.body(body)?
   54     54   
    })
   55     55   
}

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

@@ -38,38 +99,99 @@
   58     58   
                            <
   59     59   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
   60     60   
                                as ::aws_smithy_http_server::plugin::Plugin<
   61     61   
                                    PokemonService<L>,
   62     62   
                                    crate::operation_shape::CapturePokemon,
   63     63   
                                    ModelPl::Output
   64     64   
                                >
   65     65   
                            >::Output
   66     66   
                        >,
   67     67   
   68         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
   69         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
          68  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
          69  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
   70     70   
   71     71   
                    {
   72     72   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
   73     73   
        use ::aws_smithy_http_server::plugin::Plugin;
   74     74   
        let svc = crate::operation_shape::CapturePokemon::from_handler(handler);
   75     75   
        let svc = self.model_plugin.apply(svc);
   76     76   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
   77     77   
            .apply(svc);
   78     78   
        let svc = self.http_plugin.apply(svc);
   79     79   
        self.capture_pokemon_custom(svc)
@@ -105,105 +185,185 @@
  125    125   
                            <
  126    126   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  127    127   
                                as ::aws_smithy_http_server::plugin::Plugin<
  128    128   
                                    PokemonService<L>,
  129    129   
                                    crate::operation_shape::CapturePokemon,
  130    130   
                                    ModelPl::Output
  131    131   
                                >
  132    132   
                            >::Output
  133    133   
                        >,
  134    134   
  135         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  136         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         135  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         136  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  137    137   
  138    138   
                    {
  139    139   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  140    140   
        use ::aws_smithy_http_server::plugin::Plugin;
  141    141   
        let svc = crate::operation_shape::CapturePokemon::from_service(service);
  142    142   
        let svc = self.model_plugin.apply(svc);
  143    143   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  144    144   
            .apply(svc);
  145    145   
        let svc = self.http_plugin.apply(svc);
  146    146   
        self.capture_pokemon_custom(svc)
  147    147   
    }
  148    148   
  149    149   
    /// Sets the [`CapturePokemon`](crate::operation_shape::CapturePokemon) to a custom [`Service`](tower::Service).
  150    150   
    /// not constrained by the Smithy contract.
  151    151   
    fn capture_pokemon_custom<S>(mut self, svc: S) -> Self
  152    152   
    where
  153    153   
        S: ::tower::Service<
  154         -
                ::http::Request<Body>,
  155         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         154  +
                ::http_1x::Request<Body>,
         155  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  156    156   
                Error = ::std::convert::Infallible,
  157    157   
            > + Clone
  158    158   
            + Send
  159    159   
            + 'static,
  160    160   
        S::Future: Send + 'static,
  161    161   
    {
  162    162   
        self.capture_pokemon = Some(::aws_smithy_http_server::routing::Route::new(svc));
  163    163   
        self
  164    164   
    }
  165    165   
@@ -188,188 +249,249 @@
  208    208   
                            <
  209    209   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  210    210   
                                as ::aws_smithy_http_server::plugin::Plugin<
  211    211   
                                    PokemonService<L>,
  212    212   
                                    crate::operation_shape::CheckHealth,
  213    213   
                                    ModelPl::Output
  214    214   
                                >
  215    215   
                            >::Output
  216    216   
                        >,
  217    217   
  218         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  219         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         218  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         219  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  220    220   
  221    221   
                    {
  222    222   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  223    223   
        use ::aws_smithy_http_server::plugin::Plugin;
  224    224   
        let svc = crate::operation_shape::CheckHealth::from_handler(handler);
  225    225   
        let svc = self.model_plugin.apply(svc);
  226    226   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  227    227   
            .apply(svc);
  228    228   
        let svc = self.http_plugin.apply(svc);
  229    229   
        self.check_health_custom(svc)
@@ -255,255 +335,335 @@
  275    275   
                            <
  276    276   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  277    277   
                                as ::aws_smithy_http_server::plugin::Plugin<
  278    278   
                                    PokemonService<L>,
  279    279   
                                    crate::operation_shape::CheckHealth,
  280    280   
                                    ModelPl::Output
  281    281   
                                >
  282    282   
                            >::Output
  283    283   
                        >,
  284    284   
  285         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  286         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         285  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         286  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  287    287   
  288    288   
                    {
  289    289   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  290    290   
        use ::aws_smithy_http_server::plugin::Plugin;
  291    291   
        let svc = crate::operation_shape::CheckHealth::from_service(service);
  292    292   
        let svc = self.model_plugin.apply(svc);
  293    293   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  294    294   
            .apply(svc);
  295    295   
        let svc = self.http_plugin.apply(svc);
  296    296   
        self.check_health_custom(svc)
  297    297   
    }
  298    298   
  299    299   
    /// Sets the [`CheckHealth`](crate::operation_shape::CheckHealth) to a custom [`Service`](tower::Service).
  300    300   
    /// not constrained by the Smithy contract.
  301    301   
    fn check_health_custom<S>(mut self, svc: S) -> Self
  302    302   
    where
  303    303   
        S: ::tower::Service<
  304         -
                ::http::Request<Body>,
  305         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         304  +
                ::http_1x::Request<Body>,
         305  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  306    306   
                Error = ::std::convert::Infallible,
  307    307   
            > + Clone
  308    308   
            + Send
  309    309   
            + 'static,
  310    310   
        S::Future: Send + 'static,
  311    311   
    {
  312    312   
        self.check_health = Some(::aws_smithy_http_server::routing::Route::new(svc));
  313    313   
        self
  314    314   
    }
  315    315   
@@ -338,338 +399,399 @@
  358    358   
                            <
  359    359   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  360    360   
                                as ::aws_smithy_http_server::plugin::Plugin<
  361    361   
                                    PokemonService<L>,
  362    362   
                                    crate::operation_shape::DoNothing,
  363    363   
                                    ModelPl::Output
  364    364   
                                >
  365    365   
                            >::Output
  366    366   
                        >,
  367    367   
  368         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  369         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         368  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         369  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  370    370   
  371    371   
                    {
  372    372   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  373    373   
        use ::aws_smithy_http_server::plugin::Plugin;
  374    374   
        let svc = crate::operation_shape::DoNothing::from_handler(handler);
  375    375   
        let svc = self.model_plugin.apply(svc);
  376    376   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  377    377   
            .apply(svc);
  378    378   
        let svc = self.http_plugin.apply(svc);
  379    379   
        self.do_nothing_custom(svc)
@@ -405,405 +485,485 @@
  425    425   
                            <
  426    426   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  427    427   
                                as ::aws_smithy_http_server::plugin::Plugin<
  428    428   
                                    PokemonService<L>,
  429    429   
                                    crate::operation_shape::DoNothing,
  430    430   
                                    ModelPl::Output
  431    431   
                                >
  432    432   
                            >::Output
  433    433   
                        >,
  434    434   
  435         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  436         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         435  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         436  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  437    437   
  438    438   
                    {
  439    439   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  440    440   
        use ::aws_smithy_http_server::plugin::Plugin;
  441    441   
        let svc = crate::operation_shape::DoNothing::from_service(service);
  442    442   
        let svc = self.model_plugin.apply(svc);
  443    443   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  444    444   
            .apply(svc);
  445    445   
        let svc = self.http_plugin.apply(svc);
  446    446   
        self.do_nothing_custom(svc)
  447    447   
    }
  448    448   
  449    449   
    /// Sets the [`DoNothing`](crate::operation_shape::DoNothing) to a custom [`Service`](tower::Service).
  450    450   
    /// not constrained by the Smithy contract.
  451    451   
    fn do_nothing_custom<S>(mut self, svc: S) -> Self
  452    452   
    where
  453    453   
        S: ::tower::Service<
  454         -
                ::http::Request<Body>,
  455         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         454  +
                ::http_1x::Request<Body>,
         455  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  456    456   
                Error = ::std::convert::Infallible,
  457    457   
            > + Clone
  458    458   
            + Send
  459    459   
            + 'static,
  460    460   
        S::Future: Send + 'static,
  461    461   
    {
  462    462   
        self.do_nothing = Some(::aws_smithy_http_server::routing::Route::new(svc));
  463    463   
        self
  464    464   
    }
  465    465   
@@ -488,488 +549,549 @@
  508    508   
                            <
  509    509   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  510    510   
                                as ::aws_smithy_http_server::plugin::Plugin<
  511    511   
                                    PokemonService<L>,
  512    512   
                                    crate::operation_shape::GetServerStatistics,
  513    513   
                                    ModelPl::Output
  514    514   
                                >
  515    515   
                            >::Output
  516    516   
                        >,
  517    517   
  518         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  519         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         518  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         519  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  520    520   
  521    521   
                    {
  522    522   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  523    523   
        use ::aws_smithy_http_server::plugin::Plugin;
  524    524   
        let svc = crate::operation_shape::GetServerStatistics::from_handler(handler);
  525    525   
        let svc = self.model_plugin.apply(svc);
  526    526   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  527    527   
            .apply(svc);
  528    528   
        let svc = self.http_plugin.apply(svc);
  529    529   
        self.get_server_statistics_custom(svc)
@@ -555,555 +635,635 @@
  575    575   
                            <
  576    576   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  577    577   
                                as ::aws_smithy_http_server::plugin::Plugin<
  578    578   
                                    PokemonService<L>,
  579    579   
                                    crate::operation_shape::GetServerStatistics,
  580    580   
                                    ModelPl::Output
  581    581   
                                >
  582    582   
                            >::Output
  583    583   
                        >,
  584    584   
  585         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  586         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         585  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         586  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  587    587   
  588    588   
                    {
  589    589   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  590    590   
        use ::aws_smithy_http_server::plugin::Plugin;
  591    591   
        let svc = crate::operation_shape::GetServerStatistics::from_service(service);
  592    592   
        let svc = self.model_plugin.apply(svc);
  593    593   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  594    594   
            .apply(svc);
  595    595   
        let svc = self.http_plugin.apply(svc);
  596    596   
        self.get_server_statistics_custom(svc)
  597    597   
    }
  598    598   
  599    599   
    /// Sets the [`GetServerStatistics`](crate::operation_shape::GetServerStatistics) to a custom [`Service`](tower::Service).
  600    600   
    /// not constrained by the Smithy contract.
  601    601   
    fn get_server_statistics_custom<S>(mut self, svc: S) -> Self
  602    602   
    where
  603    603   
        S: ::tower::Service<
  604         -
                ::http::Request<Body>,
  605         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         604  +
                ::http_1x::Request<Body>,
         605  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  606    606   
                Error = ::std::convert::Infallible,
  607    607   
            > + Clone
  608    608   
            + Send
  609    609   
            + 'static,
  610    610   
        S::Future: Send + 'static,
  611    611   
    {
  612    612   
        self.get_server_statistics = Some(::aws_smithy_http_server::routing::Route::new(svc));
  613    613   
        self
  614    614   
    }
  615    615   
}
@@ -920,920 +981,981 @@
  940    940   
    ) -> PokemonService<
  941    941   
        ::aws_smithy_http_server::routing::RoutingService<
  942    942   
            ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<
  943    943   
                ::aws_smithy_http_server::routing::Route<B>,
  944    944   
            >,
  945    945   
            ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
  946    946   
        >,
  947    947   
    >
  948    948   
    where
  949    949   
        S: ::tower::Service<
  950         -
            ::http::Request<B>,
  951         -
            Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         950  +
            ::http_1x::Request<B>,
         951  +
            Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  952    952   
            Error = std::convert::Infallible,
  953    953   
        >,
  954    954   
        S: Clone + Send + 'static,
  955    955   
        S::Future: Send + 'static,
  956    956   
    {
  957    957   
        self.layer(&::tower::layer::layer_fn(
  958    958   
            ::aws_smithy_http_server::routing::Route::new,
  959    959   
        ))
  960    960   
    }
  961    961   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk-http0x/rust-server-codegen/Cargo.toml

@@ -0,1 +0,53 @@
           1  +
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
[package]
           3  +
name = "pokemon-service-server-sdk-http0x"
           4  +
version = "0.0.1"
           5  +
authors = ["protocoltest@example.com"]
           6  +
description = "test"
           7  +
edition = "2021"
           8  +
           9  +
[package.metadata.smithy]
          10  +
codegen-version = "ci"
          11  +
protocol = "aws.protocols#restJson1"
          12  +
[dependencies.aws-smithy-eventstream]
          13  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-eventstream"
          14  +
[dependencies.aws-smithy-json]
          15  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
          16  +
[dependencies.aws-smithy-legacy-http]
          17  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http"
          18  +
features = ["event-stream"]
          19  +
[dependencies.aws-smithy-legacy-http-server]
          20  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http-server"
          21  +
[dependencies.aws-smithy-runtime-api]
          22  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          23  +
features = ["http-02x"]
          24  +
[dependencies.aws-smithy-types]
          25  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          26  +
features = ["http-body-0-4-x"]
          27  +
[dependencies.futures-util]
          28  +
version = "0.3"
          29  +
[dependencies.http]
          30  +
version = "0.2.9"
          31  +
[dependencies.mime]
          32  +
version = "0.3"
          33  +
[dependencies.nom]
          34  +
version = "7"
          35  +
[dependencies.percent-encoding]
          36  +
version = "2.0.0"
          37  +
[dependencies.pin-project-lite]
          38  +
version = "0.2"
          39  +
[dependencies.tower]
          40  +
version = "0.4"
          41  +
[dependencies.tracing]
          42  +
version = "0.1"
          43  +
[dev-dependencies.hyper]
          44  +
version = "0.14.26"
          45  +
[dev-dependencies.tokio]
          46  +
version = "1.23.1"
          47  +
[features]
          48  +
aws-lambda = ["aws-smithy-legacy-http-server/aws-lambda"]
          49  +
request-id = ["aws-smithy-legacy-http-server/request-id"]
          50  +
rt-tokio = ["aws-smithy-types/http-body-1-x", "aws-smithy-types/rt-tokio"]
          51  +
default = ["request-id", "rt-tokio"]
          52  +
          53  +

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

@@ -0,1 +0,16 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/*
           3  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           4  +
 * SPDX-License-Identifier: Apache-2.0
           5  +
 */
           6  +
           7  +
pub(crate) trait Constrained {
           8  +
    type Unconstrained;
           9  +
}
          10  +
          11  +
#[derive(Debug, Clone)]
          12  +
#[allow(dead_code)]
          13  +
pub(crate) enum MaybeConstrained<T: Constrained> {
          14  +
    Constrained(T),
          15  +
    Unconstrained(T::Unconstrained),
          16  +
}

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

@@ -0,1 +0,1731 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerOperationErrorGenerator.kt:63 */
           3  +
/// Error type for the `GetStorage` operation.
           4  +
/* ServerOperationErrorGenerator.kt:64 */
           5  +
/// Each variant represents an error that can occur for the `GetStorage` operation.
           6  +
/* RustType.kt:534 */
           7  +
#[derive(::std::fmt::Debug)]
           8  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum GetStorageError {
           9  +
    /* ServerOperationErrorGenerator.kt:68 */
          10  +
    #[allow(missing_docs)] // documentation missing in model
          11  +
    /* ServerOperationErrorGenerator.kt:71 */
          12  +
    ResourceNotFoundException(crate::error::ResourceNotFoundException),
          13  +
    /// /* ServerOperationErrorGenerator.kt:68 */Not authorized to access Pokémon storage.
          14  +
    /* ServerOperationErrorGenerator.kt:71 */
          15  +
    StorageAccessNotAuthorized(crate::error::StorageAccessNotAuthorized),
          16  +
    /// /* ServerOperationErrorGenerator.kt:68 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
          17  +
    /* ServerOperationErrorGenerator.kt:71 */
          18  +
    ValidationException(crate::error::ValidationException),
          19  +
    /* ServerOperationErrorGenerator.kt:66 */
          20  +
}
          21  +
/* ServerOperationErrorGenerator.kt:75 */
          22  +
impl ::std::fmt::Display for GetStorageError {
          23  +
    /* ServerOperationErrorGenerator.kt:76 */
          24  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          25  +
        /* ServerOperationErrorGenerator.kt:139 */
          26  +
        match &self {
          27  +
            /* ServerOperationErrorGenerator.kt:142 */
          28  +
            GetStorageError::ResourceNotFoundException(_inner) =>
          29  +
            /* ServerOperationErrorGenerator.kt:78 */
          30  +
            {
          31  +
                _inner.fmt(f)
          32  +
            }
          33  +
            ,
          34  +
            /* ServerOperationErrorGenerator.kt:142 */
          35  +
            GetStorageError::StorageAccessNotAuthorized(_inner) =>
          36  +
            /* ServerOperationErrorGenerator.kt:78 */
          37  +
            {
          38  +
                _inner.fmt(f)
          39  +
            }
          40  +
            ,
          41  +
            /* ServerOperationErrorGenerator.kt:142 */
          42  +
            GetStorageError::ValidationException(_inner) =>
          43  +
            /* ServerOperationErrorGenerator.kt:78 */
          44  +
            {
          45  +
                _inner.fmt(f)
          46  +
            }
          47  +
            /* ServerOperationErrorGenerator.kt:139 */
          48  +
        }
          49  +
        /* ServerOperationErrorGenerator.kt:76 */
          50  +
    }
          51  +
    /* ServerOperationErrorGenerator.kt:75 */
          52  +
}
          53  +
/* ServerOperationErrorGenerator.kt:83 */
          54  +
impl GetStorageError {
          55  +
    /* ServerOperationErrorGenerator.kt:87 */
          56  +
    /// Returns `true` if the error kind is `GetStorageError::ResourceNotFoundException`.
          57  +
    /* ServerOperationErrorGenerator.kt:88 */
          58  +
    pub fn is_resource_not_found_exception(&self) -> bool {
          59  +
        /* ServerOperationErrorGenerator.kt:89 */
          60  +
        matches!(&self, GetStorageError::ResourceNotFoundException(_))
          61  +
        /* ServerOperationErrorGenerator.kt:88 */
          62  +
    }
          63  +
    /* ServerOperationErrorGenerator.kt:87 */
          64  +
    /// Returns `true` if the error kind is `GetStorageError::StorageAccessNotAuthorized`.
          65  +
    /* ServerOperationErrorGenerator.kt:88 */
          66  +
    pub fn is_storage_access_not_authorized(&self) -> bool {
          67  +
        /* ServerOperationErrorGenerator.kt:89 */
          68  +
        matches!(&self, GetStorageError::StorageAccessNotAuthorized(_))
          69  +
        /* ServerOperationErrorGenerator.kt:88 */
          70  +
    }
          71  +
    /* ServerOperationErrorGenerator.kt:87 */
          72  +
    /// Returns `true` if the error kind is `GetStorageError::ValidationException`.
          73  +
    /* ServerOperationErrorGenerator.kt:88 */
          74  +
    pub fn is_validation_exception(&self) -> bool {
          75  +
        /* ServerOperationErrorGenerator.kt:89 */
          76  +
        matches!(&self, GetStorageError::ValidationException(_))
          77  +
        /* ServerOperationErrorGenerator.kt:88 */
          78  +
    }
          79  +
    /* ServerOperationErrorGenerator.kt:92 */
          80  +
    /// Returns the error name string by matching the correct variant.
          81  +
    /* ServerOperationErrorGenerator.kt:93 */
          82  +
    pub fn name(&self) -> &'static str {
          83  +
        /* ServerOperationErrorGenerator.kt:139 */
          84  +
        match &self {
          85  +
            /* ServerOperationErrorGenerator.kt:142 */
          86  +
            GetStorageError::ResourceNotFoundException(_inner) =>
          87  +
            /* ServerOperationErrorGenerator.kt:95 */
          88  +
            {
          89  +
                _inner.name()
          90  +
            }
          91  +
            ,
          92  +
            /* ServerOperationErrorGenerator.kt:142 */
          93  +
            GetStorageError::StorageAccessNotAuthorized(_inner) =>
          94  +
            /* ServerOperationErrorGenerator.kt:95 */
          95  +
            {
          96  +
                _inner.name()
          97  +
            }
          98  +
            ,
          99  +
            /* ServerOperationErrorGenerator.kt:142 */
         100  +
            GetStorageError::ValidationException(_inner) =>
         101  +
            /* ServerOperationErrorGenerator.kt:95 */
         102  +
            {
         103  +
                _inner.name()
         104  +
            }
         105  +
            /* ServerOperationErrorGenerator.kt:139 */
         106  +
        }
         107  +
        /* ServerOperationErrorGenerator.kt:93 */
         108  +
    }
         109  +
    /* ServerOperationErrorGenerator.kt:83 */
         110  +
}
         111  +
/* ServerOperationErrorGenerator.kt:100 */
         112  +
impl ::std::error::Error for GetStorageError {
         113  +
    /* ServerOperationErrorGenerator.kt:101 */
         114  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         115  +
        /* ServerOperationErrorGenerator.kt:139 */
         116  +
        match &self {
         117  +
            /* ServerOperationErrorGenerator.kt:142 */
         118  +
            GetStorageError::ResourceNotFoundException(_inner) =>
         119  +
            /* ServerOperationErrorGenerator.kt:103 */
         120  +
            {
         121  +
                Some(_inner)
         122  +
            }
         123  +
            ,
         124  +
            /* ServerOperationErrorGenerator.kt:142 */
         125  +
            GetStorageError::StorageAccessNotAuthorized(_inner) =>
         126  +
            /* ServerOperationErrorGenerator.kt:103 */
         127  +
            {
         128  +
                Some(_inner)
         129  +
            }
         130  +
            ,
         131  +
            /* ServerOperationErrorGenerator.kt:142 */
         132  +
            GetStorageError::ValidationException(_inner) =>
         133  +
            /* ServerOperationErrorGenerator.kt:103 */
         134  +
            {
         135  +
                Some(_inner)
         136  +
            }
         137  +
            /* ServerOperationErrorGenerator.kt:139 */
         138  +
        }
         139  +
        /* ServerOperationErrorGenerator.kt:101 */
         140  +
    }
         141  +
    /* ServerOperationErrorGenerator.kt:100 */
         142  +
}
         143  +
/* ServerOperationErrorGenerator.kt:110 */
         144  +
impl ::std::convert::From<crate::error::ResourceNotFoundException>
         145  +
    for crate::error::GetStorageError
         146  +
{
         147  +
    /* ServerOperationErrorGenerator.kt:111 */
         148  +
    fn from(variant: crate::error::ResourceNotFoundException) -> crate::error::GetStorageError {
         149  +
        /* ServerOperationErrorGenerator.kt:112 */
         150  +
        Self::ResourceNotFoundException(variant)
         151  +
        /* ServerOperationErrorGenerator.kt:111 */
         152  +
    }
         153  +
    /* ServerOperationErrorGenerator.kt:110 */
         154  +
}
         155  +
/* ServerOperationErrorGenerator.kt:110 */
         156  +
impl ::std::convert::From<crate::error::StorageAccessNotAuthorized>
         157  +
    for crate::error::GetStorageError
         158  +
{
         159  +
    /* ServerOperationErrorGenerator.kt:111 */
         160  +
    fn from(variant: crate::error::StorageAccessNotAuthorized) -> crate::error::GetStorageError {
         161  +
        /* ServerOperationErrorGenerator.kt:112 */
         162  +
        Self::StorageAccessNotAuthorized(variant)
         163  +
        /* ServerOperationErrorGenerator.kt:111 */
         164  +
    }
         165  +
    /* ServerOperationErrorGenerator.kt:110 */
         166  +
}
         167  +
/* ServerOperationErrorGenerator.kt:110 */
         168  +
impl ::std::convert::From<crate::error::ValidationException> for crate::error::GetStorageError {
         169  +
    /* ServerOperationErrorGenerator.kt:111 */
         170  +
    fn from(variant: crate::error::ValidationException) -> crate::error::GetStorageError {
         171  +
        /* ServerOperationErrorGenerator.kt:112 */
         172  +
        Self::ValidationException(variant)
         173  +
        /* ServerOperationErrorGenerator.kt:111 */
         174  +
    }
         175  +
    /* ServerOperationErrorGenerator.kt:110 */
         176  +
}
         177  +
         178  +
/// /* StructureGenerator.kt:197 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         179  +
/* RustType.kt:534 */
         180  +
#[derive(
         181  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         182  +
)]
         183  +
pub /* StructureGenerator.kt:201 */ struct ValidationException {
         184  +
    /// /* StructureGenerator.kt:231 */A summary of the validation failure.
         185  +
    pub message: ::std::string::String,
         186  +
    /// /* StructureGenerator.kt:231 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         187  +
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
         188  +
    /* StructureGenerator.kt:201 */
         189  +
}
         190  +
/* StructureGenerator.kt:135 */
         191  +
impl ValidationException {
         192  +
    /// /* StructureGenerator.kt:231 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         193  +
    /* StructureGenerator.kt:166 */
         194  +
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
         195  +
        /* StructureGenerator.kt:169 */
         196  +
        self.field_list.as_deref()
         197  +
        /* StructureGenerator.kt:166 */
         198  +
    }
         199  +
    /* StructureGenerator.kt:135 */
         200  +
}
         201  +
/* ErrorImplGenerator.kt:99 */
         202  +
impl ValidationException {
         203  +
    /* ErrorImplGenerator.kt:128 */
         204  +
    /// Returns the error message.
         205  +
    pub fn message(&self) -> &str {
         206  +
        &self.message
         207  +
    }
         208  +
    /* ErrorImplGenerator.kt:141 */
         209  +
    #[doc(hidden)]
         210  +
    /// Returns the error name.
         211  +
    pub fn name(&self) -> &'static str {
         212  +
        "ValidationException"
         213  +
    }
         214  +
    /* ErrorImplGenerator.kt:99 */
         215  +
}
         216  +
/* ErrorImplGenerator.kt:153 */
         217  +
impl ::std::fmt::Display for ValidationException {
         218  +
    /* ErrorImplGenerator.kt:154 */
         219  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         220  +
        /* ErrorImplGenerator.kt:161 */
         221  +
        ::std::write!(f, "ValidationException")?;
         222  +
        /* ErrorImplGenerator.kt:166 */
         223  +
        {
         224  +
            /* ErrorImplGenerator.kt:169 */
         225  +
            ::std::write!(f, ": {}", &self.message)?;
         226  +
            /* ErrorImplGenerator.kt:166 */
         227  +
        }
         228  +
        /* ErrorImplGenerator.kt:176 */
         229  +
        Ok(())
         230  +
        /* ErrorImplGenerator.kt:154 */
         231  +
    }
         232  +
    /* ErrorImplGenerator.kt:153 */
         233  +
}
         234  +
/* ErrorImplGenerator.kt:180 */
         235  +
impl ::std::error::Error for ValidationException {}
         236  +
/* ServerCodegenVisitor.kt:356 */
         237  +
impl ValidationException {
         238  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
         239  +
    /* ServerBuilderGenerator.kt:295 */
         240  +
    pub fn builder() -> crate::error::validation_exception::Builder {
         241  +
        /* ServerBuilderGenerator.kt:296 */
         242  +
        crate::error::validation_exception::Builder::default()
         243  +
        /* ServerBuilderGenerator.kt:295 */
         244  +
    }
         245  +
    /* ServerCodegenVisitor.kt:356 */
         246  +
}
         247  +
         248  +
/// /* StructureGenerator.kt:197 */Not authorized to access Pokémon storage.
         249  +
/* RustType.kt:534 */
         250  +
#[derive(
         251  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         252  +
)]
         253  +
pub /* StructureGenerator.kt:201 */ struct StorageAccessNotAuthorized {/* StructureGenerator.kt:201 */}
         254  +
/* ErrorImplGenerator.kt:99 */
         255  +
impl StorageAccessNotAuthorized {
         256  +
    /* ErrorImplGenerator.kt:141 */
         257  +
    #[doc(hidden)]
         258  +
    /// Returns the error name.
         259  +
    pub fn name(&self) -> &'static str {
         260  +
        "StorageAccessNotAuthorized"
         261  +
    }
         262  +
    /* ErrorImplGenerator.kt:99 */
         263  +
}
         264  +
/* ErrorImplGenerator.kt:153 */
         265  +
impl ::std::fmt::Display for StorageAccessNotAuthorized {
         266  +
    /* ErrorImplGenerator.kt:154 */
         267  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         268  +
        /* ErrorImplGenerator.kt:161 */
         269  +
        ::std::write!(f, "StorageAccessNotAuthorized")?;
         270  +
        /* ErrorImplGenerator.kt:176 */
         271  +
        Ok(())
         272  +
        /* ErrorImplGenerator.kt:154 */
         273  +
    }
         274  +
    /* ErrorImplGenerator.kt:153 */
         275  +
}
         276  +
/* ErrorImplGenerator.kt:180 */
         277  +
impl ::std::error::Error for StorageAccessNotAuthorized {}
         278  +
/* ServerCodegenVisitor.kt:356 */
         279  +
impl StorageAccessNotAuthorized {
         280  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`StorageAccessNotAuthorized`](crate::error::StorageAccessNotAuthorized).
         281  +
    /* ServerBuilderGenerator.kt:295 */
         282  +
    pub fn builder() -> crate::error::storage_access_not_authorized::Builder {
         283  +
        /* ServerBuilderGenerator.kt:296 */
         284  +
        crate::error::storage_access_not_authorized::Builder::default()
         285  +
        /* ServerBuilderGenerator.kt:295 */
         286  +
    }
         287  +
    /* ServerCodegenVisitor.kt:356 */
         288  +
}
         289  +
         290  +
/* StructureGenerator.kt:197 */
         291  +
#[allow(missing_docs)] // documentation missing in model
         292  +
/* RustType.kt:534 */
         293  +
#[derive(
         294  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         295  +
)]
         296  +
pub /* StructureGenerator.kt:201 */ struct ResourceNotFoundException {
         297  +
    /* StructureGenerator.kt:231 */
         298  +
    #[allow(missing_docs)] // documentation missing in model
         299  +
    pub message: ::std::string::String,
         300  +
    /* StructureGenerator.kt:201 */
         301  +
}
         302  +
/* ErrorImplGenerator.kt:99 */
         303  +
impl ResourceNotFoundException {
         304  +
    /* ErrorImplGenerator.kt:128 */
         305  +
    /// Returns the error message.
         306  +
    pub fn message(&self) -> &str {
         307  +
        &self.message
         308  +
    }
         309  +
    /* ErrorImplGenerator.kt:141 */
         310  +
    #[doc(hidden)]
         311  +
    /// Returns the error name.
         312  +
    pub fn name(&self) -> &'static str {
         313  +
        "ResourceNotFoundException"
         314  +
    }
         315  +
    /* ErrorImplGenerator.kt:99 */
         316  +
}
         317  +
/* ErrorImplGenerator.kt:153 */
         318  +
impl ::std::fmt::Display for ResourceNotFoundException {
         319  +
    /* ErrorImplGenerator.kt:154 */
         320  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         321  +
        /* ErrorImplGenerator.kt:161 */
         322  +
        ::std::write!(f, "ResourceNotFoundException")?;
         323  +
        /* ErrorImplGenerator.kt:166 */
         324  +
        {
         325  +
            /* ErrorImplGenerator.kt:169 */
         326  +
            ::std::write!(f, ": {}", &self.message)?;
         327  +
            /* ErrorImplGenerator.kt:166 */
         328  +
        }
         329  +
        /* ErrorImplGenerator.kt:176 */
         330  +
        Ok(())
         331  +
        /* ErrorImplGenerator.kt:154 */
         332  +
    }
         333  +
    /* ErrorImplGenerator.kt:153 */
         334  +
}
         335  +
/* ErrorImplGenerator.kt:180 */
         336  +
impl ::std::error::Error for ResourceNotFoundException {}
         337  +
/* ServerCodegenVisitor.kt:356 */
         338  +
impl ResourceNotFoundException {
         339  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
         340  +
    /* ServerBuilderGenerator.kt:295 */
         341  +
    pub fn builder() -> crate::error::resource_not_found_exception::Builder {
         342  +
        /* ServerBuilderGenerator.kt:296 */
         343  +
        crate::error::resource_not_found_exception::Builder::default()
         344  +
        /* ServerBuilderGenerator.kt:295 */
         345  +
    }
         346  +
    /* ServerCodegenVisitor.kt:356 */
         347  +
}
         348  +
         349  +
/* ServerOperationErrorGenerator.kt:63 */
         350  +
/// Error type for the `GetPokemonSpecies` operation.
         351  +
/* ServerOperationErrorGenerator.kt:64 */
         352  +
/// Each variant represents an error that can occur for the `GetPokemonSpecies` operation.
         353  +
/* RustType.kt:534 */
         354  +
#[derive(::std::fmt::Debug)]
         355  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum GetPokemonSpeciesError {
         356  +
    /* ServerOperationErrorGenerator.kt:68 */
         357  +
    #[allow(missing_docs)] // documentation missing in model
         358  +
    /* ServerOperationErrorGenerator.kt:71 */
         359  +
    ResourceNotFoundException(crate::error::ResourceNotFoundException),
         360  +
    /// /* ServerOperationErrorGenerator.kt:68 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         361  +
    /* ServerOperationErrorGenerator.kt:71 */
         362  +
    ValidationException(crate::error::ValidationException),
         363  +
    /* ServerOperationErrorGenerator.kt:66 */
         364  +
}
         365  +
/* ServerOperationErrorGenerator.kt:75 */
         366  +
impl ::std::fmt::Display for GetPokemonSpeciesError {
         367  +
    /* ServerOperationErrorGenerator.kt:76 */
         368  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         369  +
        /* ServerOperationErrorGenerator.kt:139 */
         370  +
        match &self {
         371  +
            /* ServerOperationErrorGenerator.kt:142 */
         372  +
            GetPokemonSpeciesError::ResourceNotFoundException(_inner) =>
         373  +
            /* ServerOperationErrorGenerator.kt:78 */
         374  +
            {
         375  +
                _inner.fmt(f)
         376  +
            }
         377  +
            ,
         378  +
            /* ServerOperationErrorGenerator.kt:142 */
         379  +
            GetPokemonSpeciesError::ValidationException(_inner) =>
         380  +
            /* ServerOperationErrorGenerator.kt:78 */
         381  +
            {
         382  +
                _inner.fmt(f)
         383  +
            }
         384  +
            /* ServerOperationErrorGenerator.kt:139 */
         385  +
        }
         386  +
        /* ServerOperationErrorGenerator.kt:76 */
         387  +
    }
         388  +
    /* ServerOperationErrorGenerator.kt:75 */
         389  +
}
         390  +
/* ServerOperationErrorGenerator.kt:83 */
         391  +
impl GetPokemonSpeciesError {
         392  +
    /* ServerOperationErrorGenerator.kt:87 */
         393  +
    /// Returns `true` if the error kind is `GetPokemonSpeciesError::ResourceNotFoundException`.
         394  +
    /* ServerOperationErrorGenerator.kt:88 */
         395  +
    pub fn is_resource_not_found_exception(&self) -> bool {
         396  +
        /* ServerOperationErrorGenerator.kt:89 */
         397  +
        matches!(&self, GetPokemonSpeciesError::ResourceNotFoundException(_))
         398  +
        /* ServerOperationErrorGenerator.kt:88 */
         399  +
    }
         400  +
    /* ServerOperationErrorGenerator.kt:87 */
         401  +
    /// Returns `true` if the error kind is `GetPokemonSpeciesError::ValidationException`.
         402  +
    /* ServerOperationErrorGenerator.kt:88 */
         403  +
    pub fn is_validation_exception(&self) -> bool {
         404  +
        /* ServerOperationErrorGenerator.kt:89 */
         405  +
        matches!(&self, GetPokemonSpeciesError::ValidationException(_))
         406  +
        /* ServerOperationErrorGenerator.kt:88 */
         407  +
    }
         408  +
    /* ServerOperationErrorGenerator.kt:92 */
         409  +
    /// Returns the error name string by matching the correct variant.
         410  +
    /* ServerOperationErrorGenerator.kt:93 */
         411  +
    pub fn name(&self) -> &'static str {
         412  +
        /* ServerOperationErrorGenerator.kt:139 */
         413  +
        match &self {
         414  +
            /* ServerOperationErrorGenerator.kt:142 */
         415  +
            GetPokemonSpeciesError::ResourceNotFoundException(_inner) =>
         416  +
            /* ServerOperationErrorGenerator.kt:95 */
         417  +
            {
         418  +
                _inner.name()
         419  +
            }
         420  +
            ,
         421  +
            /* ServerOperationErrorGenerator.kt:142 */
         422  +
            GetPokemonSpeciesError::ValidationException(_inner) =>
         423  +
            /* ServerOperationErrorGenerator.kt:95 */
         424  +
            {
         425  +
                _inner.name()
         426  +
            }
         427  +
            /* ServerOperationErrorGenerator.kt:139 */
         428  +
        }
         429  +
        /* ServerOperationErrorGenerator.kt:93 */
         430  +
    }
         431  +
    /* ServerOperationErrorGenerator.kt:83 */
         432  +
}
         433  +
/* ServerOperationErrorGenerator.kt:100 */
         434  +
impl ::std::error::Error for GetPokemonSpeciesError {
         435  +
    /* ServerOperationErrorGenerator.kt:101 */
         436  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         437  +
        /* ServerOperationErrorGenerator.kt:139 */
         438  +
        match &self {
         439  +
            /* ServerOperationErrorGenerator.kt:142 */
         440  +
            GetPokemonSpeciesError::ResourceNotFoundException(_inner) =>
         441  +
            /* ServerOperationErrorGenerator.kt:103 */
         442  +
            {
         443  +
                Some(_inner)
         444  +
            }
         445  +
            ,
         446  +
            /* ServerOperationErrorGenerator.kt:142 */
         447  +
            GetPokemonSpeciesError::ValidationException(_inner) =>
         448  +
            /* ServerOperationErrorGenerator.kt:103 */
         449  +
            {
         450  +
                Some(_inner)
         451  +
            }
         452  +
            /* ServerOperationErrorGenerator.kt:139 */
         453  +
        }
         454  +
        /* ServerOperationErrorGenerator.kt:101 */
         455  +
    }
         456  +
    /* ServerOperationErrorGenerator.kt:100 */
         457  +
}
         458  +
/* ServerOperationErrorGenerator.kt:110 */
         459  +
impl ::std::convert::From<crate::error::ResourceNotFoundException>
         460  +
    for crate::error::GetPokemonSpeciesError
         461  +
{
         462  +
    /* ServerOperationErrorGenerator.kt:111 */
         463  +
    fn from(
         464  +
        variant: crate::error::ResourceNotFoundException,
         465  +
    ) -> crate::error::GetPokemonSpeciesError {
         466  +
        /* ServerOperationErrorGenerator.kt:112 */
         467  +
        Self::ResourceNotFoundException(variant)
         468  +
        /* ServerOperationErrorGenerator.kt:111 */
         469  +
    }
         470  +
    /* ServerOperationErrorGenerator.kt:110 */
         471  +
}
         472  +
/* ServerOperationErrorGenerator.kt:110 */
         473  +
impl ::std::convert::From<crate::error::ValidationException>
         474  +
    for crate::error::GetPokemonSpeciesError
         475  +
{
         476  +
    /* ServerOperationErrorGenerator.kt:111 */
         477  +
    fn from(variant: crate::error::ValidationException) -> crate::error::GetPokemonSpeciesError {
         478  +
        /* ServerOperationErrorGenerator.kt:112 */
         479  +
        Self::ValidationException(variant)
         480  +
        /* ServerOperationErrorGenerator.kt:111 */
         481  +
    }
         482  +
    /* ServerOperationErrorGenerator.kt:110 */
         483  +
}
         484  +
         485  +
/* ServerOperationErrorGenerator.kt:63 */
         486  +
/// Error type for the `CapturePokemon` operation.
         487  +
/* ServerOperationErrorGenerator.kt:64 */
         488  +
/// Each variant represents an error that can occur for the `CapturePokemon` operation.
         489  +
/* RustType.kt:534 */
         490  +
#[derive(::std::fmt::Debug)]
         491  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum CapturePokemonError {
         492  +
    /* ServerOperationErrorGenerator.kt:68 */
         493  +
    #[allow(missing_docs)] // documentation missing in model
         494  +
    /* ServerOperationErrorGenerator.kt:71 */
         495  +
    UnsupportedRegionError(crate::error::UnsupportedRegionError),
         496  +
    /* ServerOperationErrorGenerator.kt:68 */
         497  +
    #[allow(missing_docs)] // documentation missing in model
         498  +
    /* ServerOperationErrorGenerator.kt:71 */
         499  +
    ThrottlingError(crate::error::ThrottlingError),
         500  +
    /// /* ServerOperationErrorGenerator.kt:68 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
         501  +
    /* ServerOperationErrorGenerator.kt:71 */
         502  +
    ValidationException(crate::error::ValidationException),
         503  +
    /* ServerOperationErrorGenerator.kt:68 */
         504  +
    #[allow(missing_docs)] // documentation missing in model
         505  +
    /* ServerOperationErrorGenerator.kt:71 */
         506  +
    MasterBallUnsuccessful(crate::error::MasterBallUnsuccessful),
         507  +
    /* ServerOperationErrorGenerator.kt:68 */
         508  +
    #[allow(missing_docs)] // documentation missing in model
         509  +
    /* ServerOperationErrorGenerator.kt:71 */
         510  +
    InvalidPokeballError(crate::error::InvalidPokeballError),
         511  +
    /* ServerOperationErrorGenerator.kt:66 */
         512  +
}
         513  +
/* ServerOperationErrorGenerator.kt:75 */
         514  +
impl ::std::fmt::Display for CapturePokemonError {
         515  +
    /* ServerOperationErrorGenerator.kt:76 */
         516  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         517  +
        /* ServerOperationErrorGenerator.kt:139 */
         518  +
        match &self {
         519  +
            /* ServerOperationErrorGenerator.kt:142 */
         520  +
            CapturePokemonError::UnsupportedRegionError(_inner) =>
         521  +
            /* ServerOperationErrorGenerator.kt:78 */
         522  +
            {
         523  +
                _inner.fmt(f)
         524  +
            }
         525  +
            ,
         526  +
            /* ServerOperationErrorGenerator.kt:142 */
         527  +
            CapturePokemonError::ThrottlingError(_inner) =>
         528  +
            /* ServerOperationErrorGenerator.kt:78 */
         529  +
            {
         530  +
                _inner.fmt(f)
         531  +
            }
         532  +
            ,
         533  +
            /* ServerOperationErrorGenerator.kt:142 */
         534  +
            CapturePokemonError::ValidationException(_inner) =>
         535  +
            /* ServerOperationErrorGenerator.kt:78 */
         536  +
            {
         537  +
                _inner.fmt(f)
         538  +
            }
         539  +
            ,
         540  +
            /* ServerOperationErrorGenerator.kt:142 */
         541  +
            CapturePokemonError::MasterBallUnsuccessful(_inner) =>
         542  +
            /* ServerOperationErrorGenerator.kt:78 */
         543  +
            {
         544  +
                _inner.fmt(f)
         545  +
            }
         546  +
            ,
         547  +
            /* ServerOperationErrorGenerator.kt:142 */
         548  +
            CapturePokemonError::InvalidPokeballError(_inner) =>
         549  +
            /* ServerOperationErrorGenerator.kt:78 */
         550  +
            {
         551  +
                _inner.fmt(f)
         552  +
            }
         553  +
            /* ServerOperationErrorGenerator.kt:139 */
         554  +
        }
         555  +
        /* ServerOperationErrorGenerator.kt:76 */
         556  +
    }
         557  +
    /* ServerOperationErrorGenerator.kt:75 */
         558  +
}
         559  +
/* ServerOperationErrorGenerator.kt:83 */
         560  +
impl CapturePokemonError {
         561  +
    /* ServerOperationErrorGenerator.kt:87 */
         562  +
    /// Returns `true` if the error kind is `CapturePokemonError::UnsupportedRegionError`.
         563  +
    /* ServerOperationErrorGenerator.kt:88 */
         564  +
    pub fn is_unsupported_region_error(&self) -> bool {
         565  +
        /* ServerOperationErrorGenerator.kt:89 */
         566  +
        matches!(&self, CapturePokemonError::UnsupportedRegionError(_))
         567  +
        /* ServerOperationErrorGenerator.kt:88 */
         568  +
    }
         569  +
    /* ServerOperationErrorGenerator.kt:87 */
         570  +
    /// Returns `true` if the error kind is `CapturePokemonError::ThrottlingError`.
         571  +
    /* ServerOperationErrorGenerator.kt:88 */
         572  +
    pub fn is_throttling_error(&self) -> bool {
         573  +
        /* ServerOperationErrorGenerator.kt:89 */
         574  +
        matches!(&self, CapturePokemonError::ThrottlingError(_))
         575  +
        /* ServerOperationErrorGenerator.kt:88 */
         576  +
    }
         577  +
    /* ServerOperationErrorGenerator.kt:87 */
         578  +
    /// Returns `true` if the error kind is `CapturePokemonError::ValidationException`.
         579  +
    /* ServerOperationErrorGenerator.kt:88 */
         580  +
    pub fn is_validation_exception(&self) -> bool {
         581  +
        /* ServerOperationErrorGenerator.kt:89 */
         582  +
        matches!(&self, CapturePokemonError::ValidationException(_))
         583  +
        /* ServerOperationErrorGenerator.kt:88 */
         584  +
    }
         585  +
    /* ServerOperationErrorGenerator.kt:87 */
         586  +
    /// Returns `true` if the error kind is `CapturePokemonError::MasterBallUnsuccessful`.
         587  +
    /* ServerOperationErrorGenerator.kt:88 */
         588  +
    pub fn is_master_ball_unsuccessful(&self) -> bool {
         589  +
        /* ServerOperationErrorGenerator.kt:89 */
         590  +
        matches!(&self, CapturePokemonError::MasterBallUnsuccessful(_))
         591  +
        /* ServerOperationErrorGenerator.kt:88 */
         592  +
    }
         593  +
    /* ServerOperationErrorGenerator.kt:87 */
         594  +
    /// Returns `true` if the error kind is `CapturePokemonError::InvalidPokeballError`.
         595  +
    /* ServerOperationErrorGenerator.kt:88 */
         596  +
    pub fn is_invalid_pokeball_error(&self) -> bool {
         597  +
        /* ServerOperationErrorGenerator.kt:89 */
         598  +
        matches!(&self, CapturePokemonError::InvalidPokeballError(_))
         599  +
        /* ServerOperationErrorGenerator.kt:88 */
         600  +
    }
         601  +
    /* ServerOperationErrorGenerator.kt:92 */
         602  +
    /// Returns the error name string by matching the correct variant.
         603  +
    /* ServerOperationErrorGenerator.kt:93 */
         604  +
    pub fn name(&self) -> &'static str {
         605  +
        /* ServerOperationErrorGenerator.kt:139 */
         606  +
        match &self {
         607  +
            /* ServerOperationErrorGenerator.kt:142 */
         608  +
            CapturePokemonError::UnsupportedRegionError(_inner) =>
         609  +
            /* ServerOperationErrorGenerator.kt:95 */
         610  +
            {
         611  +
                _inner.name()
         612  +
            }
         613  +
            ,
         614  +
            /* ServerOperationErrorGenerator.kt:142 */
         615  +
            CapturePokemonError::ThrottlingError(_inner) =>
         616  +
            /* ServerOperationErrorGenerator.kt:95 */
         617  +
            {
         618  +
                _inner.name()
         619  +
            }
         620  +
            ,
         621  +
            /* ServerOperationErrorGenerator.kt:142 */
         622  +
            CapturePokemonError::ValidationException(_inner) =>
         623  +
            /* ServerOperationErrorGenerator.kt:95 */
         624  +
            {
         625  +
                _inner.name()
         626  +
            }
         627  +
            ,
         628  +
            /* ServerOperationErrorGenerator.kt:142 */
         629  +
            CapturePokemonError::MasterBallUnsuccessful(_inner) =>
         630  +
            /* ServerOperationErrorGenerator.kt:95 */
         631  +
            {
         632  +
                _inner.name()
         633  +
            }
         634  +
            ,
         635  +
            /* ServerOperationErrorGenerator.kt:142 */
         636  +
            CapturePokemonError::InvalidPokeballError(_inner) =>
         637  +
            /* ServerOperationErrorGenerator.kt:95 */
         638  +
            {
         639  +
                _inner.name()
         640  +
            }
         641  +
            /* ServerOperationErrorGenerator.kt:139 */
         642  +
        }
         643  +
        /* ServerOperationErrorGenerator.kt:93 */
         644  +
    }
         645  +
    /* ServerOperationErrorGenerator.kt:83 */
         646  +
}
         647  +
/* ServerOperationErrorGenerator.kt:100 */
         648  +
impl ::std::error::Error for CapturePokemonError {
         649  +
    /* ServerOperationErrorGenerator.kt:101 */
         650  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         651  +
        /* ServerOperationErrorGenerator.kt:139 */
         652  +
        match &self {
         653  +
            /* ServerOperationErrorGenerator.kt:142 */
         654  +
            CapturePokemonError::UnsupportedRegionError(_inner) =>
         655  +
            /* ServerOperationErrorGenerator.kt:103 */
         656  +
            {
         657  +
                Some(_inner)
         658  +
            }
         659  +
            ,
         660  +
            /* ServerOperationErrorGenerator.kt:142 */
         661  +
            CapturePokemonError::ThrottlingError(_inner) =>
         662  +
            /* ServerOperationErrorGenerator.kt:103 */
         663  +
            {
         664  +
                Some(_inner)
         665  +
            }
         666  +
            ,
         667  +
            /* ServerOperationErrorGenerator.kt:142 */
         668  +
            CapturePokemonError::ValidationException(_inner) =>
         669  +
            /* ServerOperationErrorGenerator.kt:103 */
         670  +
            {
         671  +
                Some(_inner)
         672  +
            }
         673  +
            ,
         674  +
            /* ServerOperationErrorGenerator.kt:142 */
         675  +
            CapturePokemonError::MasterBallUnsuccessful(_inner) =>
         676  +
            /* ServerOperationErrorGenerator.kt:103 */
         677  +
            {
         678  +
                Some(_inner)
         679  +
            }
         680  +
            ,
         681  +
            /* ServerOperationErrorGenerator.kt:142 */
         682  +
            CapturePokemonError::InvalidPokeballError(_inner) =>
         683  +
            /* ServerOperationErrorGenerator.kt:103 */
         684  +
            {
         685  +
                Some(_inner)
         686  +
            }
         687  +
            /* ServerOperationErrorGenerator.kt:139 */
         688  +
        }
         689  +
        /* ServerOperationErrorGenerator.kt:101 */
         690  +
    }
         691  +
    /* ServerOperationErrorGenerator.kt:100 */
         692  +
}
         693  +
/* ServerOperationErrorGenerator.kt:110 */
         694  +
impl ::std::convert::From<crate::error::UnsupportedRegionError>
         695  +
    for crate::error::CapturePokemonError
         696  +
{
         697  +
    /* ServerOperationErrorGenerator.kt:111 */
         698  +
    fn from(variant: crate::error::UnsupportedRegionError) -> crate::error::CapturePokemonError {
         699  +
        /* ServerOperationErrorGenerator.kt:112 */
         700  +
        Self::UnsupportedRegionError(variant)
         701  +
        /* ServerOperationErrorGenerator.kt:111 */
         702  +
    }
         703  +
    /* ServerOperationErrorGenerator.kt:110 */
         704  +
}
         705  +
/* ServerOperationErrorGenerator.kt:110 */
         706  +
impl ::std::convert::From<crate::error::ThrottlingError> for crate::error::CapturePokemonError {
         707  +
    /* ServerOperationErrorGenerator.kt:111 */
         708  +
    fn from(variant: crate::error::ThrottlingError) -> crate::error::CapturePokemonError {
         709  +
        /* ServerOperationErrorGenerator.kt:112 */
         710  +
        Self::ThrottlingError(variant)
         711  +
        /* ServerOperationErrorGenerator.kt:111 */
         712  +
    }
         713  +
    /* ServerOperationErrorGenerator.kt:110 */
         714  +
}
         715  +
/* ServerOperationErrorGenerator.kt:110 */
         716  +
impl ::std::convert::From<crate::error::ValidationException> for crate::error::CapturePokemonError {
         717  +
    /* ServerOperationErrorGenerator.kt:111 */
         718  +
    fn from(variant: crate::error::ValidationException) -> crate::error::CapturePokemonError {
         719  +
        /* ServerOperationErrorGenerator.kt:112 */
         720  +
        Self::ValidationException(variant)
         721  +
        /* ServerOperationErrorGenerator.kt:111 */
         722  +
    }
         723  +
    /* ServerOperationErrorGenerator.kt:110 */
         724  +
}
         725  +
/* ServerOperationErrorGenerator.kt:110 */
         726  +
impl ::std::convert::From<crate::error::MasterBallUnsuccessful>
         727  +
    for crate::error::CapturePokemonError
         728  +
{
         729  +
    /* ServerOperationErrorGenerator.kt:111 */
         730  +
    fn from(variant: crate::error::MasterBallUnsuccessful) -> crate::error::CapturePokemonError {
         731  +
        /* ServerOperationErrorGenerator.kt:112 */
         732  +
        Self::MasterBallUnsuccessful(variant)
         733  +
        /* ServerOperationErrorGenerator.kt:111 */
         734  +
    }
         735  +
    /* ServerOperationErrorGenerator.kt:110 */
         736  +
}
         737  +
/* ServerOperationErrorGenerator.kt:110 */
         738  +
impl ::std::convert::From<crate::error::InvalidPokeballError>
         739  +
    for crate::error::CapturePokemonError
         740  +
{
         741  +
    /* ServerOperationErrorGenerator.kt:111 */
         742  +
    fn from(variant: crate::error::InvalidPokeballError) -> crate::error::CapturePokemonError {
         743  +
        /* ServerOperationErrorGenerator.kt:112 */
         744  +
        Self::InvalidPokeballError(variant)
         745  +
        /* ServerOperationErrorGenerator.kt:111 */
         746  +
    }
         747  +
    /* ServerOperationErrorGenerator.kt:110 */
         748  +
}
         749  +
         750  +
/* StructureGenerator.kt:197 */
         751  +
#[allow(missing_docs)] // documentation missing in model
         752  +
/* RustType.kt:534 */
         753  +
#[derive(
         754  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         755  +
)]
         756  +
pub /* StructureGenerator.kt:201 */ struct InvalidPokeballError {
         757  +
    /* StructureGenerator.kt:231 */
         758  +
    #[allow(missing_docs)] // documentation missing in model
         759  +
    pub pokeball: ::std::string::String,
         760  +
    /* StructureGenerator.kt:201 */
         761  +
}
         762  +
/* StructureGenerator.kt:135 */
         763  +
impl InvalidPokeballError {
         764  +
    /* StructureGenerator.kt:231 */
         765  +
    #[allow(missing_docs)] // documentation missing in model
         766  +
                           /* StructureGenerator.kt:166 */
         767  +
    pub fn pokeball(&self) -> &str {
         768  +
        /* StructureGenerator.kt:171 */
         769  +
        use std::ops::Deref;
         770  +
        self.pokeball.deref()
         771  +
        /* StructureGenerator.kt:166 */
         772  +
    }
         773  +
    /* StructureGenerator.kt:135 */
         774  +
}
         775  +
/* ErrorImplGenerator.kt:99 */
         776  +
impl InvalidPokeballError {
         777  +
    /* ErrorImplGenerator.kt:141 */
         778  +
    #[doc(hidden)]
         779  +
    /// Returns the error name.
         780  +
    pub fn name(&self) -> &'static str {
         781  +
        "InvalidPokeballError"
         782  +
    }
         783  +
    /* ErrorImplGenerator.kt:99 */
         784  +
}
         785  +
/* ErrorImplGenerator.kt:153 */
         786  +
impl ::std::fmt::Display for InvalidPokeballError {
         787  +
    /* ErrorImplGenerator.kt:154 */
         788  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         789  +
        /* ErrorImplGenerator.kt:161 */
         790  +
        ::std::write!(f, "InvalidPokeballError")?;
         791  +
        /* ErrorImplGenerator.kt:176 */
         792  +
        Ok(())
         793  +
        /* ErrorImplGenerator.kt:154 */
         794  +
    }
         795  +
    /* ErrorImplGenerator.kt:153 */
         796  +
}
         797  +
/* ErrorImplGenerator.kt:180 */
         798  +
impl ::std::error::Error for InvalidPokeballError {}
         799  +
/* ServerCodegenVisitor.kt:356 */
         800  +
impl InvalidPokeballError {
         801  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         802  +
    /* ServerBuilderGenerator.kt:295 */
         803  +
    pub fn builder() -> crate::error::invalid_pokeball_error::Builder {
         804  +
        /* ServerBuilderGenerator.kt:296 */
         805  +
        crate::error::invalid_pokeball_error::Builder::default()
         806  +
        /* ServerBuilderGenerator.kt:295 */
         807  +
    }
         808  +
    /* ServerCodegenVisitor.kt:356 */
         809  +
}
         810  +
         811  +
/* StructureGenerator.kt:197 */
         812  +
#[allow(missing_docs)] // documentation missing in model
         813  +
/* RustType.kt:534 */
         814  +
#[derive(
         815  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         816  +
)]
         817  +
pub /* StructureGenerator.kt:201 */ struct MasterBallUnsuccessful {
         818  +
    /* StructureGenerator.kt:231 */
         819  +
    #[allow(missing_docs)] // documentation missing in model
         820  +
    pub message: ::std::option::Option<::std::string::String>,
         821  +
    /* StructureGenerator.kt:201 */
         822  +
}
         823  +
/* ErrorImplGenerator.kt:99 */
         824  +
impl MasterBallUnsuccessful {
         825  +
    /* ErrorImplGenerator.kt:128 */
         826  +
    /// Returns the error message.
         827  +
    pub fn message(&self) -> ::std::option::Option<&str> {
         828  +
        self.message.as_deref()
         829  +
    }
         830  +
    /* ErrorImplGenerator.kt:141 */
         831  +
    #[doc(hidden)]
         832  +
    /// Returns the error name.
         833  +
    pub fn name(&self) -> &'static str {
         834  +
        "MasterBallUnsuccessful"
         835  +
    }
         836  +
    /* ErrorImplGenerator.kt:99 */
         837  +
}
         838  +
/* ErrorImplGenerator.kt:153 */
         839  +
impl ::std::fmt::Display for MasterBallUnsuccessful {
         840  +
    /* ErrorImplGenerator.kt:154 */
         841  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         842  +
        /* ErrorImplGenerator.kt:161 */
         843  +
        ::std::write!(f, "MasterBallUnsuccessful")?;
         844  +
        /* ErrorImplGenerator.kt:166 */
         845  +
        if let ::std::option::Option::Some(inner_1) = &self.message {
         846  +
            /* ErrorImplGenerator.kt:166 */
         847  +
            {
         848  +
                /* ErrorImplGenerator.kt:171 */
         849  +
                ::std::write!(f, ": {inner_1}")?;
         850  +
                /* ErrorImplGenerator.kt:166 */
         851  +
            }
         852  +
            /* ErrorImplGenerator.kt:166 */
         853  +
        }
         854  +
        /* ErrorImplGenerator.kt:176 */
         855  +
        Ok(())
         856  +
        /* ErrorImplGenerator.kt:154 */
         857  +
    }
         858  +
    /* ErrorImplGenerator.kt:153 */
         859  +
}
         860  +
/* ErrorImplGenerator.kt:180 */
         861  +
impl ::std::error::Error for MasterBallUnsuccessful {}
         862  +
/* ServerCodegenVisitor.kt:356 */
         863  +
impl MasterBallUnsuccessful {
         864  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
         865  +
    /* ServerBuilderGenerator.kt:295 */
         866  +
    pub fn builder() -> crate::error::master_ball_unsuccessful::Builder {
         867  +
        /* ServerBuilderGenerator.kt:296 */
         868  +
        crate::error::master_ball_unsuccessful::Builder::default()
         869  +
        /* ServerBuilderGenerator.kt:295 */
         870  +
    }
         871  +
    /* ServerCodegenVisitor.kt:356 */
         872  +
}
         873  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
         874  +
impl crate::constrained::Constrained for crate::error::MasterBallUnsuccessful {
         875  +
    type Unconstrained = crate::error::master_ball_unsuccessful::Builder;
         876  +
}
         877  +
         878  +
/* StructureGenerator.kt:197 */
         879  +
#[allow(missing_docs)] // documentation missing in model
         880  +
/* RustType.kt:534 */
         881  +
#[derive(
         882  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         883  +
)]
         884  +
pub /* StructureGenerator.kt:201 */ struct ThrottlingError {/* StructureGenerator.kt:201 */}
         885  +
/* ErrorImplGenerator.kt:99 */
         886  +
impl ThrottlingError {
         887  +
    /* ErrorImplGenerator.kt:141 */
         888  +
    #[doc(hidden)]
         889  +
    /// Returns the error name.
         890  +
    pub fn name(&self) -> &'static str {
         891  +
        "ThrottlingError"
         892  +
    }
         893  +
    /* ErrorImplGenerator.kt:99 */
         894  +
}
         895  +
/* ErrorImplGenerator.kt:153 */
         896  +
impl ::std::fmt::Display for ThrottlingError {
         897  +
    /* ErrorImplGenerator.kt:154 */
         898  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         899  +
        /* ErrorImplGenerator.kt:161 */
         900  +
        ::std::write!(f, "ThrottlingError")?;
         901  +
        /* ErrorImplGenerator.kt:176 */
         902  +
        Ok(())
         903  +
        /* ErrorImplGenerator.kt:154 */
         904  +
    }
         905  +
    /* ErrorImplGenerator.kt:153 */
         906  +
}
         907  +
/* ErrorImplGenerator.kt:180 */
         908  +
impl ::std::error::Error for ThrottlingError {}
         909  +
/* ServerCodegenVisitor.kt:356 */
         910  +
impl ThrottlingError {
         911  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ThrottlingError`](crate::error::ThrottlingError).
         912  +
    /* ServerBuilderGenerator.kt:295 */
         913  +
    pub fn builder() -> crate::error::throttling_error::Builder {
         914  +
        /* ServerBuilderGenerator.kt:296 */
         915  +
        crate::error::throttling_error::Builder::default()
         916  +
        /* ServerBuilderGenerator.kt:295 */
         917  +
    }
         918  +
    /* ServerCodegenVisitor.kt:356 */
         919  +
}
         920  +
         921  +
/* StructureGenerator.kt:197 */
         922  +
#[allow(missing_docs)] // documentation missing in model
         923  +
/* RustType.kt:534 */
         924  +
#[derive(
         925  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         926  +
)]
         927  +
pub /* StructureGenerator.kt:201 */ struct UnsupportedRegionError {
         928  +
    /* StructureGenerator.kt:231 */
         929  +
    #[allow(missing_docs)] // documentation missing in model
         930  +
    pub region: ::std::string::String,
         931  +
    /* StructureGenerator.kt:201 */
         932  +
}
         933  +
/* StructureGenerator.kt:135 */
         934  +
impl UnsupportedRegionError {
         935  +
    /* StructureGenerator.kt:231 */
         936  +
    #[allow(missing_docs)] // documentation missing in model
         937  +
                           /* StructureGenerator.kt:166 */
         938  +
    pub fn region(&self) -> &str {
         939  +
        /* StructureGenerator.kt:171 */
         940  +
        use std::ops::Deref;
         941  +
        self.region.deref()
         942  +
        /* StructureGenerator.kt:166 */
         943  +
    }
         944  +
    /* StructureGenerator.kt:135 */
         945  +
}
         946  +
/* ErrorImplGenerator.kt:99 */
         947  +
impl UnsupportedRegionError {
         948  +
    /* ErrorImplGenerator.kt:141 */
         949  +
    #[doc(hidden)]
         950  +
    /// Returns the error name.
         951  +
    pub fn name(&self) -> &'static str {
         952  +
        "UnsupportedRegionError"
         953  +
    }
         954  +
    /* ErrorImplGenerator.kt:99 */
         955  +
}
         956  +
/* ErrorImplGenerator.kt:153 */
         957  +
impl ::std::fmt::Display for UnsupportedRegionError {
         958  +
    /* ErrorImplGenerator.kt:154 */
         959  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         960  +
        /* ErrorImplGenerator.kt:161 */
         961  +
        ::std::write!(f, "UnsupportedRegionError")?;
         962  +
        /* ErrorImplGenerator.kt:176 */
         963  +
        Ok(())
         964  +
        /* ErrorImplGenerator.kt:154 */
         965  +
    }
         966  +
    /* ErrorImplGenerator.kt:153 */
         967  +
}
         968  +
/* ErrorImplGenerator.kt:180 */
         969  +
impl ::std::error::Error for UnsupportedRegionError {}
         970  +
/* ServerCodegenVisitor.kt:356 */
         971  +
impl UnsupportedRegionError {
         972  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         973  +
    /* ServerBuilderGenerator.kt:295 */
         974  +
    pub fn builder() -> crate::error::unsupported_region_error::Builder {
         975  +
        /* ServerBuilderGenerator.kt:296 */
         976  +
        crate::error::unsupported_region_error::Builder::default()
         977  +
        /* ServerBuilderGenerator.kt:295 */
         978  +
    }
         979  +
    /* ServerCodegenVisitor.kt:356 */
         980  +
}
         981  +
         982  +
/* ServerOperationErrorGenerator.kt:63 */
         983  +
/// Error type for the `CapturePokemonEvents` operation.
         984  +
/* ServerOperationErrorGenerator.kt:64 */
         985  +
/// Each variant represents an error that can occur for the `CapturePokemonEvents` operation.
         986  +
/* RustType.kt:534 */
         987  +
#[derive(::std::fmt::Debug)]
         988  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum CapturePokemonEventsError {
         989  +
    /* ServerOperationErrorGenerator.kt:68 */
         990  +
    #[allow(missing_docs)] // documentation missing in model
         991  +
    /* ServerOperationErrorGenerator.kt:71 */
         992  +
    InvalidPokeballError(crate::error::InvalidPokeballError),
         993  +
    /* ServerOperationErrorGenerator.kt:68 */
         994  +
    #[allow(missing_docs)] // documentation missing in model
         995  +
    /* ServerOperationErrorGenerator.kt:71 */
         996  +
    ThrottlingError(crate::error::ThrottlingError),
         997  +
    /* ServerOperationErrorGenerator.kt:66 */
         998  +
}
         999  +
/* ServerOperationErrorGenerator.kt:75 */
        1000  +
impl ::std::fmt::Display for CapturePokemonEventsError {
        1001  +
    /* ServerOperationErrorGenerator.kt:76 */
        1002  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1003  +
        /* ServerOperationErrorGenerator.kt:139 */
        1004  +
        match &self {
        1005  +
            /* ServerOperationErrorGenerator.kt:142 */
        1006  +
            CapturePokemonEventsError::InvalidPokeballError(_inner) =>
        1007  +
            /* ServerOperationErrorGenerator.kt:78 */
        1008  +
            {
        1009  +
                _inner.fmt(f)
        1010  +
            }
        1011  +
            ,
        1012  +
            /* ServerOperationErrorGenerator.kt:142 */
        1013  +
            CapturePokemonEventsError::ThrottlingError(_inner) =>
        1014  +
            /* ServerOperationErrorGenerator.kt:78 */
        1015  +
            {
        1016  +
                _inner.fmt(f)
        1017  +
            }
        1018  +
            /* ServerOperationErrorGenerator.kt:139 */
        1019  +
        }
        1020  +
        /* ServerOperationErrorGenerator.kt:76 */
        1021  +
    }
        1022  +
    /* ServerOperationErrorGenerator.kt:75 */
        1023  +
}
        1024  +
/* ServerOperationErrorGenerator.kt:83 */
        1025  +
impl CapturePokemonEventsError {
        1026  +
    /* ServerOperationErrorGenerator.kt:87 */
        1027  +
    /// Returns `true` if the error kind is `CapturePokemonEventsError::InvalidPokeballError`.
        1028  +
    /* ServerOperationErrorGenerator.kt:88 */
        1029  +
    pub fn is_invalid_pokeball_error(&self) -> bool {
        1030  +
        /* ServerOperationErrorGenerator.kt:89 */
        1031  +
        matches!(&self, CapturePokemonEventsError::InvalidPokeballError(_))
        1032  +
        /* ServerOperationErrorGenerator.kt:88 */
        1033  +
    }
        1034  +
    /* ServerOperationErrorGenerator.kt:87 */
        1035  +
    /// Returns `true` if the error kind is `CapturePokemonEventsError::ThrottlingError`.
        1036  +
    /* ServerOperationErrorGenerator.kt:88 */
        1037  +
    pub fn is_throttling_error(&self) -> bool {
        1038  +
        /* ServerOperationErrorGenerator.kt:89 */
        1039  +
        matches!(&self, CapturePokemonEventsError::ThrottlingError(_))
        1040  +
        /* ServerOperationErrorGenerator.kt:88 */
        1041  +
    }
        1042  +
    /* ServerOperationErrorGenerator.kt:92 */
        1043  +
    /// Returns the error name string by matching the correct variant.
        1044  +
    /* ServerOperationErrorGenerator.kt:93 */
        1045  +
    pub fn name(&self) -> &'static str {
        1046  +
        /* ServerOperationErrorGenerator.kt:139 */
        1047  +
        match &self {
        1048  +
            /* ServerOperationErrorGenerator.kt:142 */
        1049  +
            CapturePokemonEventsError::InvalidPokeballError(_inner) =>
        1050  +
            /* ServerOperationErrorGenerator.kt:95 */
        1051  +
            {
        1052  +
                _inner.name()
        1053  +
            }
        1054  +
            ,
        1055  +
            /* ServerOperationErrorGenerator.kt:142 */
        1056  +
            CapturePokemonEventsError::ThrottlingError(_inner) =>
        1057  +
            /* ServerOperationErrorGenerator.kt:95 */
        1058  +
            {
        1059  +
                _inner.name()
        1060  +
            }
        1061  +
            /* ServerOperationErrorGenerator.kt:139 */
        1062  +
        }
        1063  +
        /* ServerOperationErrorGenerator.kt:93 */
        1064  +
    }
        1065  +
    /* ServerOperationErrorGenerator.kt:83 */
        1066  +
}
        1067  +
/* ServerOperationErrorGenerator.kt:100 */
        1068  +
impl ::std::error::Error for CapturePokemonEventsError {
        1069  +
    /* ServerOperationErrorGenerator.kt:101 */
        1070  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
        1071  +
        /* ServerOperationErrorGenerator.kt:139 */
        1072  +
        match &self {
        1073  +
            /* ServerOperationErrorGenerator.kt:142 */
        1074  +
            CapturePokemonEventsError::InvalidPokeballError(_inner) =>
        1075  +
            /* ServerOperationErrorGenerator.kt:103 */
        1076  +
            {
        1077  +
                Some(_inner)
        1078  +
            }
        1079  +
            ,
        1080  +
            /* ServerOperationErrorGenerator.kt:142 */
        1081  +
            CapturePokemonEventsError::ThrottlingError(_inner) =>
        1082  +
            /* ServerOperationErrorGenerator.kt:103 */
        1083  +
            {
        1084  +
                Some(_inner)
        1085  +
            }
        1086  +
            /* ServerOperationErrorGenerator.kt:139 */
        1087  +
        }
        1088  +
        /* ServerOperationErrorGenerator.kt:101 */
        1089  +
    }
        1090  +
    /* ServerOperationErrorGenerator.kt:100 */
        1091  +
}
        1092  +
/* ServerOperationErrorGenerator.kt:110 */
        1093  +
impl ::std::convert::From<crate::error::InvalidPokeballError>
        1094  +
    for crate::error::CapturePokemonEventsError
        1095  +
{
        1096  +
    /* ServerOperationErrorGenerator.kt:111 */
        1097  +
    fn from(
        1098  +
        variant: crate::error::InvalidPokeballError,
        1099  +
    ) -> crate::error::CapturePokemonEventsError {
        1100  +
        /* ServerOperationErrorGenerator.kt:112 */
        1101  +
        Self::InvalidPokeballError(variant)
        1102  +
        /* ServerOperationErrorGenerator.kt:111 */
        1103  +
    }
        1104  +
    /* ServerOperationErrorGenerator.kt:110 */
        1105  +
}
        1106  +
/* ServerOperationErrorGenerator.kt:110 */
        1107  +
impl ::std::convert::From<crate::error::ThrottlingError>
        1108  +
    for crate::error::CapturePokemonEventsError
        1109  +
{
        1110  +
    /* ServerOperationErrorGenerator.kt:111 */
        1111  +
    fn from(variant: crate::error::ThrottlingError) -> crate::error::CapturePokemonEventsError {
        1112  +
        /* ServerOperationErrorGenerator.kt:112 */
        1113  +
        Self::ThrottlingError(variant)
        1114  +
        /* ServerOperationErrorGenerator.kt:111 */
        1115  +
    }
        1116  +
    /* ServerOperationErrorGenerator.kt:110 */
        1117  +
}
        1118  +
        1119  +
/* ServerOperationErrorGenerator.kt:63 */
        1120  +
/// Error type for the `AttemptCapturingPokemonEvent` operation.
        1121  +
/* ServerOperationErrorGenerator.kt:64 */
        1122  +
/// Each variant represents an error that can occur for the `AttemptCapturingPokemonEvent` operation.
        1123  +
/* RustType.kt:534 */
        1124  +
#[derive(::std::fmt::Debug)]
        1125  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum AttemptCapturingPokemonEventError {
        1126  +
    /* ServerOperationErrorGenerator.kt:68 */
        1127  +
    #[allow(missing_docs)] // documentation missing in model
        1128  +
    /* ServerOperationErrorGenerator.kt:71 */
        1129  +
    MasterBallUnsuccessful(crate::error::MasterBallUnsuccessful),
        1130  +
    /* ServerOperationErrorGenerator.kt:66 */
        1131  +
}
        1132  +
/* ServerOperationErrorGenerator.kt:75 */
        1133  +
impl ::std::fmt::Display for AttemptCapturingPokemonEventError {
        1134  +
    /* ServerOperationErrorGenerator.kt:76 */
        1135  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1136  +
        /* ServerOperationErrorGenerator.kt:139 */
        1137  +
        match &self {
        1138  +
            /* ServerOperationErrorGenerator.kt:142 */
        1139  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) =>
        1140  +
            /* ServerOperationErrorGenerator.kt:78 */
        1141  +
            {
        1142  +
                _inner.fmt(f)
        1143  +
            }
        1144  +
            /* ServerOperationErrorGenerator.kt:139 */
        1145  +
        }
        1146  +
        /* ServerOperationErrorGenerator.kt:76 */
        1147  +
    }
        1148  +
    /* ServerOperationErrorGenerator.kt:75 */
        1149  +
}
        1150  +
/* ServerOperationErrorGenerator.kt:83 */
        1151  +
impl AttemptCapturingPokemonEventError {
        1152  +
    /* ServerOperationErrorGenerator.kt:87 */
        1153  +
    /// Returns `true` if the error kind is `AttemptCapturingPokemonEventError::MasterBallUnsuccessful`.
        1154  +
    /* ServerOperationErrorGenerator.kt:88 */
        1155  +
    pub fn is_master_ball_unsuccessful(&self) -> bool {
        1156  +
        /* ServerOperationErrorGenerator.kt:89 */
        1157  +
        matches!(
        1158  +
            &self,
        1159  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_)
        1160  +
        )
        1161  +
        /* ServerOperationErrorGenerator.kt:88 */
        1162  +
    }
        1163  +
    /* ServerOperationErrorGenerator.kt:92 */
        1164  +
    /// Returns the error name string by matching the correct variant.
        1165  +
    /* ServerOperationErrorGenerator.kt:93 */
        1166  +
    pub fn name(&self) -> &'static str {
        1167  +
        /* ServerOperationErrorGenerator.kt:139 */
        1168  +
        match &self {
        1169  +
            /* ServerOperationErrorGenerator.kt:142 */
        1170  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) =>
        1171  +
            /* ServerOperationErrorGenerator.kt:95 */
        1172  +
            {
        1173  +
                _inner.name()
        1174  +
            }
        1175  +
            /* ServerOperationErrorGenerator.kt:139 */
        1176  +
        }
        1177  +
        /* ServerOperationErrorGenerator.kt:93 */
        1178  +
    }
        1179  +
    /* ServerOperationErrorGenerator.kt:83 */
        1180  +
}
        1181  +
/* ServerOperationErrorGenerator.kt:100 */
        1182  +
impl ::std::error::Error for AttemptCapturingPokemonEventError {
        1183  +
    /* ServerOperationErrorGenerator.kt:101 */
        1184  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
        1185  +
        /* ServerOperationErrorGenerator.kt:139 */
        1186  +
        match &self {
        1187  +
            /* ServerOperationErrorGenerator.kt:142 */
        1188  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) =>
        1189  +
            /* ServerOperationErrorGenerator.kt:103 */
        1190  +
            {
        1191  +
                Some(_inner)
        1192  +
            }
        1193  +
            /* ServerOperationErrorGenerator.kt:139 */
        1194  +
        }
        1195  +
        /* ServerOperationErrorGenerator.kt:101 */
        1196  +
    }
        1197  +
    /* ServerOperationErrorGenerator.kt:100 */
        1198  +
}
        1199  +
/* ServerOperationErrorGenerator.kt:110 */
        1200  +
impl ::std::convert::From<crate::error::MasterBallUnsuccessful>
        1201  +
    for crate::error::AttemptCapturingPokemonEventError
        1202  +
{
        1203  +
    /* ServerOperationErrorGenerator.kt:111 */
        1204  +
    fn from(
        1205  +
        variant: crate::error::MasterBallUnsuccessful,
        1206  +
    ) -> crate::error::AttemptCapturingPokemonEventError {
        1207  +
        /* ServerOperationErrorGenerator.kt:112 */
        1208  +
        Self::MasterBallUnsuccessful(variant)
        1209  +
        /* ServerOperationErrorGenerator.kt:111 */
        1210  +
    }
        1211  +
    /* ServerOperationErrorGenerator.kt:110 */
        1212  +
}
        1213  +
        1214  +
/// /* ServerBuilderGenerator.kt:171 */See [`ValidationException`](crate::error::ValidationException).
        1215  +
pub mod validation_exception {
        1216  +
        1217  +
    /* RustType.kt:534 */
        1218  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
        1219  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
        1220  +
    /* RustType.kt:534 */
        1221  +
    #[non_exhaustive]
        1222  +
    /* ServerBuilderConstraintViolations.kt:75 */
        1223  +
    #[allow(clippy::enum_variant_names)]
        1224  +
    pub enum ConstraintViolation {
        1225  +
        /// /* ServerBuilderConstraintViolations.kt:137 */`message` was not provided but it is required when building `ValidationException`.
        1226  +
        /* ServerBuilderConstraintViolations.kt:144 */
        1227  +
        MissingMessage,
        1228  +
        /* ServerBuilderConstraintViolations.kt:75 */
        1229  +
    }
        1230  +
    /* ServerBuilderConstraintViolations.kt:116 */
        1231  +
    impl ::std::fmt::Display for ConstraintViolation {
        1232  +
        /* ServerBuilderConstraintViolations.kt:117 */
        1233  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1234  +
            /* ServerBuilderConstraintViolations.kt:118 */
        1235  +
            match self {
        1236  +
                /* ServerBuilderConstraintViolations.kt:126 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
        1237  +
            /* ServerBuilderConstraintViolations.kt:118 */}
        1238  +
            /* ServerBuilderConstraintViolations.kt:117 */
        1239  +
        }
        1240  +
        /* ServerBuilderConstraintViolations.kt:116 */
        1241  +
    }
        1242  +
    /* ServerBuilderConstraintViolations.kt:83 */
        1243  +
    impl ::std::error::Error for ConstraintViolation {}
        1244  +
    /* ServerBuilderGenerator.kt:446 */
        1245  +
    impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
        1246  +
        type Error = ConstraintViolation;
        1247  +
        1248  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
        1249  +
            builder.build()
        1250  +
        }
        1251  +
    }
        1252  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ValidationException`](crate::error::ValidationException).
        1253  +
    /* RustType.kt:534 */
        1254  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1255  +
    /* ServerBuilderGenerator.kt:211 */
        1256  +
    pub struct Builder {
        1257  +
        /* ServerBuilderGenerator.kt:308 */
        1258  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
        1259  +
        /* ServerBuilderGenerator.kt:308 */
        1260  +
        pub(crate) field_list:
        1261  +
            ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
        1262  +
        /* ServerBuilderGenerator.kt:211 */
        1263  +
    }
        1264  +
    /* ServerBuilderGenerator.kt:215 */
        1265  +
    impl Builder {
        1266  +
        /// /* ServerBuilderGenerator.kt:331 */A summary of the validation failure.
        1267  +
        /* ServerBuilderGenerator.kt:343 */
        1268  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
        1269  +
            /* ServerBuilderGenerator.kt:344 */
        1270  +
            self.message =
        1271  +
                /* ServerBuilderGenerator.kt:345 */Some(
        1272  +
                    /* ServerBuilderGenerator.kt:376 */input
        1273  +
                /* ServerBuilderGenerator.kt:345 */)
        1274  +
            /* ServerBuilderGenerator.kt:344 */;
        1275  +
            self
        1276  +
            /* ServerBuilderGenerator.kt:343 */
        1277  +
        }
        1278  +
        /// /* ServerBuilderGenerator.kt:331 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
        1279  +
        /* ServerBuilderGenerator.kt:343 */
        1280  +
        pub fn field_list(
        1281  +
            mut self,
        1282  +
            input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
        1283  +
        ) -> Self {
        1284  +
            /* ServerBuilderGenerator.kt:344 */
        1285  +
            self.field_list =
        1286  +
                /* ServerBuilderGenerator.kt:376 */input
        1287  +
            /* ServerBuilderGenerator.kt:344 */;
        1288  +
            self
        1289  +
            /* ServerBuilderGenerator.kt:343 */
        1290  +
        }
        1291  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
        1292  +
        /// /* ServerBuilderGenerator.kt:260 */
        1293  +
        /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if a [`ConstraintViolation`] occurs.
        1294  +
        ///
        1295  +
        /* ServerBuilderGenerator.kt:271 */
        1296  +
        pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
        1297  +
            self.build_enforcing_all_constraints()
        1298  +
        }
        1299  +
        /* ServerBuilderGenerator.kt:283 */
        1300  +
        fn build_enforcing_all_constraints(
        1301  +
            self,
        1302  +
        ) -> Result<crate::error::ValidationException, ConstraintViolation> {
        1303  +
            /* ServerBuilderGenerator.kt:287 */
        1304  +
            Ok(
        1305  +
                /* ServerBuilderGenerator.kt:542 */
        1306  +
                crate::error::ValidationException {
        1307  +
                    /* ServerBuilderGenerator.kt:546 */
        1308  +
                    message: self
        1309  +
                        .message
        1310  +
                        /* ServerBuilderGenerator.kt:569 */
        1311  +
                        .ok_or(ConstraintViolation::MissingMessage)?,
        1312  +
                    /* ServerBuilderGenerator.kt:546 */
        1313  +
                    field_list: self.field_list,
        1314  +
                    /* ServerBuilderGenerator.kt:542 */
        1315  +
                }, /* ServerBuilderGenerator.kt:287 */
        1316  +
            )
        1317  +
            /* ServerBuilderGenerator.kt:283 */
        1318  +
        }
        1319  +
        /* ServerBuilderGenerator.kt:215 */
        1320  +
    }
        1321  +
        1322  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
        1323  +
}
        1324  +
/// /* ServerBuilderGenerator.kt:171 */See [`StorageAccessNotAuthorized`](crate::error::StorageAccessNotAuthorized).
        1325  +
pub mod storage_access_not_authorized {
        1326  +
        1327  +
    /* ServerBuilderGenerator.kt:461 */
        1328  +
    impl ::std::convert::From<Builder> for crate::error::StorageAccessNotAuthorized {
        1329  +
        fn from(builder: Builder) -> Self {
        1330  +
            builder.build()
        1331  +
        }
        1332  +
    }
        1333  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`StorageAccessNotAuthorized`](crate::error::StorageAccessNotAuthorized).
        1334  +
    /* RustType.kt:534 */
        1335  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1336  +
    /* ServerBuilderGenerator.kt:211 */
        1337  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
        1338  +
    /* ServerBuilderGenerator.kt:215 */
        1339  +
    impl Builder {
        1340  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`StorageAccessNotAuthorized`](crate::error::StorageAccessNotAuthorized).
        1341  +
        /* ServerBuilderGenerator.kt:271 */
        1342  +
        pub fn build(self) -> crate::error::StorageAccessNotAuthorized {
        1343  +
            self.build_enforcing_all_constraints()
        1344  +
        }
        1345  +
        /* ServerBuilderGenerator.kt:283 */
        1346  +
        fn build_enforcing_all_constraints(self) -> crate::error::StorageAccessNotAuthorized {
        1347  +
            /* ServerBuilderGenerator.kt:542 */
        1348  +
            crate::error::StorageAccessNotAuthorized {
        1349  +
            /* ServerBuilderGenerator.kt:542 */}
        1350  +
            /* ServerBuilderGenerator.kt:283 */
        1351  +
        }
        1352  +
        /* ServerBuilderGenerator.kt:215 */
        1353  +
    }
        1354  +
        1355  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
        1356  +
}
        1357  +
/// /* ServerBuilderGenerator.kt:171 */See [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
        1358  +
pub mod resource_not_found_exception {
        1359  +
        1360  +
    /* RustType.kt:534 */
        1361  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
        1362  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
        1363  +
    /* RustType.kt:534 */
        1364  +
    #[non_exhaustive]
        1365  +
    /* ServerBuilderConstraintViolations.kt:75 */
        1366  +
    #[allow(clippy::enum_variant_names)]
        1367  +
    pub enum ConstraintViolation {
        1368  +
        /// /* ServerBuilderConstraintViolations.kt:137 */`message` was not provided but it is required when building `ResourceNotFoundException`.
        1369  +
        /* ServerBuilderConstraintViolations.kt:144 */
        1370  +
        MissingMessage,
        1371  +
        /* ServerBuilderConstraintViolations.kt:75 */
        1372  +
    }
        1373  +
    /* ServerBuilderConstraintViolations.kt:116 */
        1374  +
    impl ::std::fmt::Display for ConstraintViolation {
        1375  +
        /* ServerBuilderConstraintViolations.kt:117 */
        1376  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1377  +
            /* ServerBuilderConstraintViolations.kt:118 */
        1378  +
            match self {
        1379  +
                /* ServerBuilderConstraintViolations.kt:126 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ResourceNotFoundException`"),
        1380  +
            /* ServerBuilderConstraintViolations.kt:118 */}
        1381  +
            /* ServerBuilderConstraintViolations.kt:117 */
        1382  +
        }
        1383  +
        /* ServerBuilderConstraintViolations.kt:116 */
        1384  +
    }
        1385  +
    /* ServerBuilderConstraintViolations.kt:83 */
        1386  +
    impl ::std::error::Error for ConstraintViolation {}
        1387  +
    /* ServerBuilderGenerator.kt:446 */
        1388  +
    impl ::std::convert::TryFrom<Builder> for crate::error::ResourceNotFoundException {
        1389  +
        type Error = ConstraintViolation;
        1390  +
        1391  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
        1392  +
            builder.build()
        1393  +
        }
        1394  +
    }
        1395  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
        1396  +
    /* RustType.kt:534 */
        1397  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1398  +
    /* ServerBuilderGenerator.kt:211 */
        1399  +
    pub struct Builder {
        1400  +
        /* ServerBuilderGenerator.kt:308 */
        1401  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
        1402  +
        /* ServerBuilderGenerator.kt:211 */
        1403  +
    }
        1404  +
    /* ServerBuilderGenerator.kt:215 */
        1405  +
    impl Builder {
        1406  +
        /* ServerBuilderGenerator.kt:331 */
        1407  +
        #[allow(missing_docs)] // documentation missing in model
        1408  +
                               /* ServerBuilderGenerator.kt:343 */
        1409  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
        1410  +
            /* ServerBuilderGenerator.kt:344 */
        1411  +
            self.message =
        1412  +
                /* ServerBuilderGenerator.kt:345 */Some(
        1413  +
                    /* ServerBuilderGenerator.kt:376 */input
        1414  +
                /* ServerBuilderGenerator.kt:345 */)
        1415  +
            /* ServerBuilderGenerator.kt:344 */;
        1416  +
            self
        1417  +
            /* ServerBuilderGenerator.kt:343 */
        1418  +
        }
        1419  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
        1420  +
        /// /* ServerBuilderGenerator.kt:260 */
        1421  +
        /// The builder fails to construct a [`ResourceNotFoundException`](crate::error::ResourceNotFoundException) if a [`ConstraintViolation`] occurs.
        1422  +
        ///
        1423  +
        /* ServerBuilderGenerator.kt:271 */
        1424  +
        pub fn build(self) -> Result<crate::error::ResourceNotFoundException, ConstraintViolation> {
        1425  +
            self.build_enforcing_all_constraints()
        1426  +
        }
        1427  +
        /* ServerBuilderGenerator.kt:283 */
        1428  +
        fn build_enforcing_all_constraints(
        1429  +
            self,
        1430  +
        ) -> Result<crate::error::ResourceNotFoundException, ConstraintViolation> {
        1431  +
            /* ServerBuilderGenerator.kt:287 */
        1432  +
            Ok(
        1433  +
                /* ServerBuilderGenerator.kt:542 */
        1434  +
                crate::error::ResourceNotFoundException {
        1435  +
                    /* ServerBuilderGenerator.kt:546 */
        1436  +
                    message: self
        1437  +
                        .message
        1438  +
                        /* ServerBuilderGenerator.kt:569 */
        1439  +
                        .ok_or(ConstraintViolation::MissingMessage)?,
        1440  +
                    /* ServerBuilderGenerator.kt:542 */
        1441  +
                }, /* ServerBuilderGenerator.kt:287 */
        1442  +
            )
        1443  +
            /* ServerBuilderGenerator.kt:283 */
        1444  +
        }
        1445  +
        /* ServerBuilderGenerator.kt:215 */
        1446  +
    }
        1447  +
        1448  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
        1449  +
}
        1450  +
/// /* ServerBuilderGenerator.kt:171 */See [`InvalidPokeballError`](crate::error::InvalidPokeballError).
        1451  +
pub mod invalid_pokeball_error {
        1452  +
        1453  +
    /* RustType.kt:534 */
        1454  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
        1455  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
        1456  +
    /* RustType.kt:534 */
        1457  +
    #[non_exhaustive]
        1458  +
    /* ServerBuilderConstraintViolations.kt:75 */
        1459  +
    #[allow(clippy::enum_variant_names)]
        1460  +
    pub enum ConstraintViolation {
        1461  +
        /// /* ServerBuilderConstraintViolations.kt:137 */`pokeball` was not provided but it is required when building `InvalidPokeballError`.
        1462  +
        /* ServerBuilderConstraintViolations.kt:144 */
        1463  +
        MissingPokeball,
        1464  +
        /* ServerBuilderConstraintViolations.kt:75 */
        1465  +
    }
        1466  +
    /* ServerBuilderConstraintViolations.kt:116 */
        1467  +
    impl ::std::fmt::Display for ConstraintViolation {
        1468  +
        /* ServerBuilderConstraintViolations.kt:117 */
        1469  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1470  +
            /* ServerBuilderConstraintViolations.kt:118 */
        1471  +
            match self {
        1472  +
                /* ServerBuilderConstraintViolations.kt:126 */ConstraintViolation::MissingPokeball => write!(f, "`pokeball` was not provided but it is required when building `InvalidPokeballError`"),
        1473  +
            /* ServerBuilderConstraintViolations.kt:118 */}
        1474  +
            /* ServerBuilderConstraintViolations.kt:117 */
        1475  +
        }
        1476  +
        /* ServerBuilderConstraintViolations.kt:116 */
        1477  +
    }
        1478  +
    /* ServerBuilderConstraintViolations.kt:83 */
        1479  +
    impl ::std::error::Error for ConstraintViolation {}
        1480  +
    /* ServerBuilderGenerator.kt:446 */
        1481  +
    impl ::std::convert::TryFrom<Builder> for crate::error::InvalidPokeballError {
        1482  +
        type Error = ConstraintViolation;
        1483  +
        1484  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
        1485  +
            builder.build()
        1486  +
        }
        1487  +
    }
        1488  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`InvalidPokeballError`](crate::error::InvalidPokeballError).
        1489  +
    /* RustType.kt:534 */
        1490  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1491  +
    /* ServerBuilderGenerator.kt:211 */
        1492  +
    pub struct Builder {
        1493  +
        /* ServerBuilderGenerator.kt:308 */
        1494  +
        pub(crate) pokeball: ::std::option::Option<::std::string::String>,
        1495  +
        /* ServerBuilderGenerator.kt:211 */
        1496  +
    }
        1497  +
    /* ServerBuilderGenerator.kt:215 */
        1498  +
    impl Builder {
        1499  +
        /* ServerBuilderGenerator.kt:331 */
        1500  +
        #[allow(missing_docs)] // documentation missing in model
        1501  +
                               /* ServerBuilderGenerator.kt:343 */
        1502  +
        pub fn pokeball(mut self, input: ::std::string::String) -> Self {
        1503  +
            /* ServerBuilderGenerator.kt:344 */
        1504  +
            self.pokeball =
        1505  +
                /* ServerBuilderGenerator.kt:345 */Some(
        1506  +
                    /* ServerBuilderGenerator.kt:376 */input
        1507  +
                /* ServerBuilderGenerator.kt:345 */)
        1508  +
            /* ServerBuilderGenerator.kt:344 */;
        1509  +
            self
        1510  +
            /* ServerBuilderGenerator.kt:343 */
        1511  +
        }
        1512  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`InvalidPokeballError`](crate::error::InvalidPokeballError).
        1513  +
        /// /* ServerBuilderGenerator.kt:260 */
        1514  +
        /// The builder fails to construct a [`InvalidPokeballError`](crate::error::InvalidPokeballError) if a [`ConstraintViolation`] occurs.
        1515  +
        ///
        1516  +
        /* ServerBuilderGenerator.kt:271 */
        1517  +
        pub fn build(self) -> Result<crate::error::InvalidPokeballError, ConstraintViolation> {
        1518  +
            self.build_enforcing_all_constraints()
        1519  +
        }
        1520  +
        /* ServerBuilderGenerator.kt:283 */
        1521  +
        fn build_enforcing_all_constraints(
        1522  +
            self,
        1523  +
        ) -> Result<crate::error::InvalidPokeballError, ConstraintViolation> {
        1524  +
            /* ServerBuilderGenerator.kt:287 */
        1525  +
            Ok(
        1526  +
                /* ServerBuilderGenerator.kt:542 */
        1527  +
                crate::error::InvalidPokeballError {
        1528  +
                    /* ServerBuilderGenerator.kt:546 */
        1529  +
                    pokeball: self
        1530  +
                        .pokeball
        1531  +
                        /* ServerBuilderGenerator.kt:569 */
        1532  +
                        .ok_or(ConstraintViolation::MissingPokeball)?,
        1533  +
                    /* ServerBuilderGenerator.kt:542 */
        1534  +
                }, /* ServerBuilderGenerator.kt:287 */
        1535  +
            )
        1536  +
            /* ServerBuilderGenerator.kt:283 */
        1537  +
        }
        1538  +
        /* ServerBuilderGenerator.kt:215 */
        1539  +
    }
        1540  +
        1541  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
        1542  +
}
        1543  +
/// /* ServerBuilderGenerator.kt:171 */See [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
        1544  +
pub mod master_ball_unsuccessful {
        1545  +
        1546  +
    /* ServerBuilderGenerator.kt:461 */
        1547  +
    impl ::std::convert::From<Builder> for crate::error::MasterBallUnsuccessful {
        1548  +
        fn from(builder: Builder) -> Self {
        1549  +
            builder.build()
        1550  +
        }
        1551  +
    }
        1552  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
        1553  +
    /* RustType.kt:534 */
        1554  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1555  +
    /* ServerBuilderGenerator.kt:211 */
        1556  +
    pub struct Builder {
        1557  +
        /* ServerBuilderGenerator.kt:308 */
        1558  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
        1559  +
        /* ServerBuilderGenerator.kt:211 */
        1560  +
    }
        1561  +
    /* ServerBuilderGenerator.kt:215 */
        1562  +
    impl Builder {
        1563  +
        /* ServerBuilderGenerator.kt:331 */
        1564  +
        #[allow(missing_docs)] // documentation missing in model
        1565  +
                               /* ServerBuilderGenerator.kt:343 */
        1566  +
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        1567  +
            /* ServerBuilderGenerator.kt:344 */
        1568  +
            self.message =
        1569  +
                /* ServerBuilderGenerator.kt:376 */input
        1570  +
            /* ServerBuilderGenerator.kt:344 */;
        1571  +
            self
        1572  +
            /* ServerBuilderGenerator.kt:343 */
        1573  +
        }
        1574  +
        /* ServerBuilderGenerator.kt:426 */
        1575  +
        #[allow(missing_docs)] // documentation missing in model
        1576  +
                               /* ServerBuilderGenerator.kt:428 */
        1577  +
        pub(crate) fn set_message(
        1578  +
            mut self,
        1579  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
        1580  +
        ) -> Self {
        1581  +
            /* ServerBuilderGenerator.kt:429 */
        1582  +
            self.message = input.map(|v| v.into());
        1583  +
            self
        1584  +
            /* ServerBuilderGenerator.kt:428 */
        1585  +
        }
        1586  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
        1587  +
        /* ServerBuilderGenerator.kt:271 */
        1588  +
        pub fn build(self) -> crate::error::MasterBallUnsuccessful {
        1589  +
            self.build_enforcing_all_constraints()
        1590  +
        }
        1591  +
        /* ServerBuilderGenerator.kt:283 */
        1592  +
        fn build_enforcing_all_constraints(self) -> crate::error::MasterBallUnsuccessful {
        1593  +
            /* ServerBuilderGenerator.kt:542 */
        1594  +
            crate::error::MasterBallUnsuccessful {
        1595  +
                /* ServerBuilderGenerator.kt:546 */
        1596  +
                message: self.message,
        1597  +
                /* ServerBuilderGenerator.kt:542 */
        1598  +
            }
        1599  +
            /* ServerBuilderGenerator.kt:283 */
        1600  +
        }
        1601  +
        /* ServerBuilderGenerator.kt:215 */
        1602  +
    }
        1603  +
        1604  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
        1605  +
}
        1606  +
/// /* ServerBuilderGenerator.kt:171 */See [`ThrottlingError`](crate::error::ThrottlingError).
        1607  +
pub mod throttling_error {
        1608  +
        1609  +
    /* ServerBuilderGenerator.kt:461 */
        1610  +
    impl ::std::convert::From<Builder> for crate::error::ThrottlingError {
        1611  +
        fn from(builder: Builder) -> Self {
        1612  +
            builder.build()
        1613  +
        }
        1614  +
    }
        1615  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ThrottlingError`](crate::error::ThrottlingError).
        1616  +
    /* RustType.kt:534 */
        1617  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1618  +
    /* ServerBuilderGenerator.kt:211 */
        1619  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
        1620  +
    /* ServerBuilderGenerator.kt:215 */
        1621  +
    impl Builder {
        1622  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ThrottlingError`](crate::error::ThrottlingError).
        1623  +
        /* ServerBuilderGenerator.kt:271 */
        1624  +
        pub fn build(self) -> crate::error::ThrottlingError {
        1625  +
            self.build_enforcing_all_constraints()
        1626  +
        }
        1627  +
        /* ServerBuilderGenerator.kt:283 */
        1628  +
        fn build_enforcing_all_constraints(self) -> crate::error::ThrottlingError {
        1629  +
            /* ServerBuilderGenerator.kt:542 */
        1630  +
            crate::error::ThrottlingError {
        1631  +
            /* ServerBuilderGenerator.kt:542 */}
        1632  +
            /* ServerBuilderGenerator.kt:283 */
        1633  +
        }
        1634  +
        /* ServerBuilderGenerator.kt:215 */
        1635  +
    }
        1636  +
        1637  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
        1638  +
}
        1639  +
/// /* ServerBuilderGenerator.kt:171 */See [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
        1640  +
pub mod unsupported_region_error {
        1641  +
        1642  +
    /* RustType.kt:534 */
        1643  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
        1644  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
        1645  +
    /* RustType.kt:534 */
        1646  +
    #[non_exhaustive]
        1647  +
    /* ServerBuilderConstraintViolations.kt:75 */
        1648  +
    #[allow(clippy::enum_variant_names)]
        1649  +
    pub enum ConstraintViolation {
        1650  +
        /// /* ServerBuilderConstraintViolations.kt:137 */`region` was not provided but it is required when building `UnsupportedRegionError`.
        1651  +
        /* ServerBuilderConstraintViolations.kt:144 */
        1652  +
        MissingRegion,
        1653  +
        /* ServerBuilderConstraintViolations.kt:75 */
        1654  +
    }
        1655  +
    /* ServerBuilderConstraintViolations.kt:116 */
        1656  +
    impl ::std::fmt::Display for ConstraintViolation {
        1657  +
        /* ServerBuilderConstraintViolations.kt:117 */
        1658  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1659  +
            /* ServerBuilderConstraintViolations.kt:118 */
        1660  +
            match self {
        1661  +
                /* ServerBuilderConstraintViolations.kt:126 */ConstraintViolation::MissingRegion => write!(f, "`region` was not provided but it is required when building `UnsupportedRegionError`"),
        1662  +
            /* ServerBuilderConstraintViolations.kt:118 */}
        1663  +
            /* ServerBuilderConstraintViolations.kt:117 */
        1664  +
        }
        1665  +
        /* ServerBuilderConstraintViolations.kt:116 */
        1666  +
    }
        1667  +
    /* ServerBuilderConstraintViolations.kt:83 */
        1668  +
    impl ::std::error::Error for ConstraintViolation {}
        1669  +
    /* ServerBuilderGenerator.kt:446 */
        1670  +
    impl ::std::convert::TryFrom<Builder> for crate::error::UnsupportedRegionError {
        1671  +
        type Error = ConstraintViolation;
        1672  +
        1673  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
        1674  +
            builder.build()
        1675  +
        }
        1676  +
    }
        1677  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
        1678  +
    /* RustType.kt:534 */
        1679  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1680  +
    /* ServerBuilderGenerator.kt:211 */
        1681  +
    pub struct Builder {
        1682  +
        /* ServerBuilderGenerator.kt:308 */
        1683  +
        pub(crate) region: ::std::option::Option<::std::string::String>,
        1684  +
        /* ServerBuilderGenerator.kt:211 */
        1685  +
    }
        1686  +
    /* ServerBuilderGenerator.kt:215 */
        1687  +
    impl Builder {
        1688  +
        /* ServerBuilderGenerator.kt:331 */
        1689  +
        #[allow(missing_docs)] // documentation missing in model
        1690  +
                               /* ServerBuilderGenerator.kt:343 */
        1691  +
        pub fn region(mut self, input: ::std::string::String) -> Self {
        1692  +
            /* ServerBuilderGenerator.kt:344 */
        1693  +
            self.region =
        1694  +
                /* ServerBuilderGenerator.kt:345 */Some(
        1695  +
                    /* ServerBuilderGenerator.kt:376 */input
        1696  +
                /* ServerBuilderGenerator.kt:345 */)
        1697  +
            /* ServerBuilderGenerator.kt:344 */;
        1698  +
            self
        1699  +
            /* ServerBuilderGenerator.kt:343 */
        1700  +
        }
        1701  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
        1702  +
        /// /* ServerBuilderGenerator.kt:260 */
        1703  +
        /// The builder fails to construct a [`UnsupportedRegionError`](crate::error::UnsupportedRegionError) if a [`ConstraintViolation`] occurs.
        1704  +
        ///
        1705  +
        /* ServerBuilderGenerator.kt:271 */
        1706  +
        pub fn build(self) -> Result<crate::error::UnsupportedRegionError, ConstraintViolation> {
        1707  +
            self.build_enforcing_all_constraints()
        1708  +
        }
        1709  +
        /* ServerBuilderGenerator.kt:283 */
        1710  +
        fn build_enforcing_all_constraints(
        1711  +
            self,
        1712  +
        ) -> Result<crate::error::UnsupportedRegionError, ConstraintViolation> {
        1713  +
            /* ServerBuilderGenerator.kt:287 */
        1714  +
            Ok(
        1715  +
                /* ServerBuilderGenerator.kt:542 */
        1716  +
                crate::error::UnsupportedRegionError {
        1717  +
                    /* ServerBuilderGenerator.kt:546 */
        1718  +
                    region: self
        1719  +
                        .region
        1720  +
                        /* ServerBuilderGenerator.kt:569 */
        1721  +
                        .ok_or(ConstraintViolation::MissingRegion)?,
        1722  +
                    /* ServerBuilderGenerator.kt:542 */
        1723  +
                }, /* ServerBuilderGenerator.kt:287 */
        1724  +
            )
        1725  +
            /* ServerBuilderGenerator.kt:283 */
        1726  +
        }
        1727  +
        /* ServerBuilderGenerator.kt:215 */
        1728  +
    }
        1729  +
        1730  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
        1731  +
}