Server Test

Server Test

rev. 03e6e47f15dfd569240d570d98975ebba692c405

Files changed:

tmp-codegen-diff/codegen-server-test/naming_test_casing-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/naming_test_casing/rust-server-codegen/Cargo.toml

@@ -1,1 +42,45 @@
    8      8   
    9      9   
[package.metadata.smithy]
   10     10   
codegen-version = "ci"
   11     11   
protocol = "aws.protocols#awsJson1_1"
   12     12   
[dependencies.aws-smithy-http]
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   14     14   
[dependencies.aws-smithy-http-server]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-server"
   16     16   
[dependencies.aws-smithy-runtime-api]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          18  +
features = ["http-1x"]
   18     19   
[dependencies.aws-smithy-types]
   19     20   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          21  +
features = ["http-body-1-x"]
   20     22   
[dependencies.futures-util]
   21     23   
version = "0.3"
   22         -
[dependencies.http]
   23         -
version = "0.2.9"
          24  +
[dependencies.http-1x]
          25  +
version = "1"
          26  +
package = "http"
   24     27   
[dependencies.mime]
   25     28   
version = "0.3"
   26     29   
[dependencies.pin-project-lite]
   27     30   
version = "0.2"
   28     31   
[dependencies.tower]
   29     32   
version = "0.4"
   30     33   
[dependencies.tracing]
   31     34   
version = "0.1"
   32     35   
[dev-dependencies.hyper]
   33         -
version = "0.14.12"
          36  +
version = "1"
   34     37   
[dev-dependencies.tokio]
   35     38   
version = "1.23.1"
   36     39   
[features]
   37     40   
rt-tokio = ["aws-smithy-types/rt-tokio"]
   38     41   
aws-lambda = ["aws-smithy-http-server/aws-lambda"]
   39     42   
request-id = ["aws-smithy-http-server/request-id"]
   40     43   
default = ["rt-tokio", "request-id"]
   41     44   
   42     45   

tmp-codegen-diff/codegen-server-test/naming_test_casing/rust-server-codegen/src/lib.rs

@@ -19,19 +128,131 @@
   39     39   
)]
   40     40   
//! The [`crate::input`], and [`crate::output`],
   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 naming_test_casing::{AcronymInsideService, AcronymInsideServiceConfig};
          49  +
//! use naming_test_casing::serve;
          50  +
//! use ::tokio::net::TcpListener;
   49     51   
//!
   50     52   
//! # let app = AcronymInsideService::builder(
   51     53   
//! #     AcronymInsideServiceConfig::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 naming_test_casing::server::routing::LambdaHandler;
   65     68   
//! use naming_test_casing::AcronymInsideService;
   66     69   
//!
   67     70   
//! # async fn dummy() {
   68     71   
//! # let app = AcronymInsideService::builder(
   69     72   
//! #     AcronymInsideServiceConfig::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 AcronymInsideService
   78     81   
//!
   79     82   
//! To construct [`AcronymInsideService`] we use [`AcronymInsideServiceBuilder`] returned by [`AcronymInsideService::builder`].
   80     83   
//!
   81     84   
//! ## Plugins
   82     85   
//!
   83     86   
//! The [`AcronymInsideService::builder`] method, returning [`AcronymInsideServiceBuilder`],
   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 naming_test_casing::server::plugin::IdentityPlugin as LoggingPlugin;
   89     92   
//! # use naming_test_casing::server::plugin::IdentityPlugin as MetricsPlugin;
   90         -
//! # use ::hyper::Body;
          93  +
//! # use ::hyper::body::Incoming;
   91     94   
//! use naming_test_casing::server::plugin::HttpPlugins;
   92     95   
//! use naming_test_casing::{AcronymInsideService, AcronymInsideServiceConfig, AcronymInsideServiceBuilder};
   93     96   
//!
   94     97   
//! let http_plugins = HttpPlugins::new()
   95     98   
//!         .push(LoggingPlugin)
   96     99   
//!         .push(MetricsPlugin);
   97    100   
//! let config = AcronymInsideServiceConfig::builder().build();
   98         -
//! let builder: AcronymInsideServiceBuilder<Body, _, _, _> = AcronymInsideService::builder(config);
         101  +
//! let builder: AcronymInsideServiceBuilder<::hyper::body::Incoming, _, _, _> = AcronymInsideService::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   
//! [`AcronymInsideServiceBuilder`] 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 +228,235 @@
  155    158   
//! [`AcronymInsideServiceBuilder::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   
//! [`AcronymInsideServiceBuilder::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   
//! [`AcronymInsideServiceBuilder::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 naming_test_casing::{AcronymInsideService, AcronymInsideServiceConfig};
         168  +
//! use naming_test_casing::serve;
         169  +
//! use ::tokio::net::TcpListener;
  165    170   
//!
  166    171   
//! #[::tokio::main]
  167    172   
//! pub async fn main() {
  168    173   
//!    let config = AcronymInsideServiceConfig::builder().build();
  169    174   
//!    let app = AcronymInsideService::builder(config)
  170    175   
//!        .do_nothing(do_nothing)
  171    176   
//!        .build()
  172    177   
//!        .expect("failed to build an instance of AcronymInsideService");
  173    178   
//!
  174    179   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  175    180   
//!        .expect("unable to parse the server bind address and port");
  176         -
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         181  +
//!    let listener = TcpListener::bind(bind).await
         182  +
//!        .expect("failed to bind TCP listener");
  177    183   
//!    # let server = async { Ok::<_, ()>(()) };
  178    184   
//!
  179    185   
//!    // Run your service!
  180         -
//!    if let Err(err) = server.await {
         186  +
//!    if let Err(err) = serve(listener, app.into_make_service()).await {
  181    187   
//!        eprintln!("server error: {:?}", err);
  182    188   
//!    }
  183    189   
//! }
  184    190   
//!
  185    191   
//! use naming_test_casing::{input, output};
  186    192   
//!
  187    193   
//! async fn do_nothing(input: input::DoNothingInput) -> output::DoNothingOutput {
  188    194   
//!     todo!()
  189    195   
//! }
  190    196   
//!
  191    197   
//! ```
  192    198   
//!
  193         -
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         199  +
//! [`serve`]: crate::serve
         200  +
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  194    201   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  195    202   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  196    203   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  197         -
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  198    204   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         205  +
pub use crate::server::serve::serve;
  199    206   
pub use crate::service::{
  200    207   
    AcronymInsideService, AcronymInsideServiceBuilder, AcronymInsideServiceConfig,
  201    208   
    AcronymInsideServiceConfigBuilder, MissingOperationsError,
  202    209   
};
  203    210   
  204    211   
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  205    212   
pub mod server {
  206    213   
    // Re-export all types from the `aws-smithy-http-server` crate.
  207    214   
    pub use ::aws_smithy_http_server::*;
  208    215   
}

tmp-codegen-diff/codegen-server-test/naming_test_casing/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 = DoNothingInputFuture;
   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_1,
   46     46   
            ) {
   47     47   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
   48     48   
            }
   49     49   
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request).await
   50     50   
        };
   51     51   
        use ::futures_util::future::TryFutureExt;

tmp-codegen-diff/codegen-server-test/naming_test_casing/rust-server-codegen/src/protocol_serde/shape_do_nothing.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_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.1",
   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/naming_test_casing/rust-server-codegen/src/service.rs

@@ -35,35 +96,96 @@
   55     55   
                            <
   56     56   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
   57     57   
                                as ::aws_smithy_http_server::plugin::Plugin<
   58     58   
                                    AcronymInsideService<L>,
   59     59   
                                    crate::operation_shape::DoNothing,
   60     60   
                                    ModelPl::Output
   61     61   
                                >
   62     62   
                            >::Output
   63     63   
                        >,
   64     64   
   65         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
   66         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
          65  +
                        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,
          66  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
   67     67   
   68     68   
                    {
   69     69   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
   70     70   
        use ::aws_smithy_http_server::plugin::Plugin;
   71     71   
        let svc = crate::operation_shape::DoNothing::from_handler(handler);
   72     72   
        let svc = self.model_plugin.apply(svc);
   73     73   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
   74     74   
            .apply(svc);
   75     75   
        let svc = self.http_plugin.apply(svc);
   76     76   
        self.do_nothing_custom(svc)
@@ -102,102 +182,182 @@
  122    122   
                            <
  123    123   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  124    124   
                                as ::aws_smithy_http_server::plugin::Plugin<
  125    125   
                                    AcronymInsideService<L>,
  126    126   
                                    crate::operation_shape::DoNothing,
  127    127   
                                    ModelPl::Output
  128    128   
                                >
  129    129   
                            >::Output
  130    130   
                        >,
  131    131   
  132         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  133         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         132  +
                        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,
         133  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  134    134   
  135    135   
                    {
  136    136   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  137    137   
        use ::aws_smithy_http_server::plugin::Plugin;
  138    138   
        let svc = crate::operation_shape::DoNothing::from_service(service);
  139    139   
        let svc = self.model_plugin.apply(svc);
  140    140   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  141    141   
            .apply(svc);
  142    142   
        let svc = self.http_plugin.apply(svc);
  143    143   
        self.do_nothing_custom(svc)
  144    144   
    }
  145    145   
  146    146   
    /// Sets the [`DoNothing`](crate::operation_shape::DoNothing) to a custom [`Service`](tower::Service).
  147    147   
    /// not constrained by the Smithy contract.
  148    148   
    fn do_nothing_custom<S>(mut self, svc: S) -> Self
  149    149   
    where
  150    150   
        S: ::tower::Service<
  151         -
                ::http::Request<Body>,
  152         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         151  +
                ::http_1x::Request<Body>,
         152  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  153    153   
                Error = ::std::convert::Infallible,
  154    154   
            > + Clone
  155    155   
            + Send
  156    156   
            + 'static,
  157    157   
        S::Future: Send + 'static,
  158    158   
    {
  159    159   
        self.do_nothing = Some(::aws_smithy_http_server::routing::Route::new(svc));
  160    160   
        self
  161    161   
    }
  162    162   
}
@@ -393,393 +454,454 @@
  413    413   
    ) -> AcronymInsideService<
  414    414   
        ::aws_smithy_http_server::routing::RoutingService<
  415    415   
            ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<
  416    416   
                ::aws_smithy_http_server::routing::Route<B>,
  417    417   
            >,
  418    418   
            ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  419    419   
        >,
  420    420   
    >
  421    421   
    where
  422    422   
        S: ::tower::Service<
  423         -
            ::http::Request<B>,
  424         -
            Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         423  +
            ::http_1x::Request<B>,
         424  +
            Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  425    425   
            Error = std::convert::Infallible,
  426    426   
        >,
  427    427   
        S: Clone + Send + 'static,
  428    428   
        S::Future: Send + 'static,
  429    429   
    {
  430    430   
        self.layer(&::tower::layer::layer_fn(
  431    431   
            ::aws_smithy_http_server::routing::Route::new,
  432    432   
        ))
  433    433   
    }
  434    434   
}

