Server Test

Server Test

rev. d838bf488731ae5e751cce0fe13f339a5b9be858 (ignoring whitespace)

Files changed:

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

@@ -1,1 +44,45 @@
    5      5   
#![allow(clippy::large_enum_variant)]
    6      6   
#![allow(clippy::wrong_self_convention)]
    7      7   
#![allow(clippy::should_implement_trait)]
    8      8   
#![allow(clippy::disallowed_names)]
    9      9   
#![allow(clippy::vec_init_then_push)]
   10     10   
#![allow(clippy::type_complexity)]
   11     11   
#![allow(clippy::needless_return)]
   12     12   
#![allow(clippy::derive_partial_eq_without_eq)]
   13     13   
#![allow(clippy::result_large_err)]
   14     14   
#![allow(clippy::unnecessary_map_on_constructor)]
          15  +
#![allow(clippy::useless_conversion)]
   15     16   
#![allow(clippy::deprecated_semver)]
   16     17   
#![allow(clippy::uninlined_format_args)]
   17     18   
#![allow(rustdoc::bare_urls)]
   18     19   
#![allow(rustdoc::redundant_explicit_links)]
   19     20   
#![allow(rustdoc::broken_intra_doc_links)]
   20     21   
#![allow(rustdoc::invalid_html_tags)]
   21     22   
#![forbid(unsafe_code)]
   22     23   
#![cfg_attr(docsrs, feature(doc_cfg))]
   23     24   
//! s3-http0x
   24     25   

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

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

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

@@ -1,1 +455,137 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
::pin_project_lite::pin_project! {
    3      3   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    4         -
    /// [`GetObjectInput`](crate::input::GetObjectInput) using modelled bindings.
    5         -
    pub struct GetObjectInputFuture {
    6         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetObjectInput, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
    7         -
    }
    8         -
}
    9         -
   10         -
impl std::future::Future for GetObjectInputFuture {
   11         -
    type Output = Result<
   12         -
        crate::input::GetObjectInput,
   13         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
   14         -
    >;
   15         -
   16         -
    fn poll(
   17         -
        self: std::pin::Pin<&mut Self>,
   18         -
        cx: &mut std::task::Context<'_>,
   19         -
    ) -> std::task::Poll<Self::Output> {
   20         -
        let this = self.project();
   21         -
        this.inner.as_mut().poll(cx)
   22         -
    }
   23         -
}
   24         -
   25         -
impl<B>
   26         -
    ::aws_smithy_legacy_http_server::request::FromRequest<
   27         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
   28         -
        B,
   29         -
    > for crate::input::GetObjectInput
   30         -
where
   31         -
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   32         -
    B: 'static,
   33         -
   34         -
    B::Data: Send,
   35         -
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
   36         -
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   37         -
{
   38         -
    type Rejection =
   39         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
   40         -
    type Future = GetObjectInputFuture;
   41         -
   42         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   43         -
        let fut = async move {
   44         -
            crate::protocol_serde::shape_get_object::de_get_object_http_request(request).await
   45         -
        };
   46         -
        use ::futures_util::future::TryFutureExt;
   47         -
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
   48         -
                        ::tracing::debug!(error = %e, "failed to deserialize request");
   49         -
                        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
   50         -
                    });
   51         -
        GetObjectInputFuture {
   52         -
            inner: Box::pin(fut),
   53         -
        }
   54         -
    }
   55         -
}
   56         -
impl
   57         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
   58         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
   59         -
    > for crate::output::GetObjectOutput
   60         -
{
   61         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   62         -
        match crate::protocol_serde::shape_get_object::ser_get_object_http_response(self) {
   63         -
            Ok(response) => response,
   64         -
            Err(e) => {
   65         -
                ::tracing::error!(error = %e, "failed to serialize response");
   66         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
   67         -
            }
   68         -
        }
   69         -
    }
   70         -
}
   71         -
impl
   72         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
   73         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
   74         -
    > for crate::error::GetObjectError
   75         -
{
   76         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   77         -
        match crate::protocol_serde::shape_get_object::ser_get_object_http_error(&self) {
   78         -
            Ok(mut response) => {
   79         -
                response.extensions_mut().insert(
   80         -
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
   81         -
                        self.name(),
   82         -
                    ),
   83         -
                );
   84         -
                response
   85         -
            }
   86         -
            Err(e) => {
   87         -
                ::tracing::error!(error = %e, "failed to serialize response");
   88         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
   89         -
            }
   90         -
        }
   91         -
    }
   92         -
}
   93         -
   94         -
