Server Test

Server Test

rev. ee474c7509d7728618c23068f3741e8e5b339ef9 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,290 @@
           1  +
#![allow(deprecated)]
           2  +
#![allow(unknown_lints)]
           3  +
#![allow(clippy::module_inception)]
           4  +
#![allow(clippy::upper_case_acronyms)]
           5  +
#![allow(clippy::large_enum_variant)]
           6  +
#![allow(clippy::wrong_self_convention)]
           7  +
#![allow(clippy::should_implement_trait)]
           8  +
#![allow(clippy::disallowed_names)]
           9  +
#![allow(clippy::vec_init_then_push)]
          10  +
#![allow(clippy::type_complexity)]
          11  +
#![allow(clippy::needless_return)]
          12  +
#![allow(clippy::derive_partial_eq_without_eq)]
          13  +
#![allow(clippy::result_large_err)]
          14  +
#![allow(clippy::unnecessary_map_on_constructor)]
          15  +
#![allow(clippy::deprecated_semver)]
          16  +
#![allow(clippy::uninlined_format_args)]
          17  +
#![allow(rustdoc::bare_urls)]
          18  +
#![allow(rustdoc::redundant_explicit_links)]
          19  +
#![allow(rustdoc::invalid_html_tags)]
          20  +
#![forbid(unsafe_code)]
          21  +
#![cfg_attr(docsrs, feature(doc_cfg))]
          22  +
//! The Pokémon Service allows you to retrieve information about Pokémon species.
          23  +
          24  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          25  +
/* ServerRootGenerator.kt:207 */
          26  +
//! A fast and customizable Rust implementation of the PokemonService Smithy service.
          27  +
//!
          28  +
//! # Using PokemonService
          29  +
//!
          30  +
//! The primary entrypoint is [`PokemonService`]: it satisfies the [`Service<http::Request, Response = http::Response>`](::tower::Service)
          31  +
//! trait and therefore can be handed to a [`hyper` server](https://github.com/hyperium/hyper) via [`PokemonService::into_make_service`]
          32  +
//! or used in AWS Lambda
          33  +
#![cfg_attr(
          34  +
    feature = "aws-lambda",
          35  +
    doc = " via [`LambdaHandler`](crate::server::routing::LambdaHandler)."
          36  +
)]
          37  +
#![cfg_attr(
          38  +
    not(feature = "aws-lambda"),
          39  +
    doc = " by enabling the `aws-lambda` feature flag and utilizing the `LambdaHandler`."
          40  +
)]
          41  +
//! The [`crate::input`], [`crate::output`], and [`crate::error`]
          42  +
//! modules provide the types used in each operation.
          43  +
//!
          44  +
//! ### Running on Hyper
          45  +
//!
          46  +
//! ```rust,no_run
          47  +
//! # use std::net::SocketAddr;
          48  +
//! # async fn dummy() {
          49  +
//! use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
          50  +
//!
          51  +
//! # let app = PokemonService::builder(
          52  +
//! #     PokemonServiceConfig::builder()
          53  +
//! #         .build()
          54  +
//! # ).build_unchecked();
          55  +
//! let server = app.into_make_service();
          56  +
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
          57  +
//!     .expect("unable to parse the server bind address and port");
          58  +
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          59  +
//! # }
          60  +
//!
          61  +
//! ```
          62  +
//!
          63  +
//! ### Running on Lambda
          64  +
//!
          65  +
//! ```rust,ignore
          66  +
//! use pokemon_service_server_sdk_http0x::server::routing::LambdaHandler;
          67  +
//! use pokemon_service_server_sdk_http0x::PokemonService;
          68  +
//!
          69  +
//! # async fn dummy() {
          70  +
//! # let app = PokemonService::builder(
          71  +
//! #     PokemonServiceConfig::builder()
          72  +
//! #         .build()
          73  +
//! # ).build_unchecked();
          74  +
//! let handler = LambdaHandler::new(app);
          75  +
//! lambda_http::run(handler).await.unwrap();
          76  +
//! # }
          77  +
//! ```
          78  +
//!
          79  +
//! # Building the PokemonService
          80  +
//!
          81  +
//! To construct [`PokemonService`] we use [`PokemonServiceBuilder`] returned by [`PokemonService::builder`].
          82  +
//!
          83  +
//! ## Plugins
          84  +
//!
          85  +
//! The [`PokemonService::builder`] method, returning [`PokemonServiceBuilder`],
          86  +
//! accepts a config object on which plugins can be registered.
          87  +
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
          88  +
//!
          89  +
//! ```rust,no_run
          90  +
//! # use pokemon_service_server_sdk_http0x::server::plugin::IdentityPlugin as LoggingPlugin;
          91  +
//! # use pokemon_service_server_sdk_http0x::server::plugin::IdentityPlugin as MetricsPlugin;
          92  +
//! # use ::hyper::Body;
          93  +
//! use pokemon_service_server_sdk_http0x::server::plugin::HttpPlugins;
          94  +
//! use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig, PokemonServiceBuilder};
          95  +
//!
          96  +
//! let http_plugins = HttpPlugins::new()
          97  +
//!         .push(LoggingPlugin)
          98  +
//!         .push(MetricsPlugin);
          99  +
//! let config = PokemonServiceConfig::builder().build();
         100  +
//! let builder: PokemonServiceBuilder<::hyper::Body, _, _, _> = PokemonService::builder(config);
         101  +
//! ```
         102  +
//!
         103  +
//! Check out [`crate::server::plugin`] to learn more about plugins.
         104  +
//!
         105  +
//! ## Handlers
         106  +
//!
         107  +
//! [`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.
         108  +
//! We call these async functions **handlers**. This is where your application business logic lives.
         109  +
//!
         110  +
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
         111  +
//!
         112  +
//! * A `Result<Output, Error>` if your operation has modeled errors, or
         113  +
//! * An `Output` otherwise.
         114  +
//!
         115  +
//! ```rust,no_run
         116  +
//! # struct Input;
         117  +
//! # struct Output;
         118  +
//! # struct Error;
         119  +
//! async fn infallible_handler(input: Input) -> Output { todo!() }
         120  +
//!
         121  +
//! async fn fallible_handler(input: Input) -> Result<Output, Error> { todo!() }
         122  +
//! ```
         123  +
//!
         124  +
//! Handlers can accept up to 8 extractors:
         125  +
//!
         126  +
//! ```rust,no_run
         127  +
//! # struct Input;
         128  +
//! # struct Output;
         129  +
//! # struct Error;
         130  +
//! # struct State;
         131  +
//! # use std::net::SocketAddr;
         132  +
//! use pokemon_service_server_sdk_http0x::server::request::{extension::Extension, connect_info::ConnectInfo};
         133  +
//!
         134  +
//! async fn handler_with_no_extensions(input: Input) -> Output {
         135  +
//!     todo!()
         136  +
//! }
         137  +
//!
         138  +
//! async fn handler_with_one_extractor(input: Input, ext: Extension<State>) -> Output {
         139  +
//!     todo!()
         140  +
//! }
         141  +
//!
         142  +
//! async fn handler_with_two_extractors(
         143  +
//!     input: Input,
         144  +
//!     ext0: Extension<State>,
         145  +
//!     ext1: ConnectInfo<SocketAddr>,
         146  +
//! ) -> Output {
         147  +
//!     todo!()
         148  +
//! }
         149  +
//! ```
         150  +
//!
         151  +
//! See the [`operation module`](crate::operation) for information on precisely what constitutes a handler.
         152  +
//!
         153  +
//! ## Build
         154  +
//!
         155  +
//! You can convert [`PokemonServiceBuilder`] into [`PokemonService`] using either [`PokemonServiceBuilder::build`] or [`PokemonServiceBuilder::build_unchecked`].
         156  +
//!
         157  +
//! [`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.
         158  +
//!
         159  +
//! [`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.
         160  +