tmp-codegen-diff/codegen-server-test/naming_test_ops-http0x/rust-server-codegen/Cargo.toml

@@ -0,1 +0,56 @@
           1  +
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
[package]
           3  +
name = "naming_test_ops-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#awsJson1_1"
          12  +
[dependencies.aws-smithy-json]
          13  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
          14  +
[dependencies.aws-smithy-legacy-http]
          15  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http"
          16  +
[dependencies.aws-smithy-legacy-http-server]
          17  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http-server"
          18  +
[dependencies.aws-smithy-runtime-api]
          19  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          20  +
features = ["http-02x"]
          21  +
[dependencies.aws-smithy-types]
          22  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          23  +
features = ["http-body-0-4-x"]
          24  +
[dependencies.futures-util]
          25  +
version = "0.3"
          26  +
[dependencies.http]
          27  +
version = "0.2.9"
          28  +
[dependencies.hyper]
          29  +
version = "0.14.26"
          30  +
[dependencies.mime]
          31  +
version = "0.3"
          32  +
[dependencies.pin-project-lite]
          33  +
version = "0.2"
          34  +
[dependencies.tower]
          35  +
version = "0.4"
          36  +
[dependencies.tracing]
          37  +
version = "0.1"
          38  +
[dev-dependencies.aws-smithy-protocol-test]
          39  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
          40  +
[dev-dependencies.bytes]
          41  +
version = "1.4.0"
          42  +
[dev-dependencies.pretty_assertions]
          43  +
version = "1.3.0"
          44  +
[dev-dependencies.tokio]
          45  +
version = "1.23.1"
          46  +
features = ["macros", "test-util", "rt-multi-thread"]
          47  +
[dev-dependencies.tracing-test]
          48  +
version = "0.2.5"
          49  +
features = ["no-env-filter"]
          50  +
[features]
          51  +
rt-tokio = ["aws-smithy-types/rt-tokio"]
          52  +
aws-lambda = ["aws-smithy-legacy-http-server/aws-lambda"]
          53  +
request-id = ["aws-smithy-legacy-http-server/request-id"]
          54  +
default = ["rt-tokio", "request-id"]
          55  +
          56  +

tmp-codegen-diff/codegen-server-test/naming_test_ops-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/naming_test_ops-http0x/rust-server-codegen/src/error.rs

@@ -0,1 +0,376 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Error type for the `RPCEcho` operation.
           3  +
/// Each variant represents an error that can occur for the `RPCEcho` operation.
           4  +
#[derive(::std::fmt::Debug)]
           5  +
pub enum RPCEchoError {
           6  +
    /// 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.
           7  +
    ValidationException(crate::error::ValidationException),
           8  +
}
           9  +
impl ::std::fmt::Display for RPCEchoError {
          10  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          11  +
        match &self {
          12  +
            RPCEchoError::ValidationException(_inner) => _inner.fmt(f),
          13  +
        }
          14  +
    }
          15  +
}
          16  +
impl RPCEchoError {
          17  +
    /// Returns `true` if the error kind is `RPCEchoError::ValidationException`.
          18  +
    pub fn is_validation_exception(&self) -> bool {
          19  +
        matches!(&self, RPCEchoError::ValidationException(_))
          20  +
    }
          21  +
    /// Returns the error name string by matching the correct variant.
          22  +
    pub fn name(&self) -> &'static str {
          23  +
        match &self {
          24  +
            RPCEchoError::ValidationException(_inner) => _inner.name(),
          25  +
        }
          26  +
    }
          27  +
}
          28  +
impl ::std::error::Error for RPCEchoError {
          29  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
          30  +
        match &self {
          31  +
            RPCEchoError::ValidationException(_inner) => Some(_inner),
          32  +
        }
          33  +
    }
          34  +
}
          35  +
impl ::std::convert::From<crate::error::ValidationException> for crate::error::RPCEchoError {
          36  +
    fn from(variant: crate::error::ValidationException) -> crate::error::RPCEchoError {
          37  +
        Self::ValidationException(variant)
          38  +
    }
          39  +
}
          40  +
          41  +
/// 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.
          42  +
#[derive(
          43  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          44  +
)]
          45  +
pub struct ValidationException {
          46  +
    /// A summary of the validation failure.
          47  +
    pub message: ::std::string::String,
          48  +
    /// 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.
          49  +
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
          50  +
}
          51  +
impl ValidationException {
          52  +
    /// 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.
          53  +
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
          54  +
        self.field_list.as_deref()
          55  +
    }
          56  +
}
          57  +
impl ValidationException {
          58  +
    /// Returns the error message.
          59  +
    pub fn message(&self) -> &str {
          60  +
        &self.message
          61  +
    }
          62  +
    #[doc(hidden)]
          63  +
    /// Returns the error name.
          64  +
    pub fn name(&self) -> &'static str {
          65  +
        "ValidationException"
          66  +
    }
          67  +
}
          68  +
impl ::std::fmt::Display for ValidationException {
          69  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          70  +
        ::std::write!(f, "ValidationException")?;
          71  +
        {
          72  +
            ::std::write!(f, ": {}", &self.message)?;
          73  +
        }
          74  +
        Ok(())
          75  +
    }
          76  +
}
          77  +
impl ::std::error::Error for ValidationException {}
          78  +
impl ValidationException {
          79  +
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
          80  +
    pub fn builder() -> crate::error::validation_exception::Builder {
          81  +
        crate::error::validation_exception::Builder::default()
          82  +
    }
          83  +
}
          84  +
          85  +
/// Error type for the `Match` operation.
          86  +
/// Each variant represents an error that can occur for the `Match` operation.
          87  +
#[derive(::std::fmt::Debug)]
          88  +
pub enum MatchError {
          89  +
    /// 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.
          90  +
    ValidationException(crate::error::ValidationException),
          91  +
}
          92  +
impl ::std::fmt::Display for MatchError {
          93  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          94  +
        match &self {
          95  +
            MatchError::ValidationException(_inner) => _inner.fmt(f),
          96  +
        }
          97  +
    }
          98  +
}
          99  +
impl MatchError {
         100  +
    /// Returns `true` if the error kind is `MatchError::ValidationException`.
         101  +
    pub fn is_validation_exception(&self) -> bool {
         102  +
        matches!(&self, MatchError::ValidationException(_))
         103  +
    }
         104  +
    /// Returns the error name string by matching the correct variant.
         105  +
    pub fn name(&self) -> &'static str {
         106  +
        match &self {
         107  +
            MatchError::ValidationException(_inner) => _inner.name(),
         108  +
        }
         109  +
    }
         110  +
}
         111  +
impl ::std::error::Error for MatchError {
         112  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         113  +
        match &self {
         114  +
            MatchError::ValidationException(_inner) => Some(_inner),
         115  +
        }
         116  +
    }
         117  +
}
         118  +
impl ::std::convert::From<crate::error::ValidationException> for crate::error::MatchError {
         119  +
    fn from(variant: crate::error::ValidationException) -> crate::error::MatchError {
         120  +
        Self::ValidationException(variant)
         121  +
    }
         122  +
}
         123  +
         124  +
/// Error type for the `ErrCollisions` operation.
         125  +
/// Each variant represents an error that can occur for the `ErrCollisions` operation.
         126  +
#[derive(::std::fmt::Debug)]
         127  +
pub enum ErrCollisionsError {
         128  +
    #[allow(missing_docs)] // documentation missing in model
         129  +
    CollidingError(crate::error::CollidingError),
         130  +
    /// This will be renamed to CollidingError
         131  +
    CollidingException(crate::error::CollidingException),
         132  +
}
         133  +
impl ::std::fmt::Display for ErrCollisionsError {
         134  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         135  +
        match &self {
         136  +
            ErrCollisionsError::CollidingError(_inner) => _inner.fmt(f),
         137  +
            ErrCollisionsError::CollidingException(_inner) => _inner.fmt(f),
         138  +
        }
         139  +
    }
         140  +
}
         141  +
impl ErrCollisionsError {
         142  +
    /// Returns `true` if the error kind is `ErrCollisionsError::CollidingError`.
         143  +
    pub fn is_colliding_error(&self) -> bool {
         144  +
        matches!(&self, ErrCollisionsError::CollidingError(_))
         145  +
    }
         146  +
    /// Returns `true` if the error kind is `ErrCollisionsError::CollidingException`.
         147  +
    pub fn is_colliding_exception(&self) -> bool {
         148  +
        matches!(&self, ErrCollisionsError::CollidingException(_))
         149  +
    }
         150  +
    /// Returns the error name string by matching the correct variant.
         151  +
    pub fn name(&self) -> &'static str {
         152  +
        match &self {
         153  +
            ErrCollisionsError::CollidingError(_inner) => _inner.name(),
         154  +
            ErrCollisionsError::CollidingException(_inner) => _inner.name(),
         155  +
        }
         156  +
    }
         157  +
}
         158  +