::pin_project_lite::pin_project! {
   95         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
   96         -
    /// [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput) using modelled bindings.
   97         -
    pub struct DeleteObjectTaggingInputFuture {
   98         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DeleteObjectTaggingInput, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
   99         -
    }
  100         -
}
  101         -
  102         -
impl std::future::Future for DeleteObjectTaggingInputFuture {
  103         -
    type Output = Result<
  104         -
        crate::input::DeleteObjectTaggingInput,
  105         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
  106         -
    >;
  107         -
  108         -
    fn poll(
  109         -
        self: std::pin::Pin<&mut Self>,
  110         -
        cx: &mut std::task::Context<'_>,
  111         -
    ) -> std::task::Poll<Self::Output> {
  112         -
        let this = self.project();
  113         -
        this.inner.as_mut().poll(cx)
  114         -
    }
  115         -
}
  116         -
  117         -
impl<B>
  118         -
    ::aws_smithy_legacy_http_server::request::FromRequest<
  119         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
  120         -
        B,
  121         -
    > for crate::input::DeleteObjectTaggingInput
  122         -
where
  123         -
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  124         -
    B: 'static,
  125         -
  126         -
    B::Data: Send,
  127         -
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
  128         -
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  129         -
{
  130         -
    type Rejection =
  131         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
  132         -
    type Future = DeleteObjectTaggingInputFuture;
  133         -
  134         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  135         -
        let fut = async move {
  136         -
            crate::protocol_serde::shape_delete_object_tagging::de_delete_object_tagging_http_request(request)
  137         -
                            .await
  138         -
        };
  139         -
        use ::futures_util::future::TryFutureExt;
  140         -
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
  141         -
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  142         -
                        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
  143         -
                    });
  144         -
        DeleteObjectTaggingInputFuture {
  145         -
            inner: Box::pin(fut),
  146         -
        }
  147         -
    }
  148         -
}
  149         -
impl
  150         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  151         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
  152         -
    > for crate::output::DeleteObjectTaggingOutput
  153         -
{
  154         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  155         -
        match crate::protocol_serde::shape_delete_object_tagging::ser_delete_object_tagging_http_response(self) {
  156         -
                        Ok(response) => response,
  157         -
                        Err(e) => {
  158         -
                            ::tracing::error!(error = %e, "failed to serialize response");
  159         -
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
  160         -
                        }
  161         -
                    }
  162         -
    }
  163         -
}
  164         -
impl
  165         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  166         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
  167         -
    > for crate::error::DeleteObjectTaggingError
  168         -
{
  169         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  170         -
        match crate::protocol_serde::shape_delete_object_tagging::ser_delete_object_tagging_http_error(&self) {
  171         -
            Ok(mut response) => {
  172         -
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
  173         -
                response
  174         -
            },
  175         -
            Err(e) => {
  176         -
                ::tracing::error!(error = %e, "failed to serialize response");
  177         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
  178         -
            }
  179         -
        }
  180         -
    }
  181         -
}
  182         -
  183         -
