Server Test

Server Test

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb (ignoring whitespace)

Files changed:

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

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

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

@@ -0,1 +0,7 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) static CONTENT_TYPE_APPLICATION_JSON: std::sync::LazyLock<::mime::Mime> =
           3  +
    std::sync::LazyLock::new(|| {
           4  +
        "application/json"
           5  +
            .parse::<::mime::Mime>()
           6  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
           7  +
    });

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

@@ -0,1 +0,925 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// Describes one specific validation failure for an input member.
           4  +
#[derive(
           5  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
           6  +
)]
           7  +
pub struct ValidationExceptionField {
           8  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
           9  +
    pub path: ::std::string::String,
          10  +
    /// A detailed description of the validation failure.
          11  +
    pub message: ::std::string::String,
          12  +
}
          13  +
impl ValidationExceptionField {
          14  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          15  +
    pub fn path(&self) -> &str {
          16  +
        use std::ops::Deref;
          17  +
        self.path.deref()
          18  +
    }
          19  +
    /// A detailed description of the validation failure.
          20  +
    pub fn message(&self) -> &str {
          21  +
        use std::ops::Deref;
          22  +
        self.message.deref()
          23  +
    }
          24  +
}
          25  +
impl ValidationExceptionField {
          26  +
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
          27  +
    pub fn builder() -> crate::model::validation_exception_field::Builder {
          28  +
        crate::model::validation_exception_field::Builder::default()
          29  +
    }
          30  +
}
          31  +
          32  +
#[allow(missing_docs)] // documentation missing in model
          33  +
///
          34  +
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
          35  +
/// [constraint traits]. Use [`HeaderSet::try_from`] to construct values of this type.
          36  +
///
          37  +
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
          38  +
///
          39  +
#[derive(
          40  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          41  +
)]
          42  +
pub struct HeaderSet(pub(crate) ::std::vec::Vec<::std::string::String>);
          43  +
impl HeaderSet {
          44  +
    /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
          45  +
    pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
          46  +
        &self.0
          47  +
    }
          48  +
    /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
          49  +
    pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
          50  +
        self.0
          51  +
    }
          52  +
          53  +
    fn check_unique_items(
          54  +
        items: ::std::vec::Vec<::std::string::String>,
          55  +
    ) -> ::std::result::Result<
          56  +
        ::std::vec::Vec<::std::string::String>,
          57  +
        crate::model::header_set::ConstraintViolation,
          58  +
    > {
          59  +
        let mut seen = ::std::collections::HashMap::new();
          60  +
        let mut duplicate_indices = ::std::vec::Vec::new();
          61  +
        for (idx, item) in items.iter().enumerate() {
          62  +
            if let Some(prev_idx) = seen.insert(item, idx) {
          63  +
                duplicate_indices.push(prev_idx);
          64  +
            }
          65  +
        }
          66  +
          67  +
        let mut last_duplicate_indices = ::std::vec::Vec::new();
          68  +
        for idx in &duplicate_indices {
          69  +
            if let Some(prev_idx) = seen.remove(&items[*idx]) {
          70  +
                last_duplicate_indices.push(prev_idx);
          71  +
            }
          72  +
        }
          73  +
        duplicate_indices.extend(last_duplicate_indices);
          74  +
          75  +
        if !duplicate_indices.is_empty() {
          76  +
            debug_assert!(duplicate_indices.len() >= 2);
          77  +
            Err(crate::model::header_set::ConstraintViolation::UniqueItems {
          78  +
                duplicate_indices,
          79  +
                original: items,
          80  +
            })
          81  +
        } else {
          82  +
            Ok(items)
          83  +
        }
          84  +
    }
          85  +
}
          86  +
impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for HeaderSet {
          87  +
    type Error = crate::model::header_set::ConstraintViolation;
          88  +
          89  +
    /// Constructs a `HeaderSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
          90  +
    fn try_from(
          91  +
        value: ::std::vec::Vec<::std::string::String>,
          92  +
    ) -> ::std::result::Result<Self, Self::Error> {
          93  +
        let value = Self::check_unique_items(value)?;
          94  +
          95  +
        Ok(Self(value))
          96  +
    }
          97  +
}
          98  +
          99  +
impl ::std::convert::From<HeaderSet> for ::std::vec::Vec<::std::string::String> {
         100  +
    fn from(value: HeaderSet) -> Self {
         101  +
        value.into_inner()
         102  +
    }
         103  +
}
         104  +
impl crate::constrained::Constrained for HeaderSet {
         105  +
    type Unconstrained = crate::unconstrained::header_set_unconstrained::HeaderSetUnconstrained;
         106  +
}
         107  +
         108  +
#[allow(missing_docs)] // documentation missing in model
         109  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
         110  +
pub struct InnerShape {
         111  +
    #[allow(missing_docs)] // documentation missing in model
         112  +
    pub required_inner_most_shape: crate::model::InnermostShape,
         113  +
}
         114  +
impl InnerShape {
         115  +
    #[allow(missing_docs)] // documentation missing in model
         116  +
    pub fn required_inner_most_shape(&self) -> &crate::model::InnermostShape {
         117  +
        &self.required_inner_most_shape
         118  +
    }
         119  +
}
         120  +
impl InnerShape {
         121  +
    /// Creates a new builder-style object to manufacture [`InnerShape`](crate::model::InnerShape).
         122  +
    pub fn builder() -> crate::model::inner_shape::Builder {
         123  +
        crate::model::inner_shape::Builder::default()
         124  +
    }
         125  +
}
         126  +
impl crate::constrained::Constrained for crate::model::InnerShape {
         127  +
    type Unconstrained = crate::model::inner_shape::Builder;
         128  +
}
         129  +
         130  +