impl ::std::error::Error for ErrCollisionsError {
         159  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         160  +
        match &self {
         161  +
            ErrCollisionsError::CollidingError(_inner) => Some(_inner),
         162  +
            ErrCollisionsError::CollidingException(_inner) => Some(_inner),
         163  +
        }
         164  +
    }
         165  +
}
         166  +
impl ::std::convert::From<crate::error::CollidingError> for crate::error::ErrCollisionsError {
         167  +
    fn from(variant: crate::error::CollidingError) -> crate::error::ErrCollisionsError {
         168  +
        Self::CollidingError(variant)
         169  +
    }
         170  +
}
         171  +
impl ::std::convert::From<crate::error::CollidingException> for crate::error::ErrCollisionsError {
         172  +
    fn from(variant: crate::error::CollidingException) -> crate::error::ErrCollisionsError {
         173  +
        Self::CollidingException(variant)
         174  +
    }
         175  +
}
         176  +
         177  +
/// This will be renamed to CollidingError
         178  +
#[derive(
         179  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         180  +
)]
         181  +
pub struct CollidingException {}
         182  +
impl CollidingException {
         183  +
    #[doc(hidden)]
         184  +
    /// Returns the error name.
         185  +
    pub fn name(&self) -> &'static str {
         186  +
        "CollidingException"
         187  +
    }
         188  +
}
         189  +
impl ::std::fmt::Display for CollidingException {
         190  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         191  +
        ::std::write!(f, "CollidingException")?;
         192  +
        Ok(())
         193  +
    }
         194  +
}
         195  +
impl ::std::error::Error for CollidingException {}
         196  +
impl CollidingException {
         197  +
    /// Creates a new builder-style object to manufacture [`CollidingException`](crate::error::CollidingException).
         198  +
    pub fn builder() -> crate::error::colliding_exception::Builder {
         199  +
        crate::error::colliding_exception::Builder::default()
         200  +
    }
         201  +
}
         202  +
         203  +
#[allow(missing_docs)] // documentation missing in model
         204  +
#[derive(
         205  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         206  +
)]
         207  +
pub struct CollidingError {}
         208  +
impl CollidingError {
         209  +
    #[doc(hidden)]
         210  +
    /// Returns the error name.
         211  +
    pub fn name(&self) -> &'static str {
         212  +
        "CollidingError"
         213  +
    }
         214  +
}
         215  +
impl ::std::fmt::Display for CollidingError {
         216  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         217  +
        ::std::write!(f, "CollidingError")?;
         218  +
        Ok(())
         219  +
    }
         220  +
}
         221  +
impl ::std::error::Error for CollidingError {}
         222  +
impl CollidingError {
         223  +
    /// Creates a new builder-style object to manufacture [`CollidingError`](crate::error::CollidingError).
         224  +
    pub fn builder() -> crate::error::colliding_error::Builder {
         225  +
        crate::error::colliding_error::Builder::default()
         226  +
    }
         227  +
}
         228  +
         229  +
/// Error type for the `ReservedWordsAsMembers` operation.
         230  +
/// Each variant represents an error that can occur for the `ReservedWordsAsMembers` operation.
         231  +
#[derive(::std::fmt::Debug)]
         232  +
pub enum ReservedWordsAsMembersError {
         233  +
    /// 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.
         234  +
    ValidationException(crate::error::ValidationException),
         235  +
}
         236  +
impl ::std::fmt::Display for ReservedWordsAsMembersError {
         237  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         238  +
        match &self {
         239  +
            ReservedWordsAsMembersError::ValidationException(_inner) => _inner.fmt(f),
         240  +
        }
         241  +
    }
         242  +
}
         243  +
impl ReservedWordsAsMembersError {
         244  +
    /// Returns `true` if the error kind is `ReservedWordsAsMembersError::ValidationException`.
         245  +
    pub fn is_validation_exception(&self) -> bool {
         246  +
        matches!(&self, ReservedWordsAsMembersError::ValidationException(_))
         247  +
    }
         248  +
    /// Returns the error name string by matching the correct variant.
         249  +
    pub fn name(&self) -> &'static str {
         250  +
        match &self {
         251  +
            ReservedWordsAsMembersError::ValidationException(_inner) => _inner.name(),
         252  +
        }
         253  +
    }
         254  +
}
         255  +
impl ::std::error::Error for ReservedWordsAsMembersError {
         256  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         257  +
        match &self {
         258  +
            ReservedWordsAsMembersError::ValidationException(_inner) => Some(_inner),
         259  +
        }
         260  +
    }
         261  +
}
         262  +
impl ::std::convert::From<crate::error::ValidationException>
         263  +
    for crate::error::ReservedWordsAsMembersError
         264  +
{
         265  +
    fn from(
         266  +
        variant: crate::error::ValidationException,
         267  +
    ) -> crate::error::ReservedWordsAsMembersError {
         268  +
        Self::ValidationException(variant)
         269  +
    }
         270  +
}
         271  +
/// See [`ValidationException`](crate::error::ValidationException).
         272  +
pub mod validation_exception {
         273  +
         274  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         275  +
    /// Holds one variant for each of the ways the builder can fail.
         276  +
    #[non_exhaustive]
         277  +
    #[allow(clippy::enum_variant_names)]
         278  +
    pub enum ConstraintViolation {
         279  +
        /// `message` was not provided but it is required when building `ValidationException`.
         280  +
        MissingMessage,
         281  +
    }
         282  +
    impl ::std::fmt::Display for ConstraintViolation {
         283  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         284  +
            match self {
         285  +
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
         286  +
            }
         287  +
        }
         288  +
    }
         289  +
    impl ::std::error::Error for ConstraintViolation {}
         290  +
    impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
         291  +
        type Error = ConstraintViolation;
         292  +
         293  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         294  +
            builder.build()
         295  +
        }
         296  +
    }
         297  +
    /// A builder for [`ValidationException`](crate::error::ValidationException).
         298  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         299  +
    pub struct Builder {
         300  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         301  +
        pub(crate) field_list:
         302  +
            ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
         303  +
    }
         304  +
    impl Builder {
         305  +
        /// A summary of the validation failure.
         306  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         307  +
            self.message = Some(input);
         308  +
            self
         309  +
        }
         310  +
        /// 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.
         311  +
        pub fn field_list(
         312  +
            mut self,
         313  +
            input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
         314  +
        ) -> Self {
         315  +
            self.field_list = input;
         316  +
            self
         317  +
        }
         318  +
        /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
         319  +
        ///
         320  +
        /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if a [`ConstraintViolation`] occurs.
         321  +
        ///
         322  +
        pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
         323  +
            self.build_enforcing_all_constraints()
         324  +
        }
         325  +
        fn build_enforcing_all_constraints(
         326  +
            self,
         327  +
        ) -> Result<crate::error::ValidationException, ConstraintViolation> {
         328  +
            Ok(crate::error::ValidationException {
         329  +
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
         330  +
                field_list: self.field_list,
         331  +
            })
         332  +
        }
         333  +
    }
         334  +
}
         335  +
/// See [`CollidingException`](crate::error::CollidingException).
         336  +
pub mod colliding_exception {
         337  +
         338  +
    impl ::std::convert::From<Builder> for crate::error::CollidingException {
         339  +
        fn from(builder: Builder) -> Self {
         340  +
            builder.build()
         341  +
        }
         342  +
    }
         343  +
    /// A builder for [`CollidingException`](crate::error::CollidingException).
         344  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         345  +
    pub struct Builder {}
         346  +
    impl Builder {
         347  +
        /// Consumes the builder and constructs a [`CollidingException`](crate::error::CollidingException).
         348  +
        pub fn build(self) -> crate::error::CollidingException {
         349  +
            self.build_enforcing_all_constraints()
         350  +
        }
         351  +
        fn build_enforcing_all_constraints(self) -> crate::error::CollidingException {
         352  +
            crate::error::CollidingException {}
         353  +
        }
         354  +
    }
         355  +
}
         356  +
/// See [`CollidingError`](crate::error::CollidingError).
         357  +
pub mod colliding_error {
         358  +
         359  +
    impl ::std::convert::From<Builder> for crate::error::CollidingError {
         360  +
        fn from(builder: Builder) -> Self {
         361  +
            builder.build()
         362  +
        }
         363  +
    }
         364  +
    /// A builder for [`CollidingError`](crate::error::CollidingError).
         365  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         366  +
    pub struct Builder {}
         367  +
    impl Builder {
         368  +
        /// Consumes the builder and constructs a [`CollidingError`](crate::error::CollidingError).
         369  +
        pub fn build(self) -> crate::error::CollidingError {
         370  +
            self.build_enforcing_all_constraints()
         371  +
        }
         372  +
        fn build_enforcing_all_constraints(self) -> crate::error::CollidingError {
         373  +
            crate::error::CollidingError {}
         374  +
        }
         375  +
    }
         376  +
}

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

@@ -0,1 +0,1136 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[derive(
           4  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
           5  +
)]
           6  +
pub struct RpcEchoInput {
           7  +
    #[allow(missing_docs)] // documentation missing in model
           8  +
    pub r#as: ::std::option::Option<i32>,
           9  +
    #[allow(missing_docs)] // documentation missing in model
          10  +
    pub r#async: ::std::option::Option<bool>,
          11  +
    #[allow(missing_docs)] // documentation missing in model
          12  +
    pub r#enum: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
          13  +
    #[allow(missing_docs)] // documentation missing in model
          14  +
    pub self_: ::std::option::Option<bool>,
          15  +
    #[allow(missing_docs)] // documentation missing in model
          16  +
    pub crate_: ::std::option::Option<bool>,
          17  +
    #[allow(missing_docs)] // documentation missing in model
          18  +
    pub super_: ::std::option::Option<bool>,
          19  +
    #[allow(missing_docs)] // documentation missing in model
          20  +
    pub build_value: ::std::option::Option<::std::string::String>,
          21  +
    #[allow(missing_docs)] // documentation missing in model
          22  +
    pub default_value: ::std::option::Option<::std::string::String>,
          23  +
    #[allow(missing_docs)] // documentation missing in model
          24  +
    pub send: ::std::option::Option<::std::string::String>,
          25  +
}
          26  +