::pin_project_lite::pin_project! {
  184         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  185         -
    /// [`GetBucketLocationInput`](crate::input::GetBucketLocationInput) using modelled bindings.
  186         -
    pub struct GetBucketLocationInputFuture {
  187         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetBucketLocationInput, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
           4  +
    /// [`ListObjectsV2Input`](crate::input::ListObjectsV2Input) using modelled bindings.
           5  +
    pub struct ListObjectsV2InputFuture {
           6  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ListObjectsV2Input, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
  188      7   
    }
  189      8   
}
  190      9   
  191         -
impl std::future::Future for GetBucketLocationInputFuture {
          10  +
impl std::future::Future for ListObjectsV2InputFuture {
  192     11   
    type Output = Result<
  193         -
        crate::input::GetBucketLocationInput,
          12  +
        crate::input::ListObjectsV2Input,
  194     13   
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
  195     14   
    >;
  196     15   
  197     16   
    fn poll(
  198     17   
        self: std::pin::Pin<&mut Self>,
  199     18   
        cx: &mut std::task::Context<'_>,
  200     19   
    ) -> std::task::Poll<Self::Output> {
  201     20   
        let this = self.project();
  202     21   
        this.inner.as_mut().poll(cx)
  203     22   
    }
  204     23   
}
  205     24   
  206     25   
impl<B>
  207     26   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  208     27   
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
  209     28   
        B,
  210         -
    > for crate::input::GetBucketLocationInput
          29  +
    > for crate::input::ListObjectsV2Input
  211     30   
where
  212     31   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  213     32   
    B: 'static,
  214     33   
  215     34   
    B::Data: Send,
  216     35   
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
  217     36   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  218     37   
{
  219     38   
    type Rejection =
  220     39   
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
  221         -
    type Future = GetBucketLocationInputFuture;
          40  +
    type Future = ListObjectsV2InputFuture;
  222     41   
  223     42   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  224     43   
        let fut = async move {
  225     44   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  226     45   
                request.headers(),
  227     46   
                &crate::mimes::CONTENT_TYPE_APPLICATION_XML,
  228     47   
            ) {
  229     48   
                return Err(::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection::NotAcceptable);
  230     49   
            }
  231         -
            crate::protocol_serde::shape_get_bucket_location::de_get_bucket_location_http_request(
  232         -
                request,
  233         -
            )
          50  +
            crate::protocol_serde::shape_list_objects_v2::de_list_objects_v2_http_request(request)
  234     51   
                .await
  235     52   
        };
  236     53   
        use ::futures_util::future::TryFutureExt;
  237     54   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
  238     55   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  239     56   
                        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
  240     57   
                    });
  241         -
        GetBucketLocationInputFuture {
          58  +
        ListObjectsV2InputFuture {
  242     59   
            inner: Box::pin(fut),
  243     60   
        }
  244     61   
    }
  245     62   
}
  246     63   
impl
  247     64   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  248     65   
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
  249         -
    > for crate::output::GetBucketLocationOutput
          66  +
    > for crate::output::ListObjectsV2Output
  250     67   
{
  251     68   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  252         -
        match crate::protocol_serde::shape_get_bucket_location::ser_get_bucket_location_http_response(self) {
          69  +
        match crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_http_response(self)
          70  +
        {
  253     71   
            Ok(response) => response,
  254     72   
            Err(e) => {
  255     73   
                ::tracing::error!(error = %e, "failed to serialize response");
  256     74   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
  257     75   
            }
  258     76   
        }
  259     77   
    }
  260     78   
}
  261     79   
impl
  262     80   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  263     81   
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
  264         -
    > for crate::error::GetBucketLocationError
          82  +
    > for crate::error::ListObjectsV2Error
  265     83   
{
  266     84   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  267         -
        match crate::protocol_serde::shape_get_bucket_location::ser_get_bucket_location_http_error(
  268         -
            &self,
  269         -
        ) {
          85  +
        match crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_http_error(&self) {
  270     86   
            Ok(mut response) => {
  271     87   
                response.extensions_mut().insert(
  272     88   
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
  273     89   
                        self.name(),
  274     90   
                    ),
  275     91   
                );
  276     92   
                response
  277     93   
            }
  278     94   
            Err(e) => {
  279     95   
                ::tracing::error!(error = %e, "failed to serialize response");
  280     96   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
  281     97   
            }
  282     98   
        }
  283     99   
    }
  284    100   
}
  285    101   
  286    102   
#[allow(unreachable_code, unused_variables)]
  287    103   
#[cfg(test)]
  288         -