#[allow(missing_docs)] // documentation missing in model
         131  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
         132  +
pub struct InnermostShape {
         133  +
    #[allow(missing_docs)] // documentation missing in model
         134  +
    pub a_string: ::std::string::String,
         135  +
    #[allow(missing_docs)] // documentation missing in model
         136  +
    pub a_boolean: bool,
         137  +
    #[allow(missing_docs)] // documentation missing in model
         138  +
    pub a_byte: i8,
         139  +
    #[allow(missing_docs)] // documentation missing in model
         140  +
    pub a_short: i16,
         141  +
    #[allow(missing_docs)] // documentation missing in model
         142  +
    pub an_int: i32,
         143  +
    #[allow(missing_docs)] // documentation missing in model
         144  +
    pub a_long: i64,
         145  +
    #[allow(missing_docs)] // documentation missing in model
         146  +
    pub a_float: f32,
         147  +
    #[allow(missing_docs)] // documentation missing in model
         148  +
    pub a_double: f64,
         149  +
    #[allow(missing_docs)] // documentation missing in model
         150  +
    pub a_timestamp: ::aws_smithy_types::DateTime,
         151  +
    #[allow(missing_docs)] // documentation missing in model
         152  +
    pub a_document: ::aws_smithy_types::DateTime,
         153  +
    #[allow(missing_docs)] // documentation missing in model
         154  +
    pub a_string_list: ::std::vec::Vec<::std::string::String>,
         155  +
    #[allow(missing_docs)] // documentation missing in model
         156  +
    pub a_string_map:
         157  +
        ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::DateTime>,
         158  +
    #[allow(missing_docs)] // documentation missing in model
         159  +
    pub a_string_set: ::std::vec::Vec<::std::string::String>,
         160  +
    #[allow(missing_docs)] // documentation missing in model
         161  +
    pub a_blob: ::aws_smithy_types::Blob,
         162  +
    #[allow(missing_docs)] // documentation missing in model
         163  +
    pub a_union: crate::model::AUnion,
         164  +
}
         165  +
impl InnermostShape {
         166  +
    #[allow(missing_docs)] // documentation missing in model
         167  +
    pub fn a_string(&self) -> &str {
         168  +
        use std::ops::Deref;
         169  +
        self.a_string.deref()
         170  +
    }
         171  +
    #[allow(missing_docs)] // documentation missing in model
         172  +
    pub fn a_boolean(&self) -> bool {
         173  +
        self.a_boolean
         174  +
    }
         175  +
    #[allow(missing_docs)] // documentation missing in model
         176  +
    pub fn a_byte(&self) -> i8 {
         177  +
        self.a_byte
         178  +
    }
         179  +
    #[allow(missing_docs)] // documentation missing in model
         180  +
    pub fn a_short(&self) -> i16 {
         181  +
        self.a_short
         182  +
    }
         183  +
    #[allow(missing_docs)] // documentation missing in model
         184  +
    pub fn an_int(&self) -> i32 {
         185  +
        self.an_int
         186  +
    }
         187  +
    #[allow(missing_docs)] // documentation missing in model
         188  +
    pub fn a_long(&self) -> i64 {
         189  +
        self.a_long
         190  +
    }
         191  +
    #[allow(missing_docs)] // documentation missing in model
         192  +
    pub fn a_float(&self) -> f32 {
         193  +
        self.a_float
         194  +
    }
         195  +
    #[allow(missing_docs)] // documentation missing in model
         196  +
    pub fn a_double(&self) -> f64 {
         197  +
        self.a_double
         198  +
    }
         199  +
    #[allow(missing_docs)] // documentation missing in model
         200  +
    pub fn a_timestamp(&self) -> &::aws_smithy_types::DateTime {
         201  +
        &self.a_timestamp
         202  +
    }
         203  +
    #[allow(missing_docs)] // documentation missing in model
         204  +
    pub fn a_document(&self) -> &::aws_smithy_types::DateTime {
         205  +
        &self.a_document
         206  +
    }
         207  +
    #[allow(missing_docs)] // documentation missing in model
         208  +
    pub fn a_string_list(&self) -> &[::std::string::String] {
         209  +
        use std::ops::Deref;
         210  +
        self.a_string_list.deref()
         211  +
    }
         212  +
    #[allow(missing_docs)] // documentation missing in model
         213  +
    pub fn a_string_map(
         214  +
        &self,
         215  +
    ) -> &::std::collections::HashMap<::std::string::String, ::aws_smithy_types::DateTime> {
         216  +
        &self.a_string_map
         217  +
    }
         218  +
    #[allow(missing_docs)] // documentation missing in model
         219  +
    pub fn a_string_set(&self) -> &[::std::string::String] {
         220  +
        use std::ops::Deref;
         221  +
        self.a_string_set.deref()
         222  +
    }
         223  +
    #[allow(missing_docs)] // documentation missing in model
         224  +
    pub fn a_blob(&self) -> &::aws_smithy_types::Blob {
         225  +
        &self.a_blob
         226  +
    }
         227  +
    #[allow(missing_docs)] // documentation missing in model
         228  +
    pub fn a_union(&self) -> &crate::model::AUnion {
         229  +
        &self.a_union
         230  +
    }
         231  +
}
         232  +
impl InnermostShape {
         233  +
    /// Creates a new builder-style object to manufacture [`InnermostShape`](crate::model::InnermostShape).
         234  +
    pub fn builder() -> crate::model::innermost_shape::Builder {
         235  +
        crate::model::innermost_shape::Builder::default()
         236  +
    }
         237  +
}
         238  +
impl crate::constrained::Constrained for crate::model::InnermostShape {
         239  +
    type Unconstrained = crate::model::innermost_shape::Builder;
         240  +
}
         241  +
         242  +