impl RpcEchoInput {
          27  +
    #[allow(missing_docs)] // documentation missing in model
          28  +
    pub fn r#as(&self) -> ::std::option::Option<i32> {
          29  +
        self.r#as
          30  +
    }
          31  +
    #[allow(missing_docs)] // documentation missing in model
          32  +
    pub fn r#async(&self) -> ::std::option::Option<bool> {
          33  +
        self.r#async
          34  +
    }
          35  +
    #[allow(missing_docs)] // documentation missing in model
          36  +
    pub fn r#enum(&self) -> ::std::option::Option<&crate::model::UnknownVariantCollidingEnum> {
          37  +
        self.r#enum.as_ref()
          38  +
    }
          39  +
    #[allow(missing_docs)] // documentation missing in model
          40  +
    pub fn self_(&self) -> ::std::option::Option<bool> {
          41  +
        self.self_
          42  +
    }
          43  +
    #[allow(missing_docs)] // documentation missing in model
          44  +
    pub fn crate_(&self) -> ::std::option::Option<bool> {
          45  +
        self.crate_
          46  +
    }
          47  +
    #[allow(missing_docs)] // documentation missing in model
          48  +
    pub fn super_(&self) -> ::std::option::Option<bool> {
          49  +
        self.super_
          50  +
    }
          51  +
    #[allow(missing_docs)] // documentation missing in model
          52  +
    pub fn build_value(&self) -> ::std::option::Option<&str> {
          53  +
        self.build_value.as_deref()
          54  +
    }
          55  +
    #[allow(missing_docs)] // documentation missing in model
          56  +
    pub fn default_value(&self) -> ::std::option::Option<&str> {
          57  +
        self.default_value.as_deref()
          58  +
    }
          59  +
    #[allow(missing_docs)] // documentation missing in model
          60  +
    pub fn send(&self) -> ::std::option::Option<&str> {
          61  +
        self.send.as_deref()
          62  +
    }
          63  +
}
          64  +
impl RpcEchoInput {
          65  +
    /// Creates a new builder-style object to manufacture [`RpcEchoInput`](crate::input::RpcEchoInput).
          66  +
    pub fn builder() -> crate::input::rpc_echo_input::Builder {
          67  +
        crate::input::rpc_echo_input::Builder::default()
          68  +
    }
          69  +
}
          70  +
impl crate::constrained::Constrained for crate::input::RpcEchoInput {
          71  +
    type Unconstrained = crate::input::rpc_echo_input::Builder;
          72  +
}
          73  +
          74  +
#[allow(missing_docs)] // documentation missing in model
          75  +
#[derive(
          76  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          77  +
)]
          78  +
pub struct MatchInput {
          79  +
    #[allow(missing_docs)] // documentation missing in model
          80  +
    pub r#as: ::std::option::Option<i32>,
          81  +
    #[allow(missing_docs)] // documentation missing in model
          82  +
    pub r#async: ::std::option::Option<bool>,
          83  +
    #[allow(missing_docs)] // documentation missing in model
          84  +
    pub r#enum: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
          85  +
    #[allow(missing_docs)] // documentation missing in model
          86  +
    pub self_: ::std::option::Option<bool>,
          87  +
    #[allow(missing_docs)] // documentation missing in model
          88  +
    pub crate_: ::std::option::Option<bool>,
          89  +
    #[allow(missing_docs)] // documentation missing in model
          90  +
    pub super_: ::std::option::Option<bool>,
          91  +
    #[allow(missing_docs)] // documentation missing in model
          92  +
    pub build_value: ::std::option::Option<::std::string::String>,
          93  +
    #[allow(missing_docs)] // documentation missing in model
          94  +
    pub default_value: ::std::option::Option<::std::string::String>,
          95  +
    #[allow(missing_docs)] // documentation missing in model
          96  +
    pub send: ::std::option::Option<::std::string::String>,
          97  +
}
          98  +
impl MatchInput {
          99  +
    #[allow(missing_docs)] // documentation missing in model
         100  +
    pub fn r#as(&self) -> ::std::option::Option<i32> {
         101  +
        self.r#as
         102  +
    }
         103  +
    #[allow(missing_docs)] // documentation missing in model
         104  +
    pub fn r#async(&self) -> ::std::option::Option<bool> {
         105  +
        self.r#async
         106  +
    }
         107  +
    #[allow(missing_docs)] // documentation missing in model
         108  +
    pub fn r#enum(&self) -> ::std::option::Option<&crate::model::UnknownVariantCollidingEnum> {
         109  +
        self.r#enum.as_ref()
         110  +
    }
         111  +
    #[allow(missing_docs)] // documentation missing in model
         112  +
    pub fn self_(&self) -> ::std::option::Option<bool> {
         113  +
        self.self_
         114  +
    }
         115  +
    #[allow(missing_docs)] // documentation missing in model
         116  +
    pub fn crate_(&self) -> ::std::option::Option<bool> {
         117  +
        self.crate_
         118  +
    }
         119  +
    #[allow(missing_docs)] // documentation missing in model
         120  +
    pub fn super_(&self) -> ::std::option::Option<bool> {
         121  +
        self.super_
         122  +
    }
         123  +
    #[allow(missing_docs)] // documentation missing in model
         124  +
    pub fn build_value(&self) -> ::std::option::Option<&str> {
         125  +
        self.build_value.as_deref()
         126  +
    }
         127  +
    #[allow(missing_docs)] // documentation missing in model
         128  +
    pub fn default_value(&self) -> ::std::option::Option<&str> {
         129  +
        self.default_value.as_deref()
         130  +
    }
         131  +
    #[allow(missing_docs)] // documentation missing in model
         132  +
    pub fn send(&self) -> ::std::option::Option<&str> {
         133  +
        self.send.as_deref()
         134  +
    }
         135  +
}
         136  +
impl MatchInput {
         137  +
    /// Creates a new builder-style object to manufacture [`MatchInput`](crate::input::MatchInput).
         138  +
    pub fn builder() -> crate::input::match_input::Builder {
         139  +
        crate::input::match_input::Builder::default()
         140  +
    }
         141  +
}
         142  +
impl crate::constrained::Constrained for crate::input::MatchInput {
         143  +
    type Unconstrained = crate::input::match_input::Builder;
         144  +
}
         145  +
         146  +
#[allow(missing_docs)] // documentation missing in model
         147  +
#[derive(
         148  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         149  +
)]
         150  +
pub struct OptionInput {
         151  +
    #[allow(missing_docs)] // documentation missing in model
         152  +
    pub pv_member: ::std::option::Option<bool>,
         153  +
}
         154  +
impl OptionInput {
         155  +
    #[allow(missing_docs)] // documentation missing in model
         156  +
    pub fn pv_member(&self) -> ::std::option::Option<bool> {
         157  +
        self.pv_member
         158  +
    }
         159  +
}
         160  +
impl OptionInput {
         161  +
    /// Creates a new builder-style object to manufacture [`OptionInput`](crate::input::OptionInput).
         162  +
    pub fn builder() -> crate::input::option_input::Builder {
         163  +
        crate::input::option_input::Builder::default()
         164  +
    }
         165  +
}
         166  +
impl crate::constrained::Constrained for crate::input::OptionInput {
         167  +
    type Unconstrained = crate::input::option_input::Builder;
         168  +
}
         169  +
         170  +
#[allow(missing_docs)] // documentation missing in model
         171  +
#[derive(
         172  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         173  +
)]
         174  +
pub struct ResultInput {
         175  +
    #[allow(missing_docs)] // documentation missing in model
         176  +
    pub pv_member: ::std::option::Option<bool>,
         177  +
}
         178  +
impl ResultInput {
         179  +
    #[allow(missing_docs)] // documentation missing in model
         180  +
    pub fn pv_member(&self) -> ::std::option::Option<bool> {
         181  +
        self.pv_member
         182  +
    }
         183  +
}
         184  +
impl ResultInput {
         185  +
    /// Creates a new builder-style object to manufacture [`ResultInput`](crate::input::ResultInput).
         186  +
    pub fn builder() -> crate::input::result_input::Builder {
         187  +
        crate::input::result_input::Builder::default()
         188  +
    }
         189  +
}
         190  +
impl crate::constrained::Constrained for crate::input::ResultInput {
         191  +
    type Unconstrained = crate::input::result_input::Builder;
         192  +
}
         193  +
         194  +
#[allow(missing_docs)] // documentation missing in model
         195  +
#[derive(
         196  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         197  +
)]
         198  +
pub struct ErrCollisionsInput {}
         199  +
impl ErrCollisionsInput {
         200  +
    /// Creates a new builder-style object to manufacture [`ErrCollisionsInput`](crate::input::ErrCollisionsInput).
         201  +
    pub fn builder() -> crate::input::err_collisions_input::Builder {
         202  +
        crate::input::err_collisions_input::Builder::default()
         203  +
    }
         204  +
}
         205  +
impl crate::constrained::Constrained for crate::input::ErrCollisionsInput {
         206  +
    type Unconstrained = crate::input::err_collisions_input::Builder;
         207  +
}
         208  +
         209  +
#[allow(missing_docs)] // documentation missing in model
         210  +
#[derive(
         211  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         212  +
)]
         213  +
pub struct StructureNamePunningInput {
         214  +
    #[allow(missing_docs)] // documentation missing in model
         215  +
    pub regular_string: ::std::option::Option<::std::string::String>,
         216  +
    #[allow(missing_docs)] // documentation missing in model
         217  +
    pub punned_vec: ::std::option::Option<crate::model::Vec>,
         218  +
}
         219  +
impl StructureNamePunningInput {
         220  +
    #[allow(missing_docs)] // documentation missing in model
         221  +
    pub fn regular_string(&self) -> ::std::option::Option<&str> {
         222  +
        self.regular_string.as_deref()
         223  +
    }
         224  +
    #[allow(missing_docs)] // documentation missing in model
         225  +
    pub fn punned_vec(&self) -> ::std::option::Option<&crate::model::Vec> {
         226  +
        self.punned_vec.as_ref()
         227  +
    }
         228  +
}
         229  +