mod get_bucket_location_test {
         104  +
mod list_objects_v2_test {
  289    105   
  290         -
    /// S3 clients should use the @s3UnwrappedXmlOutput trait to determine
  291         -
    /// that the response shape is not wrapped in a restxml operation-level XML node.
  292         -
    ///
  293         -
    /// Test ID: GetBucketLocationUnwrappedOutput
  294         -
    #[::tokio::test]
  295         -
    #[::tracing_test::traced_test]
  296         -
    #[should_panic]
  297         -
    async fn get_bucket_location_unwrapped_output_response() {
  298         -
        let output = crate::output::GetBucketLocationOutput {
  299         -
            location_constraint: ::std::option::Option::Some(
  300         -
                "us-west-2"
  301         -
                    .parse::<crate::model::BucketLocationConstraint>()
  302         -
                    .expect("static value validated to member"),
  303         -
            ),
  304         -
        };
  305         -
        use ::aws_smithy_legacy_http_server::response::IntoResponse;
  306         -
        let http_response = output.into_response();
  307         -
        ::pretty_assertions::assert_eq!(
  308         -
            ::http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  309         -
            http_response.status()
  310         -
        );
  311         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
  312         -
            .await
  313         -
            .expect("unable to extract body to bytes");
  314         -
        ::aws_smithy_protocol_test::assert_ok(
  315         -
        ::aws_smithy_protocol_test::validate_body(&body, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<LocationConstraint xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">us-west-2</LocationConstraint>", ::aws_smithy_protocol_test::MediaType::from("unknown"))
  316         -
        );
  317         -
    }
  318         -
}
  319         -
  320         -
::pin_project_lite::pin_project! {
  321         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  322         -
    /// [`ListObjectsV2Input`](crate::input::ListObjectsV2Input) using modelled bindings.
  323         -
    pub struct ListObjectsV2InputFuture {
  324         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ListObjectsV2Input, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
  325         -
    }
  326         -
}
  327         -
  328         -
impl std::future::Future for ListObjectsV2InputFuture {
  329         -
    type Output = Result<
  330         -
        crate::input::ListObjectsV2Input,
  331         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
  332         -
    >;
  333         -
  334         -
    fn poll(
  335         -
        self: std::pin::Pin<&mut Self>,
  336         -
        cx: &mut std::task::Context<'_>,
  337         -
    ) -> std::task::Poll<Self::Output> {
  338         -
        let this = self.project();
  339         -
        this.inner.as_mut().poll(cx)
  340         -
    }
  341         -
}
  342         -
  343         -
impl<B>
  344         -
    ::aws_smithy_legacy_http_server::request::FromRequest<
  345         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
  346         -
        B,
  347         -
    > for crate::input::ListObjectsV2Input
  348         -
where
  349         -
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  350         -
    B: 'static,
  351         -
  352         -
    B::Data: Send,
  353         -
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
  354         -
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  355         -
{
  356         -
    type Rejection =
  357         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
  358         -
    type Future = ListObjectsV2InputFuture;
  359         -
  360         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  361         -
        let fut = async move {
  362         -
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  363         -
                request.headers(),
  364         -
                &crate::mimes::CONTENT_TYPE_APPLICATION_XML,
  365         -
            ) {
  366         -
                return Err(::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection::NotAcceptable);
  367         -
            }
  368         -
            crate::protocol_serde::shape_list_objects_v2::de_list_objects_v2_http_request(request)
  369         -
                .await
  370         -
        };
  371         -
        use ::futures_util::future::TryFutureExt;
  372         -
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
  373         -
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  374         -
                        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
  375         -
                    });
  376         -
        ListObjectsV2InputFuture {
  377         -
            inner: Box::pin(fut),
  378         -
        }
  379         -
    }
  380         -
}
  381         -
impl
  382         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  383         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
  384         -
    > for crate::output::ListObjectsV2Output
  385         -
{
  386         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  387         -
        match crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_http_response(self)
  388         -
        {
  389         -
            Ok(response) => response,
  390         -
            Err(e) => {
  391         -
                ::tracing::error!(error = %e, "failed to serialize response");
  392         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
  393         -
            }
  394         -
        }
  395         -
    }
  396         -
}
  397         -
impl
  398         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  399         -
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
  400         -
    > for crate::error::ListObjectsV2Error
  401         -
{
  402         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  403         -
        match crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_http_error(&self) {
  404         -
            Ok(mut response) => {
  405         -
                response.extensions_mut().insert(
  406         -
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
  407         -
                        self.name(),
  408         -
                    ),
  409         -
                );
  410         -
                response
  411         -
            }
  412         -
            Err(e) => {
  413         -
                ::tracing::error!(error = %e, "failed to serialize response");
  414         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
  415         -
            }
  416         -
        }
  417         -
    }
  418         -
}
  419         -
  420         -