#[allow(missing_docs)] // documentation missing in model
         243  +
#[derive(
         244  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         245  +
)]
         246  +
pub enum AUnion {
         247  +
    #[allow(missing_docs)] // documentation missing in model
         248  +
    I32(i32),
         249  +
    #[allow(missing_docs)] // documentation missing in model
         250  +
    String(::std::string::String),
         251  +
    #[allow(missing_docs)] // documentation missing in model
         252  +
    Time(::aws_smithy_types::DateTime),
         253  +
}
         254  +
impl AUnion {
         255  +
    /// Tries to convert the enum instance into [`I32`](crate::model::AUnion::I32), extracting the inner [`i32`](i32).
         256  +
    /// Returns `Err(&Self)` if it can't be converted.
         257  +
    pub fn as_i32(&self) -> ::std::result::Result<&i32, &Self> {
         258  +
        if let AUnion::I32(val) = &self {
         259  +
            ::std::result::Result::Ok(val)
         260  +
        } else {
         261  +
            ::std::result::Result::Err(self)
         262  +
        }
         263  +
    }
         264  +
    /// Returns true if this is a [`I32`](crate::model::AUnion::I32).
         265  +
    pub fn is_i32(&self) -> bool {
         266  +
        self.as_i32().is_ok()
         267  +
    }
         268  +
    /// Tries to convert the enum instance into [`String`](crate::model::AUnion::String), extracting the inner [`String`](::std::string::String).
         269  +
    /// Returns `Err(&Self)` if it can't be converted.
         270  +
    pub fn as_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
         271  +
        if let AUnion::String(val) = &self {
         272  +
            ::std::result::Result::Ok(val)
         273  +
        } else {
         274  +
            ::std::result::Result::Err(self)
         275  +
        }
         276  +
    }
         277  +
    /// Returns true if this is a [`String`](crate::model::AUnion::String).
         278  +
    pub fn is_string(&self) -> bool {
         279  +
        self.as_string().is_ok()
         280  +
    }
         281  +
    /// Tries to convert the enum instance into [`Time`](crate::model::AUnion::Time), extracting the inner [`DateTime`](::aws_smithy_types::DateTime).
         282  +
    /// Returns `Err(&Self)` if it can't be converted.
         283  +
    pub fn as_time(&self) -> ::std::result::Result<&::aws_smithy_types::DateTime, &Self> {
         284  +
        if let AUnion::Time(val) = &self {
         285  +
            ::std::result::Result::Ok(val)
         286  +
        } else {
         287  +
            ::std::result::Result::Err(self)
         288  +
        }
         289  +
    }
         290  +
    /// Returns true if this is a [`Time`](crate::model::AUnion::Time).
         291  +
    pub fn is_time(&self) -> bool {
         292  +
        self.as_time().is_ok()
         293  +
    }
         294  +
}
         295  +
         296  +
#[allow(missing_docs)] // documentation missing in model
         297  +
#[derive(
         298  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         299  +
)]
         300  +
pub struct EmptyStructure {}
         301  +
impl EmptyStructure {
         302  +
    /// Creates a new builder-style object to manufacture [`EmptyStructure`](crate::model::EmptyStructure).
         303  +
    pub fn builder() -> crate::model::empty_structure::Builder {
         304  +
        crate::model::empty_structure::Builder::default()
         305  +
    }
         306  +
}
         307  +
impl crate::constrained::Constrained for crate::model::EmptyStructure {
         308  +
    type Unconstrained = crate::model::empty_structure::Builder;
         309  +
}
         310  +
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         311  +
pub mod validation_exception_field {
         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  +
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         319  +
        MissingPath,
         320  +
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         321  +
        MissingMessage,
         322  +
    }
         323  +
    impl ::std::fmt::Display for ConstraintViolation {
         324  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         325  +
            match self {
         326  +
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         327  +
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         328  +
            }
         329  +
        }
         330  +
    }
         331  +
    impl ::std::error::Error for ConstraintViolation {}
         332  +
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
         333  +
        type Error = ConstraintViolation;
         334  +
         335  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         336  +
            builder.build()
         337  +
        }
         338  +
    }
         339  +
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         340  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         341  +
    pub struct Builder {
         342  +
        pub(crate) path: ::std::option::Option<::std::string::String>,
         343  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         344  +
    }
         345  +
    impl Builder {
         346  +
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         347  +
        pub fn path(mut self, input: ::std::string::String) -> Self {
         348  +
            self.path = Some(input);
         349  +
            self
         350  +
        }
         351  +
        /// A detailed description of the validation failure.
         352  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         353  +
            self.message = Some(input);
         354  +
            self
         355  +
        }
         356  +
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         357  +
        ///
         358  +
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
         359  +
        ///
         360  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         361  +
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         362  +
            self.build_enforcing_all_constraints()
         363  +
        }
         364  +
        fn build_enforcing_all_constraints(
         365  +
            self,
         366  +
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         367  +
            Ok(crate::model::ValidationExceptionField {
         368  +
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
         369  +
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
         370  +
            })
         371  +
        }
         372  +
    }
         373  +
}
         374  +
/// See [`HeaderSet`](crate::model::HeaderSet).
         375  +
