Server Test

Server Test

rev. d838bf488731ae5e751cce0fe13f339a5b9be858 (ignoring whitespace)

Files changed:

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

@@ -1,1 +70,70 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
pub(crate) mod foo_enum_list_constrained {
           4  +
           5  +
    #[derive(Debug, Clone)]
           6  +
    pub(crate) struct FooEnumListConstrained(pub(crate) std::vec::Vec<crate::model::FooEnum>);
           7  +
           8  +
    impl crate::constrained::Constrained for FooEnumListConstrained {
           9  +
        type Unconstrained =
          10  +
            crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained;
          11  +
    }
          12  +
    impl ::std::convert::From<::std::vec::Vec<crate::model::FooEnum>> for FooEnumListConstrained {
          13  +
        fn from(v: ::std::vec::Vec<crate::model::FooEnum>) -> Self {
          14  +
            Self(v)
          15  +
        }
          16  +
    }
          17  +
          18  +
    impl ::std::convert::From<FooEnumListConstrained> for ::std::vec::Vec<crate::model::FooEnum> {
          19  +
        fn from(v: FooEnumListConstrained) -> Self {
          20  +
            v.0
          21  +
        }
          22  +
    }
          23  +
}
    3     24   
pub(crate) mod foo_enum_map_constrained {
    4     25   
    5     26   
    #[derive(Debug, Clone)]
    6     27   
    pub(crate) struct FooEnumMapConstrained(
    7     28   
        pub(crate) std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
    8     29   
    );
    9     30   
   10     31   
    impl crate::constrained::Constrained for FooEnumMapConstrained {
   11     32   
        type Unconstrained =
   12     33   
            crate::unconstrained::foo_enum_map_unconstrained::FooEnumMapUnconstrained;
   13     34   
    }
   14     35   
    impl
   15     36   
        ::std::convert::From<
   16     37   
            ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
   17     38   
        > for FooEnumMapConstrained
   18     39   
    {
   19     40   
        fn from(
   20     41   
            v: ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
   21     42   
        ) -> Self {
   22     43   
            Self(v)
   23     44   
        }
   24     45   
    }
   25     46   
   26     47   
    impl ::std::convert::From<FooEnumMapConstrained>
   27     48   
        for ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>
   28     49   
    {
   29     50   
        fn from(v: FooEnumMapConstrained) -> Self {
   30     51   
            v.0
   31     52   
        }
   32     53   
    }
   33     54   
}
   34         -
pub(crate) mod foo_enum_list_constrained {
   35         -
   36         -
    #[derive(Debug, Clone)]
   37         -
    pub(crate) struct FooEnumListConstrained(pub(crate) std::vec::Vec<crate::model::FooEnum>);
   38         -
   39         -
    impl crate::constrained::Constrained for FooEnumListConstrained {
   40         -
        type Unconstrained =
   41         -
            crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained;
   42         -
    }
   43         -
    impl ::std::convert::From<::std::vec::Vec<crate::model::FooEnum>> for FooEnumListConstrained {
   44         -
        fn from(v: ::std::vec::Vec<crate::model::FooEnum>) -> Self {
   45         -
            Self(v)
   46         -
        }
   47         -
    }
   48         -
   49         -
    impl ::std::convert::From<FooEnumListConstrained> for ::std::vec::Vec<crate::model::FooEnum> {
   50         -
        fn from(v: FooEnumListConstrained) -> Self {
   51         -
            v.0
   52         -
        }
   53         -
    }
   54         -
}
   55     55   
   56     56   
/*
   57     57   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
   58     58   
 * SPDX-License-Identifier: Apache-2.0
   59     59   
 */
   60     60   
   61     61   
pub(crate) trait Constrained {
   62     62   
    type Unconstrained;
   63     63   
}
   64     64   

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

@@ -1,1 +157,163 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// Error type for the `EndpointWithHostLabelOperation` operation.
    4         -
/// Each variant represents an error that can occur for the `EndpointWithHostLabelOperation` operation.
           3  +
/// Error type for the `KitchenSinkOperation` operation.
           4  +
/// Each variant represents an error that can occur for the `KitchenSinkOperation` operation.
    5      5   
#[derive(::std::fmt::Debug)]
    6         -
pub enum EndpointWithHostLabelOperationError {
    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),
           6  +
pub enum KitchenSinkOperationError {
           7  +
    #[allow(missing_docs)] // documentation missing in model
           8  +
    ErrorWithMembers(crate::error::ErrorWithMembers),
           9  +
    #[allow(missing_docs)] // documentation missing in model
          10  +
    ErrorWithoutMembers(crate::error::ErrorWithoutMembers),
    9     11   
}
   10         -
impl ::std::fmt::Display for EndpointWithHostLabelOperationError {
          12  +
impl ::std::fmt::Display for KitchenSinkOperationError {
   11     13   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   12     14   
        match &self {
   13         -
            EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.fmt(f),
          15  +
            KitchenSinkOperationError::ErrorWithMembers(_inner) => _inner.fmt(f),
          16  +
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) => _inner.fmt(f),
   14     17   
        }
   15     18   
    }
   16     19   
}
   17         -
impl EndpointWithHostLabelOperationError {
   18         -
    /// Returns `true` if the error kind is `EndpointWithHostLabelOperationError::ValidationException`.
   19         -
    pub fn is_validation_exception(&self) -> bool {
   20         -
        matches!(
   21         -
            &self,
   22         -
            EndpointWithHostLabelOperationError::ValidationException(_)
   23         -
        )
          20  +
impl KitchenSinkOperationError {
          21  +
    /// Returns `true` if the error kind is `KitchenSinkOperationError::ErrorWithMembers`.
          22  +
    pub fn is_error_with_members(&self) -> bool {
          23  +
        matches!(&self, KitchenSinkOperationError::ErrorWithMembers(_))
          24  +
    }
          25  +
    /// Returns `true` if the error kind is `KitchenSinkOperationError::ErrorWithoutMembers`.
          26  +
    pub fn is_error_without_members(&self) -> bool {
          27  +
        matches!(&self, KitchenSinkOperationError::ErrorWithoutMembers(_))
   24     28   
    }
   25     29   
    /// Returns the error name string by matching the correct variant.
   26     30   
    pub fn name(&self) -> &'static str {
   27     31   
        match &self {
   28         -
            EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.name(),
          32  +
            KitchenSinkOperationError::ErrorWithMembers(_inner) => _inner.name(),
          33  +
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) => _inner.name(),
   29     34   
        }
   30     35   
    }
   31     36   
}
   32         -
impl ::std::error::Error for EndpointWithHostLabelOperationError {
          37  +
impl ::std::error::Error for KitchenSinkOperationError {
   33     38   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
   34     39   
        match &self {
   35         -
            EndpointWithHostLabelOperationError::ValidationException(_inner) => Some(_inner),
          40  +
            KitchenSinkOperationError::ErrorWithMembers(_inner) => Some(_inner),
          41  +
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) => Some(_inner),
   36     42   
        }
   37     43   
    }
   38     44   
}
   39         -
impl ::std::convert::From<crate::error::ValidationException>
   40         -
    for crate::error::EndpointWithHostLabelOperationError
          45  +