impl StructureNamePunningInput {
         230  +
    /// Creates a new builder-style object to manufacture [`StructureNamePunningInput`](crate::input::StructureNamePunningInput).
         231  +
    pub fn builder() -> crate::input::structure_name_punning_input::Builder {
         232  +
        crate::input::structure_name_punning_input::Builder::default()
         233  +
    }
         234  +
}
         235  +
impl crate::constrained::Constrained for crate::input::StructureNamePunningInput {
         236  +
    type Unconstrained = crate::input::structure_name_punning_input::Builder;
         237  +
}
         238  +
         239  +
#[allow(missing_docs)] // documentation missing in model
         240  +
#[derive(
         241  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         242  +
)]
         243  +
pub struct ReservedWordsAsMembersInput {
         244  +
    #[allow(missing_docs)] // documentation missing in model
         245  +
    pub r#as: ::std::option::Option<i32>,
         246  +
    #[allow(missing_docs)] // documentation missing in model
         247  +
    pub r#async: ::std::option::Option<bool>,
         248  +
    #[allow(missing_docs)] // documentation missing in model
         249  +
    pub r#enum: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
         250  +
    #[allow(missing_docs)] // documentation missing in model
         251  +
    pub self_: ::std::option::Option<bool>,
         252  +
    #[allow(missing_docs)] // documentation missing in model
         253  +
    pub crate_: ::std::option::Option<bool>,
         254  +
    #[allow(missing_docs)] // documentation missing in model
         255  +
    pub super_: ::std::option::Option<bool>,
         256  +
    #[allow(missing_docs)] // documentation missing in model
         257  +
    pub build_value: ::std::option::Option<::std::string::String>,
         258  +
    #[allow(missing_docs)] // documentation missing in model
         259  +
    pub default_value: ::std::option::Option<::std::string::String>,
         260  +
    #[allow(missing_docs)] // documentation missing in model
         261  +
    pub send: ::std::option::Option<::std::string::String>,
         262  +
}
         263  +
impl ReservedWordsAsMembersInput {
         264  +
    #[allow(missing_docs)] // documentation missing in model
         265  +
    pub fn r#as(&self) -> ::std::option::Option<i32> {
         266  +
        self.r#as
         267  +
    }
         268  +
    #[allow(missing_docs)] // documentation missing in model
         269  +
    pub fn r#async(&self) -> ::std::option::Option<bool> {
         270  +
        self.r#async
         271  +
    }
         272  +
    #[allow(missing_docs)] // documentation missing in model
         273  +
    pub fn r#enum(&self) -> ::std::option::Option<&crate::model::UnknownVariantCollidingEnum> {
         274  +
        self.r#enum.as_ref()
         275  +
    }
         276  +
    #[allow(missing_docs)] // documentation missing in model
         277  +
    pub fn self_(&self) -> ::std::option::Option<bool> {
         278  +
        self.self_
         279  +
    }
         280  +
    #[allow(missing_docs)] // documentation missing in model
         281  +
    pub fn crate_(&self) -> ::std::option::Option<bool> {
         282  +
        self.crate_
         283  +
    }
         284  +
    #[allow(missing_docs)] // documentation missing in model
         285  +
    pub fn super_(&self) -> ::std::option::Option<bool> {
         286  +
        self.super_
         287  +
    }
         288  +
    #[allow(missing_docs)] // documentation missing in model
         289  +
    pub fn build_value(&self) -> ::std::option::Option<&str> {
         290  +
        self.build_value.as_deref()
         291  +
    }
         292  +
    #[allow(missing_docs)] // documentation missing in model
         293  +
    pub fn default_value(&self) -> ::std::option::Option<&str> {
         294  +
        self.default_value.as_deref()
         295  +
    }
         296  +
    #[allow(missing_docs)] // documentation missing in model
         297  +
    pub fn send(&self) -> ::std::option::Option<&str> {
         298  +
        self.send.as_deref()
         299  +
    }
         300  +
}
         301  +
impl ReservedWordsAsMembersInput {
         302  +
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput).
         303  +
    pub fn builder() -> crate::input::reserved_words_as_members_input::Builder {
         304  +
        crate::input::reserved_words_as_members_input::Builder::default()
         305  +
    }
         306  +
}
         307  +
impl crate::constrained::Constrained for crate::input::ReservedWordsAsMembersInput {
         308  +
    type Unconstrained = crate::input::reserved_words_as_members_input::Builder;
         309  +
}
         310  +
/// See [`RpcEchoInput`](crate::input::RpcEchoInput).
         311  +
pub mod rpc_echo_input {
         312  +
         313  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         314  +
    /// Holds one variant for each of the ways the builder can fail.
         315  +
    #[non_exhaustive]
         316  +
    #[allow(clippy::enum_variant_names)]
         317  +
    pub enum ConstraintViolation {
         318  +
        /// Constraint violation occurred building member `r#enum` when building `RpcEchoInput`.
         319  +
        #[doc(hidden)]
         320  +
        Enum(crate::model::unknown_variant_colliding_enum::ConstraintViolation),
         321  +
    }
         322  +
    impl ::std::fmt::Display for ConstraintViolation {
         323  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         324  +
            match self {
         325  +
                ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `RpcEchoInput`"),
         326  +
            }
         327  +
        }
         328  +
    }
         329  +
    impl ::std::error::Error for ConstraintViolation {}
         330  +
    impl ConstraintViolation {
         331  +
        pub(crate) fn as_validation_exception_field(
         332  +
            self,
         333  +
            path: ::std::string::String,
         334  +
        ) -> crate::model::ValidationExceptionField {
         335  +
            match self {
         336  +
                ConstraintViolation::Enum(inner) => {
         337  +
                    inner.as_validation_exception_field(path + "/enum")
         338  +
                }
         339  +
            }
         340  +
        }
         341  +
    }
         342  +
    impl ::std::convert::From<ConstraintViolation>
         343  +
        for ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection
         344  +
    {
         345  +
        fn from(constraint_violation: ConstraintViolation) -> Self {
         346  +
            let first_validation_exception_field =
         347  +
                constraint_violation.as_validation_exception_field("".to_owned());
         348  +
            let validation_exception = crate::error::ValidationException {
         349  +
                message: format!(
         350  +
                    "1 validation error detected. {}",
         351  +
                    &first_validation_exception_field.message
         352  +
                ),
         353  +
                field_list: Some(vec![first_validation_exception_field]),
         354  +
            };
         355  +
            Self::ConstraintViolation(
         356  +
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
         357  +
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
         358  +
                            )
         359  +
        }
         360  +
    }
         361  +
    impl ::std::convert::From<Builder>
         362  +
        for crate::constrained::MaybeConstrained<crate::input::RpcEchoInput>
         363  +
    {
         364  +
        fn from(builder: Builder) -> Self {
         365  +
            Self::Unconstrained(builder)
         366  +
        }
         367  +
    }
         368  +
    impl ::std::convert::TryFrom<Builder> for crate::input::RpcEchoInput {
         369  +
        type Error = ConstraintViolation;
         370  +
         371  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         372  +
            builder.build()
         373  +
        }
         374  +
    }
         375  +
    /// A builder for [`RpcEchoInput`](crate::input::RpcEchoInput).
         376  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         377  +
    pub struct Builder {
         378  +
        pub(crate) r#as: ::std::option::Option<i32>,
         379  +
        pub(crate) r#async: ::std::option::Option<bool>,
         380  +
        pub(crate) r#enum: ::std::option::Option<
         381  +
            crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
         382  +
        >,
         383  +
        pub(crate) self_: ::std::option::Option<bool>,
         384  +
        pub(crate) crate_: ::std::option::Option<bool>,
         385  +
        pub(crate) super_: ::std::option::Option<bool>,
         386  +
        pub(crate) build_value: ::std::option::Option<::std::string::String>,
         387  +
        pub(crate) default_value: ::std::option::Option<::std::string::String>,
         388  +
        pub(crate) send: ::std::option::Option<::std::string::String>,
         389  +
    }
         390  +
    impl Builder {
         391  +
        #[allow(missing_docs)] // documentation missing in model
         392  +
        pub fn r#as(mut self, input: ::std::option::Option<i32>) -> Self {
         393  +
            self.r#as = input;
         394  +
            self
         395  +
        }
         396  +
        #[allow(missing_docs)] // documentation missing in model
         397  +
        pub(crate) fn set_as(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
         398  +
            self.r#as = input.map(|v| v.into());
         399  +
            self
         400  +
        }
         401  +
        #[allow(missing_docs)] // documentation missing in model
         402  +
        pub fn r#async(mut self, input: ::std::option::Option<bool>) -> Self {
         403  +
            self.r#async = input;
         404  +
            self
         405  +
        }
         406  +
        #[allow(missing_docs)] // documentation missing in model
         407  +
        pub(crate) fn set_async(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
         408  +
            self.r#async = input.map(|v| v.into());
         409  +
            self
         410  +
        }
         411  +
        #[allow(missing_docs)] // documentation missing in model
         412  +
        pub fn r#enum(
         413  +
            mut self,
         414  +
            input: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
         415  +
        ) -> Self {
         416  +
            self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
         417  +
            self
         418  +
        }
         419  +
        #[allow(missing_docs)] // documentation missing in model
         420  +
        pub(crate) fn set_enum(
         421  +
            mut self,
         422  +
            input: Option<
         423  +
                impl ::std::convert::Into<
         424  +
                    crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
         425  +
                >,
         426  +
            >,
         427  +
        ) -> Self {
         428  +
            self.r#enum = input.map(|v| v.into());
         429  +
            self
         430  +
        }
         431  +
        #[allow(missing_docs)] // documentation missing in model
         432  +
        pub fn self_(mut self, input: ::std::option::Option<bool>) -> Self {
         433  +
            self.self_ = input;
         434  +
            self
         435  +
        }
         436  +
        #[allow(missing_docs)] // documentation missing in model
         437  +
        pub(crate) fn set_self(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
         438  +
            self.self_ = input.map(|v| v.into());
         439  +
            self
         440  +
        }
         441  +
        #[allow(missing_docs)] // documentation missing in model
         442  +
        pub fn crate_(mut self, input: ::std::option::Option<bool>) -> Self {
         443  +
            self.crate_ = input;
         444  +
            self
         445  +
        }
         446  +
        #[allow(missing_docs)] // documentation missing in model
         447  +
        pub(crate) fn set_crate(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
         448  +
            self.crate_ = input.map(|v| v.into());
         449  +
            self
         450  +
        }
         451  +
        #[allow(missing_docs)] // documentation missing in model
         452  +
        pub fn super_(mut self, input: ::std::option::Option<bool>) -> Self {
         453  +
            self.super_ = input;
         454  +
            self
         455  +
        }
         456  +
        #[allow(missing_docs)] // documentation missing in model
         457  +
        pub(crate) fn set_super(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
         458  +
            self.super_ = input.map(|v| v.into());
         459  +
            self
         460  +
        }
         461  +
        #[allow(missing_docs)] // documentation missing in model
         462  +
        pub fn build_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         463  +
            self.build_value = input;
         464  +
            self
         465  +
        }
         466  +
        #[allow(missing_docs)] // documentation missing in model
         467  +
        pub(crate) fn set_build(
         468  +
            mut self,
         469  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         470  +
        ) -> Self {
         471  +
            self.build_value = input.map(|v| v.into());
         472  +
            self
         473  +
        }
         474  +
        #[allow(missing_docs)] // documentation missing in model
         475  +
        pub fn default_value(
         476  +
            mut self,
         477  +
            input: ::std::option::Option<::std::string::String>,
         478  +
        ) -> Self {
         479  +
            self.default_value = input;
         480  +
            self
         481  +
        }
         482  +
        #[allow(missing_docs)] // documentation missing in model
         483  +
        pub(crate) fn set_default(
         484  +
            mut self,
         485  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         486  +
        ) -> Self {
         487  +
            self.default_value = input.map(|v| v.into());
         488  +
            self
         489  +
        }
         490  +
        #[allow(missing_docs)] // documentation missing in model
         491  +
        pub fn send(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         492  +
            self.send = input;
         493  +
            self
         494  +
        }
         495  +
        #[allow(missing_docs)] // documentation missing in model
         496  +
        pub(crate) fn set_send(
         497  +
            mut self,
         498  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         499  +
        ) -> Self {
         500  +
            self.send = input.map(|v| v.into());
         501  +
            self
         502  +
        }
         503  +
        /// Consumes the builder and constructs a [`RpcEchoInput`](crate::input::RpcEchoInput).
         504  +
        ///
         505  +
        /// The builder fails to construct a [`RpcEchoInput`](crate::input::RpcEchoInput) if a [`ConstraintViolation`] occurs.
         506  +
        ///
         507  +
        pub fn build(self) -> Result<crate::input::RpcEchoInput, ConstraintViolation> {
         508  +
            self.build_enforcing_all_constraints()
         509  +
        }
         510  +
        fn build_enforcing_all_constraints(
         511  +
            self,
         512  +
        ) -> Result<crate::input::RpcEchoInput, ConstraintViolation> {
         513  +
            Ok(crate::input::RpcEchoInput {
         514  +
                r#as: self.r#as,
         515  +
                r#async: self.r#async,
         516  +
                r#enum: self
         517  +
                    .r#enum
         518  +
                    .map(|v| match v {
         519  +
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
         520  +
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
         521  +
                    })
         522  +
                    .map(|res| res.map_err(ConstraintViolation::Enum))
         523  +
                    .transpose()?,
         524  +
                self_: self.self_,
         525  +
                crate_: self.crate_,
         526  +
                super_: self.super_,
         527  +
                build_value: self.build_value,
         528  +
                default_value: self.default_value,
         529  +
                send: self.send,
         530  +
            })
         531  +
        }
         532  +
    }
         533  +
}
         534  +