//! [`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!).
         161  +
//!
         162  +
//! # Example
         163  +
//!
         164  +
//! ```rust,no_run
         165  +
//! # use std::net::SocketAddr;
         166  +
//! use pokemon_service_server_sdk_http0x::{PokemonService, PokemonServiceConfig};
         167  +
//!
         168  +
//! #[::tokio::main]
         169  +
//! pub async fn main() {
         170  +
//!    let config = PokemonServiceConfig::builder().build();
         171  +
//!    let app = PokemonService::builder(config)
         172  +
//!        .capture_pokemon(capture_pokemon)
         173  +
//!        .check_health(check_health)
         174  +
//!        .do_nothing(do_nothing)
         175  +
//!        .get_pokemon_species(get_pokemon_species)
         176  +
//!        .get_server_statistics(get_server_statistics)
         177  +
//!        .get_storage(get_storage)
         178  +
//!        .stream_pokemon_radio(stream_pokemon_radio)
         179  +
//!        .build()
         180  +
//!        .expect("failed to build an instance of PokemonService");
         181  +
//!
         182  +
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
         183  +
//!        .expect("unable to parse the server bind address and port");
         184  +
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         185  +
//!    # let server = async { Ok::<_, ()>(()) };
         186  +
//!
         187  +
//!    // Run your service!
         188  +
//!    if let Err(err) = server.await {
         189  +
//!        eprintln!("server error: {:?}", err);
         190  +
//!    }
         191  +
//! }
         192  +
//!
         193  +
//! use pokemon_service_server_sdk_http0x::{input, output, error};
         194  +
//!
         195  +
//! async fn capture_pokemon(input: input::CapturePokemonInput) -> Result<output::CapturePokemonOutput, error::CapturePokemonError> {
         196  +
//!     todo!()
         197  +
//! }
         198  +
//!
         199  +
//! async fn check_health(input: input::CheckHealthInput) -> output::CheckHealthOutput {
         200  +
//!     todo!()
         201  +
//! }
         202  +
//!
         203  +
//! async fn do_nothing(input: input::DoNothingInput) -> output::DoNothingOutput {
         204  +
//!     todo!()
         205  +
//! }
         206  +
//!
         207  +
//! async fn get_pokemon_species(input: input::GetPokemonSpeciesInput) -> Result<output::GetPokemonSpeciesOutput, error::GetPokemonSpeciesError> {
         208  +
//!     todo!()
         209  +
//! }
         210  +
//!
         211  +
//! async fn get_server_statistics(input: input::GetServerStatisticsInput) -> output::GetServerStatisticsOutput {
         212  +
//!     todo!()
         213  +
//! }
         214  +
//!
         215  +
//! async fn get_storage(input: input::GetStorageInput) -> Result<output::GetStorageOutput, error::GetStorageError> {
         216  +
//!     todo!()
         217  +
//! }
         218  +
//!
         219  +
//! async fn stream_pokemon_radio(input: input::StreamPokemonRadioInput) -> output::StreamPokemonRadioOutput {
         220  +
//!     todo!()
         221  +
//! }
         222  +
//!
         223  +
//! ```
         224  +
//!
         225  +
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         226  +
//! [hyper server]: https://docs.rs/hyper/0.14.26/hyper/server/index.html
         227  +
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
         228  +
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
         229  +
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
         230  +
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         231  +
/* ServerRootGenerator.kt:403 */
         232  +
pub use crate::service::{
         233  +
    MissingOperationsError, PokemonService, PokemonServiceBuilder, PokemonServiceConfig,
         234  +
    PokemonServiceConfigBuilder,
         235  +
};
         236  +
         237  +
/// /* ServerRustModule.kt:55 */Contains the types that are re-exported from the `aws-smithy-http-server` crate.
         238  +
pub mod server {
         239  +
    // Re-export all types from the `aws-smithy-http-server` crate.
         240  +
    pub use ::aws_smithy_legacy_http_server::*;
         241  +
         242  +
    /* CodegenDelegator.kt:203 */
         243  +
}
         244  +
         245  +
/* CrateVersionCustomization.kt:23 */
         246  +
/// Crate version number.
         247  +
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
         248  +
         249  +
/// /* ServerRustModule.kt:55 */All error types that operations can return. Documentation on these types is copied from the model.
         250  +
pub mod error;
         251  +
         252  +
/// /* ServerRustModule.kt:55 */Input structures for operations. Documentation on these types is copied from the model.
         253  +
pub mod input;
         254  +
         255  +
/// /* ServerRustModule.kt:55 */Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
         256  +
pub mod model;
         257  +
         258  +
/// /* ServerRustModule.kt:55 */All operations that this crate can perform.
         259  +
pub mod operation;
         260  +
         261  +
/* ServerRustModule.kt:79 */
         262  +
/// A collection of types representing each operation defined in the service closure.
         263  +
///
         264  +
/// The [plugin system](::aws_smithy_legacy_http_server::plugin) makes use of these
         265  +
/// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
         266  +
/// parameterize [`Plugin`](::aws_smithy_legacy_http_server::plugin::Plugin) implementations. Their traits, such as
         267  +
/// [`OperationShape`](::aws_smithy_legacy_http_server::operation::OperationShape), can be used to provide
         268  +
/// operation specific information to the [`Layer`](::tower::Layer) being applied.
         269  +
pub mod operation_shape;
         270  +
         271  +
/// /* ServerRustModule.kt:55 */Output structures for operations. Documentation on these types is copied from the model.
         272  +
pub mod output;
         273  +
         274  +
/* RustModule.kt:172 */
         275  +
mod service;
         276  +
         277  +
/// /* ServerRustModule.kt:55 */Data primitives referenced by other data types.
         278  +
pub mod types;
         279  +
         280  +
/// /* ServerRustModule.kt:55 */Constrained types for constrained shapes.
         281  +
/* RustModule.kt:172 */
         282  +
mod constrained;
         283  +
         284  +
/* RustModule.kt:172 */
         285  +
mod mimes;
         286  +
         287  +
/* RustModule.kt:172 */
         288  +
mod event_stream_serde;
         289  +
         290  +
pub(crate) mod protocol_serde;

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

@@ -0,1 +0,25 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:390 */
           3  +
pub(crate) static CONTENT_TYPE_APPLICATION_JSON: std::sync::LazyLock<::mime::Mime> =
           4  +
    std::sync::LazyLock::new(|| {
           5  +
        "application/json"
           6  +
            .parse::<::mime::Mime>()
           7  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
           8  +
    });
           9  +
          10  +
/* ServerHttpBoundProtocolGenerator.kt:390 */
          11  +
pub(crate) static CONTENT_TYPE_APPLICATION_OCTET_STREAM: std::sync::LazyLock<::mime::Mime> =
          12  +
    std::sync::LazyLock::new(|| {
          13  +
        "application/octet-stream"
          14  +
            .parse::<::mime::Mime>()
          15  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
          16  +
    });
          17  +
          18  +
/* ServerHttpBoundProtocolGenerator.kt:390 */
          19  +
pub(crate) static CONTENT_TYPE_APPLICATION_VND_AMAZON_EVENTSTREAM: std::sync::LazyLock<
          20  +
    ::mime::Mime,
          21  +
> = std::sync::LazyLock::new(|| {
          22  +
    "application/vnd.amazon.eventstream"
          23  +
        .parse::<::mime::Mime>()
          24  +
        .expect("BUG: MIME parsing failed, content_type is not valid")
          25  +
});

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

@@ -0,1 +0,933 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */Describes one specific validation failure for an input member.
           4  +
/* RustType.kt:534 */
           5  +
#[derive(
           6  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
           7  +
)]
           8  +
pub /* StructureGenerator.kt:201 */ struct ValidationExceptionField {
           9  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          10  +
    pub path: ::std::string::String,
          11  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
          12  +
    pub message: ::std::string::String,
          13  +
    /* StructureGenerator.kt:201 */
          14  +
}
          15  +
