Server Test

Server Test

rev. 7254d43655ed63111c94f599437f2b0d3f55446e (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/unconstrained.rs

@@ -1,1 +202,201 @@
    4      4   
    type Unconstrained = crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained;
    5      5   
}
    6      6   
    7      7   
impl From<crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained>
    8      8   
    for crate::constrained::MaybeConstrained<crate::model::MyUnion>
    9      9   
{
   10     10   
    fn from(value: crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained) -> Self {
   11     11   
        Self::Unconstrained(value)
   12     12   
    }
   13     13   
}
          14  +
pub(crate) mod foo_enum_list_unconstrained {
   14     15   
   15         -
pub(crate) mod my_union_unconstrained {
   16         -
   17         -
    #[allow(clippy::enum_variant_names)]
   18     16   
    #[derive(Debug, Clone)]
   19         -
    pub(crate) enum MyUnionUnconstrained {
   20         -
        BlobValue(::aws_smithy_types::Blob),
   21         -
        BooleanValue(bool),
   22         -
        EnumValue(::std::string::String),
   23         -
        ListValue(::std::vec::Vec<::std::string::String>),
   24         -
        MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
   25         -
        NumberValue(i32),
   26         -
        StringValue(::std::string::String),
   27         -
        StructureValue(crate::model::GreetingStruct),
   28         -
        TimestampValue(::aws_smithy_types::DateTime),
   29         -
    }
   30         -
    impl ::std::convert::TryFrom<MyUnionUnconstrained> for crate::model::MyUnion {
   31         -
        type Error = crate::model::my_union::ConstraintViolation;
   32         -
   33         -
        fn try_from(value: MyUnionUnconstrained) -> ::std::result::Result<Self, Self::Error> {
   34         -
            Ok(
   35         -
        match value {
   36         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BlobValue(unconstrained) => Self::BlobValue(
   37         -
                unconstrained
   38         -
            ),
   39         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BooleanValue(unconstrained) => Self::BooleanValue(
   40         -
                unconstrained
   41         -
            ),
   42         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::EnumValue(unconstrained) => Self::EnumValue(
   43         -
                unconstrained
   44         -
                                        .try_into()
   45         -
                                        
          17  +
    pub(crate) struct FooEnumListUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
   46     18   
   47         -
                                        .map_err(Self::Error::EnumValue)?
   48         -
            ),
   49         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::ListValue(unconstrained) => Self::ListValue(
   50         -
                unconstrained
   51         -
            ),
   52         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::MapValue(unconstrained) => Self::MapValue(
   53         -
                unconstrained
   54         -
            ),
   55         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::NumberValue(unconstrained) => Self::NumberValue(
   56         -
                unconstrained
   57         -
            ),
   58         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StringValue(unconstrained) => Self::StringValue(
   59         -
                unconstrained
   60         -
            ),
   61         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StructureValue(unconstrained) => Self::StructureValue(
   62         -
                unconstrained
   63         -
            ),
   64         -
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::TimestampValue(unconstrained) => Self::TimestampValue(
   65         -
                unconstrained
   66         -
            ),
          19  +
    impl From<FooEnumListUnconstrained>
          20  +
        for crate::constrained::MaybeConstrained<
          21  +
            crate::constrained::foo_enum_list_constrained::FooEnumListConstrained,
          22  +
        >
          23  +
    {
          24  +
        fn from(value: FooEnumListUnconstrained) -> Self {
          25  +
            Self::Unconstrained(value)
   67     26   
        }
   68         -
    )
          27  +
    }
          28  +
    impl std::convert::TryFrom<FooEnumListUnconstrained>
          29  +
        for crate::constrained::foo_enum_list_constrained::FooEnumListConstrained
          30  +
    {
          31  +
        type Error = crate::model::foo_enum_list::ConstraintViolation;
          32  +
        fn try_from(value: FooEnumListUnconstrained) -> std::result::Result<Self, Self::Error> {
          33  +
            let res: ::std::result::Result<
          34  +
                ::std::vec::Vec<crate::model::FooEnum>,
          35  +
                (usize, crate::model::foo_enum::ConstraintViolation),
          36  +
            > = value
          37  +
                .0
          38  +
                .into_iter()
          39  +
                .enumerate()
          40  +
                .map(|(idx, inner)| {
          41  +
                    inner
          42  +
                        .try_into()
          43  +
                        .map_err(|inner_violation| (idx, inner_violation))
          44  +
                })
          45  +
                .collect();
          46  +
            let inner =
          47  +
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
          48  +
            Ok(Self(inner))
   69     49   
        }
   70     50   
    }
   71     51   
}
   72         -
pub(crate) mod integer_enum_set_unconstrained {
          52  +
pub(crate) mod foo_enum_set_unconstrained {
   73     53   
   74     54   
    #[derive(Debug, Clone)]
   75         -
    pub(crate) struct IntegerEnumSetUnconstrained(pub(crate) std::vec::Vec<i32>);
          55  +
    pub(crate) struct FooEnumSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
   76     56   
   77         -
    impl From<IntegerEnumSetUnconstrained>
   78         -
        for crate::constrained::MaybeConstrained<crate::model::IntegerEnumSet>
          57  +
    impl From<FooEnumSetUnconstrained>
          58  +
        for crate::constrained::MaybeConstrained<crate::model::FooEnumSet>
   79     59   
    {
   80         -
        fn from(value: IntegerEnumSetUnconstrained) -> Self {
          60  +
        fn from(value: FooEnumSetUnconstrained) -> Self {
   81     61   
            Self::Unconstrained(value)
   82     62   
        }
   83     63   
    }
   84         -
    impl std::convert::TryFrom<IntegerEnumSetUnconstrained> for crate::model::IntegerEnumSet {
   85         -
        type Error = crate::model::integer_enum_set::ConstraintViolation;
   86         -
        fn try_from(value: IntegerEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
   87         -
            let inner = value.0;
          64  +
    impl std::convert::TryFrom<FooEnumSetUnconstrained> for crate::model::FooEnumSet {
          65  +
        type Error = crate::model::foo_enum_set::ConstraintViolation;
          66  +
        fn try_from(value: FooEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
          67  +
            let res: ::std::result::Result<
          68  +
                ::std::vec::Vec<crate::model::FooEnum>,
          69  +
                (usize, crate::model::foo_enum::ConstraintViolation),
          70  +
            > = value
          71  +
                .0
          72  +
                .into_iter()
          73  +
                .enumerate()
          74  +
                .map(|(idx, inner)| {
          75  +
                    inner
          76  +
                        .try_into()
          77  +
                        .map_err(|inner_violation| (idx, inner_violation))
          78  +
                })
          79  +
                .collect();
          80  +
            let inner =
          81  +
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
   88     82   
            Self::try_from(inner)
   89     83   
        }
   90     84   
    }
   91     85   
}
   92     86   
pub(crate) mod foo_enum_map_unconstrained {
   93     87   
   94     88   
    #[derive(Debug, Clone)]
   95     89   
    pub(crate) struct FooEnumMapUnconstrained(
   96     90   
        pub(crate) std::collections::HashMap<::std::string::String, ::std::string::String>,
   97     91   
    );
   98     92   
   99     93   
    impl From<FooEnumMapUnconstrained>
  100     94   
        for crate::constrained::MaybeConstrained<
  101     95   
            crate::constrained::foo_enum_map_constrained::FooEnumMapConstrained,
  102     96   
        >
  103     97   
    {
  104     98   
        fn from(value: FooEnumMapUnconstrained) -> Self {
  105     99   
            Self::Unconstrained(value)
  106    100   
        }
  107    101   
    }
  108    102   
    impl std::convert::TryFrom<FooEnumMapUnconstrained>
  109    103   
        for crate::constrained::foo_enum_map_constrained::FooEnumMapConstrained
  110    104   
    {
  111    105   
        type Error = crate::model::foo_enum_map::ConstraintViolation;
  112    106   
        fn try_from(value: FooEnumMapUnconstrained) -> std::result::Result<Self, Self::Error> {
  113    107   
            let res: ::std::result::Result<
  114    108   
                ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
  115    109   
                Self::Error,
  116    110   
            > = value
  117    111   
                .0
  118    112   
                .into_iter()
  119    113   
                .map(|(k, v)| match crate::model::FooEnum::try_from(v) {
  120    114   
                    Ok(v) => Ok((k, v)),
  121    115   
                    Err(inner_constraint_violation) => {
  122    116   
                        Err(Self::Error::Value(k, inner_constraint_violation))
  123    117   
                    }
  124    118   
                })
  125    119   
                .collect();
  126    120   
            let hm = res?;
  127    121   
            Ok(Self(hm))
  128    122   
        }
  129    123   
    }
  130    124   
}
  131         -
pub(crate) mod foo_enum_set_unconstrained {
         125  +
pub(crate) mod integer_enum_set_unconstrained {
  132    126   
  133    127   
    #[derive(Debug, Clone)]
  134         -
    pub(crate) struct FooEnumSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
         128  +
    pub(crate) struct IntegerEnumSetUnconstrained(pub(crate) std::vec::Vec<i32>);
  135    129   
  136         -
    impl From<FooEnumSetUnconstrained>
  137         -
        for crate::constrained::MaybeConstrained<crate::model::FooEnumSet>
         130  +
    impl From<IntegerEnumSetUnconstrained>
         131  +
        for crate::constrained::MaybeConstrained<crate::model::IntegerEnumSet>
  138    132   
    {
  139         -
        fn from(value: FooEnumSetUnconstrained) -> Self {
         133  +
        fn from(value: IntegerEnumSetUnconstrained) -> Self {
  140    134   
            Self::Unconstrained(value)
  141    135   
        }
  142    136   
    }
  143         -
    impl std::convert::TryFrom<FooEnumSetUnconstrained> for crate::model::FooEnumSet {
  144         -
        type Error = crate::model::foo_enum_set::ConstraintViolation;
  145         -
        fn try_from(value: FooEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
  146         -
            let res: ::std::result::Result<
  147         -
                ::std::vec::Vec<crate::model::FooEnum>,
  148         -
                (usize, crate::model::foo_enum::ConstraintViolation),
  149         -
            > = value
  150         -
                .0
  151         -
                .into_iter()
  152         -
                .enumerate()
  153         -
                .map(|(idx, inner)| {
  154         -
                    inner
  155         -
                        .try_into()
  156         -
                        .map_err(|inner_violation| (idx, inner_violation))
  157         -
                })
  158         -
                .collect();
  159         -
            let inner =
  160         -
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
         137  +
    impl std::convert::TryFrom<IntegerEnumSetUnconstrained> for crate::model::IntegerEnumSet {
         138  +
        type Error = crate::model::integer_enum_set::ConstraintViolation;
         139  +
        fn try_from(value: IntegerEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         140  +
            let inner = value.0;
  161    141   
            Self::try_from(inner)
  162    142   
        }
  163    143   
    }
  164    144   
}
  165         -
pub(crate) mod foo_enum_list_unconstrained {
         145  +
pub(crate) mod my_union_unconstrained {
  166    146   
         147  +
    #[allow(clippy::enum_variant_names)]
  167    148   
    #[derive(Debug, Clone)]
  168         -
    pub(crate) struct FooEnumListUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
  169         -
  170         -
    impl From<FooEnumListUnconstrained>
  171         -
        for crate::constrained::MaybeConstrained<
  172         -
            crate::constrained::foo_enum_list_constrained::FooEnumListConstrained,
  173         -
        >
  174         -
    {
  175         -
        fn from(value: FooEnumListUnconstrained) -> Self {
  176         -
            Self::Unconstrained(value)
  177         -
        }
         149  +
    pub(crate) enum MyUnionUnconstrained {
         150  +
        BlobValue(::aws_smithy_types::Blob),
         151  +
        BooleanValue(bool),
         152  +
        EnumValue(::std::string::String),
         153  +
        ListValue(::std::vec::Vec<::std::string::String>),
         154  +
        MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
         155  +
        NumberValue(i32),
         156  +
        StringValue(::std::string::String),
         157  +
        StructureValue(crate::model::GreetingStruct),
         158  +
        TimestampValue(::aws_smithy_types::DateTime),
  178    159   
    }
  179         -
    impl std::convert::TryFrom<FooEnumListUnconstrained>
  180         -
        for crate::constrained::foo_enum_list_constrained::FooEnumListConstrained
  181         -
    {
  182         -
        type Error = crate::model::foo_enum_list::ConstraintViolation;
  183         -
        fn try_from(value: FooEnumListUnconstrained) -> std::result::Result<Self, Self::Error> {
  184         -
            let res: ::std::result::Result<
  185         -
                ::std::vec::Vec<crate::model::FooEnum>,
  186         -
                (usize, crate::model::foo_enum::ConstraintViolation),
  187         -
            > = value
  188         -
                .0
  189         -
                .into_iter()
  190         -
                .enumerate()
  191         -
                .map(|(idx, inner)| {
  192         -
                    inner
         160  +
    impl ::std::convert::TryFrom<MyUnionUnconstrained> for crate::model::MyUnion {
         161  +
        type Error = crate::model::my_union::ConstraintViolation;
         162  +
         163  +
        fn try_from(value: MyUnionUnconstrained) -> ::std::result::Result<Self, Self::Error> {
         164  +
            Ok(
         165  +
        match value {
         166  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BlobValue(unconstrained) => Self::BlobValue(
         167  +
                unconstrained
         168  +
            ),
         169  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BooleanValue(unconstrained) => Self::BooleanValue(
         170  +
                unconstrained
         171  +
            ),
         172  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::EnumValue(unconstrained) => Self::EnumValue(
         173  +
                unconstrained
  193    174   
                                        .try_into()
  194         -
                        .map_err(|inner_violation| (idx, inner_violation))
  195         -
                })
  196         -
                .collect();
  197         -
            let inner =
  198         -
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
  199         -
            Ok(Self(inner))
         175  +
                                        
         176  +
                                        
         177  +
                                        .map_err(Self::Error::EnumValue)?
         178  +
            ),
         179  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::ListValue(unconstrained) => Self::ListValue(
         180  +
                unconstrained
         181  +
            ),
         182  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::MapValue(unconstrained) => Self::MapValue(
         183  +
                unconstrained
         184  +
            ),
         185  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::NumberValue(unconstrained) => Self::NumberValue(
         186  +
                unconstrained
         187  +
            ),
         188  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StringValue(unconstrained) => Self::StringValue(
         189  +
                unconstrained
         190  +
            ),
         191  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StructureValue(unconstrained) => Self::StructureValue(
         192  +
                unconstrained
         193  +
            ),
         194  +
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::TimestampValue(unconstrained) => Self::TimestampValue(
         195  +
                unconstrained
         196  +
            ),
         197  +
        }
         198  +
    )
  200    199   
        }
  201    200   
    }
  202    201   
}

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

@@ -1,1 +32,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/// Error type for the `RequiredInnerShapeOperation` operation.
           4  +
/// Each variant represents an error that can occur for the `RequiredInnerShapeOperation` operation.
           5  +
#[derive(::std::fmt::Debug)]
           6  +
pub enum RequiredInnerShapeOperationError {
           7  +
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
           8  +
    ValidationException(crate::error::ValidationException),
           9  +
}
          10  +
impl ::std::fmt::Display for RequiredInnerShapeOperationError {
          11  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          12  +
        match &self {
          13  +
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.fmt(f),
          14  +
        }
          15  +
    }
          16  +
}
          17  +
impl RequiredInnerShapeOperationError {
          18  +
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::ValidationException`.
          19  +
    pub fn is_validation_exception(&self) -> bool {
          20  +
        matches!(
          21  +
            &self,
          22  +
            RequiredInnerShapeOperationError::ValidationException(_)
          23  +
        )
          24  +
    }
          25  +
    /// Returns the error name string by matching the correct variant.
          26  +
    pub fn name(&self) -> &'static str {
          27  +
        match &self {
          28  +
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.name(),
          29  +
        }
          30  +
    }
          31  +
}
          32  +
impl ::std::error::Error for RequiredInnerShapeOperationError {
          33  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
          34  +
        match &self {
          35  +
            RequiredInnerShapeOperationError::ValidationException(_inner) => Some(_inner),
          36  +
        }
          37  +
    }
          38  +
}
          39  +
impl ::std::convert::From<crate::error::ValidationException>
          40  +
    for crate::error::RequiredInnerShapeOperationError
          41  +
{
          42  +
    fn from(
          43  +
        variant: crate::error::ValidationException,
          44  +
    ) -> crate::error::RequiredInnerShapeOperationError {
          45  +
        Self::ValidationException(variant)
          46  +
    }
          47  +
}
          48  +
    3     49   
/// Error type for the `RequiredHeaderCollectionOperation` operation.
    4     50   
/// Each variant represents an error that can occur for the `RequiredHeaderCollectionOperation` operation.
    5     51   
#[derive(::std::fmt::Debug)]
    6     52   
pub enum RequiredHeaderCollectionOperationError {
    7     53   
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
    8     54   
    ValidationException(crate::error::ValidationException),
    9     55   
}
   10     56   
impl ::std::fmt::Display for RequiredHeaderCollectionOperationError {
   11     57   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   12     58   
        match &self {
@@ -62,108 +168,167 @@
   82    128   
        Ok(())
   83    129   
    }
   84    130   
}
   85    131   
impl ::std::error::Error for ValidationException {}
   86    132   
impl ValidationException {
   87    133   
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
   88    134   
    pub fn builder() -> crate::error::validation_exception::Builder {
   89    135   
        crate::error::validation_exception::Builder::default()
   90    136   
    }
   91    137   
}
   92         -
   93         -
/// Error type for the `RequiredInnerShapeOperation` operation.
   94         -
/// Each variant represents an error that can occur for the `RequiredInnerShapeOperation` operation.
   95         -
#[derive(::std::fmt::Debug)]
   96         -
pub enum RequiredInnerShapeOperationError {
   97         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
   98         -
    ValidationException(crate::error::ValidationException),
   99         -
}
  100         -
impl ::std::fmt::Display for RequiredInnerShapeOperationError {
  101         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  102         -
        match &self {
  103         -
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.fmt(f),
  104         -
        }
  105         -
    }
  106         -
}
  107         -
impl RequiredInnerShapeOperationError {
  108         -
    /// Returns `true` if the error kind is `RequiredInnerShapeOperationError::ValidationException`.
  109         -
    pub fn is_validation_exception(&self) -> bool {
  110         -
        matches!(
  111         -
            &self,
  112         -
            RequiredInnerShapeOperationError::ValidationException(_)
  113         -
        )
  114         -
    }
  115         -
    /// Returns the error name string by matching the correct variant.
  116         -
    pub fn name(&self) -> &'static str {
  117         -
        match &self {
  118         -
            RequiredInnerShapeOperationError::ValidationException(_inner) => _inner.name(),
  119         -
        }
  120         -
    }
  121         -
}
  122         -
impl ::std::error::Error for RequiredInnerShapeOperationError {
  123         -
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  124         -
        match &self {
  125         -
            RequiredInnerShapeOperationError::ValidationException(_inner) => Some(_inner),
  126         -
        }
  127         -
    }
  128         -
}
  129         -
impl ::std::convert::From<crate::error::ValidationException>
  130         -
    for crate::error::RequiredInnerShapeOperationError
  131         -
{
  132         -
    fn from(
  133         -
        variant: crate::error::ValidationException,
  134         -
    ) -> crate::error::RequiredInnerShapeOperationError {
  135         -
        Self::ValidationException(variant)
  136         -
    }
  137         -
}
  138         -
  139    138   
/// See [`ValidationException`](crate::error::ValidationException).
  140    139   
pub mod validation_exception {
  141    140   
  142    141   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  143    142   
    /// Holds one variant for each of the ways the builder can fail.
  144    143   
    #[non_exhaustive]
  145    144   
    #[allow(clippy::enum_variant_names)]
  146    145   
    pub enum ConstraintViolation {
  147    146   
        /// `message` was not provided but it is required when building `ValidationException`.
  148    147   
        MissingMessage,

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

@@ -1,1 +235,354 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(missing_docs)] // documentation missing in model
    3         -
#[derive(
    4         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5         -
)]
    6         -
pub struct ResponseCodeDefaultOperationInput {}
    7         -
impl ResponseCodeDefaultOperationInput {
    8         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
    9         -
    pub fn builder() -> crate::input::response_code_default_operation_input::Builder {
   10         -
        crate::input::response_code_default_operation_input::Builder::default()
   11         -
    }
           3  +
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           4  +
pub struct TypeComplexityOperationInput {
           5  +
    #[allow(missing_docs)] // documentation missing in model
           6  +
    pub list: ::std::option::Option<
           7  +
        ::std::vec::Vec<
           8  +
            ::std::vec::Vec<
           9  +
                ::std::vec::Vec<
          10  +
                    ::std::collections::HashMap<
          11  +
                        ::std::string::String,
          12  +
                        crate::model::EmptyStructure,
          13  +
                    >,
          14  +
                >,
          15  +
            >,
          16  +
        >,
          17  +
    >,
   12     18   
}
   13         -
impl crate::constrained::Constrained for crate::input::ResponseCodeDefaultOperationInput {
   14         -
    type Unconstrained = crate::input::response_code_default_operation_input::Builder;
          19  +
impl TypeComplexityOperationInput {
          20  +
    #[allow(missing_docs)] // documentation missing in model
          21  +
    pub fn list(
          22  +
        &self,
          23  +
    ) -> ::std::option::Option<
          24  +
        &[::std::vec::Vec<
          25  +
            ::std::vec::Vec<
          26  +
                ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
          27  +
            >,
          28  +
        >],
          29  +
    > {
          30  +
        self.list.as_deref()
          31  +
    }
   15     32   
}
   16         -
   17         -
#[allow(missing_docs)] // documentation missing in model
   18         -
#[derive(
   19         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   20         -
)]
   21         -
pub struct ResponseCodeHttpFallbackOperationInput {}
   22         -
impl ResponseCodeHttpFallbackOperationInput {
   23         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
   24         -
    pub fn builder() -> crate::input::response_code_http_fallback_operation_input::Builder {
   25         -
        crate::input::response_code_http_fallback_operation_input::Builder::default()
          33  +
impl TypeComplexityOperationInput {
          34  +
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
          35  +
    pub fn builder() -> crate::input::type_complexity_operation_input::Builder {
          36  +
        crate::input::type_complexity_operation_input::Builder::default()
   26     37   
    }
   27     38   
}
   28         -
impl crate::constrained::Constrained for crate::input::ResponseCodeHttpFallbackOperationInput {
   29         -
    type Unconstrained = crate::input::response_code_http_fallback_operation_input::Builder;
          39  +
impl crate::constrained::Constrained for crate::input::TypeComplexityOperationInput {
          40  +
    type Unconstrained = crate::input::type_complexity_operation_input::Builder;
   30     41   
}
   31     42   
   32     43   
#[allow(missing_docs)] // documentation missing in model
   33         -
#[derive(
   34         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   35         -
)]
   36         -
pub struct ResponseCodeRequiredOperationInput {}
   37         -
impl ResponseCodeRequiredOperationInput {
   38         -
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
   39         -
    pub fn builder() -> crate::input::response_code_required_operation_input::Builder {
   40         -
        crate::input::response_code_required_operation_input::Builder::default()
          44  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
          45  +
pub struct RequiredInnerShapeOperationInput {
          46  +
    #[allow(missing_docs)] // documentation missing in model
          47  +
    pub inner: ::std::option::Option<crate::model::InnerShape>,
          48  +
}
          49  +
impl RequiredInnerShapeOperationInput {
          50  +
    #[allow(missing_docs)] // documentation missing in model
          51  +
    pub fn inner(&self) -> ::std::option::Option<&crate::model::InnerShape> {
          52  +
        self.inner.as_ref()
   41     53   
    }
   42     54   
}
   43         -
impl crate::constrained::Constrained for crate::input::ResponseCodeRequiredOperationInput {
   44         -
    type Unconstrained = crate::input::response_code_required_operation_input::Builder;
          55  +
impl RequiredInnerShapeOperationInput {
          56  +
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
          57  +
    pub fn builder() -> crate::input::required_inner_shape_operation_input::Builder {
          58  +
        crate::input::required_inner_shape_operation_input::Builder::default()
          59  +
    }
          60  +
}
          61  +
impl crate::constrained::Constrained for crate::input::RequiredInnerShapeOperationInput {
          62  +
    type Unconstrained = crate::input::required_inner_shape_operation_input::Builder;
   45     63   
}
   46     64   
   47     65   
#[allow(missing_docs)] // documentation missing in model
   48     66   
#[derive(
   49     67   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   50     68   
)]
   51     69   
pub struct RequiredHeaderCollectionOperationInput {
   52     70   
    #[allow(missing_docs)] // documentation missing in model
   53     71   
    pub required_header_list: ::std::vec::Vec<::std::string::String>,
   54     72   
    #[allow(missing_docs)] // documentation missing in model
   55     73   
    pub required_header_set: crate::model::HeaderSet,
   56     74   
}
   57     75   
impl RequiredHeaderCollectionOperationInput {
   58     76   
    #[allow(missing_docs)] // documentation missing in model
   59     77   
    pub fn required_header_list(&self) -> &[::std::string::String] {
   60     78   
        use std::ops::Deref;
   61     79   
        self.required_header_list.deref()
   62     80   
    }
   63     81   
    #[allow(missing_docs)] // documentation missing in model
   64     82   
    pub fn required_header_set(&self) -> &crate::model::HeaderSet {
   65     83   
        &self.required_header_set
   66     84   
    }
   67     85   
}
   68     86   
impl RequiredHeaderCollectionOperationInput {
   69     87   
    /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput).
   70     88   
    pub fn builder() -> crate::input::required_header_collection_operation_input::Builder {
   71     89   
        crate::input::required_header_collection_operation_input::Builder::default()
   72     90   
    }
   73     91   
}
   74     92   
impl crate::constrained::Constrained for crate::input::RequiredHeaderCollectionOperationInput {
   75     93   
    type Unconstrained = crate::input::required_header_collection_operation_input::Builder;
   76     94   
}
   77     95   
   78     96   
#[allow(missing_docs)] // documentation missing in model
   79         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   80         -
pub struct RequiredInnerShapeOperationInput {
   81         -
    #[allow(missing_docs)] // documentation missing in model
   82         -
    pub inner: ::std::option::Option<crate::model::InnerShape>,
   83         -
}
   84         -
impl RequiredInnerShapeOperationInput {
   85         -
    #[allow(missing_docs)] // documentation missing in model
   86         -
    pub fn inner(&self) -> ::std::option::Option<&crate::model::InnerShape> {
   87         -
        self.inner.as_ref()
          97  +
#[derive(
          98  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          99  +
)]
         100  +
pub struct ResponseCodeRequiredOperationInput {}
         101  +
impl ResponseCodeRequiredOperationInput {
         102  +
    /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         103  +
    pub fn builder() -> crate::input::response_code_required_operation_input::Builder {
         104  +
        crate::input::response_code_required_operation_input::Builder::default()
   88    105   
    }
   89    106   
}
   90         -
impl RequiredInnerShapeOperationInput {
   91         -
    /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
   92         -
    pub fn builder() -> crate::input::required_inner_shape_operation_input::Builder {
   93         -
        crate::input::required_inner_shape_operation_input::Builder::default()
         107  +
impl crate::constrained::Constrained for crate::input::ResponseCodeRequiredOperationInput {
         108  +
    type Unconstrained = crate::input::response_code_required_operation_input::Builder;
         109  +
}
         110  +
         111  +
#[allow(missing_docs)] // documentation missing in model
         112  +
#[derive(
         113  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         114  +
)]
         115  +
pub struct ResponseCodeHttpFallbackOperationInput {}
         116  +
impl ResponseCodeHttpFallbackOperationInput {
         117  +
    /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
         118  +
    pub fn builder() -> crate::input::response_code_http_fallback_operation_input::Builder {
         119  +
        crate::input::response_code_http_fallback_operation_input::Builder::default()
   94    120   
    }
   95    121   
}
   96         -
impl crate::constrained::Constrained for crate::input::RequiredInnerShapeOperationInput {
   97         -
    type Unconstrained = crate::input::required_inner_shape_operation_input::Builder;
         122  +
impl crate::constrained::Constrained for crate::input::ResponseCodeHttpFallbackOperationInput {
         123  +
    type Unconstrained = crate::input::response_code_http_fallback_operation_input::Builder;
   98    124   
}
   99    125   
  100    126   
#[allow(missing_docs)] // documentation missing in model
  101         -
#[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
  102         -
pub struct TypeComplexityOperationInput {
  103         -
    #[allow(missing_docs)] // documentation missing in model
  104         -
    pub list: ::std::option::Option<
         127  +
#[derive(
         128  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         129  +
)]
         130  +
pub struct ResponseCodeDefaultOperationInput {}
         131  +
impl ResponseCodeDefaultOperationInput {
         132  +
    /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
         133  +
    pub fn builder() -> crate::input::response_code_default_operation_input::Builder {
         134  +
        crate::input::response_code_default_operation_input::Builder::default()
         135  +
    }
         136  +
}
         137  +
impl crate::constrained::Constrained for crate::input::ResponseCodeDefaultOperationInput {
         138  +
    type Unconstrained = crate::input::response_code_default_operation_input::Builder;
         139  +
}
         140  +
/// See [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
         141  +
pub mod type_complexity_operation_input {
         142  +
         143  +
    impl ::std::convert::From<Builder> for crate::input::TypeComplexityOperationInput {
         144  +
        fn from(builder: Builder) -> Self {
         145  +
            builder.build()
         146  +
        }
         147  +
    }
         148  +
    /// A builder for [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
         149  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         150  +
    pub struct Builder {
         151  +
        pub(crate) list: ::std::option::Option<
  105    152   
            ::std::vec::Vec<
  106    153   
                ::std::vec::Vec<
  107    154   
                    ::std::vec::Vec<
  108    155   
                        ::std::collections::HashMap<
  109    156   
                            ::std::string::String,
  110    157   
                            crate::model::EmptyStructure,
  111    158   
                        >,
  112    159   
                    >,
  113    160   
                >,
  114    161   
            >,
  115    162   
        >,
  116         -
}
  117         -
impl TypeComplexityOperationInput {
         163  +
    }
         164  +
    impl Builder {
  118    165   
        #[allow(missing_docs)] // documentation missing in model
  119    166   
        pub fn list(
  120         -
        &self,
  121         -
    ) -> ::std::option::Option<
  122         -
        &[::std::vec::Vec<
         167  +
            mut self,
         168  +
            input: ::std::option::Option<
  123    169   
                ::std::vec::Vec<
  124         -
                ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
         170  +
                    ::std::vec::Vec<
         171  +
                        ::std::vec::Vec<
         172  +
                            ::std::collections::HashMap<
         173  +
                                ::std::string::String,
         174  +
                                crate::model::EmptyStructure,
  125    175   
                            >,
  126         -
        >],
  127         -
    > {
  128         -
        self.list.as_deref()
         176  +
                        >,
         177  +
                    >,
         178  +
                >,
         179  +
            >,
         180  +
        ) -> Self {
         181  +
            self.list = input;
         182  +
            self
         183  +
        }
         184  +
        #[allow(missing_docs)] // documentation missing in model
         185  +
        pub(crate) fn set_list(
         186  +
            mut self,
         187  +
            input: Option<
         188  +
                impl ::std::convert::Into<
         189  +
                    ::std::vec::Vec<
         190  +
                        ::std::vec::Vec<
         191  +
                            ::std::vec::Vec<
         192  +
                                ::std::collections::HashMap<
         193  +
                                    ::std::string::String,
         194  +
                                    crate::model::EmptyStructure,
         195  +
                                >,
         196  +
                            >,
         197  +
                        >,
         198  +
                    >,
         199  +
                >,
         200  +
            >,
         201  +
        ) -> Self {
         202  +
            self.list = input.map(|v| v.into());
         203  +
            self
         204  +
        }
         205  +
        /// Consumes the builder and constructs a [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
         206  +
        pub fn build(self) -> crate::input::TypeComplexityOperationInput {
         207  +
            self.build_enforcing_all_constraints()
         208  +
        }
         209  +
        fn build_enforcing_all_constraints(self) -> crate::input::TypeComplexityOperationInput {
         210  +
            crate::input::TypeComplexityOperationInput { list: self.list }
  129    211   
        }
  130         -
}
  131         -
impl TypeComplexityOperationInput {
  132         -
    /// Creates a new builder-style object to manufacture [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
  133         -
    pub fn builder() -> crate::input::type_complexity_operation_input::Builder {
  134         -
        crate::input::type_complexity_operation_input::Builder::default()
  135    212   
    }
  136    213   
}
  137         -
impl crate::constrained::Constrained for crate::input::TypeComplexityOperationInput {
  138         -
    type Unconstrained = crate::input::type_complexity_operation_input::Builder;
  139         -
}
  140         -
/// See [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
  141         -
pub mod response_code_default_operation_input {
         214  +
/// See [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
         215  +
pub mod required_inner_shape_operation_input {
  142    216   
  143         -
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeDefaultOperationInput {
  144         -
        fn from(builder: Builder) -> Self {
  145         -
            builder.build()
         217  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         218  +
    /// Holds one variant for each of the ways the builder can fail.
         219  +
    #[non_exhaustive]
         220  +
    #[allow(clippy::enum_variant_names)]
         221  +
    pub enum ConstraintViolation {
         222  +
        /// Constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`.
         223  +
        #[doc(hidden)]
         224  +
        Inner(crate::model::inner_shape::ConstraintViolation),
  146    225   
    }
         226  +
    impl ::std::fmt::Display for ConstraintViolation {
         227  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         228  +
            match self {
         229  +
                ConstraintViolation::Inner(_) => write!(f, "constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`"),
  147    230   
            }
  148         -
    /// A builder for [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
  149         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  150         -
    pub struct Builder {}
  151         -
    impl Builder {
  152         -
        /// Consumes the builder and constructs a [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
  153         -
        pub fn build(self) -> crate::input::ResponseCodeDefaultOperationInput {
  154         -
            self.build_enforcing_all_constraints()
  155    231   
        }
  156         -
        fn build_enforcing_all_constraints(
         232  +
    }
         233  +
    impl ::std::error::Error for ConstraintViolation {}
         234  +
    impl ConstraintViolation {
         235  +
        pub(crate) fn as_validation_exception_field(
  157    236   
            self,
  158         -
        ) -> crate::input::ResponseCodeDefaultOperationInput {
  159         -
            crate::input::ResponseCodeDefaultOperationInput {}
         237  +
            path: ::std::string::String,
         238  +
        ) -> crate::model::ValidationExceptionField {
         239  +
            match self {
         240  +
                ConstraintViolation::Inner(inner) => {
         241  +
                    inner.as_validation_exception_field(path + "/inner")
  160    242   
                }
  161    243   
            }
  162         -
}
  163         -
/// See [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
  164         -
pub mod response_code_http_fallback_operation_input {
  165         -
  166         -
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeHttpFallbackOperationInput {
  167         -
        fn from(builder: Builder) -> Self {
  168         -
            builder.build()
  169    244   
        }
  170    245   
    }
  171         -
    /// A builder for [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
  172         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  173         -
    pub struct Builder {}
  174         -
    impl Builder {
  175         -
        /// Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
  176         -
        pub fn build(self) -> crate::input::ResponseCodeHttpFallbackOperationInput {
  177         -
            self.build_enforcing_all_constraints()
         246  +
    impl ::std::convert::From<ConstraintViolation>
         247  +
        for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
         248  +
    {
         249  +
        fn from(constraint_violation: ConstraintViolation) -> Self {
         250  +
            let first_validation_exception_field =
         251  +
                constraint_violation.as_validation_exception_field("".to_owned());
         252  +
            let validation_exception = crate::error::ValidationException {
         253  +
                message: format!(
         254  +
                    "1 validation error detected. {}",
         255  +
                    &first_validation_exception_field.message
         256  +
                ),
         257  +
                field_list: Some(vec![first_validation_exception_field]),
         258  +
            };
         259  +
            Self::ConstraintViolation(
         260  +
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
         261  +
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
         262  +
                            )
         263  +
        }
  178    264   
    }
  179         -
        fn build_enforcing_all_constraints(
  180         -
            self,
  181         -
        ) -> crate::input::ResponseCodeHttpFallbackOperationInput {
  182         -
            crate::input::ResponseCodeHttpFallbackOperationInput {}
         265  +
    impl ::std::convert::From<Builder>
         266  +
        for crate::constrained::MaybeConstrained<crate::input::RequiredInnerShapeOperationInput>
         267  +
    {
         268  +
        fn from(builder: Builder) -> Self {
         269  +
            Self::Unconstrained(builder)
  183    270   
        }
  184    271   
    }
  185         -
}
  186         -
/// See [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
  187         -
pub mod response_code_required_operation_input {
         272  +
    impl ::std::convert::TryFrom<Builder> for crate::input::RequiredInnerShapeOperationInput {
         273  +
        type Error = ConstraintViolation;
  188    274   
  189         -
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeRequiredOperationInput {
  190         -
        fn from(builder: Builder) -> Self {
         275  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  191    276   
            builder.build()
  192    277   
        }
  193    278   
    }
  194         -
    /// A builder for [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         279  +
    /// A builder for [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
  195    280   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  196         -
    pub struct Builder {}
         281  +
    pub struct Builder {
         282  +
        pub(crate) inner:
         283  +
            ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::InnerShape>>,
         284  +
    }
  197    285   
    impl Builder {
  198         -
        /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
  199         -
        pub fn build(self) -> crate::input::ResponseCodeRequiredOperationInput {
         286  +
        #[allow(missing_docs)] // documentation missing in model
         287  +
        pub fn inner(mut self, input: ::std::option::Option<crate::model::InnerShape>) -> Self {
         288  +
            self.inner = input.map(crate::constrained::MaybeConstrained::Constrained);
         289  +
            self
         290  +
        }
         291  +
        #[allow(missing_docs)] // documentation missing in model
         292  +
        pub(crate) fn set_inner(
         293  +
            mut self,
         294  +
            input: Option<
         295  +
                impl ::std::convert::Into<
         296  +
                    crate::constrained::MaybeConstrained<crate::model::InnerShape>,
         297  +
                >,
         298  +
            >,
         299  +
        ) -> Self {
         300  +
            self.inner = input.map(|v| v.into());
         301  +
            self
         302  +
        }
         303  +
        /// Consumes the builder and constructs a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
         304  +
        ///
         305  +
        /// The builder fails to construct a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput) if a [`ConstraintViolation`] occurs.
         306  +
        ///
         307  +
        pub fn build(
         308  +
            self,
         309  +
        ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
  200    310   
            self.build_enforcing_all_constraints()
  201    311   
        }
  202    312   
        fn build_enforcing_all_constraints(
  203    313   
            self,
  204         -
        ) -> crate::input::ResponseCodeRequiredOperationInput {
  205         -
            crate::input::ResponseCodeRequiredOperationInput {}
         314  +
        ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
         315  +
            Ok(crate::input::RequiredInnerShapeOperationInput {
         316  +
                inner: self
         317  +
                    .inner
         318  +
                    .map(|v| match v {
         319  +
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
         320  +
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
         321  +
                    })
         322  +
                    .map(|res| res.map_err(ConstraintViolation::Inner))
         323  +
                    .transpose()?,
         324  +
            })
  206    325   
        }
  207    326   
    }
  208    327   
}
  209    328   
/// See [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput).
  210    329   
pub mod required_header_collection_operation_input {
  211    330   
  212    331   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  213    332   
    /// Holds one variant for each of the ways the builder can fail.
  214    333   
    #[non_exhaustive]
  215    334   
    #[allow(clippy::enum_variant_names)]
@@ -331,450 +548,548 @@
  351    470   
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
  352    471   
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
  353    472   
                    })
  354    473   
                    .map(|res| res.map_err(ConstraintViolation::RequiredHeaderSet))
  355    474   
                    .transpose()?
  356    475   
                    .ok_or(ConstraintViolation::MissingRequiredHeaderSet)?,
  357    476   
            })
  358    477   
        }
  359    478   
    }
  360    479   
}
  361         -
/// See [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
  362         -
pub mod required_inner_shape_operation_input {
         480  +
/// See [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         481  +
pub mod response_code_required_operation_input {
  363    482   
  364         -
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  365         -
    /// Holds one variant for each of the ways the builder can fail.
  366         -
    #[non_exhaustive]
  367         -
    #[allow(clippy::enum_variant_names)]
  368         -
    pub enum ConstraintViolation {
  369         -
        /// Constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`.
  370         -
        #[doc(hidden)]
  371         -
        Inner(crate::model::inner_shape::ConstraintViolation),
  372         -
    }
  373         -
    impl ::std::fmt::Display for ConstraintViolation {
  374         -
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  375         -
            match self {
  376         -
                ConstraintViolation::Inner(_) => write!(f, "constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`"),
         483  +
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeRequiredOperationInput {
         484  +
        fn from(builder: Builder) -> Self {
         485  +
            builder.build()
  377    486   
        }
  378    487   
    }
         488  +
    /// A builder for [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         489  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         490  +
    pub struct Builder {}
         491  +
    impl Builder {
         492  +
        /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
         493  +
        pub fn build(self) -> crate::input::ResponseCodeRequiredOperationInput {
         494  +
            self.build_enforcing_all_constraints()
  379    495   
        }
  380         -
    impl ::std::error::Error for ConstraintViolation {}
  381         -
    impl ConstraintViolation {
  382         -
        pub(crate) fn as_validation_exception_field(
         496  +
        fn build_enforcing_all_constraints(
  383    497   
            self,
  384         -
            path: ::std::string::String,
  385         -
        ) -> crate::model::ValidationExceptionField {
  386         -
            match self {
  387         -
                ConstraintViolation::Inner(inner) => {
  388         -
                    inner.as_validation_exception_field(path + "/inner")
  389         -
                }
  390         -
            }
  391         -
        }
  392         -
    }
  393         -
    impl ::std::convert::From<ConstraintViolation>
  394         -
        for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
  395         -
    {
  396         -
        fn from(constraint_violation: ConstraintViolation) -> Self {
  397         -
            let first_validation_exception_field =
  398         -
                constraint_violation.as_validation_exception_field("".to_owned());
  399         -
            let validation_exception = crate::error::ValidationException {
  400         -
                message: format!(
  401         -
                    "1 validation error detected. {}",
  402         -
                    &first_validation_exception_field.message
  403         -
                ),
  404         -
                field_list: Some(vec![first_validation_exception_field]),
  405         -
            };
  406         -
            Self::ConstraintViolation(
  407         -
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
  408         -
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
  409         -
                            )
  410         -
        }
  411         -
    }
  412         -
    impl ::std::convert::From<Builder>
  413         -
        for crate::constrained::MaybeConstrained<crate::input::RequiredInnerShapeOperationInput>
  414         -
    {
  415         -
        fn from(builder: Builder) -> Self {
  416         -
            Self::Unconstrained(builder)
         498  +
        ) -> crate::input::ResponseCodeRequiredOperationInput {
         499  +
            crate::input::ResponseCodeRequiredOperationInput {}
  417    500   
        }
  418    501   
    }
  419         -
    impl ::std::convert::TryFrom<Builder> for crate::input::RequiredInnerShapeOperationInput {
  420         -
        type Error = ConstraintViolation;
         502  +
}
         503  +
/// See [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
         504  +
pub mod response_code_http_fallback_operation_input {
  421    505   
  422         -
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         506  +
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeHttpFallbackOperationInput {
         507  +
        fn from(builder: Builder) -> Self {
  423    508   
            builder.build()
  424    509   
        }
  425    510   
    }
  426         -
    /// A builder for [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
         511  +
    /// A builder for [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
  427    512   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  428         -
    pub struct Builder {
  429         -
        pub(crate) inner:
  430         -
            ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::InnerShape>>,
  431         -
    }
         513  +
    pub struct Builder {}
  432    514   
    impl Builder {
  433         -
        #[allow(missing_docs)] // documentation missing in model
  434         -
        pub fn inner(mut self, input: ::std::option::Option<crate::model::InnerShape>) -> Self {
  435         -
            self.inner = input.map(crate::constrained::MaybeConstrained::Constrained);
  436         -
            self
  437         -
        }
  438         -
        #[allow(missing_docs)] // documentation missing in model
  439         -
        pub(crate) fn set_inner(
  440         -
            mut self,
  441         -
            input: Option<
  442         -
                impl ::std::convert::Into<
  443         -
                    crate::constrained::MaybeConstrained<crate::model::InnerShape>,
  444         -
                >,
  445         -
            >,
  446         -
        ) -> Self {
  447         -
            self.inner = input.map(|v| v.into());
  448         -
            self
  449         -
        }
  450         -
        /// Consumes the builder and constructs a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
  451         -
        ///
  452         -
        /// The builder fails to construct a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput) if a [`ConstraintViolation`] occurs.
  453         -
        ///
  454         -
        pub fn build(
  455         -
            self,
  456         -
        ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
         515  +
        /// Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
         516  +
        pub fn build(self) -> crate::input::ResponseCodeHttpFallbackOperationInput {
  457    517   
            self.build_enforcing_all_constraints()
  458    518   
        }
  459    519   
        fn build_enforcing_all_constraints(
  460    520   
            self,
  461         -
        ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
  462         -
            Ok(crate::input::RequiredInnerShapeOperationInput {
  463         -
                inner: self
  464         -
                    .inner
  465         -
                    .map(|v| match v {
  466         -
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
  467         -
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
  468         -
                    })
  469         -
                    .map(|res| res.map_err(ConstraintViolation::Inner))
  470         -
                    .transpose()?,
  471         -
            })
         521  +
        ) -> crate::input::ResponseCodeHttpFallbackOperationInput {
         522  +
            crate::input::ResponseCodeHttpFallbackOperationInput {}
  472    523   
        }
  473    524   
    }
  474    525   
}
  475         -
/// See [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
  476         -
pub mod type_complexity_operation_input {
         526  +
/// See [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
         527  +
pub mod response_code_default_operation_input {
  477    528   
  478         -
    impl ::std::convert::From<Builder> for crate::input::TypeComplexityOperationInput {
         529  +
    impl ::std::convert::From<Builder> for crate::input::ResponseCodeDefaultOperationInput {
  479    530   
        fn from(builder: Builder) -> Self {
  480    531   
            builder.build()
  481    532   
        }
  482    533   
    }
  483         -
    /// A builder for [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
         534  +
    /// A builder for [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
  484    535   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  485         -
    pub struct Builder {
  486         -
        pub(crate) list: ::std::option::Option<
  487         -
            ::std::vec::Vec<
  488         -
                ::std::vec::Vec<
  489         -
                    ::std::vec::Vec<
  490         -
                        ::std::collections::HashMap<
  491         -
                            ::std::string::String,
  492         -
                            crate::model::EmptyStructure,
  493         -
                        >,
  494         -
                    >,
  495         -
                >,
  496         -
            >,
  497         -
        >,
  498         -
    }
         536  +
    pub struct Builder {}
  499    537   
    impl Builder {
  500         -
        #[allow(missing_docs)] // documentation missing in model
  501         -
        pub fn list(
  502         -
            mut self,
  503         -
            input: ::std::option::Option<
  504         -
                ::std::vec::Vec<
  505         -
                    ::std::vec::Vec<
  506         -
                        ::std::vec::Vec<
  507         -
                            ::std::collections::HashMap<
  508         -
                                ::std::string::String,
  509         -
                                crate::model::EmptyStructure,
  510         -
                            >,
  511         -
                        >,
  512         -
                    >,
  513         -
                >,
  514         -
            >,
  515         -
        ) -> Self {
  516         -
            self.list = input;
  517         -
            self
  518         -
        }
  519         -
        #[allow(missing_docs)] // documentation missing in model
  520         -
        pub(crate) fn set_list(
  521         -
            mut self,
  522         -
            input: Option<
  523         -
                impl ::std::convert::Into<
  524         -
                    ::std::vec::Vec<
  525         -
                        ::std::vec::Vec<
  526         -
                            ::std::vec::Vec<
  527         -
                                ::std::collections::HashMap<
  528         -
                                    ::std::string::String,
  529         -
                                    crate::model::EmptyStructure,
  530         -
                                >,
  531         -
                            >,
  532         -
                        >,
  533         -
                    >,
  534         -
                >,
  535         -
            >,
  536         -
        ) -> Self {
  537         -
            self.list = input.map(|v| v.into());
  538         -
            self
  539         -
        }
  540         -
        /// Consumes the builder and constructs a [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
  541         -
        pub fn build(self) -> crate::input::TypeComplexityOperationInput {
         538  +
        /// Consumes the builder and constructs a [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
         539  +
        pub fn build(self) -> crate::input::ResponseCodeDefaultOperationInput {
  542    540   
            self.build_enforcing_all_constraints()
  543    541   
        }
  544         -
        fn build_enforcing_all_constraints(self) -> crate::input::TypeComplexityOperationInput {
  545         -
            crate::input::TypeComplexityOperationInput { list: self.list }
         542  +
        fn build_enforcing_all_constraints(
         543  +
            self,
         544  +
        ) -> crate::input::ResponseCodeDefaultOperationInput {
         545  +
            crate::input::ResponseCodeDefaultOperationInput {}
  546    546   
        }
  547    547   
    }
  548    548   
}

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

@@ -1,1 +60,52 @@
    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,
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           4  +
pub struct InnerShape {
           5  +
    #[allow(missing_docs)] // documentation missing in model
           6  +
    pub required_inner_most_shape: crate::model::InnermostShape,
   12      7   
}
   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()
           8  +
impl InnerShape {
           9  +
    #[allow(missing_docs)] // documentation missing in model
          10  +
    pub fn required_inner_most_shape(&self) -> &crate::model::InnermostShape {
          11  +
        &self.required_inner_most_shape
   23     12   
    }
   24     13   
}
   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()
          14  +
impl InnerShape {
          15  +
    /// Creates a new builder-style object to manufacture [`InnerShape`](crate::model::InnerShape).
          16  +
    pub fn builder() -> crate::model::inner_shape::Builder {
          17  +
        crate::model::inner_shape::Builder::default()
   29     18   
    }
   30     19   
}
          20  +
impl crate::constrained::Constrained for crate::model::InnerShape {
          21  +
    type Unconstrained = crate::model::inner_shape::Builder;
          22  +
}
   31     23   
   32     24   
#[allow(missing_docs)] // documentation missing in model
   33     25   
///
   34     26   
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
   35     27   
/// [constraint traits]. Use [`HeaderSet::try_from`] to construct values of this type.
   36     28   
///
   37     29   
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
   38     30   
///
   39     31   
#[derive(
   40     32   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
@@ -78,70 +159,129 @@
   98     90   
   99     91   
impl ::std::convert::From<HeaderSet> for ::std::vec::Vec<::std::string::String> {
  100     92   
    fn from(value: HeaderSet) -> Self {
  101     93   
        value.into_inner()
  102     94   
    }
  103     95   
}
  104     96   
impl crate::constrained::Constrained for HeaderSet {
  105     97   
    type Unconstrained = crate::unconstrained::header_set_unconstrained::HeaderSetUnconstrained;
  106     98   
}
  107     99   
  108         -
#[allow(missing_docs)] // documentation missing in model
  109         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
  110         -
pub struct InnerShape {
  111         -
    #[allow(missing_docs)] // documentation missing in model
  112         -
    pub required_inner_most_shape: crate::model::InnermostShape,
  113         -
}
  114         -
impl InnerShape {
  115         -
    #[allow(missing_docs)] // documentation missing in model
  116         -
    pub fn required_inner_most_shape(&self) -> &crate::model::InnermostShape {
  117         -
        &self.required_inner_most_shape
  118         -
    }
  119         -
}
  120         -
impl InnerShape {
  121         -
    /// Creates a new builder-style object to manufacture [`InnerShape`](crate::model::InnerShape).
  122         -
    pub fn builder() -> crate::model::inner_shape::Builder {
  123         -
        crate::model::inner_shape::Builder::default()
  124         -
    }
  125         -
}
  126         -
impl crate::constrained::Constrained for crate::model::InnerShape {
  127         -
    type Unconstrained = crate::model::inner_shape::Builder;
  128         -
}
  129         -
  130    100   
#[allow(missing_docs)] // documentation missing in model
  131    101   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
  132    102   
pub struct InnermostShape {
  133    103   
    #[allow(missing_docs)] // documentation missing in model
  134    104   
    pub a_string: ::std::string::String,
  135    105   
    #[allow(missing_docs)] // documentation missing in model
  136    106   
    pub a_boolean: bool,
  137    107   
    #[allow(missing_docs)] // documentation missing in model
  138    108   
    pub a_byte: i8,
  139    109   
    #[allow(missing_docs)] // documentation missing in model
@@ -224,194 +283,282 @@
  244    214   
impl InnermostShape {
  245    215   
    /// Creates a new builder-style object to manufacture [`InnermostShape`](crate::model::InnermostShape).
  246    216   
    pub fn builder() -> crate::model::innermost_shape::Builder {
  247    217   
        crate::model::innermost_shape::Builder::default()
  248    218   
    }
  249    219   
}
  250    220   
impl crate::constrained::Constrained for crate::model::InnermostShape {
  251    221   
    type Unconstrained = crate::model::innermost_shape::Builder;
  252    222   
}
  253    223   
         224  +
/// Describes one specific validation failure for an input member.
         225  +
#[derive(
         226  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         227  +
)]
         228  +
pub struct ValidationExceptionField {
         229  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         230  +
    pub path: ::std::string::String,
         231  +
    /// A detailed description of the validation failure.
         232  +
    pub message: ::std::string::String,
         233  +
}
         234  +
impl ValidationExceptionField {
         235  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         236  +
    pub fn path(&self) -> &str {
         237  +
        use std::ops::Deref;
         238  +
        self.path.deref()
         239  +
    }
         240  +
    /// A detailed description of the validation failure.
         241  +
    pub fn message(&self) -> &str {
         242  +
        use std::ops::Deref;
         243  +
        self.message.deref()
         244  +
    }
         245  +
}
         246  +
impl ValidationExceptionField {
         247  +
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         248  +
    pub fn builder() -> crate::model::validation_exception_field::Builder {
         249  +
        crate::model::validation_exception_field::Builder::default()
         250  +
    }
         251  +
}
         252  +
  254    253   
#[allow(missing_docs)] // documentation missing in model
  255    254   
#[derive(
  256    255   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  257    256   
)]
  258    257   
pub enum AUnion {
  259    258   
    #[allow(missing_docs)] // documentation missing in model
  260    259   
    I32(i32),
  261    260   
    #[allow(missing_docs)] // documentation missing in model
  262    261   
    String(::std::string::String),
  263    262   
    #[allow(missing_docs)] // documentation missing in model
@@ -292,291 +460,350 @@
  312    311   
pub struct EmptyStructure {}
  313    312   
impl EmptyStructure {
  314    313   
    /// Creates a new builder-style object to manufacture [`EmptyStructure`](crate::model::EmptyStructure).
  315    314   
    pub fn builder() -> crate::model::empty_structure::Builder {
  316    315   
        crate::model::empty_structure::Builder::default()
  317    316   
    }
  318    317   
}
  319    318   
impl crate::constrained::Constrained for crate::model::EmptyStructure {
  320    319   
    type Unconstrained = crate::model::empty_structure::Builder;
  321    320   
}
  322         -
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  323         -
pub mod validation_exception_field {
  324         -
  325         -
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  326         -
    /// Holds one variant for each of the ways the builder can fail.
  327         -
    #[non_exhaustive]
  328         -
    #[allow(clippy::enum_variant_names)]
  329         -
    pub enum ConstraintViolation {
  330         -
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
  331         -
        MissingPath,
  332         -
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
  333         -
        MissingMessage,
  334         -
    }
  335         -
    impl ::std::fmt::Display for ConstraintViolation {
  336         -
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  337         -
            match self {
  338         -
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
  339         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
  340         -
            }
  341         -
        }
  342         -
    }
  343         -
    impl ::std::error::Error for ConstraintViolation {}
  344         -
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
  345         -
        type Error = ConstraintViolation;
  346         -
  347         -
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  348         -
            builder.build()
  349         -
        }
  350         -
    }
  351         -
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  352         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  353         -
    pub struct Builder {
  354         -
        pub(crate) path: ::std::option::Option<::std::string::String>,
  355         -
        pub(crate) message: ::std::option::Option<::std::string::String>,
  356         -
    }
  357         -
    impl Builder {
  358         -
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
  359         -
        pub fn path(mut self, input: ::std::string::String) -> Self {
  360         -
            self.path = Some(input);
  361         -
            self
  362         -
        }
  363         -
        /// A detailed description of the validation failure.
  364         -
        pub fn message(mut self, input: ::std::string::String) -> Self {
  365         -
            self.message = Some(input);
  366         -
            self
  367         -
        }
  368         -
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  369         -
        ///
  370         -
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
  371         -
        ///
  372         -
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
  373         -
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  374         -
            self.build_enforcing_all_constraints()
  375         -
        }
  376         -
        fn build_enforcing_all_constraints(
  377         -
            self,
  378         -
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  379         -
            Ok(crate::model::ValidationExceptionField {
  380         -
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
  381         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  382         -
            })
  383         -
        }
  384         -
    }
  385         -
}
  386         -
/// See [`HeaderSet`](crate::model::HeaderSet).
  387         -
pub mod header_set {
  388         -
  389         -
    #[allow(clippy::enum_variant_names)]
  390         -
    #[derive(Debug, PartialEq)]
  391         -
    pub enum ConstraintViolation {
  392         -
        /// Constraint violation error when the list does not contain unique items
  393         -
        UniqueItems {
  394         -
            /// A vector of indices into `original` pointing to all duplicate items. This vector has
  395         -
            /// at least two elements.
  396         -
            /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
  397         -
            /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
  398         -
            /// Nothing is guaranteed about the order of the indices.
  399         -
            duplicate_indices: ::std::vec::Vec<usize>,
  400         -
            /// The original vector, that contains duplicate items.
  401         -
            original: ::std::vec::Vec<::std::string::String>,
  402         -
        },
  403         -
    }
  404         -
  405         -
    impl ::std::fmt::Display for ConstraintViolation {
  406         -
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  407         -
            let message = match self {
  408         -
                                Self::UniqueItems { duplicate_indices, .. } =>
  409         -
                            format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.misc#HeaderSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
  410         -
                            };
  411         -
            write!(f, "{message}")
  412         -
        }
  413         -
    }
  414         -
  415         -
    impl ::std::error::Error for ConstraintViolation {}
  416         -
    impl ConstraintViolation {
  417         -
        pub(crate) fn as_validation_exception_field(
  418         -
            self,
  419         -
            path: ::std::string::String,
  420         -
        ) -> crate::model::ValidationExceptionField {
  421         -
            match self {
  422         -
                        Self::UniqueItems { duplicate_indices, .. } =>
  423         -
                                crate::model::ValidationExceptionField {
  424         -
                                    message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
  425         -
                                    path,
  426         -
                                },
  427         -
                    }
  428         -
        }
  429         -
    }
  430         -
}
  431    321   
/// See [`InnerShape`](crate::model::InnerShape).
  432    322   
pub mod inner_shape {
  433    323   
  434    324   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  435    325   
    /// Holds one variant for each of the ways the builder can fail.
  436    326   
    #[non_exhaustive]
  437    327   
    #[allow(clippy::enum_variant_names)]
  438    328   
    pub enum ConstraintViolation {
  439    329   
        /// `required_inner_most_shape` was not provided but it is required when building `InnerShape`.
  440    330   
        MissingRequiredInnerMostShape,
@@ -501,391 +560,495 @@
  521    411   
                        crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
  522    412   
                        crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
  523    413   
                    })
  524    414   
                    .map(|res| res.map_err(ConstraintViolation::RequiredInnerMostShape))
  525    415   
                    .transpose()?
  526    416   
                    .ok_or(ConstraintViolation::MissingRequiredInnerMostShape)?,
  527    417   
            })
  528    418   
        }
  529    419   
    }
  530    420   
}
         421  +
/// See [`HeaderSet`](crate::model::HeaderSet).
         422  +
pub mod header_set {
         423  +
         424  +
    #[allow(clippy::enum_variant_names)]
         425  +
    #[derive(Debug, PartialEq)]
         426  +
    pub enum ConstraintViolation {
         427  +
        /// Constraint violation error when the list does not contain unique items
         428  +
        UniqueItems {
         429  +
            /// A vector of indices into `original` pointing to all duplicate items. This vector has
         430  +
            /// at least two elements.
         431  +
            /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
         432  +
            /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
         433  +
            /// Nothing is guaranteed about the order of the indices.
         434  +
            duplicate_indices: ::std::vec::Vec<usize>,
         435  +
            /// The original vector, that contains duplicate items.
         436  +
            original: ::std::vec::Vec<::std::string::String>,
         437  +
        },
         438  +
    }
         439  +
         440  +
    impl ::std::fmt::Display for ConstraintViolation {
         441  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         442  +
            let message = match self {
         443  +
                                Self::UniqueItems { duplicate_indices, .. } =>
         444  +
                            format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.misc#HeaderSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
         445  +
                            };
         446  +
            write!(f, "{message}")
         447  +
        }
         448  +
    }
         449  +
         450  +
    impl ::std::error::Error for ConstraintViolation {}
         451  +
    impl ConstraintViolation {
         452  +
        pub(crate) fn as_validation_exception_field(
         453  +
            self,
         454  +
            path: ::std::string::String,
         455  +
        ) -> crate::model::ValidationExceptionField {
         456  +
            match self {
         457  +
                        Self::UniqueItems { duplicate_indices, .. } =>
         458  +
                                crate::model::ValidationExceptionField {
         459  +
                                    message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
         460  +
                                    path,
         461  +
                                },
         462  +
                    }
         463  +
        }
         464  +
    }
         465  +
}
  531    466   
/// See [`InnermostShape`](crate::model::InnermostShape).
  532    467   
pub mod innermost_shape {
  533    468   
  534    469   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  535    470   
    /// Holds one variant for each of the ways the builder can fail.
  536    471   
    #[non_exhaustive]
  537    472   
    #[allow(clippy::enum_variant_names)]
  538    473   
    pub enum ConstraintViolation {
  539    474   
        /// `a_string` was not provided but it is required when building `InnermostShape`.
  540    475   
        MissingAString,
@@ -935,870 +985,984 @@
  955    890   
                    .ok_or(ConstraintViolation::MissingAStringMap)?,
  956    891   
                a_string_set: self
  957    892   
                    .a_string_set
  958    893   
                    .ok_or(ConstraintViolation::MissingAStringSet)?,
  959    894   
                a_blob: self.a_blob.ok_or(ConstraintViolation::MissingABlob)?,
  960    895   
                a_union: self.a_union.ok_or(ConstraintViolation::MissingAUnion)?,
  961    896   
            })
  962    897   
        }
  963    898   
    }
  964    899   
}
         900  +
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         901  +
pub mod validation_exception_field {
         902  +
         903  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         904  +
    /// Holds one variant for each of the ways the builder can fail.
         905  +
    #[non_exhaustive]
         906  +
    #[allow(clippy::enum_variant_names)]
         907  +
    pub enum ConstraintViolation {
         908  +
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         909  +
        MissingPath,
         910  +
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         911  +
        MissingMessage,
         912  +
    }
         913  +
    impl ::std::fmt::Display for ConstraintViolation {
         914  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         915  +
            match self {
         916  +
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         917  +
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         918  +
            }
         919  +
        }
         920  +
    }
         921  +
    impl ::std::error::Error for ConstraintViolation {}
         922  +
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
         923  +
        type Error = ConstraintViolation;
         924  +
         925  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         926  +
            builder.build()
         927  +
        }
         928  +
    }
         929  +
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         930  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         931  +
    pub struct Builder {
         932  +
        pub(crate) path: ::std::option::Option<::std::string::String>,
         933  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         934  +
    }
         935  +
    impl Builder {
         936  +
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         937  +
        pub fn path(mut self, input: ::std::string::String) -> Self {
         938  +
            self.path = Some(input);
         939  +
            self
         940  +
        }
         941  +
        /// A detailed description of the validation failure.
         942  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         943  +
            self.message = Some(input);
         944  +
            self
         945  +
        }
         946  +
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         947  +
        ///
         948  +
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
         949  +
        ///
         950  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         951  +
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         952  +
            self.build_enforcing_all_constraints()
         953  +
        }
         954  +
        fn build_enforcing_all_constraints(
         955  +
            self,
         956  +
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         957  +
            Ok(crate::model::ValidationExceptionField {
         958  +
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
         959  +
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
         960  +
            })
         961  +
        }
         962  +
    }
         963  +
}
  965    964   
/// See [`EmptyStructure`](crate::model::EmptyStructure).
  966    965   
pub mod empty_structure {
  967    966   
  968    967   
    impl ::std::convert::From<Builder> for crate::model::EmptyStructure {
  969    968   
        fn from(builder: Builder) -> Self {
  970    969   
            builder.build()
  971    970   
        }
  972    971   
    }
  973    972   
    /// A builder for [`EmptyStructure`](crate::model::EmptyStructure).
  974    973   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]