/// See [`MatchInput`](crate::input::MatchInput).
         535  +
pub mod match_input {
         536  +
         537  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         538  +
    /// Holds one variant for each of the ways the builder can fail.
         539  +
    #[non_exhaustive]
         540  +
    #[allow(clippy::enum_variant_names)]
         541  +
    pub enum ConstraintViolation {
         542  +
        /// Constraint violation occurred building member `r#enum` when building `MatchInput`.
         543  +
        #[doc(hidden)]
         544  +
        Enum(crate::model::unknown_variant_colliding_enum::ConstraintViolation),
         545  +
    }
         546  +
    impl ::std::fmt::Display for ConstraintViolation {
         547  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         548  +
            match self {
         549  +
                ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `MatchInput`"),
         550  +
            }
         551  +
        }
         552  +
    }
         553  +
    impl ::std::error::Error for ConstraintViolation {}
         554  +
    impl ConstraintViolation {
         555  +
        pub(crate) fn as_validation_exception_field(
         556  +
            self,
         557  +
            path: ::std::string::String,
         558  +
        ) -> crate::model::ValidationExceptionField {
         559  +
            match self {
         560  +
                ConstraintViolation::Enum(inner) => {
         561  +
                    inner.as_validation_exception_field(path + "/enum")
         562  +
                }
         563  +
            }
         564  +
        }
         565  +
    }
         566  +
    impl ::std::convert::From<ConstraintViolation>
         567  +
        for ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection
         568  +
    {
         569  +
        fn from(constraint_violation: ConstraintViolation) -> Self {
         570  +
            let first_validation_exception_field =
         571  +
                constraint_violation.as_validation_exception_field("".to_owned());
         572  +
            let validation_exception = crate::error::ValidationException {
         573  +
                message: format!(
         574  +
                    "1 validation error detected. {}",
         575  +
                    &first_validation_exception_field.message
         576  +
                ),
         577  +
                field_list: Some(vec![first_validation_exception_field]),
         578  +
            };
         579  +
            Self::ConstraintViolation(
         580  +
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
         581  +
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
         582  +
                            )
         583  +
        }
         584  +
    }
         585  +
    impl ::std::convert::From<Builder>
         586  +
        for crate::constrained::MaybeConstrained<crate::input::MatchInput>
         587  +
    {
         588  +
        fn from(builder: Builder) -> Self {
         589  +
            Self::Unconstrained(builder)
         590  +
        }
         591  +
    }
         592  +
    impl ::std::convert::TryFrom<Builder> for crate::input::MatchInput {
         593  +
        type Error = ConstraintViolation;
         594  +
         595  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         596  +
            builder.build()
         597  +
        }
         598  +
    }
         599  +
    /// A builder for [`MatchInput`](crate::input::MatchInput).
         600  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         601  +
    pub struct Builder {
         602  +
        pub(crate) r#as: ::std::option::Option<i32>,
         603  +
        pub(crate) r#async: ::std::option::Option<bool>,
         604  +
        pub(crate) r#enum: ::std::option::Option<
         605  +
            crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
         606  +
        >,
         607  +
        pub(crate) self_: ::std::option::Option<bool>,
         608  +
        pub(crate) crate_: ::std::option::Option<bool>,
         609  +
        pub(crate) super_: ::std::option::Option<bool>,
         610  +
        pub(crate) build_value: ::std::option::Option<::std::string::String>,
         611  +
        pub(crate) default_value: ::std::option::Option<::std::string::String>,
         612  +
        pub(crate) send: ::std::option::Option<::std::string::String>,
         613  +
    }
         614  +
    impl Builder {
         615  +
        #[allow(missing_docs)] // documentation missing in model
         616  +
        pub fn r#as(mut self, input: ::std::option::Option<i32>) -> Self {
         617  +
            self.r#as = input;
         618  +
            self
         619  +
        }
         620  +
        #[allow(missing_docs)] // documentation missing in model
         621  +
        pub(crate) fn set_as(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
         622  +
            self.r#as = input.map(|v| v.into());
         623  +
            self
         624  +
        }
         625  +
        #[allow(missing_docs)] // documentation missing in model
         626  +
        pub fn r#async(mut self, input: ::std::option::Option<bool>) -> Self {
         627  +
            self.r#async = input;
         628  +
            self
         629  +
        }
         630  +
        #[allow(missing_docs)] // documentation missing in model
         631  +
        pub(crate) fn set_async(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
         632  +
            self.r#async = input.map(|v| v.into());
         633  +
            self
         634  +
        }
         635  +
        #[allow(missing_docs)] // documentation missing in model
         636  +
        pub fn r#enum(
         637  +
            mut self,
         638  +
            input: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
         639  +
        ) -> Self {
         640  +
            self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
         641  +
            self
         642  +
        }
         643  +
        #[allow(missing_docs)] // documentation missing in model
         644  +
        pub(crate) fn set_enum(
         645  +
            mut self,
         646  +
            input: Option<
         647  +
                impl ::std::convert::Into<
         648  +
                    crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
         649  +
                >,
         650  +
            >,
         651  +
        ) -> Self {
         652  +
            self.r#enum = input.map(|v| v.into());
         653  +
            self
         654  +
        }
         655  +
        #[allow(missing_docs)] // documentation missing in model
         656  +
        pub fn self_(mut self, input: ::std::option::Option<bool>) -> Self {
         657  +
            self.self_ = input;
         658  +
            self
         659  +
        }
         660  +
        #[allow(missing_docs)] // documentation missing in model
         661  +
        pub(crate) fn set_self(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
         662  +
            self.self_ = input.map(|v| v.into());
         663  +
            self
         664  +
        }
         665  +
        #[allow(missing_docs)] // documentation missing in model
         666  +
        pub fn crate_(mut self, input: ::std::option::Option<bool>) -> Self {
         667  +
            self.crate_ = input;
         668  +
            self
         669  +
        }
         670  +
        #[allow(missing_docs)] // documentation missing in model
         671  +
        pub(crate) fn set_crate(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
         672  +
            self.crate_ = input.map(|v| v.into());
         673  +
            self
         674  +
        }
         675  +
        #[allow(missing_docs)] // documentation missing in model
         676  +
        pub fn super_(mut self, input: ::std::option::Option<bool>) -> Self {
         677  +
            self.super_ = input;
         678  +
            self
         679  +
        }
         680  +
        #[allow(missing_docs)] // documentation missing in model
         681  +
        pub(crate) fn set_super(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
         682  +
            self.super_ = input.map(|v| v.into());
         683  +
            self
         684  +
        }
         685  +
        #[allow(missing_docs)] // documentation missing in model
         686  +
        pub fn build_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         687  +
            self.build_value = input;
         688  +
            self
         689  +
        }
         690  +
        #[allow(missing_docs)] // documentation missing in model
         691  +
        pub(crate) fn set_build(
         692  +
            mut self,
         693  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         694  +
        ) -> Self {
         695  +
            self.build_value = input.map(|v| v.into());
         696  +
            self
         697  +
        }
         698  +
        #[allow(missing_docs)] // documentation missing in model
         699  +
        pub fn default_value(
         700  +
            mut self,
         701  +
            input: ::std::option::Option<::std::string::String>,
         702  +
        ) -> Self {
         703  +
            self.default_value = input;
         704  +
            self
         705  +
        }
         706  +
        #[allow(missing_docs)] // documentation missing in model
         707  +
        pub(crate) fn set_default(
         708  +
            mut self,
         709  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         710  +
        ) -> Self {
         711  +
            self.default_value = input.map(|v| v.into());
         712  +
            self
         713  +
        }
         714  +
        #[allow(missing_docs)] // documentation missing in model
         715  +
        pub fn send(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         716  +
            self.send = input;
         717  +
            self
         718  +
        }
         719  +
        #[allow(missing_docs)] // documentation missing in model
         720  +
        pub(crate) fn set_send(
         721  +
            mut self,
         722  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         723  +
        ) -> Self {
         724  +
            self.send = input.map(|v| v.into());
         725  +
            self
         726  +
        }
         727  +
        /// Consumes the builder and constructs a [`MatchInput`](crate::input::MatchInput).
         728  +
        ///
         729  +
        /// The builder fails to construct a [`MatchInput`](crate::input::MatchInput) if a [`ConstraintViolation`] occurs.
         730  +
        ///
         731  +
        pub fn build(self) -> Result<crate::input::MatchInput, ConstraintViolation> {
         732  +
            self.build_enforcing_all_constraints()
         733  +
        }
         734  +
        fn build_enforcing_all_constraints(
         735  +
            self,
         736  +
        ) -> Result<crate::input::MatchInput, ConstraintViolation> {
         737  +
            Ok(crate::input::MatchInput {
         738  +
                r#as: self.r#as,
         739  +
                r#async: self.r#async,
         740  +
                r#enum: self
         741  +
                    .r#enum
         742  +
                    .map(|v| match v {
         743  +
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
         744  +
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
         745  +
                    })
         746  +
                    .map(|res| res.map_err(ConstraintViolation::Enum))
         747  +
                    .transpose()?,
         748  +
                self_: self.self_,
         749  +
                crate_: self.crate_,
         750  +
                super_: self.super_,
         751  +
                build_value: self.build_value,
         752  +
                default_value: self.default_value,
         753  +
                send: self.send,
         754  +
            })
         755  +
        }
         756  +
    }
         757  +
}
         758  +