#[allow(unreachable_code, unused_variables)]
  421         -
#[cfg(test)]
  422         -
mod list_objects_v2_test {
  423         -
  424         -
    /// S3 clients should map the default addressing style to virtual host.
  425         -
    /// Test ID: S3DefaultAddressing
         106  +
    /// S3 clients should map the default addressing style to virtual host.
         107  +
    /// Test ID: S3DefaultAddressing
  426    108   
    #[::tokio::test]
  427    109   
    #[::tracing_test::traced_test]
  428    110   
    #[should_panic]
  429    111   
    async fn s3_default_addressing_request() {
  430    112   
        #[allow(unused_mut)]
  431    113   
        let mut http_request = ::http::Request::builder()
  432    114   
            .uri("/")
  433    115   
            .method("GET")
  434    116   
            .body(::aws_smithy_legacy_http_server::body::Body::from(
  435    117   
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
@@ -917,599 +0,946 @@
  937    619   
            expected_headers,
  938    620   
        ));
  939    621   
        let body = ::hyper::body::to_bytes(http_response.into_body())
  940    622   
            .await
  941    623   
            .expect("unable to extract body to bytes");
  942    624   
        ::aws_smithy_protocol_test::assert_ok(
  943    625   
        ::aws_smithy_protocol_test::validate_body(&body, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error>\n\t<Type>Sender</Type>\n\t<Code>NoSuchBucket</Code>\n</Error>", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
  944    626   
        );
  945    627   
    }
  946    628   
}
         629  +
         630  +
::pin_project_lite::pin_project! {
         631  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         632  +
    /// [`GetBucketLocationInput`](crate::input::GetBucketLocationInput) using modelled bindings.
         633  +
    pub struct GetBucketLocationInputFuture {
         634  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetBucketLocationInput, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
         635  +
    }
         636  +
}
         637  +
         638  +
impl std::future::Future for GetBucketLocationInputFuture {
         639  +
    type Output = Result<
         640  +
        crate::input::GetBucketLocationInput,
         641  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
         642  +
    >;
         643  +
         644  +
    fn poll(
         645  +
        self: std::pin::Pin<&mut Self>,
         646  +
        cx: &mut std::task::Context<'_>,
         647  +
    ) -> std::task::Poll<Self::Output> {
         648  +
        let this = self.project();
         649  +
        this.inner.as_mut().poll(cx)
         650  +
    }
         651  +
}
         652  +
         653  +
impl<B>
         654  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         655  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
         656  +
        B,
         657  +
    > for crate::input::GetBucketLocationInput
         658  +
where
         659  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
         660  +
    B: 'static,
         661  +
         662  +
    B::Data: Send,
         663  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
         664  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
         665  +
{
         666  +
    type Rejection =
         667  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
         668  +
    type Future = GetBucketLocationInputFuture;
         669  +
         670  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         671  +
        let fut = async move {
         672  +
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
         673  +
                request.headers(),
         674  +
                &crate::mimes::CONTENT_TYPE_APPLICATION_XML,
         675  +
            ) {
         676  +
                return Err(::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection::NotAcceptable);
         677  +
            }
         678  +
            crate::protocol_serde::shape_get_bucket_location::de_get_bucket_location_http_request(
         679  +
                request,
         680  +
            )
         681  +
            .await
         682  +
        };
         683  +
        use ::futures_util::future::TryFutureExt;
         684  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
         685  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
         686  +
                        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
         687  +
                    });
         688  +
        GetBucketLocationInputFuture {
         689  +
            inner: Box::pin(fut),
         690  +
        }
         691  +
    }
         692  +
}
         693  +
impl
         694  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         695  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
         696  +
    > for crate::output::GetBucketLocationOutput
         697  +
{
         698  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         699  +
        match crate::protocol_serde::shape_get_bucket_location::ser_get_bucket_location_http_response(self) {
         700  +
                        Ok(response) => response,
         701  +
                        Err(e) => {
         702  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         703  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
         704  +
                        }
         705  +
                    }
         706  +
    }
         707  +
}
         708  +