/* StructureGenerator.kt:135 */
          16  +
impl ValidationExceptionField {
          17  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          18  +
    /* StructureGenerator.kt:166 */
          19  +
    pub fn path(&self) -> &str {
          20  +
        /* StructureGenerator.kt:171 */
          21  +
        use std::ops::Deref;
          22  +
        self.path.deref()
          23  +
        /* StructureGenerator.kt:166 */
          24  +
    }
          25  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
          26  +
    /* StructureGenerator.kt:166 */
          27  +
    pub fn message(&self) -> &str {
          28  +
        /* StructureGenerator.kt:171 */
          29  +
        use std::ops::Deref;
          30  +
        self.message.deref()
          31  +
        /* StructureGenerator.kt:166 */
          32  +
    }
          33  +
    /* StructureGenerator.kt:135 */
          34  +
}
          35  +
/* ServerCodegenVisitor.kt:356 */
          36  +
impl ValidationExceptionField {
          37  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
          38  +
    /* ServerBuilderGenerator.kt:295 */
          39  +
    pub fn builder() -> crate::model::validation_exception_field::Builder {
          40  +
        /* ServerBuilderGenerator.kt:296 */
          41  +
        crate::model::validation_exception_field::Builder::default()
          42  +
        /* ServerBuilderGenerator.kt:295 */
          43  +
    }
          44  +
    /* ServerCodegenVisitor.kt:356 */
          45  +
}
          46  +
          47  +
/* StructureGenerator.kt:197 */
          48  +
#[allow(missing_docs)] // documentation missing in model
          49  +
/* RustType.kt:534 */
          50  +
#[derive(
          51  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          52  +
)]
          53  +
pub /* StructureGenerator.kt:201 */ struct FlavorText {
          54  +
    /// /* StructureGenerator.kt:231 */The localized flavor text for an API resource in a specific language.
          55  +
    pub flavor_text: ::std::string::String,
          56  +
    /// /* StructureGenerator.kt:231 */The language this name is in.
          57  +
    pub language: crate::model::Language,
          58  +
    /* StructureGenerator.kt:201 */
          59  +
}
          60  +
/* StructureGenerator.kt:135 */
          61  +
impl FlavorText {
          62  +
    /// /* StructureGenerator.kt:231 */The localized flavor text for an API resource in a specific language.
          63  +
    /* StructureGenerator.kt:166 */
          64  +
    pub fn flavor_text(&self) -> &str {
          65  +
        /* StructureGenerator.kt:171 */
          66  +
        use std::ops::Deref;
          67  +
        self.flavor_text.deref()
          68  +
        /* StructureGenerator.kt:166 */
          69  +
    }
          70  +
    /// /* StructureGenerator.kt:231 */The language this name is in.
          71  +
    /* StructureGenerator.kt:166 */
          72  +
    pub fn language(&self) -> &crate::model::Language {
          73  +
        /* StructureGenerator.kt:172 */
          74  +
        &self.language
          75  +
        /* StructureGenerator.kt:166 */
          76  +
    }
          77  +
    /* StructureGenerator.kt:135 */
          78  +
}
          79  +
/* ServerCodegenVisitor.kt:356 */
          80  +
impl FlavorText {
          81  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`FlavorText`](crate::model::FlavorText).
          82  +
    /* ServerBuilderGenerator.kt:295 */
          83  +
    pub fn builder() -> crate::model::flavor_text::Builder {
          84  +
        /* ServerBuilderGenerator.kt:296 */
          85  +
        crate::model::flavor_text::Builder::default()
          86  +
        /* ServerBuilderGenerator.kt:295 */
          87  +
    }
          88  +
    /* ServerCodegenVisitor.kt:356 */
          89  +
}
          90  +
          91  +
/// /* EnumGenerator.kt:183 */Supported languages for FlavorText entries.
          92  +
/* RustType.kt:534 */
          93  +
#[derive(
          94  +
    ::std::clone::Clone,
          95  +
    ::std::cmp::Eq,
          96  +
    ::std::cmp::Ord,
          97  +
    ::std::cmp::PartialEq,
          98  +
    ::std::cmp::PartialOrd,
          99  +
    ::std::fmt::Debug,
         100  +
    ::std::hash::Hash,
         101  +
)]
         102  +
pub /* EnumGenerator.kt:298 */ enum Language {
         103  +
    /// /* EnumGenerator.kt:183 */American English.
         104  +
    /* EnumGenerator.kt:170 */
         105  +
    English,
         106  +
    /// /* EnumGenerator.kt:183 */Español.
         107  +
    /* EnumGenerator.kt:170 */
         108  +
    Spanish,
         109  +
    /// /* EnumGenerator.kt:183 */Italiano.
         110  +
    /* EnumGenerator.kt:170 */
         111  +
    Italian,
         112  +
    /// /* EnumGenerator.kt:183 */日本語。
         113  +
    /* EnumGenerator.kt:170 */
         114  +
    Japanese,
         115  +
    /* EnumGenerator.kt:298 */
         116  +
}
         117  +
/// /* CodegenDelegator.kt:52 */See [`Language`](crate::model::Language).
         118  +
pub mod language {
         119  +
    #[derive(Debug, PartialEq)]
         120  +
    pub struct ConstraintViolation(pub(crate) ::std::string::String);
         121  +
         122  +
    impl ::std::fmt::Display for ConstraintViolation {
         123  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         124  +
            write!(
         125  +
                f,
         126  +
                r#"Value provided for 'com.aws.example#Language' failed to satisfy constraint: Member must satisfy enum value set: [en, es, it, jp]"#
         127  +
            )
         128  +
        }
         129  +
    }
         130  +
         131  +
    impl ::std::error::Error for ConstraintViolation {}
         132  +
         133  +
    /* ServerEnumGenerator.kt:47 */
         134  +
}
         135  +
/* ServerEnumGenerator.kt:88 */
         136  +
impl ::std::convert::TryFrom<&str> for Language {
         137  +
    type Error = crate::model::language::ConstraintViolation;
         138  +
    fn try_from(
         139  +
        s: &str,
         140  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
         141  +
        match s {
         142  +
            "en" => Ok(Language::English),
         143  +
            "es" => Ok(Language::Spanish),
         144  +
            "it" => Ok(Language::Italian),
         145  +
            "jp" => Ok(Language::Japanese),
         146  +
            _ => Err(crate::model::language::ConstraintViolation(s.to_owned())),
         147  +
        }
         148  +
    }
         149  +
}
         150  +
impl ::std::convert::TryFrom<::std::string::String> for Language {
         151  +
    type Error = crate::model::language::ConstraintViolation;
         152  +
    fn try_from(
         153  +
        s: ::std::string::String,
         154  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
         155  +
    {
         156  +
        s.as_str().try_into()
         157  +
    }
         158  +
}
         159  +
/* ServerEnumGenerator.kt:148 */
         160  +
impl std::str::FromStr for Language {
         161  +
    type Err = crate::model::language::ConstraintViolation;
         162  +
    fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
         163  +
        Self::try_from(s)
         164  +
    }
         165  +
}
         166  +
/* EnumGenerator.kt:309 */
         167  +
impl Language {
         168  +
    /// Returns the `&str` value of the enum member.
         169  +
    pub fn as_str(&self) -> &str {
         170  +
        match self {
         171  +
            Language::English => "en",
         172  +
            Language::Spanish => "es",
         173  +
            Language::Italian => "it",
         174  +
            Language::Japanese => "jp",
         175  +
        }
         176  +
    }
         177  +
    /// Returns all the `&str` representations of the enum members.
         178  +
    pub const fn values() -> &'static [&'static str] {
         179  +
        &["en", "es", "it", "jp"]
         180  +
    }
         181  +
}
         182  +
/* EnumGenerator.kt:254 */
         183  +