/// See [`OptionInput`](crate::input::OptionInput).
         759  +
pub mod option_input {
         760  +
         761  +
    impl ::std::convert::From<Builder> for crate::input::OptionInput {
         762  +
        fn from(builder: Builder) -> Self {
         763  +
            builder.build()
         764  +
        }
         765  +
    }
         766  +
    /// A builder for [`OptionInput`](crate::input::OptionInput).
         767  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         768  +
    pub struct Builder {
         769  +
        pub(crate) pv_member: ::std::option::Option<bool>,
         770  +
    }
         771  +
    impl Builder {
         772  +
        #[allow(missing_docs)] // documentation missing in model
         773  +
        pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
         774  +
            self.pv_member = input;
         775  +
            self
         776  +
        }
         777  +
        #[allow(missing_docs)] // documentation missing in model
         778  +
        pub(crate) fn set_pv_member(
         779  +
            mut self,
         780  +
            input: Option<impl ::std::convert::Into<bool>>,
         781  +
        ) -> Self {
         782  +
            self.pv_member = input.map(|v| v.into());
         783  +
            self
         784  +
        }
         785  +
        /// Consumes the builder and constructs a [`OptionInput`](crate::input::OptionInput).
         786  +
        pub fn build(self) -> crate::input::OptionInput {
         787  +
            self.build_enforcing_all_constraints()
         788  +
        }
         789  +
        fn build_enforcing_all_constraints(self) -> crate::input::OptionInput {
         790  +
            crate::input::OptionInput {
         791  +
                pv_member: self.pv_member,
         792  +
            }
         793  +
        }
         794  +
    }
         795  +
}
         796  +
/// See [`ResultInput`](crate::input::ResultInput).
         797  +
pub mod result_input {
         798  +
         799  +
    impl ::std::convert::From<Builder> for crate::input::ResultInput {
         800  +
        fn from(builder: Builder) -> Self {
         801  +
            builder.build()
         802  +
        }
         803  +
    }
         804  +
    /// A builder for [`ResultInput`](crate::input::ResultInput).
         805  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         806  +
    pub struct Builder {
         807  +
        pub(crate) pv_member: ::std::option::Option<bool>,
         808  +
    }
         809  +
    impl Builder {
         810  +
        #[allow(missing_docs)] // documentation missing in model
         811  +
        pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
         812  +
            self.pv_member = input;
         813  +
            self
         814  +
        }
         815  +
        #[allow(missing_docs)] // documentation missing in model
         816  +
        pub(crate) fn set_pv_member(
         817  +
            mut self,
         818  +
            input: Option<impl ::std::convert::Into<bool>>,
         819  +
        ) -> Self {
         820  +
            self.pv_member = input.map(|v| v.into());
         821  +
            self
         822  +
        }
         823  +
        /// Consumes the builder and constructs a [`ResultInput`](crate::input::ResultInput).
         824  +
        pub fn build(self) -> crate::input::ResultInput {
         825  +
            self.build_enforcing_all_constraints()
         826  +
        }
         827  +
        fn build_enforcing_all_constraints(self) -> crate::input::ResultInput {
         828  +
            crate::input::ResultInput {
         829  +
                pv_member: self.pv_member,
         830  +
            }
         831  +
        }
         832  +
    }
         833  +
}
         834  +
/// See [`ErrCollisionsInput`](crate::input::ErrCollisionsInput).
         835  +
pub mod err_collisions_input {
         836  +
         837  +
    impl ::std::convert::From<Builder> for crate::input::ErrCollisionsInput {
         838  +
        fn from(builder: Builder) -> Self {
         839  +
            builder.build()
         840  +
        }
         841  +
    }
         842  +
    /// A builder for [`ErrCollisionsInput`](crate::input::ErrCollisionsInput).
         843  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         844  +
    pub struct Builder {}
         845  +
    impl Builder {
         846  +
        /// Consumes the builder and constructs a [`ErrCollisionsInput`](crate::input::ErrCollisionsInput).
         847  +
        pub fn build(self) -> crate::input::ErrCollisionsInput {
         848  +
            self.build_enforcing_all_constraints()
         849  +
        }
         850  +
        fn build_enforcing_all_constraints(self) -> crate::input::ErrCollisionsInput {
         851  +
            crate::input::ErrCollisionsInput {}
         852  +
        }
         853  +
    }
         854  +
}
         855  +
/// See [`StructureNamePunningInput`](crate::input::StructureNamePunningInput).
         856  +
pub mod structure_name_punning_input {
         857  +
         858  +
    impl ::std::convert::From<Builder> for crate::input::StructureNamePunningInput {
         859  +
        fn from(builder: Builder) -> Self {
         860  +
            builder.build()
         861  +
        }
         862  +
    }
         863  +
    /// A builder for [`StructureNamePunningInput`](crate::input::StructureNamePunningInput).
         864  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         865  +
    pub struct Builder {
         866  +
        pub(crate) regular_string: ::std::option::Option<::std::string::String>,
         867  +
        pub(crate) punned_vec: ::std::option::Option<crate::model::Vec>,
         868  +
    }
         869  +
    impl Builder {
         870  +
        #[allow(missing_docs)] // documentation missing in model
         871  +
        pub fn regular_string(
         872  +
            mut self,
         873  +
            input: ::std::option::Option<::std::string::String>,
         874  +
        ) -> Self {
         875  +
            self.regular_string = input;
         876  +
            self
         877  +
        }
         878  +
        #[allow(missing_docs)] // documentation missing in model
         879  +
        pub(crate) fn set_regular_string(
         880  +
            mut self,
         881  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         882  +
        ) -> Self {
         883  +
            self.regular_string = input.map(|v| v.into());
         884  +
            self
         885  +
        }
         886  +
        #[allow(missing_docs)] // documentation missing in model
         887  +
        pub fn punned_vec(mut self, input: ::std::option::Option<crate::model::Vec>) -> Self {
         888  +
            self.punned_vec = input;
         889  +
            self
         890  +
        }
         891  +
        #[allow(missing_docs)] // documentation missing in model
         892  +
        pub(crate) fn set_punned_vec(
         893  +
            mut self,
         894  +
            input: Option<impl ::std::convert::Into<crate::model::Vec>>,
         895  +
        ) -> Self {
         896  +
            self.punned_vec = input.map(|v| v.into());
         897  +
            self
         898  +
        }
         899  +
        /// Consumes the builder and constructs a [`StructureNamePunningInput`](crate::input::StructureNamePunningInput).
         900  +
        pub fn build(self) -> crate::input::StructureNamePunningInput {
         901  +
            self.build_enforcing_all_constraints()
         902  +
        }
         903  +
        fn build_enforcing_all_constraints(self) -> crate::input::StructureNamePunningInput {
         904  +
            crate::input::StructureNamePunningInput {
         905  +
                regular_string: self.regular_string,
         906  +
                punned_vec: self.punned_vec,
         907  +
            }
         908  +
        }
         909  +
    }
         910  +
}
         911  +