impl ::std::convert::From<crate::error::ErrorWithMembers>
          46  +
    for crate::error::KitchenSinkOperationError
   41     47   
{
   42         -
    fn from(
   43         -
        variant: crate::error::ValidationException,
   44         -
    ) -> crate::error::EndpointWithHostLabelOperationError {
   45         -
        Self::ValidationException(variant)
          48  +
    fn from(variant: crate::error::ErrorWithMembers) -> crate::error::KitchenSinkOperationError {
          49  +
        Self::ErrorWithMembers(variant)
          50  +
    }
          51  +
}
          52  +
impl ::std::convert::From<crate::error::ErrorWithoutMembers>
          53  +
    for crate::error::KitchenSinkOperationError
          54  +
{
          55  +
    fn from(variant: crate::error::ErrorWithoutMembers) -> crate::error::KitchenSinkOperationError {
          56  +
        Self::ErrorWithoutMembers(variant)
   46     57   
    }
   47     58   
}
   48     59   
   49         -
/// 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.
   50         -
#[derive(
   51         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   52         -
)]
   53         -
pub struct ValidationException {
   54         -
    /// A summary of the validation failure.
   55         -
    pub message: ::std::string::String,
   56         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
   57         -
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
          60  +
/// Error type for the `JsonEnums` operation.
          61  +
/// Each variant represents an error that can occur for the `JsonEnums` operation.
          62  +
#[derive(::std::fmt::Debug)]
          63  +
pub enum JsonEnumsError {
          64  +
    /// 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.
          65  +
    ValidationException(crate::error::ValidationException),
   58     66   
}
   59         -
impl ValidationException {
   60         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
   61         -
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
   62         -
        self.field_list.as_deref()
          67  +
impl ::std::fmt::Display for JsonEnumsError {
          68  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          69  +
        match &self {
          70  +
            JsonEnumsError::ValidationException(_inner) => _inner.fmt(f),
          71  +
        }
   63     72   
    }
   64     73   
}
   65         -
impl ValidationException {
   66         -
    /// Returns the error message.
   67         -
    pub fn message(&self) -> &str {
   68         -
        &self.message
          74  +
impl JsonEnumsError {
          75  +
    /// Returns `true` if the error kind is `JsonEnumsError::ValidationException`.
          76  +
    pub fn is_validation_exception(&self) -> bool {
          77  +
        matches!(&self, JsonEnumsError::ValidationException(_))
   69     78   
    }
   70         -
    #[doc(hidden)]
   71         -
    /// Returns the error name.
          79  +
    /// Returns the error name string by matching the correct variant.
   72     80   
    pub fn name(&self) -> &'static str {
   73         -
        "ValidationException"
          81  +
        match &self {
          82  +
            JsonEnumsError::ValidationException(_inner) => _inner.name(),
          83  +
        }
   74     84   
    }
   75     85   
}
   76         -
impl ::std::fmt::Display for ValidationException {
   77         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   78         -
        ::std::write!(f, "ValidationException")?;
   79         -
        {
   80         -
            ::std::write!(f, ": {}", &self.message)?;
          86  +
impl ::std::error::Error for JsonEnumsError {
          87  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
          88  +
        match &self {
          89  +
            JsonEnumsError::ValidationException(_inner) => Some(_inner),
   81     90   
        }
   82         -
        Ok(())
   83     91   
    }
   84     92   
}
   85         -
impl ::std::error::Error for ValidationException {}
   86         -
impl ValidationException {
   87         -
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
   88         -
    pub fn builder() -> crate::error::validation_exception::Builder {
   89         -
        crate::error::validation_exception::Builder::default()
          93  +
impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonEnumsError {
          94  +
    fn from(variant: crate::error::ValidationException) -> crate::error::JsonEnumsError {
          95  +
        Self::ValidationException(variant)
   90     96   
    }
   91     97   
}
   92     98   
   93         -
/// Error type for the `JsonUnions` operation.
   94         -
/// Each variant represents an error that can occur for the `JsonUnions` operation.
          99  +
/// Error type for the `JsonIntEnums` operation.
         100  +
/// Each variant represents an error that can occur for the `JsonIntEnums` operation.
   95    101   
#[derive(::std::fmt::Debug)]
   96         -
pub enum JsonUnionsError {
         102  +
pub enum JsonIntEnumsError {
   97    103   
    /// 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    104   
    ValidationException(crate::error::ValidationException),
   99    105   
}
  100         -
impl ::std::fmt::Display for JsonUnionsError {
         106  +
impl ::std::fmt::Display for JsonIntEnumsError {
  101    107   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  102    108   
        match &self {
  103         -
            JsonUnionsError::ValidationException(_inner) => _inner.fmt(f),
         109  +
            JsonIntEnumsError::ValidationException(_inner) => _inner.fmt(f),
  104    110   
        }
  105    111   
    }
  106    112   
}
  107         -
impl JsonUnionsError {
  108         -
    /// Returns `true` if the error kind is `JsonUnionsError::ValidationException`.
         113  +
impl JsonIntEnumsError {
         114  +
    /// Returns `true` if the error kind is `JsonIntEnumsError::ValidationException`.
  109    115   
    pub fn is_validation_exception(&self) -> bool {
  110         -
        matches!(&self, JsonUnionsError::ValidationException(_))
         116  +
        matches!(&self, JsonIntEnumsError::ValidationException(_))
  111    117   
    }
  112    118   
    /// Returns the error name string by matching the correct variant.
  113    119   
    pub fn name(&self) -> &'static str {
  114    120   
        match &self {
  115         -
            JsonUnionsError::ValidationException(_inner) => _inner.name(),
         121  +
            JsonIntEnumsError::ValidationException(_inner) => _inner.name(),
  116    122   
        }
  117    123   
    }
  118    124   
}
  119         -
impl ::std::error::Error for JsonUnionsError {
         125  +
impl ::std::error::Error for JsonIntEnumsError {
  120    126   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  121    127   
        match &self {
  122         -
            JsonUnionsError::ValidationException(_inner) => Some(_inner),
         128  +
            JsonIntEnumsError::ValidationException(_inner) => Some(_inner),
  123    129   
        }
  124    130   
    }
  125    131   
}
  126         -
impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonUnionsError {
  127         -
    fn from(variant: crate::error::ValidationException) -> crate::error::JsonUnionsError {
         132  +
impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonIntEnumsError {
         133  +
    fn from(variant: crate::error::ValidationException) -> crate::error::JsonIntEnumsError {
  128    134   
        Self::ValidationException(variant)
  129    135   
    }
  130    136   
}
  131    137   
  132    138   
/// Error type for the `GreetingWithErrors` operation.
  133    139   
/// Each variant represents an error that can occur for the `GreetingWithErrors` operation.
  134    140   
#[derive(::std::fmt::Debug)]
  135    141   
pub enum GreetingWithErrorsError {
  136    142   
    /// This error is thrown when an invalid greeting value is provided.
  137    143   
    InvalidGreeting(crate::error::InvalidGreeting),
@@ -169,175 +574,679 @@
  189    195   
    fn from(variant: crate::error::ComplexError) -> crate::error::GreetingWithErrorsError {
  190    196   
        Self::ComplexError(variant)
  191    197   
    }
  192    198   
}
  193    199   
impl ::std::convert::From<crate::error::FooError> for crate::error::GreetingWithErrorsError {
  194    200   
    fn from(variant: crate::error::FooError) -> crate::error::GreetingWithErrorsError {
  195    201   
        Self::FooError(variant)
  196    202   
    }
  197    203   
}
  198    204   
  199         -
/// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
  200         -
#[derive(
  201         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  202         -
)]
  203         -
pub struct FooError {}
  204         -
impl FooError {
  205         -
    #[doc(hidden)]
  206         -
    /// Returns the error name.
         205  +
/// Error type for the `JsonUnions` operation.
         206  +
/// Each variant represents an error that can occur for the `JsonUnions` operation.
         207  +
#[derive(::std::fmt::Debug)]
         208  +
pub enum JsonUnionsError {
         209  +
    /// 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.
         210  +
    ValidationException(crate::error::ValidationException),
         211  +
}
         212  +
impl ::std::fmt::Display for JsonUnionsError {
         213  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         214  +
        match &self {
         215  +
            JsonUnionsError::ValidationException(_inner) => _inner.fmt(f),
         216  +
        }
         217  +
    }
         218  +
}
         219  +
impl JsonUnionsError {
         220  +
    /// Returns `true` if the error kind is `JsonUnionsError::ValidationException`.
         221  +
    pub fn is_validation_exception(&self) -> bool {
         222  +
        matches!(&self, JsonUnionsError::ValidationException(_))
         223  +
    }
         224  +
    /// Returns the error name string by matching the correct variant.
  207    225   
    pub fn name(&self) -> &'static str {
  208         -
        "FooError"
         226  +
        match &self {
         227  +
            JsonUnionsError::ValidationException(_inner) => _inner.name(),
         228  +
        }
  209    229   
    }
  210    230   
}
  211         -
impl ::std::fmt::Display for FooError {
  212         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  213         -
        ::std::write!(f, "FooError")?;
  214         -
        Ok(())
         231  +
impl ::std::error::Error for JsonUnionsError {
         232  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         233  +
        match &self {
         234  +
            JsonUnionsError::ValidationException(_inner) => Some(_inner),
         235  +
        }
  215    236   
    }
  216    237   
}
  217         -
impl ::std::error::Error for FooError {}
  218         -
impl FooError {
  219         -
    /// Creates a new builder-style object to manufacture [`FooError`](crate::error::FooError).
  220         -
    pub fn builder() -> crate::error::foo_error::Builder {
  221         -
        crate::error::foo_error::Builder::default()
         238  +
impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonUnionsError {
         239  +
    fn from(variant: crate::error::ValidationException) -> crate::error::JsonUnionsError {
         240  +
        Self::ValidationException(variant)
  222    241   
    }
  223    242   
}
  224    243   
  225         -
/// This error is thrown when a request is invalid.
  226         -
#[derive(
  227         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  228         -
)]
  229         -
pub struct ComplexError {
  230         -
    #[allow(missing_docs)] // documentation missing in model
  231         -
    pub top_level: ::std::option::Option<::std::string::String>,
  232         -
    #[allow(missing_docs)] // documentation missing in model
  233         -
    pub nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
         244  +
/// Error type for the `EndpointWithHostLabelOperation` operation.
         245  +
/// Each variant represents an error that can occur for the `EndpointWithHostLabelOperation` operation.
         246  +
#[derive(::std::fmt::Debug)]
         247  +
pub enum EndpointWithHostLabelOperationError {
         248  +
    /// 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.
         249  +
    ValidationException(crate::error::ValidationException),
  234    250   
}
  235         -
impl ComplexError {
  236         -
    #[allow(missing_docs)] // documentation missing in model
  237         -
    pub fn top_level(&self) -> ::std::option::Option<&str> {
  238         -
        self.top_level.as_deref()
         251  +
impl ::std::fmt::Display for EndpointWithHostLabelOperationError {
         252  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         253  +
        match &self {
         254  +
            EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.fmt(f),
  239    255   
        }
  240         -
    #[allow(missing_docs)] // documentation missing in model
  241         -
    pub fn nested(&self) -> ::std::option::Option<&crate::model::ComplexNestedErrorData> {
  242         -
        self.nested.as_ref()
  243    256   
    }
  244    257   
}
  245         -
impl ComplexError {
  246         -
    #[doc(hidden)]
  247         -
    /// Returns the error name.
         258  +
impl EndpointWithHostLabelOperationError {
         259  +
    /// Returns `true` if the error kind is `EndpointWithHostLabelOperationError::ValidationException`.
         260  +
    pub fn is_validation_exception(&self) -> bool {
         261  +
        matches!(
         262  +
            &self,
         263  +
            EndpointWithHostLabelOperationError::ValidationException(_)
         264  +
        )
         265  +
    }
         266  +
    /// Returns the error name string by matching the correct variant.
  248    267   
    pub fn name(&self) -> &'static str {
  249         -
        "ComplexError"
         268  +
        match &self {
         269  +
            EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.name(),
         270  +
        }
  250    271   
    }
  251    272   
}
  252         -
impl ::std::fmt::Display for ComplexError {
  253         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  254         -
        ::std::write!(f, "ComplexError")?;
  255         -
        Ok(())
         273  +
impl ::std::error::Error for EndpointWithHostLabelOperationError {
         274  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         275  +
        match &self {
         276  +
            EndpointWithHostLabelOperationError::ValidationException(_inner) => Some(_inner),
         277  +
        }
  256    278   
    }
  257    279   
}
  258         -
impl ::std::error::Error for ComplexError {}
  259         -
impl ComplexError {
  260         -
    /// Creates a new builder-style object to manufacture [`ComplexError`](crate::error::ComplexError).
  261         -
    pub fn builder() -> crate::error::complex_error::Builder {
  262         -
        crate::error::complex_error::Builder::default()
         280  +
impl ::std::convert::From<crate::error::ValidationException>
         281  +
    for crate::error::EndpointWithHostLabelOperationError
         282  +
{
         283  +
    fn from(
         284  +
        variant: crate::error::ValidationException,
         285  +
    ) -> crate::error::EndpointWithHostLabelOperationError {
         286  +
        Self::ValidationException(variant)
  263    287   
    }
  264    288   
}
  265    289   
  266         -
/// This error is thrown when an invalid greeting value is provided.
  267         -
#[derive(
  268         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  269         -
)]
  270         -
pub struct InvalidGreeting {
         290  +
#[allow(missing_docs)] // documentation missing in model
         291  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
         292  +
pub struct ErrorWithMembers {
         293  +
    #[allow(missing_docs)] // documentation missing in model
         294  +
    pub code: ::std::option::Option<::std::string::String>,
         295  +
    #[allow(missing_docs)] // documentation missing in model
         296  +
    pub complex_data: ::std::option::Option<crate::model::KitchenSink>,
         297  +
    #[allow(missing_docs)] // documentation missing in model
         298  +
    pub integer_field: ::std::option::Option<i32>,
         299  +
    #[allow(missing_docs)] // documentation missing in model
         300  +
    pub list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         301  +
    #[allow(missing_docs)] // documentation missing in model
         302  +
    pub map_field: ::std::option::Option<
         303  +
        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
         304  +
    >,
  271    305   
    #[allow(missing_docs)] // documentation missing in model
  272    306   
    pub message: ::std::option::Option<::std::string::String>,
         307  +
    /// abc
         308  +
    pub string_field: ::std::option::Option<::std::string::String>,
  273    309   
}
  274         -
impl InvalidGreeting {
         310  +
impl ErrorWithMembers {
         311  +
    #[allow(missing_docs)] // documentation missing in model
         312  +
    pub fn code(&self) -> ::std::option::Option<&str> {
         313  +
        self.code.as_deref()
         314  +
    }
         315  +
    #[allow(missing_docs)] // documentation missing in model
         316  +
    pub fn complex_data(&self) -> ::std::option::Option<&crate::model::KitchenSink> {
         317  +
        self.complex_data.as_ref()
         318  +
    }
         319  +
    #[allow(missing_docs)] // documentation missing in model
         320  +
    pub fn integer_field(&self) -> ::std::option::Option<i32> {
         321  +
        self.integer_field
         322  +
    }
         323  +
    #[allow(missing_docs)] // documentation missing in model
         324  +
    pub fn list_field(&self) -> ::std::option::Option<&[::std::string::String]> {
         325  +
        self.list_field.as_deref()
         326  +
    }
         327  +
    #[allow(missing_docs)] // documentation missing in model
         328  +
    pub fn map_field(
         329  +
        &self,
         330  +
    ) -> ::std::option::Option<
         331  +
        &::std::collections::HashMap<::std::string::String, ::std::string::String>,
         332  +
    > {
         333  +
        self.map_field.as_ref()
         334  +
    }
         335  +
    /// abc
         336  +
    pub fn string_field(&self) -> ::std::option::Option<&str> {
         337  +
        self.string_field.as_deref()
         338  +
    }
         339  +
}
         340  +
impl ErrorWithMembers {
  275    341   
    /// Returns the error message.
  276    342   
    pub fn message(&self) -> ::std::option::Option<&str> {
  277    343   
        self.message.as_deref()
  278    344   
    }
  279    345   
    #[doc(hidden)]
  280    346   
    /// Returns the error name.
  281    347   
    pub fn name(&self) -> &'static str {
  282         -
        "InvalidGreeting"
         348  +
        "ErrorWithMembers"
  283    349   
    }
  284    350   
}
  285         -
impl ::std::fmt::Display for InvalidGreeting {
         351  +
impl ::std::fmt::Display for ErrorWithMembers {
  286    352   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  287         -
        ::std::write!(f, "InvalidGreeting")?;
         353  +
        ::std::write!(f, "ErrorWithMembers")?;
  288    354   
        if let ::std::option::Option::Some(inner_1) = &self.message {
  289    355   
            {
  290    356   
                ::std::write!(f, ": {inner_1}")?;
  291    357   
            }
  292    358   
        }
  293    359   
        Ok(())
  294    360   
    }
  295    361   
}
  296         -
impl ::std::error::Error for InvalidGreeting {}
  297         -
impl InvalidGreeting {
  298         -
    /// Creates a new builder-style object to manufacture [`InvalidGreeting`](crate::error::InvalidGreeting).
  299         -
    pub fn builder() -> crate::error::invalid_greeting::Builder {
  300         -
        crate::error::invalid_greeting::Builder::default()
         362  +
impl ::std::error::Error for ErrorWithMembers {}
         363  +
impl ErrorWithMembers {
         364  +
    /// Creates a new builder-style object to manufacture [`ErrorWithMembers`](crate::error::ErrorWithMembers).
         365  +
    pub fn builder() -> crate::error::error_with_members::Builder {
         366  +
        crate::error::error_with_members::Builder::default()
  301    367   
    }
  302    368   
}
  303    369   
  304         -
/// Error type for the `JsonIntEnums` operation.
  305         -
/// Each variant represents an error that can occur for the `JsonIntEnums` operation.
  306         -
#[derive(::std::fmt::Debug)]
  307         -
pub enum JsonIntEnumsError {
  308         -
    /// 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.
  309         -
    ValidationException(crate::error::ValidationException),
         370  +
#[allow(missing_docs)] // documentation missing in model
         371  +
#[derive(
         372  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         373  +
)]
         374  +
pub struct ErrorWithoutMembers {}
         375  +
impl ErrorWithoutMembers {
         376  +
    #[doc(hidden)]
         377  +
    /// Returns the error name.
         378  +
    pub fn name(&self) -> &'static str {
         379  +
        "ErrorWithoutMembers"
         380  +
    }
  310    381   
}
  311         -
impl ::std::fmt::Display for JsonIntEnumsError {
         382  +
impl ::std::fmt::Display for ErrorWithoutMembers {
  312    383   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  313         -
        match &self {
  314         -
            JsonIntEnumsError::ValidationException(_inner) => _inner.fmt(f),
         384  +
        ::std::write!(f, "ErrorWithoutMembers")?;
         385  +
        Ok(())
  315    386   
    }
         387  +
}
         388  +
impl ::std::error::Error for ErrorWithoutMembers {}
         389  +
impl ErrorWithoutMembers {
         390  +
    /// Creates a new builder-style object to manufacture [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
         391  +
    pub fn builder() -> crate::error::error_without_members::Builder {
         392  +
        crate::error::error_without_members::Builder::default()
  316    393   
    }
  317    394   
}
  318         -
impl JsonIntEnumsError {
  319         -
    /// Returns `true` if the error kind is `JsonIntEnumsError::ValidationException`.
  320         -
    pub fn is_validation_exception(&self) -> bool {
  321         -
        matches!(&self, JsonIntEnumsError::ValidationException(_))
         395  +
         396  +
/// 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.
         397  +
#[derive(
         398  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         399  +
)]
         400  +
pub struct ValidationException {
         401  +
    /// A summary of the validation failure.
         402  +
    pub message: ::std::string::String,
         403  +
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         404  +
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
         405  +
}
         406  +
impl ValidationException {
         407  +
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         408  +
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
         409  +
        self.field_list.as_deref()
  322    410   
    }
  323         -
    /// Returns the error name string by matching the correct variant.
  324         -
    pub fn name(&self) -> &'static str {
  325         -
        match &self {
  326         -
            JsonIntEnumsError::ValidationException(_inner) => _inner.name(),
         411  +
}
         412  +
impl ValidationException {
         413  +
    /// Returns the error message.
         414  +
    pub fn message(&self) -> &str {
         415  +
        &self.message
  327    416   
    }
         417  +
    #[doc(hidden)]
         418  +
    /// Returns the error name.
         419  +
    pub fn name(&self) -> &'static str {
         420  +
        "ValidationException"
  328    421   
    }
  329    422   
}
  330         -
impl ::std::error::Error for JsonIntEnumsError {
  331         -
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  332         -
        match &self {
  333         -
            JsonIntEnumsError::ValidationException(_inner) => Some(_inner),
         423  +
impl ::std::fmt::Display for ValidationException {
         424  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         425  +
        ::std::write!(f, "ValidationException")?;
         426  +
        {
         427  +
            ::std::write!(f, ": {}", &self.message)?;
  334    428   
        }
         429  +
        Ok(())
  335    430   
    }
  336    431   
}
  337         -
impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonIntEnumsError {
  338         -
    fn from(variant: crate::error::ValidationException) -> crate::error::JsonIntEnumsError {
  339         -
        Self::ValidationException(variant)
         432  +
impl ::std::error::Error for ValidationException {}
         433  +
impl ValidationException {
         434  +
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
         435  +
    pub fn builder() -> crate::error::validation_exception::Builder {
         436  +
        crate::error::validation_exception::Builder::default()
  340    437   
    }
  341    438   
}
  342    439   
  343         -
/// Error type for the `JsonEnums` operation.
  344         -
/// Each variant represents an error that can occur for the `JsonEnums` operation.
  345         -
#[derive(::std::fmt::Debug)]
  346         -
pub enum JsonEnumsError {
  347         -
    /// 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.
  348         -
    ValidationException(crate::error::ValidationException),
  349         -
}
  350         -
impl ::std::fmt::Display for JsonEnumsError {
  351         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  352         -
        match &self {
  353         -
            JsonEnumsError::ValidationException(_inner) => _inner.fmt(f),
  354         -
        }
  355         -
    }
         440  +
/// This error is thrown when an invalid greeting value is provided.
         441  +
#[derive(
         442  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         443  +
)]
         444  +
pub struct InvalidGreeting {
         445  +
    #[allow(missing_docs)] // documentation missing in model
         446  +
    pub message: ::std::option::Option<::std::string::String>,
  356    447   
}
  357         -
impl JsonEnumsError {
  358         -
    /// Returns `true` if the error kind is `JsonEnumsError::ValidationException`.
  359         -
    pub fn is_validation_exception(&self) -> bool {
  360         -
        matches!(&self, JsonEnumsError::ValidationException(_))
         448  +
impl InvalidGreeting {
         449  +
    /// Returns the error message.
         450  +
    pub fn message(&self) -> ::std::option::Option<&str> {
         451  +
        self.message.as_deref()
  361    452   
    }
  362         -
    /// Returns the error name string by matching the correct variant.
         453  +
    #[doc(hidden)]
         454  +
    /// Returns the error name.
  363    455   
    pub fn name(&self) -> &'static str {
  364         -
        match &self {
  365         -
            JsonEnumsError::ValidationException(_inner) => _inner.name(),
  366         -
        }
         456  +
        "InvalidGreeting"
  367    457   
    }
  368    458   
}
  369         -
impl ::std::error::Error for JsonEnumsError {
  370         -
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  371         -
        match &self {
  372         -
            JsonEnumsError::ValidationException(_inner) => Some(_inner),
         459  +
impl ::std::fmt::Display for InvalidGreeting {
         460  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         461  +
        ::std::write!(f, "InvalidGreeting")?;
         462  +
        if let ::std::option::Option::Some(inner_2) = &self.message {
         463  +
            {
         464  +
                ::std::write!(f, ": {inner_2}")?;
         465  +
            }
  373    466   
        }
         467  +
        Ok(())
  374    468   
    }
  375    469   
}
  376         -
impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonEnumsError {
  377         -
    fn from(variant: crate::error::ValidationException) -> crate::error::JsonEnumsError {
  378         -
        Self::ValidationException(variant)
         470  +
impl ::std::error::Error for InvalidGreeting {}
         471  +
impl InvalidGreeting {
         472  +
    /// Creates a new builder-style object to manufacture [`InvalidGreeting`](crate::error::InvalidGreeting).
         473  +
    pub fn builder() -> crate::error::invalid_greeting::Builder {
         474  +
        crate::error::invalid_greeting::Builder::default()
  379    475   
    }
  380    476   
}
  381    477   
  382         -
/// Error type for the `KitchenSinkOperation` operation.
  383         -
/// Each variant represents an error that can occur for the `KitchenSinkOperation` operation.
  384         -
#[derive(::std::fmt::Debug)]
  385         -
pub enum KitchenSinkOperationError {
         478  +
/// This error is thrown when a request is invalid.
         479  +
#[derive(
         480  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         481  +
)]
         482  +
pub struct ComplexError {
  386    483   
    #[allow(missing_docs)] // documentation missing in model
  387         -
    ErrorWithMembers(crate::error::ErrorWithMembers),
         484  +
    pub top_level: ::std::option::Option<::std::string::String>,
  388    485   
    #[allow(missing_docs)] // documentation missing in model
  389         -
    ErrorWithoutMembers(crate::error::ErrorWithoutMembers),
         486  +
    pub nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
  390    487   
}
  391         -
impl ::std::fmt::Display for KitchenSinkOperationError {
  392         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  393         -
        match &self {
  394         -
            KitchenSinkOperationError::ErrorWithMembers(_inner) => _inner.fmt(f),
  395         -
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) => _inner.fmt(f),
         488  +
impl ComplexError {
         489  +
    #[allow(missing_docs)] // documentation missing in model
         490  +
    pub fn top_level(&self) -> ::std::option::Option<&str> {
         491  +
        self.top_level.as_deref()
  396    492   
    }
         493  +
    #[allow(missing_docs)] // documentation missing in model
         494  +
    pub fn nested(&self) -> ::std::option::Option<&crate::model::ComplexNestedErrorData> {
         495  +
        self.nested.as_ref()
  397    496   
    }
  398    497   
}
  399         -
impl KitchenSinkOperationError {
  400         -
    /// Returns `true` if the error kind is `KitchenSinkOperationError::ErrorWithMembers`.
  401         -
    pub fn is_error_with_members(&self) -> bool {
  402         -
        matches!(&self, KitchenSinkOperationError::ErrorWithMembers(_))
  403         -
    }
  404         -
    /// Returns `true` if the error kind is `KitchenSinkOperationError::ErrorWithoutMembers`.
  405         -
    pub fn is_error_without_members(&self) -> bool {
  406         -
        matches!(&self, KitchenSinkOperationError::ErrorWithoutMembers(_))
  407         -
    }
  408         -
    /// Returns the error name string by matching the correct variant.
         498  +
impl ComplexError {
         499  +
    #[doc(hidden)]
         500  +
    /// Returns the error name.
  409    501   
    pub fn name(&self) -> &'static str {
  410         -
        match &self {
  411         -
            KitchenSinkOperationError::ErrorWithMembers(_inner) => _inner.name(),
  412         -
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) => _inner.name(),
  413         -
        }
  414         -
    }
  415         -
}
  416         -
impl ::std::error::Error for KitchenSinkOperationError {
  417         -
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  418         -
        match &self {
  419         -
            KitchenSinkOperationError::ErrorWithMembers(_inner) => Some(_inner),
  420         -
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) => Some(_inner),
  421         -
        }
         502  +
        "ComplexError"
  422    503   
    }
  423    504   
}
  424         -
impl ::std::convert::From<crate::error::ErrorWithMembers>
  425         -
    for crate::error::KitchenSinkOperationError
  426         -
{
  427         -
    fn from(variant: crate::error::ErrorWithMembers) -> crate::error::KitchenSinkOperationError {
  428         -
        Self::ErrorWithMembers(variant)
         505  +
impl ::std::fmt::Display for ComplexError {
         506  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         507  +
        ::std::write!(f, "ComplexError")?;
         508  +
        Ok(())
  429    509   
    }
  430    510   
}
  431         -
impl ::std::convert::From<crate::error::ErrorWithoutMembers>
  432         -
    for crate::error::KitchenSinkOperationError
  433         -
{
  434         -
    fn from(variant: crate::error::ErrorWithoutMembers) -> crate::error::KitchenSinkOperationError {
  435         -
        Self::ErrorWithoutMembers(variant)
         511  +
impl ::std::error::Error for ComplexError {}
         512  +
impl ComplexError {
         513  +
    /// Creates a new builder-style object to manufacture [`ComplexError`](crate::error::ComplexError).
         514  +
    pub fn builder() -> crate::error::complex_error::Builder {
         515  +
        crate::error::complex_error::Builder::default()
  436    516   
    }
  437    517   
}
  438    518   
  439         -
#[allow(missing_docs)] // documentation missing in model
         519  +
/// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
  440    520   
#[derive(
  441    521   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  442    522   
)]
  443         -
pub struct ErrorWithoutMembers {}
  444         -
impl ErrorWithoutMembers {
         523  +
pub struct FooError {}
         524  +
impl FooError {
  445    525   
    #[doc(hidden)]
  446    526   
    /// Returns the error name.
  447    527   
    pub fn name(&self) -> &'static str {
  448         -
        "ErrorWithoutMembers"
         528  +
        "FooError"
  449    529   
    }
  450    530   
}
  451         -
impl ::std::fmt::Display for ErrorWithoutMembers {
         531  +
impl ::std::fmt::Display for FooError {
  452    532   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  453         -
        ::std::write!(f, "ErrorWithoutMembers")?;
         533  +
        ::std::write!(f, "FooError")?;
  454    534   
        Ok(())
  455    535   
    }
  456    536   
}
  457         -
impl ::std::error::Error for ErrorWithoutMembers {}
  458         -
impl ErrorWithoutMembers {
  459         -
    /// Creates a new builder-style object to manufacture [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
  460         -
    pub fn builder() -> crate::error::error_without_members::Builder {
  461         -
        crate::error::error_without_members::Builder::default()
         537  +
impl ::std::error::Error for FooError {}
         538  +
impl FooError {
         539  +
    /// Creates a new builder-style object to manufacture [`FooError`](crate::error::FooError).
         540  +
    pub fn builder() -> crate::error::foo_error::Builder {
         541  +
        crate::error::foo_error::Builder::default()
  462    542   
    }
  463    543   
}
         544  +
/// See [`ErrorWithMembers`](crate::error::ErrorWithMembers).
         545  +
pub mod error_with_members {
  464    546   
  465         -
#[allow(missing_docs)] // documentation missing in model
  466         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
  467         -
pub struct ErrorWithMembers {
  468         -
    #[allow(missing_docs)] // documentation missing in model
  469         -
    pub code: ::std::option::Option<::std::string::String>,
  470         -
    #[allow(missing_docs)] // documentation missing in model
  471         -
    pub complex_data: ::std::option::Option<crate::model::KitchenSink>,
  472         -
    #[allow(missing_docs)] // documentation missing in model
  473         -
    pub integer_field: ::std::option::Option<i32>,
  474         -
    #[allow(missing_docs)] // documentation missing in model
  475         -
    pub list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  476         -
    #[allow(missing_docs)] // documentation missing in model
  477         -
    pub map_field: ::std::option::Option<
         547  +
    impl ::std::convert::From<Builder> for crate::error::ErrorWithMembers {
         548  +
        fn from(builder: Builder) -> Self {
         549  +
            builder.build()
         550  +
        }
         551  +
    }
         552  +
    /// A builder for [`ErrorWithMembers`](crate::error::ErrorWithMembers).
         553  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         554  +
    pub struct Builder {
         555  +
        pub(crate) code: ::std::option::Option<::std::string::String>,
         556  +
        pub(crate) complex_data: ::std::option::Option<crate::model::KitchenSink>,
         557  +
        pub(crate) integer_field: ::std::option::Option<i32>,
         558  +
        pub(crate) list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         559  +
        pub(crate) map_field: ::std::option::Option<
  478    560   
            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  479    561   
        >,
         562  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         563  +
        pub(crate) string_field: ::std::option::Option<::std::string::String>,
         564  +
    }
         565  +
    impl Builder {
  480    566   
        #[allow(missing_docs)] // documentation missing in model
  481         -
    pub message: ::std::option::Option<::std::string::String>,
  482         -
    /// abc
  483         -
    pub string_field: ::std::option::Option<::std::string::String>,
  484         -
}
  485         -
impl ErrorWithMembers {
  486         -
    #[allow(missing_docs)] // documentation missing in model
  487         -
    pub fn code(&self) -> ::std::option::Option<&str> {
  488         -
        self.code.as_deref()
         567  +
        pub fn code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         568  +
            self.code = input;
         569  +
            self
  489    570   
        }
  490    571   
        #[allow(missing_docs)] // documentation missing in model
  491         -
    pub fn complex_data(&self) -> ::std::option::Option<&crate::model::KitchenSink> {
  492         -
        self.complex_data.as_ref()
         572  +
        pub fn complex_data(
         573  +
            mut self,
         574  +
            input: ::std::option::Option<crate::model::KitchenSink>,
         575  +
        ) -> Self {
         576  +
            self.complex_data = input;
         577  +
            self
  493    578   
        }
  494    579   
        #[allow(missing_docs)] // documentation missing in model
  495         -
    pub fn integer_field(&self) -> ::std::option::Option<i32> {
  496         -
        self.integer_field
         580  +
        pub fn integer_field(mut self, input: ::std::option::Option<i32>) -> Self {
         581  +
            self.integer_field = input;
         582  +
            self
  497    583   
        }
  498    584   
        #[allow(missing_docs)] // documentation missing in model
  499         -
    pub fn list_field(&self) -> ::std::option::Option<&[::std::string::String]> {
  500         -
        self.list_field.as_deref()
         585  +
        pub fn list_field(
         586  +
            mut self,
         587  +
            input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         588  +
        ) -> Self {
         589  +
            self.list_field = input;
         590  +
            self
  501    591   
        }
  502    592   
        #[allow(missing_docs)] // documentation missing in model
  503    593   
        pub fn map_field(
  504         -
        &self,
  505         -
    ) -> ::std::option::Option<
  506         -
        &::std::collections::HashMap<::std::string::String, ::std::string::String>,
  507         -
    > {
  508         -
        self.map_field.as_ref()
         594  +
            mut self,
         595  +
            input: ::std::option::Option<
         596  +
                ::std::collections::HashMap<::std::string::String, ::std::string::String>,
         597  +
            >,
         598  +
        ) -> Self {
         599  +
            self.map_field = input;
         600  +
            self
         601  +
        }
         602  +
        #[allow(missing_docs)] // documentation missing in model
         603  +
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         604  +
            self.message = input;
         605  +
            self
  509    606   
        }
  510    607   
        /// abc
  511         -
    pub fn string_field(&self) -> ::std::option::Option<&str> {
  512         -
        self.string_field.as_deref()
         608  +
        pub fn string_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         609  +
            self.string_field = input;
         610  +
            self
         611  +
        }
         612  +
        /// Consumes the builder and constructs a [`ErrorWithMembers`](crate::error::ErrorWithMembers).
         613  +
        pub fn build(self) -> crate::error::ErrorWithMembers {
         614  +
            self.build_enforcing_all_constraints()
         615  +
        }
         616  +
        fn build_enforcing_all_constraints(self) -> crate::error::ErrorWithMembers {
         617  +
            crate::error::ErrorWithMembers {
         618  +
                code: self.code,
         619  +
                complex_data: self.complex_data,
         620  +
                integer_field: self.integer_field,
         621  +
                list_field: self.list_field,
         622  +
                map_field: self.map_field,
         623  +
                message: self.message,
         624  +
                string_field: self.string_field,
  513    625   
            }
  514         -
}
  515         -
impl ErrorWithMembers {
  516         -
    /// Returns the error message.
  517         -
    pub fn message(&self) -> ::std::option::Option<&str> {
  518         -
        self.message.as_deref()
  519    626   
        }
  520         -
    #[doc(hidden)]
  521         -
    /// Returns the error name.
  522         -
    pub fn name(&self) -> &'static str {
  523         -
        "ErrorWithMembers"
  524    627   
    }
  525    628   
}
  526         -
impl ::std::fmt::Display for ErrorWithMembers {
  527         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  528         -
        ::std::write!(f, "ErrorWithMembers")?;
  529         -
        if let ::std::option::Option::Some(inner_2) = &self.message {
  530         -
            {
  531         -
                ::std::write!(f, ": {inner_2}")?;
         629  +
/// See [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
         630  +
pub mod error_without_members {
         631  +
         632  +
    impl ::std::convert::From<Builder> for crate::error::ErrorWithoutMembers {
         633  +
        fn from(builder: Builder) -> Self {
         634  +
            builder.build()
  532    635   
        }
  533    636   
    }
  534         -
        Ok(())
         637  +
    /// A builder for [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
         638  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         639  +
    pub struct Builder {}
         640  +
    impl Builder {
         641  +
        /// Consumes the builder and constructs a [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
         642  +
        pub fn build(self) -> crate::error::ErrorWithoutMembers {
         643  +
            self.build_enforcing_all_constraints()
         644  +
        }
         645  +
        fn build_enforcing_all_constraints(self) -> crate::error::ErrorWithoutMembers {
         646  +
            crate::error::ErrorWithoutMembers {}
  535    647   
        }
  536         -
}
  537         -
impl ::std::error::Error for ErrorWithMembers {}
  538         -
impl ErrorWithMembers {
  539         -
    /// Creates a new builder-style object to manufacture [`ErrorWithMembers`](crate::error::ErrorWithMembers).
  540         -
    pub fn builder() -> crate::error::error_with_members::Builder {
  541         -
        crate::error::error_with_members::Builder::default()
  542    648   
    }
  543    649   
}
  544         -
  545    650   
/// See [`ValidationException`](crate::error::ValidationException).
  546    651   
pub mod validation_exception {
  547    652   
  548    653   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  549    654   
    /// Holds one variant for each of the ways the builder can fail.
  550    655   
    #[non_exhaustive]
  551    656   
    #[allow(clippy::enum_variant_names)]
  552    657   
    pub enum ConstraintViolation {
  553    658   
        /// `message` was not provided but it is required when building `ValidationException`.
  554    659   
        MissingMessage,
@@ -579,684 +805,804 @@
  599    704   
        fn build_enforcing_all_constraints(
  600    705   
            self,
  601    706   
        ) -> Result<crate::error::ValidationException, ConstraintViolation> {
  602    707   
            Ok(crate::error::ValidationException {
  603    708   
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  604    709   
                field_list: self.field_list,
  605    710   
            })
  606    711   
        }
  607    712   
    }
  608    713   
}
  609         -
/// See [`FooError`](crate::error::FooError).
  610         -
pub mod foo_error {
         714  +
/// See [`InvalidGreeting`](crate::error::InvalidGreeting).
         715  +
pub mod invalid_greeting {
  611    716   
  612         -
    impl ::std::convert::From<Builder> for crate::error::FooError {
         717  +
    impl ::std::convert::From<Builder> for crate::error::InvalidGreeting {
  613    718   
        fn from(builder: Builder) -> Self {
  614    719   
            builder.build()
  615    720   
        }
  616    721   
    }
  617         -
    /// A builder for [`FooError`](crate::error::FooError).
         722  +
    /// A builder for [`InvalidGreeting`](crate::error::InvalidGreeting).
  618    723   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  619         -
    pub struct Builder {}
         724  +
    pub struct Builder {
         725  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         726  +
    }
  620    727   
    impl Builder {
  621         -
        /// Consumes the builder and constructs a [`FooError`](crate::error::FooError).
  622         -
        pub fn build(self) -> crate::error::FooError {
         728  +
        #[allow(missing_docs)] // documentation missing in model
         729  +
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         730  +
            self.message = input;
         731  +
            self
         732  +
        }
         733  +
        /// Consumes the builder and constructs a [`InvalidGreeting`](crate::error::InvalidGreeting).
         734  +
        pub fn build(self) -> crate::error::InvalidGreeting {
  623    735   
            self.build_enforcing_all_constraints()
  624    736   
        }
  625         -
        fn build_enforcing_all_constraints(self) -> crate::error::FooError {
  626         -
            crate::error::FooError {}
         737  +
        fn build_enforcing_all_constraints(self) -> crate::error::InvalidGreeting {
         738  +
            crate::error::InvalidGreeting {
         739  +
                message: self.message,
         740  +
            }
  627    741   
        }
  628    742   
    }
  629    743   
}
  630    744   
/// See [`ComplexError`](crate::error::ComplexError).
  631    745   
pub mod complex_error {
  632    746   
  633    747   
    impl ::std::convert::From<Builder> for crate::error::ComplexError {
  634    748   
        fn from(builder: Builder) -> Self {
  635    749   
            builder.build()
  636    750   
        }
  637    751   
    }
  638    752   
    /// A builder for [`ComplexError`](crate::error::ComplexError).
  639    753   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  640    754   
    pub struct Builder {
  641    755   
        pub(crate) top_level: ::std::option::Option<::std::string::String>,
  642    756   
        pub(crate) nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
  643    757   
    }
  644    758   
    impl Builder {
  645    759   
        #[allow(missing_docs)] // documentation missing in model
  646    760   
        pub fn top_level(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  647    761   
            self.top_level = input;
  648    762   
            self
  649    763   
        }
  650    764   
        #[allow(missing_docs)] // documentation missing in model
  651    765   
        pub fn nested(
  652    766   
            mut self,
  653    767   
            input: ::std::option::Option<crate::model::ComplexNestedErrorData>,
  654    768   
        ) -> Self {
  655    769   
            self.nested = input;
  656    770   
            self
  657    771   
        }
  658    772   
        /// Consumes the builder and constructs a [`ComplexError`](crate::error::ComplexError).
  659    773   
        pub fn build(self) -> crate::error::ComplexError {
  660    774   
            self.build_enforcing_all_constraints()
  661    775   
        }
  662    776   
        fn build_enforcing_all_constraints(self) -> crate::error::ComplexError {
  663    777   
            crate::error::ComplexError {
  664    778   
                top_level: self.top_level,
  665    779   
                nested: self.nested,
  666    780   
            }
  667    781   
        }
  668    782   
    }
  669    783   
}
  670         -
/// See [`InvalidGreeting`](crate::error::InvalidGreeting).
  671         -
pub mod invalid_greeting {
  672         -
  673         -
    impl ::std::convert::From<Builder> for crate::error::InvalidGreeting {
  674         -
        fn from(builder: Builder) -> Self {
  675         -
            builder.build()
  676         -
        }
  677         -
    }
  678         -
    /// A builder for [`InvalidGreeting`](crate::error::InvalidGreeting).
  679         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  680         -
    pub struct Builder {
  681         -
        pub(crate) message: ::std::option::Option<::std::string::String>,
  682         -
    }
  683         -
    impl Builder {
  684         -
        #[allow(missing_docs)] // documentation missing in model
  685         -
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  686         -
            self.message = input;
  687         -
            self
  688         -
        }
  689         -
        /// Consumes the builder and constructs a [`InvalidGreeting`](crate::error::InvalidGreeting).
  690         -
        pub fn build(self) -> crate::error::InvalidGreeting {
  691         -
            self.build_enforcing_all_constraints()
  692         -
        }
  693         -
        fn build_enforcing_all_constraints(self) -> crate::error::InvalidGreeting {
  694         -
            crate::error::InvalidGreeting {
  695         -
                message: self.message,
  696         -
            }
  697         -
        }
  698         -
    }
  699         -
}
  700         -
/// See [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
  701         -
pub mod error_without_members {
         784  +
/// See [`FooError`](crate::error::FooError).
         785  +
pub mod foo_error {
  702    786   
  703         -
    impl ::std::convert::From<Builder> for crate::error::ErrorWithoutMembers {
         787  +
    impl ::std::convert::From<Builder> for crate::error::FooError {
  704    788   
        fn from(builder: Builder) -> Self {
  705    789   
            builder.build()
  706    790   
        }
  707    791   
    }
  708         -
    /// A builder for [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
         792  +
    /// A builder for [`FooError`](crate::error::FooError).
  709    793   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  710    794   
    pub struct Builder {}
  711    795   
    impl Builder {
  712         -
        /// Consumes the builder and constructs a [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
  713         -
        pub fn build(self) -> crate::error::ErrorWithoutMembers {
  714         -
            self.build_enforcing_all_constraints()
  715         -
        }
  716         -
        fn build_enforcing_all_constraints(self) -> crate::error::ErrorWithoutMembers {
  717         -
            crate::error::ErrorWithoutMembers {}
  718         -
        }
  719         -
    }
  720         -
}
  721         -
/// See [`ErrorWithMembers`](crate::error::ErrorWithMembers).
  722         -
pub mod error_with_members {
  723         -
  724         -
    impl ::std::convert::From<Builder> for crate::error::ErrorWithMembers {
  725         -
        fn from(builder: Builder) -> Self {
  726         -
            builder.build()
  727         -
        }
  728         -
    }
  729         -
    /// A builder for [`ErrorWithMembers`](crate::error::ErrorWithMembers).
  730         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  731         -
    pub struct Builder {
  732         -
        pub(crate) code: ::std::option::Option<::std::string::String>,
  733         -
        pub(crate) complex_data: ::std::option::Option<crate::model::KitchenSink>,
  734         -
        pub(crate) integer_field: ::std::option::Option<i32>,
  735         -
        pub(crate) list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  736         -
        pub(crate) map_field: ::std::option::Option<
  737         -
            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  738         -
        >,
  739         -
        pub(crate) message: ::std::option::Option<::std::string::String>,
  740         -
        pub(crate) string_field: ::std::option::Option<::std::string::String>,
  741         -
    }
  742         -
    impl Builder {
  743         -
        #[allow(missing_docs)] // documentation missing in model
  744         -
        pub fn code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  745         -
            self.code = input;
  746         -
            self
  747         -
        }
  748         -
        #[allow(missing_docs)] // documentation missing in model
  749         -
        pub fn complex_data(
  750         -
            mut self,
  751         -
            input: ::std::option::Option<crate::model::KitchenSink>,
  752         -
        ) -> Self {
  753         -
            self.complex_data = input;
  754         -
            self
  755         -
        }
  756         -
        #[allow(missing_docs)] // documentation missing in model
  757         -
        pub fn integer_field(mut self, input: ::std::option::Option<i32>) -> Self {
  758         -
            self.integer_field = input;
  759         -
            self
  760         -
        }
  761         -
        #[allow(missing_docs)] // documentation missing in model
  762         -
        pub fn list_field(
  763         -
            mut self,
  764         -
            input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  765         -
        ) -> Self {
  766         -
            self.list_field = input;
  767         -
            self
  768         -
        }
  769         -
        #[allow(missing_docs)] // documentation missing in model
  770         -
        pub fn map_field(
  771         -
            mut self,
  772         -
            input: ::std::option::Option<
  773         -
                ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  774         -
            >,
  775         -
        ) -> Self {
  776         -
            self.map_field = input;
  777         -
            self
  778         -
        }
  779         -
        #[allow(missing_docs)] // documentation missing in model
  780         -
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  781         -
            self.message = input;
  782         -
            self
  783         -
        }
  784         -
        /// abc
  785         -
        pub fn string_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  786         -
            self.string_field = input;
  787         -
            self
  788         -
        }
  789         -
        /// Consumes the builder and constructs a [`ErrorWithMembers`](crate::error::ErrorWithMembers).
  790         -
        pub fn build(self) -> crate::error::ErrorWithMembers {
         796  +
        /// Consumes the builder and constructs a [`FooError`](crate::error::FooError).
         797  +
        pub fn build(self) -> crate::error::FooError {
  791    798   
            self.build_enforcing_all_constraints()
  792    799   
        }
  793         -
        fn build_enforcing_all_constraints(self) -> crate::error::ErrorWithMembers {
  794         -
            crate::error::ErrorWithMembers {
  795         -
                code: self.code,
  796         -
                complex_data: self.complex_data,
  797         -
                integer_field: self.integer_field,
  798         -
                list_field: self.list_field,
  799         -
                map_field: self.map_field,
  800         -
                message: self.message,
  801         -
                string_field: self.string_field,
  802         -
            }
         800  +
        fn build_enforcing_all_constraints(self) -> crate::error::FooError {
         801  +
            crate::error::FooError {}
  803    802   
        }
  804    803   
    }
  805    804   
}