impl ::std::convert::AsRef<str> for Language {
         184  +
    fn as_ref(&self) -> &str {
         185  +
        self.as_str()
         186  +
    }
         187  +
}
         188  +
/* ConstrainedTraitForEnumGenerator.kt:36 */
         189  +
impl crate::constrained::Constrained for Language {
         190  +
    type Unconstrained = ::std::string::String;
         191  +
}
         192  +
         193  +
impl ::std::convert::From<::std::string::String>
         194  +
    for crate::constrained::MaybeConstrained<crate::model::Language>
         195  +
{
         196  +
    fn from(value: ::std::string::String) -> Self {
         197  +
        Self::Unconstrained(value)
         198  +
    }
         199  +
}
         200  +
         201  +
/* UnionGenerator.kt:67 */
         202  +
#[allow(missing_docs)] // documentation missing in model
         203  +
/* RustType.kt:534 */
         204  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
         205  +
pub /* UnionGenerator.kt:85 */ enum CapturePokemonEvents {
         206  +
    /* UnionGenerator.kt:90 */
         207  +
    #[allow(missing_docs)] // documentation missing in model
         208  +
    /* UnionGenerator.kt:190 */
         209  +
    Event(crate::model::CaptureEvent),
         210  +
    /* UnionGenerator.kt:85 */
         211  +
}
         212  +
/* UnionGenerator.kt:111 */
         213  +
impl CapturePokemonEvents {
         214  +
    /* RustType.kt:534 */
         215  +
    #[allow(irrefutable_let_patterns)]
         216  +
    /* UnionGenerator.kt:217 */
         217  +
    /// Tries to convert the enum instance into [`Event`](crate::model::CapturePokemonEvents::Event), extracting the inner [`CaptureEvent`](crate::model::CaptureEvent).
         218  +
    /* UnionGenerator.kt:222 */
         219  +
    /// Returns `Err(&Self)` if it can't be converted.
         220  +
    /* UnionGenerator.kt:223 */
         221  +
    pub fn as_event(&self) -> ::std::result::Result<&crate::model::CaptureEvent, &Self> {
         222  +
        /* UnionGenerator.kt:227 */
         223  +
        if let CapturePokemonEvents::Event(val) = &self {
         224  +
            ::std::result::Result::Ok(val)
         225  +
        } else {
         226  +
            ::std::result::Result::Err(self)
         227  +
        }
         228  +
        /* UnionGenerator.kt:223 */
         229  +
    }
         230  +
    /* UnionGenerator.kt:121 */
         231  +
    /// Returns true if this is a [`Event`](crate::model::CapturePokemonEvents::Event).
         232  +
    /* UnionGenerator.kt:122 */
         233  +
    pub fn is_event(&self) -> bool {
         234  +
        /* UnionGenerator.kt:123 */
         235  +
        self.as_event().is_ok()
         236  +
        /* UnionGenerator.kt:122 */
         237  +
    }
         238  +
    /* UnionGenerator.kt:111 */
         239  +
}
         240  +
         241  +
/* StructureGenerator.kt:197 */
         242  +
#[allow(missing_docs)] // documentation missing in model
         243  +
/* RustType.kt:534 */
         244  +
#[derive(
         245  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         246  +
)]
         247  +
pub /* StructureGenerator.kt:201 */ struct CaptureEvent {
         248  +
    /* StructureGenerator.kt:231 */
         249  +
    #[allow(missing_docs)] // documentation missing in model
         250  +
    pub name: ::std::option::Option<::std::string::String>,
         251  +
    /* StructureGenerator.kt:231 */
         252  +
    #[allow(missing_docs)] // documentation missing in model
         253  +
    pub captured: ::std::option::Option<bool>,
         254  +
    /* StructureGenerator.kt:231 */
         255  +
    #[allow(missing_docs)] // documentation missing in model
         256  +
    pub shiny: ::std::option::Option<bool>,
         257  +
    /* StructureGenerator.kt:231 */
         258  +
    #[allow(missing_docs)] // documentation missing in model
         259  +
    pub pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
         260  +
    /* StructureGenerator.kt:201 */
         261  +
}
         262  +
/* StructureGenerator.kt:135 */
         263  +
impl CaptureEvent {
         264  +
    /* StructureGenerator.kt:231 */
         265  +
    #[allow(missing_docs)] // documentation missing in model
         266  +
                           /* StructureGenerator.kt:166 */
         267  +
    pub fn name(&self) -> ::std::option::Option<&str> {
         268  +
        /* StructureGenerator.kt:169 */
         269  +
        self.name.as_deref()
         270  +
        /* StructureGenerator.kt:166 */
         271  +
    }
         272  +
    /* StructureGenerator.kt:231 */
         273  +
    #[allow(missing_docs)] // documentation missing in model
         274  +
                           /* StructureGenerator.kt:166 */
         275  +
    pub fn captured(&self) -> ::std::option::Option<bool> {
         276  +
        /* StructureGenerator.kt:168 */
         277  +
        self.captured
         278  +
        /* StructureGenerator.kt:166 */
         279  +
    }
         280  +
    /* StructureGenerator.kt:231 */
         281  +
    #[allow(missing_docs)] // documentation missing in model
         282  +
                           /* StructureGenerator.kt:166 */
         283  +
    pub fn shiny(&self) -> ::std::option::Option<bool> {
         284  +
        /* StructureGenerator.kt:168 */
         285  +
        self.shiny
         286  +
        /* StructureGenerator.kt:166 */
         287  +
    }
         288  +
    /* StructureGenerator.kt:231 */
         289  +
    #[allow(missing_docs)] // documentation missing in model
         290  +
                           /* StructureGenerator.kt:166 */
         291  +
    pub fn pokedex_update(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
         292  +
        /* StructureGenerator.kt:170 */
         293  +
        self.pokedex_update.as_ref()
         294  +
        /* StructureGenerator.kt:166 */
         295  +
    }
         296  +
    /* StructureGenerator.kt:135 */
         297  +
}
         298  +
/* ServerCodegenVisitor.kt:356 */
         299  +