impl
         709  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         710  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
         711  +
    > for crate::error::GetBucketLocationError
         712  +
{
         713  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         714  +
        match crate::protocol_serde::shape_get_bucket_location::ser_get_bucket_location_http_error(
         715  +
            &self,
         716  +
        ) {
         717  +
            Ok(mut response) => {
         718  +
                response.extensions_mut().insert(
         719  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         720  +
                        self.name(),
         721  +
                    ),
         722  +
                );
         723  +
                response
         724  +
            }
         725  +
            Err(e) => {
         726  +
                ::tracing::error!(error = %e, "failed to serialize response");
         727  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
         728  +
            }
         729  +
        }
         730  +
    }
         731  +
}
         732  +
         733  +
#[allow(unreachable_code, unused_variables)]
         734  +
#[cfg(test)]
         735  +
mod get_bucket_location_test {
         736  +
         737  +
    /// S3 clients should use the @s3UnwrappedXmlOutput trait to determine
         738  +
    /// that the response shape is not wrapped in a restxml operation-level XML node.
         739  +
    ///
         740  +
    /// Test ID: GetBucketLocationUnwrappedOutput
         741  +
    #[::tokio::test]
         742  +
    #[::tracing_test::traced_test]
         743  +
    #[should_panic]
         744  +
    async fn get_bucket_location_unwrapped_output_response() {
         745  +
        let output = crate::output::GetBucketLocationOutput {
         746  +
            location_constraint: ::std::option::Option::Some(
         747  +
                "us-west-2"
         748  +
                    .parse::<crate::model::BucketLocationConstraint>()
         749  +
                    .expect("static value validated to member"),
         750  +
            ),
         751  +
        };
         752  +
        use ::aws_smithy_legacy_http_server::response::IntoResponse;
         753  +
        let http_response = output.into_response();
         754  +
        ::pretty_assertions::assert_eq!(
         755  +
            ::http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
         756  +
            http_response.status()
         757  +
        );
         758  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
         759  +
            .await
         760  +
            .expect("unable to extract body to bytes");
         761  +
        ::aws_smithy_protocol_test::assert_ok(
         762  +
        ::aws_smithy_protocol_test::validate_body(&body, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<LocationConstraint xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">us-west-2</LocationConstraint>", ::aws_smithy_protocol_test::MediaType::from("unknown"))
         763  +
        );
         764  +
    }
         765  +
}
         766  +
         767  +
::pin_project_lite::pin_project! {
         768  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         769  +
    /// [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput) using modelled bindings.
         770  +
    pub struct DeleteObjectTaggingInputFuture {
         771  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DeleteObjectTaggingInput, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
         772  +
    }
         773  +
}
         774  +
         775  +
impl std::future::Future for DeleteObjectTaggingInputFuture {
         776  +
    type Output = Result<
         777  +
        crate::input::DeleteObjectTaggingInput,
         778  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
         779  +
    >;
         780  +
         781  +
    fn poll(
         782  +
        self: std::pin::Pin<&mut Self>,
         783  +
        cx: &mut std::task::Context<'_>,
         784  +
    ) -> std::task::Poll<Self::Output> {
         785  +
        let this = self.project();
         786  +
        this.inner.as_mut().poll(cx)
         787  +
    }
         788  +
}
         789  +
         790  +
impl<B>
         791  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         792  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
         793  +
        B,
         794  +
    > for crate::input::DeleteObjectTaggingInput
         795  +
where
         796  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
         797  +
    B: 'static,
         798  +
         799  +
    B::Data: Send,
         800  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
         801  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
         802  +
{
         803  +
    type Rejection =
         804  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
         805  +
    type Future = DeleteObjectTaggingInputFuture;
         806  +
         807  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         808  +
        let fut = async move {
         809  +
            crate::protocol_serde::shape_delete_object_tagging::de_delete_object_tagging_http_request(request)
         810  +
                            .await
         811  +
        };
         812  +
        use ::futures_util::future::TryFutureExt;
         813  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
         814  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
         815  +
                        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
         816  +
                    });
         817  +
        DeleteObjectTaggingInputFuture {
         818  +
            inner: Box::pin(fut),
         819  +
        }
         820  +
    }
         821  +
}
         822  +
