Server Test

Server Test

rev. ee474c7509d7728618c23068f3741e8e5b339ef9

Files changed:

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

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

tmp-codegen-diff/codegen-server-test/s3-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_XML: std::sync::LazyLock<::mime::Mime> =
           3  +
    std::sync::LazyLock::new(|| {
           4  +
        "application/xml"
           5  +
            .parse::<::mime::Mime>()
           6  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
           7  +
    });

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

@@ -0,1 +0,853 @@
           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 [`ObjectKey::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 ObjectKey(pub(crate) ::std::string::String);
          43  +
impl ObjectKey {
          44  +
    /// Extracts a string slice containing the entire underlying `String`.
          45  +
    pub fn as_str(&self) -> &str {
          46  +
        &self.0
          47  +
    }
          48  +
          49  +
    /// Returns an immutable reference to the underlying [`::std::string::String`].
          50  +
    pub fn inner(&self) -> &::std::string::String {
          51  +
        &self.0
          52  +
    }
          53  +
          54  +
    /// Consumes the value, returning the underlying [`::std::string::String`].
          55  +
    pub fn into_inner(self) -> ::std::string::String {
          56  +
        self.0
          57  +
    }
          58  +
}
          59  +
impl ObjectKey {
          60  +
    fn check_length(
          61  +
        string: &str,
          62  +
    ) -> ::std::result::Result<(), crate::model::object_key::ConstraintViolation> {
          63  +
        let length = string.chars().count();
          64  +
          65  +
        if 1 <= length {
          66  +
            Ok(())
          67  +
        } else {
          68  +
            Err(crate::model::object_key::ConstraintViolation::Length(
          69  +
                length,
          70  +
            ))
          71  +
        }
          72  +
    }
          73  +
}
          74  +
impl ::std::convert::TryFrom<::std::string::String> for ObjectKey {
          75  +
    type Error = crate::model::object_key::ConstraintViolation;
          76  +
          77  +
    /// Constructs a `ObjectKey` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
          78  +
    fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
          79  +
        Self::check_length(&value)?;
          80  +
          81  +
        Ok(Self(value))
          82  +
    }
          83  +
}
          84  +
impl crate::constrained::Constrained for ObjectKey {
          85  +
    type Unconstrained = ::std::string::String;
          86  +
}
          87  +
          88  +
impl ::std::convert::From<::std::string::String>
          89  +
    for crate::constrained::MaybeConstrained<crate::model::ObjectKey>
          90  +
{
          91  +
    fn from(value: ::std::string::String) -> Self {
          92  +
        Self::Unconstrained(value)
          93  +
    }
          94  +
}
          95  +
          96  +
impl ::std::fmt::Display for ObjectKey {
          97  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          98  +
        self.0.fmt(f)
          99  +
    }
         100  +
}
         101  +
         102  +
impl ::std::convert::From<ObjectKey> for ::std::string::String {
         103  +
    fn from(value: ObjectKey) -> Self {
         104  +
        value.into_inner()
         105  +
    }
         106  +
}
         107  +
         108  +
#[allow(missing_docs)] // documentation missing in model
         109  +
#[derive(
         110  +
    ::std::clone::Clone,
         111  +
    ::std::cmp::Eq,
         112  +
    ::std::cmp::Ord,
         113  +
    ::std::cmp::PartialEq,
         114  +
    ::std::cmp::PartialOrd,
         115  +
    ::std::fmt::Debug,
         116  +
    ::std::hash::Hash,
         117  +
)]
         118  +
pub enum BucketLocationConstraint {
         119  +
    #[allow(missing_docs)] // documentation missing in model
         120  +
    UsWest2,
         121  +
}
         122  +
/// See [`BucketLocationConstraint`](crate::model::BucketLocationConstraint).
         123  +
pub mod bucket_location_constraint {
         124  +
    #[derive(Debug, PartialEq)]
         125  +
    pub struct ConstraintViolation(pub(crate) ::std::string::String);
         126  +
         127  +
    impl ::std::fmt::Display for ConstraintViolation {
         128  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         129  +
            write!(
         130  +
                f,
         131  +
                r#"Value provided for 'com.amazonaws.s3#BucketLocationConstraint' failed to satisfy constraint: Member must satisfy enum value set: [us-west-2]"#
         132  +
            )
         133  +
        }
         134  +
    }
         135  +
         136  +
    impl ::std::error::Error for ConstraintViolation {}
         137  +
}
         138  +
impl ::std::convert::TryFrom<&str> for BucketLocationConstraint {
         139  +
    type Error = crate::model::bucket_location_constraint::ConstraintViolation;
         140  +
    fn try_from(
         141  +
        s: &str,
         142  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
         143  +
        match s {
         144  +
            "us-west-2" => Ok(BucketLocationConstraint::UsWest2),
         145  +
            _ => Err(crate::model::bucket_location_constraint::ConstraintViolation(s.to_owned())),
         146  +
        }
         147  +
    }
         148  +
}
         149  +
impl ::std::convert::TryFrom<::std::string::String> for BucketLocationConstraint {
         150  +
    type Error = crate::model::bucket_location_constraint::ConstraintViolation;
         151  +
    fn try_from(
         152  +
        s: ::std::string::String,
         153  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
         154  +
    {
         155  +
        s.as_str().try_into()
         156  +
    }
         157  +
}
         158  +
impl std::str::FromStr for BucketLocationConstraint {
         159  +
    type Err = crate::model::bucket_location_constraint::ConstraintViolation;
         160  +
    fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
         161  +
        Self::try_from(s)
         162  +
    }
         163  +
}
         164  +
impl BucketLocationConstraint {
         165  +
    /// Returns the `&str` value of the enum member.
         166  +
    pub fn as_str(&self) -> &str {
         167  +
        match self {
         168  +
            BucketLocationConstraint::UsWest2 => "us-west-2",
         169  +
        }
         170  +
    }
         171  +
    /// Returns all the `&str` representations of the enum members.
         172  +
    pub const fn values() -> &'static [&'static str] {
         173  +
        &["us-west-2"]
         174  +
    }
         175  +
}
         176  +
impl ::std::convert::AsRef<str> for BucketLocationConstraint {
         177  +
    fn as_ref(&self) -> &str {
         178  +
        self.as_str()
         179  +
    }
         180  +
}
         181  +
impl crate::constrained::Constrained for BucketLocationConstraint {
         182  +
    type Unconstrained = ::std::string::String;
         183  +
}
         184  +
         185  +
impl ::std::convert::From<::std::string::String>
         186  +
    for crate::constrained::MaybeConstrained<crate::model::BucketLocationConstraint>
         187  +
{
         188  +
    fn from(value: ::std::string::String) -> Self {
         189  +
        Self::Unconstrained(value)
         190  +
    }
         191  +
}
         192  +
         193  +
#[allow(missing_docs)] // documentation missing in model
         194  +
#[derive(
         195  +
    ::std::clone::Clone,
         196  +
    ::std::cmp::Eq,
         197  +
    ::std::cmp::Ord,
         198  +
    ::std::cmp::PartialEq,
         199  +
    ::std::cmp::PartialOrd,
         200  +
    ::std::fmt::Debug,
         201  +
    ::std::hash::Hash,
         202  +
)]
         203  +
pub enum EncodingType {
         204  +
    #[allow(missing_docs)] // documentation missing in model
         205  +
    Url,
         206  +
}
         207  +
/// See [`EncodingType`](crate::model::EncodingType).
         208  +
pub mod encoding_type {
         209  +
    #[derive(Debug, PartialEq)]
         210  +
    pub struct ConstraintViolation(pub(crate) ::std::string::String);
         211  +
         212  +
    impl ::std::fmt::Display for ConstraintViolation {
         213  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         214  +
            write!(
         215  +
                f,
         216  +
                r#"Value provided for 'com.amazonaws.s3#EncodingType' failed to satisfy constraint: Member must satisfy enum value set: [url]"#
         217  +
            )
         218  +
        }
         219  +
    }
         220  +
         221  +
    impl ::std::error::Error for ConstraintViolation {}
         222  +
    impl ConstraintViolation {
         223  +
        pub(crate) fn as_validation_exception_field(
         224  +
            self,
         225  +
            path: ::std::string::String,
         226  +
        ) -> crate::model::ValidationExceptionField {
         227  +
            crate::model::ValidationExceptionField {
         228  +
                message: format!(
         229  +
                    r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [url]"#,
         230  +
                    &path
         231  +
                ),
         232  +
                path,
         233  +
            }
         234  +
        }
         235  +
    }
         236  +
}
         237  +
impl ::std::convert::TryFrom<&str> for EncodingType {
         238  +
    type Error = crate::model::encoding_type::ConstraintViolation;
         239  +
    fn try_from(
         240  +
        s: &str,
         241  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
         242  +
        match s {
         243  +
            "url" => Ok(EncodingType::Url),
         244  +
            _ => Err(crate::model::encoding_type::ConstraintViolation(
         245  +
                s.to_owned(),
         246  +
            )),
         247  +
        }
         248  +
    }
         249  +
}
         250  +
impl ::std::convert::TryFrom<::std::string::String> for EncodingType {
         251  +
    type Error = crate::model::encoding_type::ConstraintViolation;
         252  +
    fn try_from(
         253  +
        s: ::std::string::String,
         254  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
         255  +
    {
         256  +
        s.as_str().try_into()
         257  +
    }
         258  +
}
         259  +
impl std::str::FromStr for EncodingType {
         260  +
    type Err = crate::model::encoding_type::ConstraintViolation;
         261  +
    fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
         262  +
        Self::try_from(s)
         263  +
    }
         264  +
}
         265  +
impl EncodingType {
         266  +
    /// Returns the `&str` value of the enum member.
         267  +
    pub fn as_str(&self) -> &str {
         268  +
        match self {
         269  +
            EncodingType::Url => "url",
         270  +
        }
         271  +
    }
         272  +
    /// Returns all the `&str` representations of the enum members.
         273  +
    pub const fn values() -> &'static [&'static str] {
         274  +
        &["url"]
         275  +
    }
         276  +
}
         277  +
impl ::std::convert::AsRef<str> for EncodingType {
         278  +
    fn as_ref(&self) -> &str {
         279  +
        self.as_str()
         280  +
    }
         281  +
}
         282  +
impl crate::constrained::Constrained for EncodingType {
         283  +
    type Unconstrained = ::std::string::String;
         284  +
}
         285  +
         286  +
impl ::std::convert::From<::std::string::String>
         287  +
    for crate::constrained::MaybeConstrained<crate::model::EncodingType>
         288  +
{
         289  +
    fn from(value: ::std::string::String) -> Self {
         290  +
        Self::Unconstrained(value)
         291  +
    }
         292  +
}
         293  +
         294  +
#[allow(missing_docs)] // documentation missing in model
         295  +
#[derive(
         296  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         297  +
)]
         298  +
pub struct CommonPrefix {
         299  +
    #[allow(missing_docs)] // documentation missing in model
         300  +
    pub prefix: ::std::option::Option<::std::string::String>,
         301  +
}
         302  +
impl CommonPrefix {
         303  +
    #[allow(missing_docs)] // documentation missing in model
         304  +
    pub fn prefix(&self) -> ::std::option::Option<&str> {
         305  +
        self.prefix.as_deref()
         306  +
    }
         307  +
}
         308  +
impl CommonPrefix {
         309  +
    /// Creates a new builder-style object to manufacture [`CommonPrefix`](crate::model::CommonPrefix).
         310  +
    pub fn builder() -> crate::model::common_prefix::Builder {
         311  +
        crate::model::common_prefix::Builder::default()
         312  +
    }
         313  +
}
         314  +
         315  +
#[allow(missing_docs)] // documentation missing in model
         316  +
#[derive(
         317  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         318  +
)]
         319  +
pub struct Object {
         320  +
    #[allow(missing_docs)] // documentation missing in model
         321  +
    pub key: ::std::option::Option<crate::model::ObjectKey>,
         322  +
    #[allow(missing_docs)] // documentation missing in model
         323  +
    pub last_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
         324  +
    #[allow(missing_docs)] // documentation missing in model
         325  +
    pub e_tag: ::std::option::Option<::std::string::String>,
         326  +
    #[allow(missing_docs)] // documentation missing in model
         327  +
    pub size: ::std::option::Option<i32>,
         328  +
    #[allow(missing_docs)] // documentation missing in model
         329  +
    pub storage_class: ::std::option::Option<crate::model::ObjectStorageClass>,
         330  +
    #[allow(missing_docs)] // documentation missing in model
         331  +
    pub owner: ::std::option::Option<crate::model::Owner>,
         332  +
}
         333  +
impl Object {
         334  +
    #[allow(missing_docs)] // documentation missing in model
         335  +
    pub fn key(&self) -> ::std::option::Option<&crate::model::ObjectKey> {
         336  +
        self.key.as_ref()
         337  +
    }
         338  +
    #[allow(missing_docs)] // documentation missing in model
         339  +
    pub fn last_modified(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
         340  +
        self.last_modified.as_ref()
         341  +
    }
         342  +
    #[allow(missing_docs)] // documentation missing in model
         343  +
    pub fn e_tag(&self) -> ::std::option::Option<&str> {
         344  +
        self.e_tag.as_deref()
         345  +
    }
         346  +
    #[allow(missing_docs)] // documentation missing in model
         347  +
    pub fn size(&self) -> ::std::option::Option<i32> {
         348  +
        self.size
         349  +
    }
         350  +
    #[allow(missing_docs)] // documentation missing in model
         351  +
    pub fn storage_class(&self) -> ::std::option::Option<&crate::model::ObjectStorageClass> {
         352  +
        self.storage_class.as_ref()
         353  +
    }
         354  +
    #[allow(missing_docs)] // documentation missing in model
         355  +
    pub fn owner(&self) -> ::std::option::Option<&crate::model::Owner> {
         356  +
        self.owner.as_ref()
         357  +
    }
         358  +
}
         359  +
impl Object {
         360  +
    /// Creates a new builder-style object to manufacture [`Object`](crate::model::Object).
         361  +
    pub fn builder() -> crate::model::object::Builder {
         362  +
        crate::model::object::Builder::default()
         363  +
    }
         364  +
}
         365  +
         366  +
#[allow(missing_docs)] // documentation missing in model
         367  +
#[derive(
         368  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         369  +
)]
         370  +
pub struct Owner {
         371  +
    #[allow(missing_docs)] // documentation missing in model
         372  +
    pub display_name: ::std::option::Option<::std::string::String>,
         373  +
    #[allow(missing_docs)] // documentation missing in model
         374  +
    pub id: ::std::option::Option<::std::string::String>,
         375  +
}
         376  +
impl Owner {
         377  +
    #[allow(missing_docs)] // documentation missing in model
         378  +
    pub fn display_name(&self) -> ::std::option::Option<&str> {
         379  +
        self.display_name.as_deref()
         380  +
    }
         381  +
    #[allow(missing_docs)] // documentation missing in model
         382  +
    pub fn id(&self) -> ::std::option::Option<&str> {
         383  +
        self.id.as_deref()
         384  +
    }
         385  +
}
         386  +
impl Owner {
         387  +
    /// Creates a new builder-style object to manufacture [`Owner`](crate::model::Owner).
         388  +
    pub fn builder() -> crate::model::owner::Builder {
         389  +
        crate::model::owner::Builder::default()
         390  +
    }
         391  +
}
         392  +
         393  +
#[allow(missing_docs)] // documentation missing in model
         394  +
#[derive(
         395  +
    ::std::clone::Clone,
         396  +
    ::std::cmp::Eq,
         397  +
    ::std::cmp::Ord,
         398  +
    ::std::cmp::PartialEq,
         399  +
    ::std::cmp::PartialOrd,
         400  +
    ::std::fmt::Debug,
         401  +
    ::std::hash::Hash,
         402  +
)]
         403  +
pub enum ObjectStorageClass {
         404  +
    #[allow(missing_docs)] // documentation missing in model
         405  +
    DeepArchive,
         406  +
    #[allow(missing_docs)] // documentation missing in model
         407  +
    Glacier,
         408  +
    #[allow(missing_docs)] // documentation missing in model
         409  +
    IntelligentTiering,
         410  +
    #[allow(missing_docs)] // documentation missing in model
         411  +
    OnezoneIa,
         412  +
    #[allow(missing_docs)] // documentation missing in model
         413  +
    Outposts,
         414  +
    #[allow(missing_docs)] // documentation missing in model
         415  +
    ReducedRedundancy,
         416  +
    #[allow(missing_docs)] // documentation missing in model
         417  +
    Standard,
         418  +
    #[allow(missing_docs)] // documentation missing in model
         419  +
    StandardIa,
         420  +
}
         421  +
/// See [`ObjectStorageClass`](crate::model::ObjectStorageClass).
         422  +
pub mod object_storage_class {
         423  +
    #[derive(Debug, PartialEq)]
         424  +
    pub struct ConstraintViolation(pub(crate) ::std::string::String);
         425  +
         426  +
    impl ::std::fmt::Display for ConstraintViolation {
         427  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         428  +
            write!(
         429  +
                f,
         430  +
                r#"Value provided for 'com.amazonaws.s3#ObjectStorageClass' failed to satisfy constraint: Member must satisfy enum value set: [STANDARD, REDUCED_REDUNDANCY, GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, OUTPOSTS]"#
         431  +
            )
         432  +
        }
         433  +
    }
         434  +
         435  +
    impl ::std::error::Error for ConstraintViolation {}
         436  +
}
         437  +
impl ::std::convert::TryFrom<&str> for ObjectStorageClass {
         438  +
    type Error = crate::model::object_storage_class::ConstraintViolation;
         439  +
    fn try_from(
         440  +
        s: &str,
         441  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
         442  +
        match s {
         443  +
            "DEEP_ARCHIVE" => Ok(ObjectStorageClass::DeepArchive),
         444  +
            "GLACIER" => Ok(ObjectStorageClass::Glacier),
         445  +
            "INTELLIGENT_TIERING" => Ok(ObjectStorageClass::IntelligentTiering),
         446  +
            "ONEZONE_IA" => Ok(ObjectStorageClass::OnezoneIa),
         447  +
            "OUTPOSTS" => Ok(ObjectStorageClass::Outposts),
         448  +
            "REDUCED_REDUNDANCY" => Ok(ObjectStorageClass::ReducedRedundancy),
         449  +
            "STANDARD" => Ok(ObjectStorageClass::Standard),
         450  +
            "STANDARD_IA" => Ok(ObjectStorageClass::StandardIa),
         451  +
            _ => Err(crate::model::object_storage_class::ConstraintViolation(
         452  +
                s.to_owned(),
         453  +
            )),
         454  +
        }
         455  +
    }
         456  +
}
         457  +
impl ::std::convert::TryFrom<::std::string::String> for ObjectStorageClass {
         458  +
    type Error = crate::model::object_storage_class::ConstraintViolation;
         459  +
    fn try_from(
         460  +
        s: ::std::string::String,
         461  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
         462  +
    {
         463  +
        s.as_str().try_into()
         464  +
    }
         465  +
}
         466  +
impl std::str::FromStr for ObjectStorageClass {
         467  +
    type Err = crate::model::object_storage_class::ConstraintViolation;
         468  +
    fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
         469  +
        Self::try_from(s)
         470  +
    }
         471  +
}
         472  +
impl ObjectStorageClass {
         473  +
    /// Returns the `&str` value of the enum member.
         474  +
    pub fn as_str(&self) -> &str {
         475  +
        match self {
         476  +
            ObjectStorageClass::DeepArchive => "DEEP_ARCHIVE",
         477  +
            ObjectStorageClass::Glacier => "GLACIER",
         478  +
            ObjectStorageClass::IntelligentTiering => "INTELLIGENT_TIERING",
         479  +
            ObjectStorageClass::OnezoneIa => "ONEZONE_IA",
         480  +
            ObjectStorageClass::Outposts => "OUTPOSTS",
         481  +
            ObjectStorageClass::ReducedRedundancy => "REDUCED_REDUNDANCY",
         482  +
            ObjectStorageClass::Standard => "STANDARD",
         483  +
            ObjectStorageClass::StandardIa => "STANDARD_IA",
         484  +
        }
         485  +
    }
         486  +
    /// Returns all the `&str` representations of the enum members.
         487  +
    pub const fn values() -> &'static [&'static str] {
         488  +
        &[
         489  +
            "DEEP_ARCHIVE",
         490  +
            "GLACIER",
         491  +
            "INTELLIGENT_TIERING",
         492  +
            "ONEZONE_IA",
         493  +
            "OUTPOSTS",
         494  +
            "REDUCED_REDUNDANCY",
         495  +
            "STANDARD",
         496  +
            "STANDARD_IA",
         497  +
        ]
         498  +
    }
         499  +
}
         500  +
impl ::std::convert::AsRef<str> for ObjectStorageClass {
         501  +
    fn as_ref(&self) -> &str {
         502  +
        self.as_str()
         503  +
    }
         504  +
}
         505  +
impl crate::constrained::Constrained for ObjectStorageClass {
         506  +
    type Unconstrained = ::std::string::String;
         507  +
}
         508  +
         509  +
impl ::std::convert::From<::std::string::String>
         510  +
    for crate::constrained::MaybeConstrained<crate::model::ObjectStorageClass>
         511  +
{
         512  +
    fn from(value: ::std::string::String) -> Self {
         513  +
        Self::Unconstrained(value)
         514  +
    }
         515  +
}
         516  +
         517  +
#[allow(missing_docs)] // documentation missing in model
         518  +
#[derive(
         519  +
    ::std::clone::Clone,
         520  +
    ::std::cmp::Eq,
         521  +
    ::std::cmp::Ord,
         522  +
    ::std::cmp::PartialEq,
         523  +
    ::std::cmp::PartialOrd,
         524  +
    ::std::fmt::Debug,
         525  +
    ::std::hash::Hash,
         526  +
)]
         527  +
pub enum RequestPayer {
         528  +
    #[allow(missing_docs)] // documentation missing in model
         529  +
    Requester,
         530  +
}
         531  +
/// See [`RequestPayer`](crate::model::RequestPayer).
         532  +
pub mod request_payer {
         533  +
    #[derive(Debug, PartialEq)]
         534  +
    pub struct ConstraintViolation(pub(crate) ::std::string::String);
         535  +
         536  +
    impl ::std::fmt::Display for ConstraintViolation {
         537  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         538  +
            write!(
         539  +
                f,
         540  +
                r#"Value provided for 'com.amazonaws.s3#RequestPayer' failed to satisfy constraint: Member must satisfy enum value set: [requester]"#
         541  +
            )
         542  +
        }
         543  +
    }
         544  +
         545  +
    impl ::std::error::Error for ConstraintViolation {}
         546  +
    impl ConstraintViolation {
         547  +
        pub(crate) fn as_validation_exception_field(
         548  +
            self,
         549  +
            path: ::std::string::String,
         550  +
        ) -> crate::model::ValidationExceptionField {
         551  +
            crate::model::ValidationExceptionField {
         552  +
                message: format!(
         553  +
                    r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [requester]"#,
         554  +
                    &path
         555  +
                ),
         556  +
                path,
         557  +
            }
         558  +
        }
         559  +
    }
         560  +
}
         561  +
impl ::std::convert::TryFrom<&str> for RequestPayer {
         562  +
    type Error = crate::model::request_payer::ConstraintViolation;
         563  +
    fn try_from(
         564  +
        s: &str,
         565  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
         566  +
        match s {
         567  +
            "requester" => Ok(RequestPayer::Requester),
         568  +
            _ => Err(crate::model::request_payer::ConstraintViolation(
         569  +
                s.to_owned(),
         570  +
            )),
         571  +
        }
         572  +
    }
         573  +
}
         574  +
impl ::std::convert::TryFrom<::std::string::String> for RequestPayer {
         575  +
    type Error = crate::model::request_payer::ConstraintViolation;
         576  +
    fn try_from(
         577  +
        s: ::std::string::String,
         578  +
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
         579  +
    {
         580  +
        s.as_str().try_into()
         581  +
    }
         582  +
}
         583  +
impl std::str::FromStr for RequestPayer {
         584  +
    type Err = crate::model::request_payer::ConstraintViolation;
         585  +
    fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
         586  +
        Self::try_from(s)
         587  +
    }
         588  +
}
         589  +
impl RequestPayer {
         590  +
    /// Returns the `&str` value of the enum member.
         591  +
    pub fn as_str(&self) -> &str {
         592  +
        match self {
         593  +
            RequestPayer::Requester => "requester",
         594  +
        }
         595  +
    }
         596  +
    /// Returns all the `&str` representations of the enum members.
         597  +
    pub const fn values() -> &'static [&'static str] {
         598  +
        &["requester"]
         599  +
    }
         600  +
}
         601  +
impl ::std::convert::AsRef<str> for RequestPayer {
         602  +
    fn as_ref(&self) -> &str {
         603  +
        self.as_str()
         604  +
    }
         605  +
}
         606  +
impl crate::constrained::Constrained for RequestPayer {
         607  +
    type Unconstrained = ::std::string::String;
         608  +
}
         609  +
         610  +
impl ::std::convert::From<::std::string::String>
         611  +
    for crate::constrained::MaybeConstrained<crate::model::RequestPayer>
         612  +
{
         613  +
    fn from(value: ::std::string::String) -> Self {
         614  +
        Self::Unconstrained(value)
         615  +
    }
         616  +
}
         617  +
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         618  +
pub mod validation_exception_field {
         619  +
         620  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         621  +
    /// Holds one variant for each of the ways the builder can fail.
         622  +
    #[non_exhaustive]
         623  +
    #[allow(clippy::enum_variant_names)]
         624  +
    pub enum ConstraintViolation {
         625  +
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         626  +
        MissingPath,
         627  +
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         628  +
        MissingMessage,
         629  +
    }
         630  +
    impl ::std::fmt::Display for ConstraintViolation {
         631  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         632  +
            match self {
         633  +
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         634  +
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         635  +
            }
         636  +
        }
         637  +
    }
         638  +
    impl ::std::error::Error for ConstraintViolation {}
         639  +
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
         640  +
        type Error = ConstraintViolation;
         641  +
         642  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         643  +
            builder.build()
         644  +
        }
         645  +
    }
         646  +
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         647  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         648  +
    pub struct Builder {
         649  +
        pub(crate) path: ::std::option::Option<::std::string::String>,
         650  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         651  +
    }
         652  +
    impl Builder {
         653  +
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         654  +
        pub fn path(mut self, input: ::std::string::String) -> Self {
         655  +
            self.path = Some(input);
         656  +
            self
         657  +
        }
         658  +
        /// A detailed description of the validation failure.
         659  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         660  +
            self.message = Some(input);
         661  +
            self
         662  +
        }
         663  +
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         664  +
        ///
         665  +
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
         666  +
        ///
         667  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         668  +
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         669  +
            self.build_enforcing_all_constraints()
         670  +
        }
         671  +
        fn build_enforcing_all_constraints(
         672  +
            self,
         673  +
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         674  +
            Ok(crate::model::ValidationExceptionField {
         675  +
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
         676  +
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
         677  +
            })
         678  +
        }
         679  +
    }
         680  +
}
         681  +
/// See [`ObjectKey`](crate::model::ObjectKey).
         682  +
pub mod object_key {
         683  +
         684  +
    #[derive(Debug, PartialEq)]
         685  +
    pub enum ConstraintViolation {
         686  +
        /// Error when a string doesn't satisfy its `@length` requirements.
         687  +
        Length(usize),
         688  +
    }
         689  +
         690  +
    impl ::std::fmt::Display for ConstraintViolation {
         691  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         692  +
            let message = match self {
         693  +
                Self::Length(length) => {
         694  +
                    format!("Value with length {} provided for 'com.amazonaws.s3#ObjectKey' failed to satisfy constraint: Member must have length greater than or equal to 1", length)
         695  +
                }
         696  +
            };
         697  +
            write!(f, "{message}")
         698  +
        }
         699  +
    }
         700  +
         701  +
    impl ::std::error::Error for ConstraintViolation {}
         702  +
    impl ConstraintViolation {
         703  +
        pub(crate) fn as_validation_exception_field(
         704  +
            self,
         705  +
            path: ::std::string::String,
         706  +
        ) -> crate::model::ValidationExceptionField {
         707  +
            match self {
         708  +
                            Self::Length(length) => crate::model::ValidationExceptionField {
         709  +
                            message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 1", length, &path),
         710  +
                            path,
         711  +
                        },
         712  +
                        }
         713  +
        }
         714  +
    }
         715  +
}
         716  +
/// See [`CommonPrefix`](crate::model::CommonPrefix).
         717  +
pub mod common_prefix {
         718  +
         719  +
    impl ::std::convert::From<Builder> for crate::model::CommonPrefix {
         720  +
        fn from(builder: Builder) -> Self {
         721  +
            builder.build()
         722  +
        }
         723  +
    }
         724  +
    /// A builder for [`CommonPrefix`](crate::model::CommonPrefix).
         725  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         726  +
    pub struct Builder {
         727  +
        pub(crate) prefix: ::std::option::Option<::std::string::String>,
         728  +
    }
         729  +
    impl Builder {
         730  +
        #[allow(missing_docs)] // documentation missing in model
         731  +
        pub fn prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         732  +
            self.prefix = input;
         733  +
            self
         734  +
        }
         735  +
        /// Consumes the builder and constructs a [`CommonPrefix`](crate::model::CommonPrefix).
         736  +
        pub fn build(self) -> crate::model::CommonPrefix {
         737  +
            self.build_enforcing_all_constraints()
         738  +
        }
         739  +
        fn build_enforcing_all_constraints(self) -> crate::model::CommonPrefix {
         740  +
            crate::model::CommonPrefix {
         741  +
                prefix: self.prefix,
         742  +
            }
         743  +
        }
         744  +
    }
         745  +
}
         746  +
/// See [`Object`](crate::model::Object).
         747  +
pub mod object {
         748  +
         749  +
    impl ::std::convert::From<Builder> for crate::model::Object {
         750  +
        fn from(builder: Builder) -> Self {
         751  +
            builder.build()
         752  +
        }
         753  +
    }
         754  +
    /// A builder for [`Object`](crate::model::Object).
         755  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         756  +
    pub struct Builder {
         757  +
        pub(crate) key: ::std::option::Option<crate::model::ObjectKey>,
         758  +
        pub(crate) last_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
         759  +
        pub(crate) e_tag: ::std::option::Option<::std::string::String>,
         760  +
        pub(crate) size: ::std::option::Option<i32>,
         761  +
        pub(crate) storage_class: ::std::option::Option<crate::model::ObjectStorageClass>,
         762  +
        pub(crate) owner: ::std::option::Option<crate::model::Owner>,
         763  +
    }
         764  +
    impl Builder {
         765  +
        #[allow(missing_docs)] // documentation missing in model
         766  +
        pub fn key(mut self, input: ::std::option::Option<crate::model::ObjectKey>) -> Self {
         767  +
            self.key = input;
         768  +
            self
         769  +
        }
         770  +
        #[allow(missing_docs)] // documentation missing in model
         771  +
        pub fn last_modified(
         772  +
            mut self,
         773  +
            input: ::std::option::Option<::aws_smithy_types::DateTime>,
         774  +
        ) -> Self {
         775  +
            self.last_modified = input;
         776  +
            self
         777  +
        }
         778  +
        #[allow(missing_docs)] // documentation missing in model
         779  +
        pub fn e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         780  +
            self.e_tag = input;
         781  +
            self
         782  +
        }
         783  +
        #[allow(missing_docs)] // documentation missing in model
         784  +
        pub fn size(mut self, input: ::std::option::Option<i32>) -> Self {
         785  +
            self.size = input;
         786  +
            self
         787  +
        }
         788  +
        #[allow(missing_docs)] // documentation missing in model
         789  +
        pub fn storage_class(
         790  +
            mut self,
         791  +
            input: ::std::option::Option<crate::model::ObjectStorageClass>,
         792  +
        ) -> Self {
         793  +
            self.storage_class = input;
         794  +
            self
         795  +
        }
         796  +
        #[allow(missing_docs)] // documentation missing in model
         797  +
        pub fn owner(mut self, input: ::std::option::Option<crate::model::Owner>) -> Self {
         798  +
            self.owner = input;
         799  +
            self
         800  +
        }
         801  +
        /// Consumes the builder and constructs a [`Object`](crate::model::Object).
         802  +
        pub fn build(self) -> crate::model::Object {
         803  +
            self.build_enforcing_all_constraints()
         804  +
        }
         805  +
        fn build_enforcing_all_constraints(self) -> crate::model::Object {
         806  +
            crate::model::Object {
         807  +
                key: self.key,
         808  +
                last_modified: self.last_modified,
         809  +
                e_tag: self.e_tag,
         810  +
                size: self.size,
         811  +
                storage_class: self.storage_class,
         812  +
                owner: self.owner,
         813  +
            }
         814  +
        }
         815  +
    }
         816  +
}
         817  +
/// See [`Owner`](crate::model::Owner).
         818  +
pub mod owner {
         819  +
         820  +
    impl ::std::convert::From<Builder> for crate::model::Owner {
         821  +
        fn from(builder: Builder) -> Self {
         822  +
            builder.build()
         823  +
        }
         824  +
    }
         825  +
    /// A builder for [`Owner`](crate::model::Owner).
         826  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         827  +
    pub struct Builder {
         828  +
        pub(crate) display_name: ::std::option::Option<::std::string::String>,
         829  +
        pub(crate) id: ::std::option::Option<::std::string::String>,
         830  +
    }
         831  +
    impl Builder {
         832  +
        #[allow(missing_docs)] // documentation missing in model
         833  +
        pub fn display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         834  +
            self.display_name = input;
         835  +
            self
         836  +
        }
         837  +
        #[allow(missing_docs)] // documentation missing in model
         838  +
        pub fn id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         839  +
            self.id = input;
         840  +
            self
         841  +
        }
         842  +
        /// Consumes the builder and constructs a [`Owner`](crate::model::Owner).
         843  +
        pub fn build(self) -> crate::model::Owner {
         844  +
            self.build_enforcing_all_constraints()
         845  +
        }
         846  +
        fn build_enforcing_all_constraints(self) -> crate::model::Owner {
         847  +
            crate::model::Owner {
         848  +
                display_name: self.display_name,
         849  +
                id: self.id,
         850  +
            }
         851  +
        }
         852  +
    }
         853  +
}