impl CaptureEvent {
         300  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CaptureEvent`](crate::model::CaptureEvent).
         301  +
    /* ServerBuilderGenerator.kt:295 */
         302  +
    pub fn builder() -> crate::model::capture_event::Builder {
         303  +
        /* ServerBuilderGenerator.kt:296 */
         304  +
        crate::model::capture_event::Builder::default()
         305  +
        /* ServerBuilderGenerator.kt:295 */
         306  +
    }
         307  +
    /* ServerCodegenVisitor.kt:356 */
         308  +
}
         309  +
         310  +
/* UnionGenerator.kt:67 */
         311  +
#[allow(missing_docs)] // documentation missing in model
         312  +
/* RustType.kt:534 */
         313  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
         314  +
pub /* UnionGenerator.kt:85 */ enum AttemptCapturingPokemonEvent {
         315  +
    /* UnionGenerator.kt:90 */
         316  +
    #[allow(missing_docs)] // documentation missing in model
         317  +
    /* UnionGenerator.kt:190 */
         318  +
    Event(crate::model::CapturingEvent),
         319  +
    /* UnionGenerator.kt:85 */
         320  +
}
         321  +
/* UnionGenerator.kt:111 */
         322  +
impl AttemptCapturingPokemonEvent {
         323  +
    /* RustType.kt:534 */
         324  +
    #[allow(irrefutable_let_patterns)]
         325  +
    /* UnionGenerator.kt:217 */
         326  +
    /// Tries to convert the enum instance into [`Event`](crate::model::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::model::CapturingEvent).
         327  +
    /* UnionGenerator.kt:222 */
         328  +
    /// Returns `Err(&Self)` if it can't be converted.
         329  +
    /* UnionGenerator.kt:223 */
         330  +
    pub fn as_event(&self) -> ::std::result::Result<&crate::model::CapturingEvent, &Self> {
         331  +
        /* UnionGenerator.kt:227 */
         332  +
        if let AttemptCapturingPokemonEvent::Event(val) = &self {
         333  +
            ::std::result::Result::Ok(val)
         334  +
        } else {
         335  +
            ::std::result::Result::Err(self)
         336  +
        }
         337  +
        /* UnionGenerator.kt:223 */
         338  +
    }
         339  +
    /* UnionGenerator.kt:121 */
         340  +
    /// Returns true if this is a [`Event`](crate::model::AttemptCapturingPokemonEvent::Event).
         341  +
    /* UnionGenerator.kt:122 */
         342  +
    pub fn is_event(&self) -> bool {
         343  +
        /* UnionGenerator.kt:123 */
         344  +
        self.as_event().is_ok()
         345  +
        /* UnionGenerator.kt:122 */
         346  +
    }
         347  +
    /* UnionGenerator.kt:111 */
         348  +
}
         349  +
         350  +
/* StructureGenerator.kt:197 */
         351  +
#[allow(missing_docs)] // documentation missing in model
         352  +
/* RustType.kt:534 */
         353  +
#[derive(
         354  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         355  +
)]
         356  +
pub /* StructureGenerator.kt:201 */ struct CapturingEvent {
         357  +
    /* StructureGenerator.kt:231 */
         358  +
    #[allow(missing_docs)] // documentation missing in model
         359  +
    pub payload: ::std::option::Option<crate::model::CapturingPayload>,
         360  +
    /* StructureGenerator.kt:201 */
         361  +
}
         362  +
/* StructureGenerator.kt:135 */
         363  +
impl CapturingEvent {
         364  +
    /* StructureGenerator.kt:231 */
         365  +
    #[allow(missing_docs)] // documentation missing in model
         366  +
                           /* StructureGenerator.kt:166 */
         367  +
    pub fn payload(&self) -> ::std::option::Option<&crate::model::CapturingPayload> {
         368  +
        /* StructureGenerator.kt:170 */
         369  +
        self.payload.as_ref()
         370  +
        /* StructureGenerator.kt:166 */
         371  +
    }
         372  +
    /* StructureGenerator.kt:135 */
         373  +
}
         374  +
/* ServerCodegenVisitor.kt:356 */
         375  +
impl CapturingEvent {
         376  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CapturingEvent`](crate::model::CapturingEvent).
         377  +
    /* ServerBuilderGenerator.kt:295 */
         378  +
    pub fn builder() -> crate::model::capturing_event::Builder {
         379  +
        /* ServerBuilderGenerator.kt:296 */
         380  +
        crate::model::capturing_event::Builder::default()
         381  +
        /* ServerBuilderGenerator.kt:295 */
         382  +
    }
         383  +
    /* ServerCodegenVisitor.kt:356 */
         384  +
}
         385  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
         386  +
impl crate::constrained::Constrained for crate::model::CapturingEvent {
         387  +
    type Unconstrained = crate::model::capturing_event::Builder;
         388  +
}
         389  +
         390  +
/* StructureGenerator.kt:197 */
         391  +
#[allow(missing_docs)] // documentation missing in model
         392  +
/* RustType.kt:534 */
         393  +
#[derive(
         394  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         395  +
)]
         396  +
pub /* StructureGenerator.kt:201 */ struct CapturingPayload {
         397  +
    /* StructureGenerator.kt:231 */
         398  +
    #[allow(missing_docs)] // documentation missing in model
         399  +
    pub name: ::std::option::Option<::std::string::String>,
         400  +
    /* StructureGenerator.kt:231 */
         401  +
    #[allow(missing_docs)] // documentation missing in model
         402  +
    pub pokeball: ::std::option::Option<::std::string::String>,
         403  +
    /* StructureGenerator.kt:201 */
         404  +
}
         405  +
/* StructureGenerator.kt:135 */
         406  +
impl CapturingPayload {
         407  +
    /* StructureGenerator.kt:231 */
         408  +
    #[allow(missing_docs)] // documentation missing in model
         409  +
                           /* StructureGenerator.kt:166 */
         410  +
    pub fn name(&self) -> ::std::option::Option<&str> {
         411  +
        /* StructureGenerator.kt:169 */
         412  +
        self.name.as_deref()
         413  +
        /* StructureGenerator.kt:166 */
         414  +
    }
         415  +
    /* StructureGenerator.kt:231 */
         416  +
    #[allow(missing_docs)] // documentation missing in model
         417  +
                           /* StructureGenerator.kt:166 */
         418  +
    pub fn pokeball(&self) -> ::std::option::Option<&str> {
         419  +
        /* StructureGenerator.kt:169 */
         420  +
        self.pokeball.as_deref()
         421  +
        /* StructureGenerator.kt:166 */
         422  +
    }
         423  +
    /* StructureGenerator.kt:135 */
         424  +
}
         425  +
/* ServerCodegenVisitor.kt:356 */
         426  +