impl
         823  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         824  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
         825  +
    > for crate::output::DeleteObjectTaggingOutput
         826  +
{
         827  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         828  +
        match crate::protocol_serde::shape_delete_object_tagging::ser_delete_object_tagging_http_response(self) {
         829  +
                        Ok(response) => response,
         830  +
                        Err(e) => {
         831  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         832  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
         833  +
                        }
         834  +
                    }
         835  +
    }
         836  +
}
         837  +
impl
         838  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         839  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
         840  +
    > for crate::error::DeleteObjectTaggingError
         841  +
{
         842  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         843  +
        match crate::protocol_serde::shape_delete_object_tagging::ser_delete_object_tagging_http_error(&self) {
         844  +
            Ok(mut response) => {
         845  +
                response.extensions_mut().insert(::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(self.name()));
         846  +
                response
         847  +
            },
         848  +
            Err(e) => {
         849  +
                ::tracing::error!(error = %e, "failed to serialize response");
         850  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
         851  +
            }
         852  +
        }
         853  +
    }
         854  +
}
         855  +
         856  +
::pin_project_lite::pin_project! {
         857  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         858  +
    /// [`GetObjectInput`](crate::input::GetObjectInput) using modelled bindings.
         859  +
    pub struct GetObjectInputFuture {
         860  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetObjectInput, ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError>> + Send>>
         861  +
    }
         862  +
}
         863  +
         864  +
impl std::future::Future for GetObjectInputFuture {
         865  +
    type Output = Result<
         866  +
        crate::input::GetObjectInput,
         867  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError,
         868  +
    >;
         869  +
         870  +
    fn poll(
         871  +
        self: std::pin::Pin<&mut Self>,
         872  +
        cx: &mut std::task::Context<'_>,
         873  +
    ) -> std::task::Poll<Self::Output> {
         874  +
        let this = self.project();
         875  +
        this.inner.as_mut().poll(cx)
         876  +
    }
         877  +
}
         878  +
         879  +
impl<B>
         880  +
    ::aws_smithy_legacy_http_server::request::FromRequest<
         881  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
         882  +
        B,
         883  +
    > for crate::input::GetObjectInput
         884  +
where
         885  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
         886  +
    B: 'static,
         887  +
         888  +
    B::Data: Send,
         889  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
         890  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
         891  +
{
         892  +
    type Rejection =
         893  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError;
         894  +
    type Future = GetObjectInputFuture;
         895  +
         896  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         897  +
        let fut = async move {
         898  +
            crate::protocol_serde::shape_get_object::de_get_object_http_request(request).await
         899  +
        };
         900  +
        use ::futures_util::future::TryFutureExt;
         901  +
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection| {
         902  +
                        ::tracing::debug!(error = %e, "failed to deserialize request");
         903  +
                        ::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e)
         904  +
                    });
         905  +
        GetObjectInputFuture {
         906  +
            inner: Box::pin(fut),
         907  +
        }
         908  +
    }
         909  +
}
         910  +
impl
         911  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         912  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
         913  +
    > for crate::output::GetObjectOutput
         914  +
{
         915  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         916  +
        match crate::protocol_serde::shape_get_object::ser_get_object_http_response(self) {
         917  +
            Ok(response) => response,
         918  +
            Err(e) => {
         919  +
                ::tracing::error!(error = %e, "failed to serialize response");
         920  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
         921  +
            }
         922  +
        }
         923  +
    }
         924  +
}
         925  +
impl
         926  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         927  +
        ::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml,
         928  +
    > for crate::error::GetObjectError
         929  +
{
         930  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         931  +
        match crate::protocol_serde::shape_get_object::ser_get_object_http_error(&self) {
         932  +
            Ok(mut response) => {
         933  +
                response.extensions_mut().insert(
         934  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         935  +
                        self.name(),
         936  +
                    ),
         937  +
                );
         938  +
                response
         939  +
            }
         940  +
            Err(e) => {
         941  +
                ::tracing::error!(error = %e, "failed to serialize response");
         942  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::rest_xml::RestXml>::into_response(::aws_smithy_legacy_http_server::protocol::rest_xml::runtime_error::RuntimeError::from(e))
         943  +
            }
         944  +
        }
         945  +
    }
         946  +
}