pub mod header_set {
         376  +
         377  +
    #[allow(clippy::enum_variant_names)]
         378  +
    #[derive(Debug, PartialEq)]
         379  +
    pub enum ConstraintViolation {
         380  +
        /// Constraint violation error when the list does not contain unique items
         381  +
        UniqueItems {
         382  +
            /// A vector of indices into `original` pointing to all duplicate items. This vector has
         383  +
            /// at least two elements.
         384  +
            /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
         385  +
            /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
         386  +
            /// Nothing is guaranteed about the order of the indices.
         387  +
            duplicate_indices: ::std::vec::Vec<usize>,
         388  +
            /// The original vector, that contains duplicate items.
         389  +
            original: ::std::vec::Vec<::std::string::String>,
         390  +
        },
         391  +
    }
         392  +
         393  +
    impl ::std::fmt::Display for ConstraintViolation {
         394  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         395  +
            let message = match self {
         396  +
                                Self::UniqueItems { duplicate_indices, .. } =>
         397  +
                            format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.misc#HeaderSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
         398  +
                            };
         399  +
            write!(f, "{message}")
         400  +
        }
         401  +
    }
         402  +
         403  +
    impl ::std::error::Error for ConstraintViolation {}
         404  +
    impl ConstraintViolation {
         405  +
        pub(crate) fn as_validation_exception_field(
         406  +
            self,
         407  +
            path: ::std::string::String,
         408  +
        ) -> crate::model::ValidationExceptionField {
         409  +
            match self {
         410  +
                        Self::UniqueItems { duplicate_indices, .. } =>
         411  +
                                crate::model::ValidationExceptionField {
         412  +
                                    message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
         413  +
                                    path,
         414  +
                                },
         415  +
                    }
         416  +
        }
         417  +
    }
         418  +
}
         419  +
/// See [`InnerShape`](crate::model::InnerShape).
         420  +
pub mod inner_shape {
         421  +
         422  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         423  +
    /// Holds one variant for each of the ways the builder can fail.
         424  +
    #[non_exhaustive]
         425  +
    #[allow(clippy::enum_variant_names)]
         426  +
    pub enum ConstraintViolation {
         427  +
        /// `required_inner_most_shape` was not provided but it is required when building `InnerShape`.
         428  +
        MissingRequiredInnerMostShape,
         429  +
        /// Constraint violation occurred building member `required_inner_most_shape` when building `InnerShape`.
         430  +
        #[doc(hidden)]
         431  +
        RequiredInnerMostShape(crate::model::innermost_shape::ConstraintViolation),
         432  +
    }
         433  +
    impl ::std::fmt::Display for ConstraintViolation {
         434  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         435  +
            match self {
         436  +
                ConstraintViolation::MissingRequiredInnerMostShape => write!(f, "`required_inner_most_shape` was not provided but it is required when building `InnerShape`"),
         437  +
                ConstraintViolation::RequiredInnerMostShape(_) => write!(f, "constraint violation occurred building member `required_inner_most_shape` when building `InnerShape`"),
         438  +
            }
         439  +
        }
         440  +
    }
         441  +
    impl ::std::error::Error for ConstraintViolation {}
         442  +
    impl ConstraintViolation {
         443  +
        pub(crate) fn as_validation_exception_field(
         444  +
            self,
         445  +
            path: ::std::string::String,
         446  +
        ) -> crate::model::ValidationExceptionField {
         447  +
            match self {
         448  +
            ConstraintViolation::MissingRequiredInnerMostShape => crate::model::ValidationExceptionField {
         449  +
                                                message: format!("Value at '{}/requiredInnerMostShape' failed to satisfy constraint: Member must not be null", path),
         450  +
                                                path: path + "/requiredInnerMostShape",
         451  +
                                            },
         452  +
            ConstraintViolation::RequiredInnerMostShape(inner) => inner.as_validation_exception_field(path + "/requiredInnerMostShape"),
         453  +
        }
         454  +
        }
         455  +
    }
         456  +
    impl ::std::convert::From<Builder>
         457  +
        for crate::constrained::MaybeConstrained<crate::model::InnerShape>
         458  +
    {
         459  +
        fn from(builder: Builder) -> Self {
         460  +
            Self::Unconstrained(builder)
         461  +
        }
         462  +
    }
         463  +
    impl ::std::convert::TryFrom<Builder> for crate::model::InnerShape {
         464  +
        type Error = ConstraintViolation;
         465  +
         466  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         467  +
            builder.build()
         468  +
        }
         469  +
    }
         470  +
    /// A builder for [`InnerShape`](crate::model::InnerShape).
         471  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         472  +
    pub struct Builder {
         473  +
        pub(crate) required_inner_most_shape: ::std::option::Option<
         474  +
            crate::constrained::MaybeConstrained<crate::model::InnermostShape>,
         475  +
        >,
         476  +
    }
         477  +
    impl Builder {
         478  +
        #[allow(missing_docs)] // documentation missing in model
         479  +
        pub fn required_inner_most_shape(mut self, input: crate::model::InnermostShape) -> Self {
         480  +
            self.required_inner_most_shape =
         481  +
                Some(crate::constrained::MaybeConstrained::Constrained(input));
         482  +
            self
         483  +
        }
         484  +
        #[allow(missing_docs)] // documentation missing in model
         485  +
        pub(crate) fn set_required_inner_most_shape(
         486  +
            mut self,
         487  +
            input: impl ::std::convert::Into<
         488  +
                crate::constrained::MaybeConstrained<crate::model::InnermostShape>,
         489  +
            >,
         490  +
        ) -> Self {
         491  +
            self.required_inner_most_shape = Some(input.into());
         492  +
            self
         493  +
        }
         494  +
        /// Consumes the builder and constructs a [`InnerShape`](crate::model::InnerShape).
         495  +
        ///
         496  +
        /// The builder fails to construct a [`InnerShape`](crate::model::InnerShape) if a [`ConstraintViolation`] occurs.
         497  +
        ///
         498  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         499  +
        pub fn build(self) -> Result<crate::model::InnerShape, ConstraintViolation> {
         500  +
            self.build_enforcing_all_constraints()
         501  +
        }
         502  +
        fn build_enforcing_all_constraints(
         503  +
            self,
         504  +
        ) -> Result<crate::model::InnerShape, ConstraintViolation> {
         505  +
            Ok(crate::model::InnerShape {
         506  +
                required_inner_most_shape: self
         507  +
                    .required_inner_most_shape
         508  +
                    .map(|v| match v {
         509  +
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
         510  +
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
         511  +
                    })
         512  +
                    .map(|res| res.map_err(ConstraintViolation::RequiredInnerMostShape))
         513  +
                    .transpose()?
         514  +
                    .ok_or(ConstraintViolation::MissingRequiredInnerMostShape)?,
         515  +
            })
         516  +
        }
         517  +
    }
         518  +
}
         519  +