impl CapturingPayload {
         427  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CapturingPayload`](crate::model::CapturingPayload).
         428  +
    /* ServerBuilderGenerator.kt:295 */
         429  +
    pub fn builder() -> crate::model::capturing_payload::Builder {
         430  +
        /* ServerBuilderGenerator.kt:296 */
         431  +
        crate::model::capturing_payload::Builder::default()
         432  +
        /* ServerBuilderGenerator.kt:295 */
         433  +
    }
         434  +
    /* ServerCodegenVisitor.kt:356 */
         435  +
}
         436  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
         437  +
impl crate::constrained::Constrained for crate::model::CapturingPayload {
         438  +
    type Unconstrained = crate::model::capturing_payload::Builder;
         439  +
}
         440  +
/// /* ServerBuilderGenerator.kt:171 */See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         441  +
pub mod validation_exception_field {
         442  +
         443  +
    /* RustType.kt:534 */
         444  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         445  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         446  +
    /* RustType.kt:534 */
         447  +
    #[non_exhaustive]
         448  +
    /* ServerBuilderConstraintViolations.kt:75 */
         449  +
    #[allow(clippy::enum_variant_names)]
         450  +
    pub enum ConstraintViolation {
         451  +
        /// /* ServerBuilderConstraintViolations.kt:137 */`path` was not provided but it is required when building `ValidationExceptionField`.
         452  +
        /* ServerBuilderConstraintViolations.kt:144 */
         453  +
        MissingPath,
         454  +
        /// /* ServerBuilderConstraintViolations.kt:137 */`message` was not provided but it is required when building `ValidationExceptionField`.
         455  +
        /* ServerBuilderConstraintViolations.kt:144 */
         456  +
        MissingMessage,
         457  +
        /* ServerBuilderConstraintViolations.kt:75 */
         458  +
    }
         459  +
    /* ServerBuilderConstraintViolations.kt:116 */
         460  +
    impl ::std::fmt::Display for ConstraintViolation {
         461  +
        /* ServerBuilderConstraintViolations.kt:117 */
         462  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         463  +
            /* ServerBuilderConstraintViolations.kt:118 */
         464  +
            match self {
         465  +
                /* ServerBuilderConstraintViolations.kt:126 */ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         466  +
                /* ServerBuilderConstraintViolations.kt:126 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         467  +
            /* ServerBuilderConstraintViolations.kt:118 */}
         468  +
            /* ServerBuilderConstraintViolations.kt:117 */
         469  +
        }
         470  +
        /* ServerBuilderConstraintViolations.kt:116 */
         471  +
    }
         472  +
    /* ServerBuilderConstraintViolations.kt:83 */
         473  +
    impl ::std::error::Error for ConstraintViolation {}
         474  +
    /* ServerBuilderGenerator.kt:446 */
         475  +
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
         476  +
        type Error = ConstraintViolation;
         477  +
         478  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         479  +
            builder.build()
         480  +
        }
         481  +
    }
         482  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         483  +
    /* RustType.kt:534 */
         484  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         485  +
    /* ServerBuilderGenerator.kt:211 */
         486  +
    pub struct Builder {
         487  +
        /* ServerBuilderGenerator.kt:308 */
         488  +
        pub(crate) path: ::std::option::Option<::std::string::String>,
         489  +
        /* ServerBuilderGenerator.kt:308 */
         490  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         491  +
        /* ServerBuilderGenerator.kt:211 */
         492  +
    }
         493  +
    /* ServerBuilderGenerator.kt:215 */
         494  +
    impl Builder {
         495  +
        /// /* ServerBuilderGenerator.kt:331 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         496  +
        /* ServerBuilderGenerator.kt:343 */
         497  +
        pub fn path(mut self, input: ::std::string::String) -> Self {
         498  +
            /* ServerBuilderGenerator.kt:344 */
         499  +
            self.path =
         500  +
                /* ServerBuilderGenerator.kt:345 */Some(
         501  +
                    /* ServerBuilderGenerator.kt:376 */input
         502  +
                /* ServerBuilderGenerator.kt:345 */)
         503  +
            /* ServerBuilderGenerator.kt:344 */;
         504  +
            self
         505  +
            /* ServerBuilderGenerator.kt:343 */
         506  +
        }
         507  +
        /// /* ServerBuilderGenerator.kt:331 */A detailed description of the validation failure.
         508  +
        /* ServerBuilderGenerator.kt:343 */
         509  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         510  +
            /* ServerBuilderGenerator.kt:344 */
         511  +
            self.message =
         512  +
                /* ServerBuilderGenerator.kt:345 */Some(
         513  +
                    /* ServerBuilderGenerator.kt:376 */input
         514  +
                /* ServerBuilderGenerator.kt:345 */)
         515  +
            /* ServerBuilderGenerator.kt:344 */;
         516  +
            self
         517  +
            /* ServerBuilderGenerator.kt:343 */
         518  +
        }
         519  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         520  +
        /// /* ServerBuilderGenerator.kt:260 */
         521  +
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
         522  +
        ///
         523  +
        /// /* ServerBuilderGenerator.kt:268 */If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         524  +
        /* ServerBuilderGenerator.kt:271 */
         525  +
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         526  +
            self.build_enforcing_all_constraints()
         527  +
        }
         528  +
        /* ServerBuilderGenerator.kt:283 */
         529  +
        fn build_enforcing_all_constraints(
         530  +
            self,
         531  +
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         532  +
            /* ServerBuilderGenerator.kt:287 */
         533  +
            Ok(
         534  +
                /* ServerBuilderGenerator.kt:542 */
         535  +
                crate::model::ValidationExceptionField {
         536  +
                    /* ServerBuilderGenerator.kt:546 */
         537  +
                    path: self
         538  +
                        .path
         539  +
                        /* ServerBuilderGenerator.kt:569 */
         540  +
                        .ok_or(ConstraintViolation::MissingPath)?,
         541  +
                    /* ServerBuilderGenerator.kt:546 */
         542  +
                    message: self
         543  +
                        .message
         544  +
                        /* ServerBuilderGenerator.kt:569 */
         545  +
                        .ok_or(ConstraintViolation::MissingMessage)?,
         546  +
                    /* ServerBuilderGenerator.kt:542 */
         547  +
                }, /* ServerBuilderGenerator.kt:287 */
         548  +
            )
         549  +
            /* ServerBuilderGenerator.kt:283 */
         550  +
        }
         551  +
        /* ServerBuilderGenerator.kt:215 */
         552  +
    }
         553  +
         554  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
         555  +
}
         556  +
/// /* ServerBuilderGenerator.kt:171 */See [`FlavorText`](crate::model::FlavorText).
         557  +
pub mod flavor_text {
         558  +
         559  +
    /* RustType.kt:534 */
         560  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         561  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         562  +
    /* RustType.kt:534 */
         563  +
    #[non_exhaustive]
         564  +
    /* ServerBuilderConstraintViolations.kt:75 */
         565  +
    #[allow(clippy::enum_variant_names)]
         566  +
    pub enum ConstraintViolation {
         567  +
        /// /* ServerBuilderConstraintViolations.kt:137 */`flavor_text` was not provided but it is required when building `FlavorText`.
         568  +
        /* ServerBuilderConstraintViolations.kt:144 */
         569  +
        MissingFlavorText,
         570  +
        /// /* ServerBuilderConstraintViolations.kt:137 */`language` was not provided but it is required when building `FlavorText`.
         571  +
        /* ServerBuilderConstraintViolations.kt:144 */
         572  +
        MissingLanguage,
         573  +
        /* ServerBuilderConstraintViolations.kt:75 */
         574  +
    }
         575  +
    /* ServerBuilderConstraintViolations.kt:116 */
         576  +
    impl ::std::fmt::Display for ConstraintViolation {
         577  +
        /* ServerBuilderConstraintViolations.kt:117 */
         578  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         579  +
            /* ServerBuilderConstraintViolations.kt:118 */
         580  +
            match self {
         581  +
                /* ServerBuilderConstraintViolations.kt:126 */
         582  +
                ConstraintViolation::MissingFlavorText => write!(
         583  +
                    f,
         584  +
                    "`flavor_text` was not provided but it is required when building `FlavorText`"
         585  +
                ),
         586  +
                /* ServerBuilderConstraintViolations.kt:126 */
         587  +
                ConstraintViolation::MissingLanguage => write!(
         588  +
                    f,
         589  +
                    "`language` was not provided but it is required when building `FlavorText`"
         590  +
                ),
         591  +
                /* ServerBuilderConstraintViolations.kt:118 */
         592  +
            }
         593  +
            /* ServerBuilderConstraintViolations.kt:117 */
         594  +
        }
         595  +
        /* ServerBuilderConstraintViolations.kt:116 */
         596  +
    }
         597  +
    /* ServerBuilderConstraintViolations.kt:83 */
         598  +
    impl ::std::error::Error for ConstraintViolation {}
         599  +
    /* ServerBuilderGenerator.kt:446 */
         600  +
    impl ::std::convert::TryFrom<Builder> for crate::model::FlavorText {
         601  +
        type Error = ConstraintViolation;
         602  +
         603  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         604  +
            builder.build()
         605  +
        }
         606  +
    }
         607  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`FlavorText`](crate::model::FlavorText).
         608  +
    /* RustType.kt:534 */
         609  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         610  +
    /* ServerBuilderGenerator.kt:211 */
         611  +
    pub struct Builder {
         612  +
        /* ServerBuilderGenerator.kt:308 */
         613  +
        pub(crate) flavor_text: ::std::option::Option<::std::string::String>,
         614  +
        /* ServerBuilderGenerator.kt:308 */
         615  +
        pub(crate) language: ::std::option::Option<crate::model::Language>,
         616  +
        /* ServerBuilderGenerator.kt:211 */
         617  +
    }
         618  +
    /* ServerBuilderGenerator.kt:215 */
         619  +
    impl Builder {
         620  +
        /// /* ServerBuilderGenerator.kt:331 */The localized flavor text for an API resource in a specific language.
         621  +
        /* ServerBuilderGenerator.kt:343 */
         622  +
        pub fn flavor_text(mut self, input: ::std::string::String) -> Self {
         623  +
            /* ServerBuilderGenerator.kt:344 */
         624  +
            self.flavor_text =
         625  +
                /* ServerBuilderGenerator.kt:345 */Some(
         626  +
                    /* ServerBuilderGenerator.kt:376 */input
         627  +
                /* ServerBuilderGenerator.kt:345 */)
         628  +
            /* ServerBuilderGenerator.kt:344 */;
         629  +
            self
         630  +
            /* ServerBuilderGenerator.kt:343 */
         631  +
        }
         632  +
        /// /* ServerBuilderGenerator.kt:331 */The language this name is in.
         633  +
        /* ServerBuilderGenerator.kt:343 */
         634  +
        pub fn language(mut self, input: crate::model::Language) -> Self {
         635  +
            /* ServerBuilderGenerator.kt:344 */
         636  +
            self.language =
         637  +
                /* ServerBuilderGenerator.kt:345 */Some(
         638  +
                    /* ServerBuilderGenerator.kt:376 */input
         639  +
                /* ServerBuilderGenerator.kt:345 */)
         640  +
            /* ServerBuilderGenerator.kt:344 */;
         641  +
            self
         642  +
            /* ServerBuilderGenerator.kt:343 */
         643  +
        }
         644  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`FlavorText`](crate::model::FlavorText).
         645  +
        /// /* ServerBuilderGenerator.kt:260 */
         646  +
        /// The builder fails to construct a [`FlavorText`](crate::model::FlavorText) if a [`ConstraintViolation`] occurs.
         647  +
        ///
         648  +
        /// /* ServerBuilderGenerator.kt:268 */If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         649  +
        /* ServerBuilderGenerator.kt:271 */
         650  +
        pub fn build(self) -> Result<crate::model::FlavorText, ConstraintViolation> {
         651  +
            self.build_enforcing_all_constraints()
         652  +
        }
         653  +
        /* ServerBuilderGenerator.kt:283 */
         654  +
        fn build_enforcing_all_constraints(
         655  +
            self,
         656  +
        ) -> Result<crate::model::FlavorText, ConstraintViolation> {
         657  +
            /* ServerBuilderGenerator.kt:287 */
         658  +
            Ok(
         659  +
                /* ServerBuilderGenerator.kt:542 */
         660  +
                crate::model::FlavorText {
         661  +
                    /* ServerBuilderGenerator.kt:546 */
         662  +
                    flavor_text: self
         663  +
                        .flavor_text
         664  +
                        /* ServerBuilderGenerator.kt:569 */
         665  +
                        .ok_or(ConstraintViolation::MissingFlavorText)?,
         666  +
                    /* ServerBuilderGenerator.kt:546 */
         667  +
                    language: self
         668  +
                        .language
         669  +
                        /* ServerBuilderGenerator.kt:569 */
         670  +
                        .ok_or(ConstraintViolation::MissingLanguage)?,
         671  +
                    /* ServerBuilderGenerator.kt:542 */
         672  +
                }, /* ServerBuilderGenerator.kt:287 */
         673  +
            )
         674  +
            /* ServerBuilderGenerator.kt:283 */
         675  +
        }
         676  +
        /* ServerBuilderGenerator.kt:215 */
         677  +
    }
         678  +
         679  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
         680  +
}
         681  +
/// /* ServerBuilderGenerator.kt:171 */See [`CaptureEvent`](crate::model::CaptureEvent).
         682  +
pub mod capture_event {
         683  +
         684  +
    /* ServerBuilderGenerator.kt:461 */
         685  +
    impl ::std::convert::From<Builder> for crate::model::CaptureEvent {
         686  +
        fn from(builder: Builder) -> Self {
         687  +
            builder.build()
         688  +
        }
         689  +
    }
         690  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CaptureEvent`](crate::model::CaptureEvent).
         691  +
    /* RustType.kt:534 */
         692  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         693  +
    /* ServerBuilderGenerator.kt:211 */
         694  +
    pub struct Builder {
         695  +
        /* ServerBuilderGenerator.kt:308 */
         696  +
        pub(crate) name: ::std::option::Option<::std::string::String>,
         697  +
        /* ServerBuilderGenerator.kt:308 */ pub(crate) captured: ::std::option::Option<bool>,
         698  +
        /* ServerBuilderGenerator.kt:308 */ pub(crate) shiny: ::std::option::Option<bool>,
         699  +
        /* ServerBuilderGenerator.kt:308 */
         700  +
        pub(crate) pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
         701  +
        /* ServerBuilderGenerator.kt:211 */
         702  +
    }
         703  +
    /* ServerBuilderGenerator.kt:215 */
         704  +
    impl Builder {
         705  +
        /* ServerBuilderGenerator.kt:331 */
         706  +
        #[allow(missing_docs)] // documentation missing in model
         707  +
                               /* ServerBuilderGenerator.kt:343 */
         708  +
        pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         709  +
            /* ServerBuilderGenerator.kt:344 */
         710  +
            self.name =
         711  +
                /* ServerBuilderGenerator.kt:376 */input
         712  +
            /* ServerBuilderGenerator.kt:344 */;
         713  +
            self
         714  +
            /* ServerBuilderGenerator.kt:343 */
         715  +
        }
         716  +
        /* ServerBuilderGenerator.kt:331 */
         717  +
        #[allow(missing_docs)] // documentation missing in model
         718  +
                               /* ServerBuilderGenerator.kt:343 */
         719  +
        pub fn captured(mut self, input: ::std::option::Option<bool>) -> Self {
         720  +
            /* ServerBuilderGenerator.kt:344 */
         721  +
            self.captured =
         722  +
                /* ServerBuilderGenerator.kt:376 */input
         723  +
            /* ServerBuilderGenerator.kt:344 */;
         724  +
            self
         725  +
            /* ServerBuilderGenerator.kt:343 */
         726  +
        }
         727  +
        /* ServerBuilderGenerator.kt:331 */
         728  +
        #[allow(missing_docs)] // documentation missing in model
         729  +
                               /* ServerBuilderGenerator.kt:343 */
         730  +
        pub fn shiny(mut self, input: ::std::option::Option<bool>) -> Self {
         731  +
            /* ServerBuilderGenerator.kt:344 */
         732  +
            self.shiny =
         733  +
                /* ServerBuilderGenerator.kt:376 */input
         734  +
            /* ServerBuilderGenerator.kt:344 */;
         735  +
            self
         736  +
            /* ServerBuilderGenerator.kt:343 */
         737  +
        }
         738  +
        /* ServerBuilderGenerator.kt:331 */
         739  +
        #[allow(missing_docs)] // documentation missing in model
         740  +
                               /* ServerBuilderGenerator.kt:343 */
         741  +
        pub fn pokedex_update(
         742  +
            mut self,
         743  +
            input: ::std::option::Option<::aws_smithy_types::Blob>,
         744  +
        ) -> Self {
         745  +
            /* ServerBuilderGenerator.kt:344 */
         746  +
            self.pokedex_update =
         747  +
                /* ServerBuilderGenerator.kt:376 */input
         748  +
            /* ServerBuilderGenerator.kt:344 */;
         749  +
            self
         750  +
            /* ServerBuilderGenerator.kt:343 */
         751  +
        }
         752  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CaptureEvent`](crate::model::CaptureEvent).
         753  +
        /* ServerBuilderGenerator.kt:271 */
         754  +
        pub fn build(self) -> crate::model::CaptureEvent {
         755  +
            self.build_enforcing_all_constraints()
         756  +
        }
         757  +
        /* ServerBuilderGenerator.kt:283 */
         758  +
        fn build_enforcing_all_constraints(self) -> crate::model::CaptureEvent {
         759  +
            /* ServerBuilderGenerator.kt:542 */
         760  +
            crate::model::CaptureEvent {
         761  +
                /* ServerBuilderGenerator.kt:546 */
         762  +
                name: self.name,
         763  +
                /* ServerBuilderGenerator.kt:546 */
         764  +
                captured: self.captured,
         765  +
                /* ServerBuilderGenerator.kt:546 */
         766  +
                shiny: self.shiny,
         767  +
                /* ServerBuilderGenerator.kt:546 */
         768  +
                pokedex_update: self.pokedex_update,
         769  +
                /* ServerBuilderGenerator.kt:542 */
         770  +
            }
         771  +
            /* ServerBuilderGenerator.kt:283 */
         772  +
        }
         773  +
        /* ServerBuilderGenerator.kt:215 */
         774  +
    }
         775  +
         776  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
         777  +
}
         778  +
/// /* ServerBuilderGenerator.kt:171 */See [`CapturingEvent`](crate::model::CapturingEvent).
         779  +
pub mod capturing_event {
         780  +
         781  +
    /* ServerBuilderGenerator.kt:461 */
         782  +
    impl ::std::convert::From<Builder> for crate::model::CapturingEvent {
         783  +
        fn from(builder: Builder) -> Self {
         784  +
            builder.build()
         785  +
        }
         786  +
    }
         787  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CapturingEvent`](crate::model::CapturingEvent).
         788  +
    /* RustType.kt:534 */
         789  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         790  +
    /* ServerBuilderGenerator.kt:211 */
         791  +
    pub struct Builder {
         792  +
        /* ServerBuilderGenerator.kt:308 */
         793  +
        pub(crate) payload: ::std::option::Option<crate::model::CapturingPayload>,
         794  +
        /* ServerBuilderGenerator.kt:211 */
         795  +
    }
         796  +
    /* ServerBuilderGenerator.kt:215 */
         797  +
    impl Builder {
         798  +
        /* ServerBuilderGenerator.kt:331 */
         799  +
        #[allow(missing_docs)] // documentation missing in model
         800  +
                               /* ServerBuilderGenerator.kt:343 */
         801  +
        pub fn payload(
         802  +
            mut self,
         803  +
            input: ::std::option::Option<crate::model::CapturingPayload>,
         804  +
        ) -> Self {
         805  +
            /* ServerBuilderGenerator.kt:344 */
         806  +
            self.payload =
         807  +
                /* ServerBuilderGenerator.kt:376 */input
         808  +
            /* ServerBuilderGenerator.kt:344 */;
         809  +
            self
         810  +
            /* ServerBuilderGenerator.kt:343 */
         811  +
        }
         812  +
        /* ServerBuilderGenerator.kt:426 */
         813  +
        #[allow(missing_docs)] // documentation missing in model
         814  +
                               /* ServerBuilderGenerator.kt:428 */
         815  +
        pub(crate) fn set_payload(
         816  +
            mut self,
         817  +
            input: Option<impl ::std::convert::Into<crate::model::CapturingPayload>>,
         818  +
        ) -> Self {
         819  +
            /* ServerBuilderGenerator.kt:429 */
         820  +
            self.payload = input.map(|v| v.into());
         821  +
            self
         822  +
            /* ServerBuilderGenerator.kt:428 */
         823  +
        }
         824  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
         825  +
        /* ServerBuilderGenerator.kt:271 */
         826  +
        pub fn build(self) -> crate::model::CapturingEvent {
         827  +
            self.build_enforcing_all_constraints()
         828  +
        }
         829  +
        /* ServerBuilderGenerator.kt:283 */
         830  +
        fn build_enforcing_all_constraints(self) -> crate::model::CapturingEvent {
         831  +
            /* ServerBuilderGenerator.kt:542 */
         832  +
            crate::model::CapturingEvent {
         833  +
                /* ServerBuilderGenerator.kt:546 */
         834  +
                payload: self.payload,
         835  +
                /* ServerBuilderGenerator.kt:542 */
         836  +
            }
         837  +
            /* ServerBuilderGenerator.kt:283 */
         838  +
        }
         839  +
        /* ServerBuilderGenerator.kt:215 */
         840  +
    }
         841  +
         842  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
         843  +
}
         844  +