/// See [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput).
         912  +
pub mod reserved_words_as_members_input {
         913  +
         914  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         915  +
    /// Holds one variant for each of the ways the builder can fail.
         916  +
    #[non_exhaustive]
         917  +
    #[allow(clippy::enum_variant_names)]
         918  +
    pub enum ConstraintViolation {
         919  +
        /// Constraint violation occurred building member `r#enum` when building `ReservedWordsAsMembersInput`.
         920  +
        #[doc(hidden)]
         921  +
        Enum(crate::model::unknown_variant_colliding_enum::ConstraintViolation),
         922  +
    }
         923  +
    impl ::std::fmt::Display for ConstraintViolation {
         924  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         925  +
            match self {
         926  +
                ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `ReservedWordsAsMembersInput`"),
         927  +
            }
         928  +
        }
         929  +
    }
         930  +
    impl ::std::error::Error for ConstraintViolation {}
         931  +
    impl ConstraintViolation {
         932  +
        pub(crate) fn as_validation_exception_field(
         933  +
            self,
         934  +
            path: ::std::string::String,
         935  +
        ) -> crate::model::ValidationExceptionField {
         936  +
            match self {
         937  +
                ConstraintViolation::Enum(inner) => {
         938  +
                    inner.as_validation_exception_field(path + "/enum")
         939  +
                }
         940  +
            }
         941  +
        }
         942  +
    }
         943  +
    impl ::std::convert::From<ConstraintViolation>
         944  +
        for ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection
         945  +
    {
         946  +
        fn from(constraint_violation: ConstraintViolation) -> Self {
         947  +
            let first_validation_exception_field =
         948  +
                constraint_violation.as_validation_exception_field("".to_owned());
         949  +
            let validation_exception = crate::error::ValidationException {
         950  +
                message: format!(
         951  +
                    "1 validation error detected. {}",
         952  +
                    &first_validation_exception_field.message
         953  +
                ),
         954  +
                field_list: Some(vec![first_validation_exception_field]),
         955  +
            };
         956  +
            Self::ConstraintViolation(
         957  +
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
         958  +
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
         959  +
                            )
         960  +
        }
         961  +
    }
         962  +
    impl ::std::convert::From<Builder>
         963  +
        for crate::constrained::MaybeConstrained<crate::input::ReservedWordsAsMembersInput>
         964  +
    {
         965  +
        fn from(builder: Builder) -> Self {
         966  +
            Self::Unconstrained(builder)
         967  +
        }
         968  +
    }
         969  +
    impl ::std::convert::TryFrom<Builder> for crate::input::ReservedWordsAsMembersInput {
         970  +
        type Error = ConstraintViolation;
         971  +
         972  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         973  +
            builder.build()
         974  +
        }
         975  +
    }
         976  +
    /// A builder for [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput).
         977  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         978  +
    pub struct Builder {
         979  +
        pub(crate) r#as: ::std::option::Option<i32>,
         980  +
        pub(crate) r#async: ::std::option::Option<bool>,
         981  +
        pub(crate) r#enum: ::std::option::Option<
         982  +
            crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
         983  +
        >,
         984  +
        pub(crate) self_: ::std::option::Option<bool>,
         985  +
        pub(crate) crate_: ::std::option::Option<bool>,
         986  +
        pub(crate) super_: ::std::option::Option<bool>,
         987  +
        pub(crate) build_value: ::std::option::Option<::std::string::String>,
         988  +
        pub(crate) default_value: ::std::option::Option<::std::string::String>,
         989  +
        pub(crate) send: ::std::option::Option<::std::string::String>,
         990  +
    }
         991  +
    impl Builder {
         992  +
        #[allow(missing_docs)] // documentation missing in model
         993  +
        pub fn r#as(mut self, input: ::std::option::Option<i32>) -> Self {
         994  +
            self.r#as = input;
         995  +
            self
         996  +
        }
         997  +
        #[allow(missing_docs)] // documentation missing in model
         998  +
        pub(crate) fn set_as(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
         999  +
            self.r#as = input.map(|v| v.into());
        1000  +
            self
        1001  +
        }
        1002  +
        #[allow(missing_docs)] // documentation missing in model
        1003  +
        pub fn r#async(mut self, input: ::std::option::Option<bool>) -> Self {
        1004  +
            self.r#async = input;
        1005  +
            self
        1006  +
        }
        1007  +
        #[allow(missing_docs)] // documentation missing in model
        1008  +
        pub(crate) fn set_async(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
        1009  +
            self.r#async = input.map(|v| v.into());
        1010  +
            self
        1011  +
        }
        1012  +
        #[allow(missing_docs)] // documentation missing in model
        1013  +
        pub fn r#enum(
        1014  +
            mut self,
        1015  +
            input: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
        1016  +
        ) -> Self {
        1017  +
            self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
        1018  +
            self
        1019  +
        }
        1020  +
        #[allow(missing_docs)] // documentation missing in model
        1021  +
        pub(crate) fn set_enum(
        1022  +
            mut self,
        1023  +
            input: Option<
        1024  +
                impl ::std::convert::Into<
        1025  +
                    crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
        1026  +
                >,
        1027  +
            >,
        1028  +
        ) -> Self {
        1029  +
            self.r#enum = input.map(|v| v.into());
        1030  +
            self
        1031  +
        }
        1032  +
        #[allow(missing_docs)] // documentation missing in model
        1033  +
        pub fn self_(mut self, input: ::std::option::Option<bool>) -> Self {
        1034  +
            self.self_ = input;
        1035  +
            self
        1036  +
        }
        1037  +
        #[allow(missing_docs)] // documentation missing in model
        1038  +
        pub(crate) fn set_self(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
        1039  +
            self.self_ = input.map(|v| v.into());
        1040  +
            self
        1041  +
        }
        1042  +
        #[allow(missing_docs)] // documentation missing in model
        1043  +
        pub fn crate_(mut self, input: ::std::option::Option<bool>) -> Self {
        1044  +
            self.crate_ = input;
        1045  +
            self
        1046  +
        }
        1047  +
        #[allow(missing_docs)] // documentation missing in model
        1048  +
        pub(crate) fn set_crate(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
        1049  +
            self.crate_ = input.map(|v| v.into());
        1050  +
            self
        1051  +
        }
        1052  +
        #[allow(missing_docs)] // documentation missing in model
        1053  +
        pub fn super_(mut self, input: ::std::option::Option<bool>) -> Self {
        1054  +
            self.super_ = input;
        1055  +
            self
        1056  +
        }
        1057  +
        #[allow(missing_docs)] // documentation missing in model
        1058  +
        pub(crate) fn set_super(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
        1059  +
            self.super_ = input.map(|v| v.into());
        1060  +
            self
        1061  +
        }
        1062  +
        #[allow(missing_docs)] // documentation missing in model
        1063  +
        pub fn build_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        1064  +
            self.build_value = input;
        1065  +
            self
        1066  +
        }
        1067  +
        #[allow(missing_docs)] // documentation missing in model
        1068  +
        pub(crate) fn set_build(
        1069  +
            mut self,
        1070  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
        1071  +
        ) -> Self {
        1072  +
            self.build_value = input.map(|v| v.into());
        1073  +
            self
        1074  +
        }
        1075  +
        #[allow(missing_docs)] // documentation missing in model
        1076  +
        pub fn default_value(
        1077  +
            mut self,
        1078  +
            input: ::std::option::Option<::std::string::String>,
        1079  +
        ) -> Self {
        1080  +
            self.default_value = input;
        1081  +
            self
        1082  +
        }
        1083  +
        #[allow(missing_docs)] // documentation missing in model
        1084  +
        pub(crate) fn set_default(
        1085  +
            mut self,
        1086  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
        1087  +
        ) -> Self {
        1088  +
            self.default_value = input.map(|v| v.into());
        1089  +
            self
        1090  +
        }
        1091  +
        #[allow(missing_docs)] // documentation missing in model
        1092  +
        pub fn send(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        1093  +
            self.send = input;
        1094  +
            self
        1095  +
        }
        1096  +
        #[allow(missing_docs)] // documentation missing in model
        1097  +
        pub(crate) fn set_send(
        1098  +
            mut self,
        1099  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
        1100  +
        ) -> Self {
        1101  +
            self.send = input.map(|v| v.into());
        1102  +
            self
        1103  +
        }
        1104  +
        /// Consumes the builder and constructs a [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput).
        1105  +
        ///
        1106  +
        /// The builder fails to construct a [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput) if a [`ConstraintViolation`] occurs.
        1107  +
        ///
        1108  +
        pub fn build(
        1109  +
            self,
        1110  +
        ) -> Result<crate::input::ReservedWordsAsMembersInput, ConstraintViolation> {
        1111  +
            self.build_enforcing_all_constraints()
        1112  +
        }
        1113  +
        fn build_enforcing_all_constraints(
        1114  +
            self,
        1115  +
        ) -> Result<crate::input::ReservedWordsAsMembersInput, ConstraintViolation> {
        1116  +
            Ok(crate::input::ReservedWordsAsMembersInput {
        1117  +
                r#as: self.r#as,
        1118  +
                r#async: self.r#async,
        1119  +
                r#enum: self
        1120  +
                    .r#enum
        1121  +
                    .map(|v| match v {
        1122  +
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
        1123  +
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
        1124  +
                    })
        1125  +
                    .map(|res| res.map_err(ConstraintViolation::Enum))
        1126  +
                    .transpose()?,
        1127  +
                self_: self.self_,
        1128  +
                crate_: self.crate_,
        1129  +
                super_: self.super_,
        1130  +
                build_value: self.build_value,
        1131  +
                default_value: self.default_value,
        1132  +
                send: self.send,
        1133  +
            })
        1134  +
        }
        1135  +
    }
        1136  +
}