/// See [`InnermostShape`](crate::model::InnermostShape).
         520  +
pub mod innermost_shape {
         521  +
         522  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         523  +
    /// Holds one variant for each of the ways the builder can fail.
         524  +
    #[non_exhaustive]
         525  +
    #[allow(clippy::enum_variant_names)]
         526  +
    pub enum ConstraintViolation {
         527  +
        /// `a_string` was not provided but it is required when building `InnermostShape`.
         528  +
        MissingAString,
         529  +
        /// `a_boolean` was not provided but it is required when building `InnermostShape`.
         530  +
        MissingABoolean,
         531  +
        /// `a_byte` was not provided but it is required when building `InnermostShape`.
         532  +
        MissingAByte,
         533  +
        /// `a_short` was not provided but it is required when building `InnermostShape`.
         534  +
        MissingAShort,
         535  +
        /// `an_int` was not provided but it is required when building `InnermostShape`.
         536  +
        MissingAnInt,
         537  +
        /// `a_long` was not provided but it is required when building `InnermostShape`.
         538  +
        MissingALong,
         539  +
        /// `a_float` was not provided but it is required when building `InnermostShape`.
         540  +
        MissingAFloat,
         541  +
        /// `a_double` was not provided but it is required when building `InnermostShape`.
         542  +
        MissingADouble,
         543  +
        /// `a_timestamp` was not provided but it is required when building `InnermostShape`.
         544  +
        MissingATimestamp,
         545  +
        /// `a_document` was not provided but it is required when building `InnermostShape`.
         546  +
        MissingADocument,
         547  +
        /// `a_string_list` was not provided but it is required when building `InnermostShape`.
         548  +
        MissingAStringList,
         549  +
        /// `a_string_map` was not provided but it is required when building `InnermostShape`.
         550  +
        MissingAStringMap,
         551  +
        /// `a_string_set` was not provided but it is required when building `InnermostShape`.
         552  +
        MissingAStringSet,
         553  +
        /// `a_blob` was not provided but it is required when building `InnermostShape`.
         554  +
        MissingABlob,
         555  +
        /// `a_union` was not provided but it is required when building `InnermostShape`.
         556  +
        MissingAUnion,
         557  +
    }
         558  +
    impl ::std::fmt::Display for ConstraintViolation {
         559  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         560  +
            match self {
         561  +
                ConstraintViolation::MissingAString => write!(f, "`a_string` was not provided but it is required when building `InnermostShape`"),
         562  +
                ConstraintViolation::MissingABoolean => write!(f, "`a_boolean` was not provided but it is required when building `InnermostShape`"),
         563  +
                ConstraintViolation::MissingAByte => write!(f, "`a_byte` was not provided but it is required when building `InnermostShape`"),
         564  +
                ConstraintViolation::MissingAShort => write!(f, "`a_short` was not provided but it is required when building `InnermostShape`"),
         565  +
                ConstraintViolation::MissingAnInt => write!(f, "`an_int` was not provided but it is required when building `InnermostShape`"),
         566  +
                ConstraintViolation::MissingALong => write!(f, "`a_long` was not provided but it is required when building `InnermostShape`"),
         567  +
                ConstraintViolation::MissingAFloat => write!(f, "`a_float` was not provided but it is required when building `InnermostShape`"),
         568  +
                ConstraintViolation::MissingADouble => write!(f, "`a_double` was not provided but it is required when building `InnermostShape`"),
         569  +
                ConstraintViolation::MissingATimestamp => write!(f, "`a_timestamp` was not provided but it is required when building `InnermostShape`"),
         570  +
                ConstraintViolation::MissingADocument => write!(f, "`a_document` was not provided but it is required when building `InnermostShape`"),
         571  +
                ConstraintViolation::MissingAStringList => write!(f, "`a_string_list` was not provided but it is required when building `InnermostShape`"),
         572  +
                ConstraintViolation::MissingAStringMap => write!(f, "`a_string_map` was not provided but it is required when building `InnermostShape`"),
         573  +
                ConstraintViolation::MissingAStringSet => write!(f, "`a_string_set` was not provided but it is required when building `InnermostShape`"),
         574  +
                ConstraintViolation::MissingABlob => write!(f, "`a_blob` was not provided but it is required when building `InnermostShape`"),
         575  +
                ConstraintViolation::MissingAUnion => write!(f, "`a_union` was not provided but it is required when building `InnermostShape`"),
         576  +
            }
         577  +
        }
         578  +
    }
         579  +
    impl ::std::error::Error for ConstraintViolation {}
         580  +
    impl ConstraintViolation {
         581  +
        pub(crate) fn as_validation_exception_field(
         582  +
            self,
         583  +
            path: ::std::string::String,
         584  +
        ) -> crate::model::ValidationExceptionField {
         585  +
            match self {
         586  +
            ConstraintViolation::MissingAString => crate::model::ValidationExceptionField {
         587  +
                                                message: format!("Value at '{}/aString' failed to satisfy constraint: Member must not be null", path),
         588  +
                                                path: path + "/aString",
         589  +
                                            },
         590  +
            ConstraintViolation::MissingABoolean => crate::model::ValidationExceptionField {
         591  +
                                                message: format!("Value at '{}/aBoolean' failed to satisfy constraint: Member must not be null", path),
         592  +
                                                path: path + "/aBoolean",
         593  +
                                            },
         594  +
            ConstraintViolation::MissingAByte => crate::model::ValidationExceptionField {
         595  +
                                                message: format!("Value at '{}/aByte' failed to satisfy constraint: Member must not be null", path),
         596  +
                                                path: path + "/aByte",
         597  +
                                            },
         598  +
            ConstraintViolation::MissingAShort => crate::model::ValidationExceptionField {
         599  +
                                                message: format!("Value at '{}/aShort' failed to satisfy constraint: Member must not be null", path),
         600  +
                                                path: path + "/aShort",
         601  +
                                            },
         602  +
            ConstraintViolation::MissingAnInt => crate::model::ValidationExceptionField {
         603  +
                                                message: format!("Value at '{}/anInt' failed to satisfy constraint: Member must not be null", path),
         604  +
                                                path: path + "/anInt",
         605  +
                                            },
         606  +
            ConstraintViolation::MissingALong => crate::model::ValidationExceptionField {
         607  +
                                                message: format!("Value at '{}/aLong' failed to satisfy constraint: Member must not be null", path),
         608  +
                                                path: path + "/aLong",
         609  +
                                            },
         610  +
            ConstraintViolation::MissingAFloat => crate::model::ValidationExceptionField {
         611  +
                                                message: format!("Value at '{}/aFloat' failed to satisfy constraint: Member must not be null", path),
         612  +
                                                path: path + "/aFloat",
         613  +
                                            },
         614  +
            ConstraintViolation::MissingADouble => crate::model::ValidationExceptionField {
         615  +
                                                message: format!("Value at '{}/aDouble' failed to satisfy constraint: Member must not be null", path),
         616  +
                                                path: path + "/aDouble",
         617  +
                                            },
         618  +
            ConstraintViolation::MissingATimestamp => crate::model::ValidationExceptionField {
         619  +
                                                message: format!("Value at '{}/aTimestamp' failed to satisfy constraint: Member must not be null", path),
         620  +
                                                path: path + "/aTimestamp",
         621  +
                                            },
         622  +
            ConstraintViolation::MissingADocument => crate::model::ValidationExceptionField {
         623  +
                                                message: format!("Value at '{}/aDocument' failed to satisfy constraint: Member must not be null", path),
         624  +
                                                path: path + "/aDocument",
         625  +
                                            },
         626  +
            ConstraintViolation::MissingAStringList => crate::model::ValidationExceptionField {
         627  +
                                                message: format!("Value at '{}/aStringList' failed to satisfy constraint: Member must not be null", path),
         628  +
                                                path: path + "/aStringList",
         629  +
                                            },
         630  +
            ConstraintViolation::MissingAStringMap => crate::model::ValidationExceptionField {
         631  +
                                                message: format!("Value at '{}/aStringMap' failed to satisfy constraint: Member must not be null", path),
         632  +
                                                path: path + "/aStringMap",
         633  +
                                            },
         634  +
            ConstraintViolation::MissingAStringSet => crate::model::ValidationExceptionField {
         635  +
                                                message: format!("Value at '{}/aStringSet' failed to satisfy constraint: Member must not be null", path),
         636  +
                                                path: path + "/aStringSet",
         637  +
                                            },
         638  +
            ConstraintViolation::MissingABlob => crate::model::ValidationExceptionField {
         639  +
                                                message: format!("Value at '{}/aBlob' failed to satisfy constraint: Member must not be null", path),
         640  +
                                                path: path + "/aBlob",
         641  +
                                            },
         642  +
            ConstraintViolation::MissingAUnion => crate::model::ValidationExceptionField {
         643  +
                                                message: format!("Value at '{}/aUnion' failed to satisfy constraint: Member must not be null", path),
         644  +
                                                path: path + "/aUnion",
         645  +
                                            },
         646  +
        }
         647  +
        }
         648  +
    }
         649  +
    impl ::std::convert::From<Builder>
         650  +
        for crate::constrained::MaybeConstrained<crate::model::InnermostShape>
         651  +
    {
         652  +
        fn from(builder: Builder) -> Self {
         653  +
            Self::Unconstrained(builder)
         654  +
        }
         655  +
    }
         656  +
    impl ::std::convert::TryFrom<Builder> for crate::model::InnermostShape {
         657  +
        type Error = ConstraintViolation;
         658  +
         659  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         660  +
            builder.build()
         661  +
        }
         662  +
    }
         663  +
    /// A builder for [`InnermostShape`](crate::model::InnermostShape).
         664  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         665  +
    pub struct Builder {
         666  +
        pub(crate) a_string: ::std::option::Option<::std::string::String>,
         667  +
        pub(crate) a_boolean: ::std::option::Option<bool>,
         668  +
        pub(crate) a_byte: ::std::option::Option<i8>,
         669  +
        pub(crate) a_short: ::std::option::Option<i16>,
         670  +
        pub(crate) an_int: ::std::option::Option<i32>,
         671  +
        pub(crate) a_long: ::std::option::Option<i64>,
         672  +
        pub(crate) a_float: ::std::option::Option<f32>,
         673  +
        pub(crate) a_double: ::std::option::Option<f64>,
         674  +
        pub(crate) a_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
         675  +
        pub(crate) a_document: ::std::option::Option<::aws_smithy_types::DateTime>,
         676  +
        pub(crate) a_string_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         677  +
        pub(crate) a_string_map: ::std::option::Option<
         678  +
            ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::DateTime>,
         679  +
        >,
         680  +
        pub(crate) a_string_set: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         681  +
        pub(crate) a_blob: ::std::option::Option<::aws_smithy_types::Blob>,
         682  +
        pub(crate) a_union: ::std::option::Option<crate::model::AUnion>,
         683  +
    }
         684  +
    impl Builder {
         685  +
        #[allow(missing_docs)] // documentation missing in model
         686  +
        pub fn a_string(mut self, input: ::std::string::String) -> Self {
         687  +
            self.a_string = Some(input);
         688  +
            self
         689  +
        }
         690  +
        #[allow(missing_docs)] // documentation missing in model
         691  +
        pub(crate) fn set_a_string(
         692  +
            mut self,
         693  +
            input: impl ::std::convert::Into<::std::string::String>,
         694  +
        ) -> Self {
         695  +
            self.a_string = Some(input.into());
         696  +
            self
         697  +
        }
         698  +
        #[allow(missing_docs)] // documentation missing in model
         699  +
        pub fn a_boolean(mut self, input: bool) -> Self {
         700  +
            self.a_boolean = Some(input);
         701  +
            self
         702  +
        }
         703  +
        #[allow(missing_docs)] // documentation missing in model
         704  +
        pub(crate) fn set_a_boolean(mut self, input: impl ::std::convert::Into<bool>) -> Self {
         705  +
            self.a_boolean = Some(input.into());
         706  +
            self
         707  +
        }
         708  +
        #[allow(missing_docs)] // documentation missing in model
         709  +
        pub fn a_byte(mut self, input: i8) -> Self {
         710  +
            self.a_byte = Some(input);
         711  +
            self
         712  +
        }
         713  +
        #[allow(missing_docs)] // documentation missing in model
         714  +
        pub(crate) fn set_a_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
         715  +
            self.a_byte = Some(input.into());
         716  +
            self
         717  +
        }
         718  +
        #[allow(missing_docs)] // documentation missing in model
         719  +
        pub fn a_short(mut self, input: i16) -> Self {
         720  +
            self.a_short = Some(input);
         721  +
            self
         722  +
        }
         723  +
        #[allow(missing_docs)] // documentation missing in model
         724  +
        pub(crate) fn set_a_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
         725  +
            self.a_short = Some(input.into());
         726  +
            self
         727  +
        }
         728  +
        #[allow(missing_docs)] // documentation missing in model
         729  +
        pub fn an_int(mut self, input: i32) -> Self {
         730  +
            self.an_int = Some(input);
         731  +
            self
         732  +
        }
         733  +
        #[allow(missing_docs)] // documentation missing in model
         734  +
        pub(crate) fn set_an_int(mut self, input: impl ::std::convert::Into<i32>) -> Self {
         735  +
            self.an_int = Some(input.into());
         736  +
            self
         737  +
        }
         738  +
        #[allow(missing_docs)] // documentation missing in model
         739  +
        pub fn a_long(mut self, input: i64) -> Self {
         740  +
            self.a_long = Some(input);
         741  +
            self
         742  +
        }
         743  +
        #[allow(missing_docs)] // documentation missing in model
         744  +
        pub(crate) fn set_a_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
         745  +
            self.a_long = Some(input.into());
         746  +
            self
         747  +
        }
         748  +
        #[allow(missing_docs)] // documentation missing in model
         749  +
        pub fn a_float(mut self, input: f32) -> Self {
         750  +
            self.a_float = Some(input);
         751  +
            self
         752  +
        }
         753  +
        #[allow(missing_docs)] // documentation missing in model
         754  +
        pub(crate) fn set_a_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
         755  +
            self.a_float = Some(input.into());
         756  +
            self
         757  +
        }
         758  +
        #[allow(missing_docs)] // documentation missing in model
         759  +
        pub fn a_double(mut self, input: f64) -> Self {
         760  +
            self.a_double = Some(input);
         761  +
            self
         762  +
        }
         763  +
        #[allow(missing_docs)] // documentation missing in model
         764  +
        pub(crate) fn set_a_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
         765  +
            self.a_double = Some(input.into());
         766  +
            self
         767  +
        }
         768  +
        #[allow(missing_docs)] // documentation missing in model
         769  +
        pub fn a_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         770  +
            self.a_timestamp = Some(input);
         771  +
            self
         772  +
        }
         773  +
        #[allow(missing_docs)] // documentation missing in model
         774  +
        pub(crate) fn set_a_timestamp(
         775  +
            mut self,
         776  +
            input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
         777  +
        ) -> Self {
         778  +
            self.a_timestamp = Some(input.into());
         779  +
            self
         780  +
        }
         781  +
        #[allow(missing_docs)] // documentation missing in model
         782  +
        pub fn a_document(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         783  +
            self.a_document = Some(input);
         784  +
            self
         785  +
        }
         786  +
        #[allow(missing_docs)] // documentation missing in model
         787  +
        pub(crate) fn set_a_document(
         788  +
            mut self,
         789  +
            input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
         790  +
        ) -> Self {
         791  +
            self.a_document = Some(input.into());
         792  +
            self
         793  +
        }
         794  +
        #[allow(missing_docs)] // documentation missing in model
         795  +
        pub fn a_string_list(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
         796  +
            self.a_string_list = Some(input);
         797  +
            self
         798  +
        }
         799  +
        #[allow(missing_docs)] // documentation missing in model
         800  +
        pub(crate) fn set_a_string_list(
         801  +
            mut self,
         802  +
            input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>,
         803  +
        ) -> Self {
         804  +
            self.a_string_list = Some(input.into());
         805  +
            self
         806  +
        }
         807  +
        #[allow(missing_docs)] // documentation missing in model
         808  +
        pub fn a_string_map(
         809  +
            mut self,
         810  +
            input: ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::DateTime>,
         811  +
        ) -> Self {
         812  +
            self.a_string_map = Some(input);
         813  +
            self
         814  +
        }
         815  +
        #[allow(missing_docs)] // documentation missing in model
         816  +
        pub(crate) fn set_a_string_map(
         817  +
            mut self,
         818  +
            input: impl ::std::convert::Into<
         819  +
                ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::DateTime>,
         820  +
            >,
         821  +
        ) -> Self {
         822  +
            self.a_string_map = Some(input.into());
         823  +
            self
         824  +
        }
         825  +
        #[allow(missing_docs)] // documentation missing in model
         826  +
        pub fn a_string_set(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
         827  +
            self.a_string_set = Some(input);
         828  +
            self
         829  +
        }
         830  +
        #[allow(missing_docs)] // documentation missing in model
         831  +
        pub(crate) fn set_a_string_set(
         832  +
            mut self,
         833  +
            input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>,
         834  +
        ) -> Self {
         835  +
            self.a_string_set = Some(input.into());
         836  +
            self
         837  +
        }
         838  +
        #[allow(missing_docs)] // documentation missing in model
         839  +
        pub fn a_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
         840  +
            self.a_blob = Some(input);
         841  +
            self
         842  +
        }
         843  +
        #[allow(missing_docs)] // documentation missing in model
         844  +
        pub(crate) fn set_a_blob(
         845  +
            mut self,
         846  +
            input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
         847  +
        ) -> Self {
         848  +
            self.a_blob = Some(input.into());
         849  +
            self
         850  +
        }
         851  +
        #[allow(missing_docs)] // documentation missing in model
         852  +
        pub fn a_union(mut self, input: crate::model::AUnion) -> Self {
         853  +
            self.a_union = Some(input);
         854  +
            self
         855  +
        }
         856  +
        #[allow(missing_docs)] // documentation missing in model
         857  +
        pub(crate) fn set_a_union(
         858  +
            mut self,
         859  +
            input: impl ::std::convert::Into<crate::model::AUnion>,
         860  +
        ) -> Self {
         861  +
            self.a_union = Some(input.into());
         862  +
            self
         863  +
        }
         864  +
        /// Consumes the builder and constructs a [`InnermostShape`](crate::model::InnermostShape).
         865  +
        ///
         866  +
        /// The builder fails to construct a [`InnermostShape`](crate::model::InnermostShape) if a [`ConstraintViolation`] occurs.
         867  +
        ///
         868  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         869  +
        pub fn build(self) -> Result<crate::model::InnermostShape, ConstraintViolation> {
         870  +
            self.build_enforcing_all_constraints()
         871  +
        }
         872  +
        fn build_enforcing_all_constraints(
         873  +
            self,
         874  +
        ) -> Result<crate::model::InnermostShape, ConstraintViolation> {
         875  +
            Ok(crate::model::InnermostShape {
         876  +
                a_string: self.a_string.ok_or(ConstraintViolation::MissingAString)?,
         877  +
                a_boolean: self.a_boolean.ok_or(ConstraintViolation::MissingABoolean)?,
         878  +
                a_byte: self.a_byte.ok_or(ConstraintViolation::MissingAByte)?,
         879  +
                a_short: self.a_short.ok_or(ConstraintViolation::MissingAShort)?,
         880  +
                an_int: self.an_int.ok_or(ConstraintViolation::MissingAnInt)?,
         881  +
                a_long: self.a_long.ok_or(ConstraintViolation::MissingALong)?,
         882  +
                a_float: self.a_float.ok_or(ConstraintViolation::MissingAFloat)?,
         883  +
                a_double: self.a_double.ok_or(ConstraintViolation::MissingADouble)?,
         884  +
                a_timestamp: self
         885  +
                    .a_timestamp
         886  +
                    .ok_or(ConstraintViolation::MissingATimestamp)?,
         887  +
                a_document: self
         888  +
                    .a_document
         889  +
                    .ok_or(ConstraintViolation::MissingADocument)?,
         890  +
                a_string_list: self
         891  +
                    .a_string_list
         892  +
                    .ok_or(ConstraintViolation::MissingAStringList)?,
         893  +
                a_string_map: self
         894  +
                    .a_string_map
         895  +
                    .ok_or(ConstraintViolation::MissingAStringMap)?,
         896  +
                a_string_set: self
         897  +
                    .a_string_set
         898  +
                    .ok_or(ConstraintViolation::MissingAStringSet)?,
         899  +
                a_blob: self.a_blob.ok_or(ConstraintViolation::MissingABlob)?,
         900  +
                a_union: self.a_union.ok_or(ConstraintViolation::MissingAUnion)?,
         901  +
            })
         902  +
        }
         903  +
    }
         904  +
}
         905  +
/// See [`EmptyStructure`](crate::model::EmptyStructure).
         906  +
pub mod empty_structure {
         907  +
         908  +
    impl ::std::convert::From<Builder> for crate::model::EmptyStructure {
         909  +
        fn from(builder: Builder) -> Self {
         910  +
            builder.build()
         911  +
        }
         912  +
    }
         913  +
    /// A builder for [`EmptyStructure`](crate::model::EmptyStructure).
         914  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         915  +
    pub struct Builder {}
         916  +
    impl Builder {
         917  +
        /// Consumes the builder and constructs a [`EmptyStructure`](crate::model::EmptyStructure).
         918  +
        pub fn build(self) -> crate::model::EmptyStructure {
         919  +
            self.build_enforcing_all_constraints()
         920  +
        }
         921  +
        fn build_enforcing_all_constraints(self) -> crate::model::EmptyStructure {
         922  +
            crate::model::EmptyStructure {}
         923  +
        }
         924  +
    }
         925  +
}