/// /* ServerBuilderGenerator.kt:171 */See [`CapturingPayload`](crate::model::CapturingPayload).
         845  +
pub mod capturing_payload {
         846  +
         847  +
    /* ServerBuilderGenerator.kt:461 */
         848  +
    impl ::std::convert::From<Builder> for crate::model::CapturingPayload {
         849  +
        fn from(builder: Builder) -> Self {
         850  +
            builder.build()
         851  +
        }
         852  +
    }
         853  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CapturingPayload`](crate::model::CapturingPayload).
         854  +
    /* RustType.kt:534 */
         855  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         856  +
    /* ServerBuilderGenerator.kt:211 */
         857  +
    pub struct Builder {
         858  +
        /* ServerBuilderGenerator.kt:308 */
         859  +
        pub(crate) name: ::std::option::Option<::std::string::String>,
         860  +
        /* ServerBuilderGenerator.kt:308 */
         861  +
        pub(crate) pokeball: ::std::option::Option<::std::string::String>,
         862  +
        /* ServerBuilderGenerator.kt:211 */
         863  +
    }
         864  +
    /* ServerBuilderGenerator.kt:215 */
         865  +
    impl Builder {
         866  +
        /* ServerBuilderGenerator.kt:331 */
         867  +
        #[allow(missing_docs)] // documentation missing in model
         868  +
                               /* ServerBuilderGenerator.kt:343 */
         869  +
        pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         870  +
            /* ServerBuilderGenerator.kt:344 */
         871  +
            self.name =
         872  +
                /* ServerBuilderGenerator.kt:376 */input
         873  +
            /* ServerBuilderGenerator.kt:344 */;
         874  +
            self
         875  +
            /* ServerBuilderGenerator.kt:343 */
         876  +
        }
         877  +
        /* ServerBuilderGenerator.kt:426 */
         878  +
        #[allow(missing_docs)] // documentation missing in model
         879  +
                               /* ServerBuilderGenerator.kt:428 */
         880  +
        pub(crate) fn set_name(
         881  +
            mut self,
         882  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         883  +
        ) -> Self {
         884  +
            /* ServerBuilderGenerator.kt:429 */
         885  +
            self.name = input.map(|v| v.into());
         886  +
            self
         887  +
            /* ServerBuilderGenerator.kt:428 */
         888  +
        }
         889  +
        /* ServerBuilderGenerator.kt:331 */
         890  +
        #[allow(missing_docs)] // documentation missing in model
         891  +
                               /* ServerBuilderGenerator.kt:343 */
         892  +
        pub fn pokeball(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         893  +
            /* ServerBuilderGenerator.kt:344 */
         894  +
            self.pokeball =
         895  +
                /* ServerBuilderGenerator.kt:376 */input
         896  +
            /* ServerBuilderGenerator.kt:344 */;
         897  +
            self
         898  +
            /* ServerBuilderGenerator.kt:343 */
         899  +
        }
         900  +
        /* ServerBuilderGenerator.kt:426 */
         901  +
        #[allow(missing_docs)] // documentation missing in model
         902  +
                               /* ServerBuilderGenerator.kt:428 */
         903  +
        pub(crate) fn set_pokeball(
         904  +
            mut self,
         905  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         906  +
        ) -> Self {
         907  +
            /* ServerBuilderGenerator.kt:429 */
         908  +
            self.pokeball = input.map(|v| v.into());
         909  +
            self
         910  +
            /* ServerBuilderGenerator.kt:428 */
         911  +
        }
         912  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CapturingPayload`](crate::model::CapturingPayload).
         913  +
        /* ServerBuilderGenerator.kt:271 */
         914  +
        pub fn build(self) -> crate::model::CapturingPayload {
         915  +
            self.build_enforcing_all_constraints()
         916  +
        }
         917  +
        /* ServerBuilderGenerator.kt:283 */
         918  +
        fn build_enforcing_all_constraints(self) -> crate::model::CapturingPayload {
         919  +
            /* ServerBuilderGenerator.kt:542 */
         920  +
            crate::model::CapturingPayload {
         921  +
                /* ServerBuilderGenerator.kt:546 */
         922  +
                name: self.name,
         923  +
                /* ServerBuilderGenerator.kt:546 */
         924  +
                pokeball: self.pokeball,
         925  +
                /* ServerBuilderGenerator.kt:542 */
         926  +
            }
         927  +
            /* ServerBuilderGenerator.kt:283 */
         928  +
        }
         929  +
        /* ServerBuilderGenerator.kt:215 */
         930  +
    }
         931  +
         932  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
         933  +
}