Server Test

Server Test

rev. d838bf488731ae5e751cce0fe13f339a5b9be858 (ignoring whitespace)

Files changed:

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

@@ -1,1 +152,152 @@
    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         -
pub struct GetObject;
           3  +
pub struct ListObjectsV2;
    4      4   
    5         -
impl ::aws_smithy_http_server::operation::OperationShape for GetObject {
           5  +
impl ::aws_smithy_http_server::operation::OperationShape for ListObjectsV2 {
    6      6   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
    7      7   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
    8         -
            "com.amazonaws.s3#GetObject",
           8  +
            "com.amazonaws.s3#ListObjectsV2",
    9      9   
            "com.amazonaws.s3",
   10         -
            "GetObject",
          10  +
            "ListObjectsV2",
   11     11   
        );
   12     12   
   13         -
    type Input = crate::input::GetObjectInput;
   14         -
    type Output = crate::output::GetObjectOutput;
   15         -
    type Error = crate::error::GetObjectError;
          13  +
    type Input = crate::input::ListObjectsV2Input;
          14  +
    type Output = crate::output::ListObjectsV2Output;
          15  +
    type Error = crate::error::ListObjectsV2Error;
   16     16   
}
   17     17   
   18         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for GetObject {
          18  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for ListObjectsV2 {
   19     19   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   20     20   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   21     21   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   22     22   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   23     23   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   24     24   
        >,
   25     25   
    >;
   26     26   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
   27     27   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   28     28   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   29     29   
    >;
   30     30   
   31     31   
    fn request_fmt() -> Self::RequestFmt {
   32     32   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   33     33   
    }
   34     34   
   35     35   
    fn response_fmt() -> Self::ResponseFmt {
   36     36   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   37     37   
    }
   38     38   
}
   39     39   
   40     40   
#[allow(missing_docs)] // documentation missing in model
   41         -
pub struct DeleteObjectTagging;
          41  +
pub struct GetBucketLocation;
   42     42   
   43         -
impl ::aws_smithy_http_server::operation::OperationShape for DeleteObjectTagging {
          43  +
impl ::aws_smithy_http_server::operation::OperationShape for GetBucketLocation {
   44     44   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   45     45   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
   46         -
            "com.amazonaws.s3#DeleteObjectTagging",
          46  +
            "com.amazonaws.s3#GetBucketLocation",
   47     47   
            "com.amazonaws.s3",
   48         -
            "DeleteObjectTagging",
          48  +
            "GetBucketLocation",
   49     49   
        );
   50     50   
   51         -
    type Input = crate::input::DeleteObjectTaggingInput;
   52         -
    type Output = crate::output::DeleteObjectTaggingOutput;
   53         -
    type Error = crate::error::DeleteObjectTaggingError;
          51  +
    type Input = crate::input::GetBucketLocationInput;
          52  +
    type Output = crate::output::GetBucketLocationOutput;
          53  +
    type Error = crate::error::GetBucketLocationError;
   54     54   
}
   55     55   
   56         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for DeleteObjectTagging {
          56  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for GetBucketLocation {
   57     57   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   58     58   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   59     59   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   60     60   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   61     61   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   62     62   
        >,
   63     63   
    >;
   64     64   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
   65     65   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   66     66   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   67     67   
    >;
   68     68   
   69     69   
    fn request_fmt() -> Self::RequestFmt {
   70     70   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   71     71   
    }
   72     72   
   73     73   
    fn response_fmt() -> Self::ResponseFmt {
   74     74   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   75     75   
    }
   76     76   
}
   77     77   
   78     78   
#[allow(missing_docs)] // documentation missing in model
   79         -
pub struct GetBucketLocation;
          79  +
pub struct DeleteObjectTagging;
   80     80   
   81         -
impl ::aws_smithy_http_server::operation::OperationShape for GetBucketLocation {
          81  +
impl ::aws_smithy_http_server::operation::OperationShape for DeleteObjectTagging {
   82     82   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   83     83   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
   84         -
            "com.amazonaws.s3#GetBucketLocation",
          84  +
            "com.amazonaws.s3#DeleteObjectTagging",
   85     85   
            "com.amazonaws.s3",
   86         -
            "GetBucketLocation",
          86  +
            "DeleteObjectTagging",
   87     87   
        );
   88     88   
   89         -
    type Input = crate::input::GetBucketLocationInput;
   90         -
    type Output = crate::output::GetBucketLocationOutput;
   91         -
    type Error = crate::error::GetBucketLocationError;
          89  +
    type Input = crate::input::DeleteObjectTaggingInput;
          90  +
    type Output = crate::output::DeleteObjectTaggingOutput;
          91  +
    type Error = crate::error::DeleteObjectTaggingError;
   92     92   
}
   93     93   
   94         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for GetBucketLocation {
          94  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for DeleteObjectTagging {
   95     95   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   96     96   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   97     97   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   98     98   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   99     99   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  100    100   
        >,
  101    101   
    >;
  102    102   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  103    103   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  104    104   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  105    105   
    >;
  106    106   
  107    107   
    fn request_fmt() -> Self::RequestFmt {
  108    108   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  109    109   
    }
  110    110   
  111    111   
    fn response_fmt() -> Self::ResponseFmt {
  112    112   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  113    113   
    }
  114    114   
}
  115    115   
  116    116   
#[allow(missing_docs)] // documentation missing in model
  117         -
pub struct ListObjectsV2;
         117  +
pub struct GetObject;
  118    118   
  119         -
impl ::aws_smithy_http_server::operation::OperationShape for ListObjectsV2 {
         119  +
impl ::aws_smithy_http_server::operation::OperationShape for GetObject {
  120    120   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  121    121   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  122         -
            "com.amazonaws.s3#ListObjectsV2",
         122  +
            "com.amazonaws.s3#GetObject",
  123    123   
            "com.amazonaws.s3",
  124         -
            "ListObjectsV2",
         124  +
            "GetObject",
  125    125   
        );
  126    126   
  127         -
    type Input = crate::input::ListObjectsV2Input;
  128         -
    type Output = crate::output::ListObjectsV2Output;
  129         -
    type Error = crate::error::ListObjectsV2Error;
         127  +
    type Input = crate::input::GetObjectInput;
         128  +
    type Output = crate::output::GetObjectOutput;
         129  +
    type Error = crate::error::GetObjectError;
  130    130   
}
  131    131   
  132         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for ListObjectsV2 {
         132  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for GetObject {
  133    133   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  134    134   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  135    135   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  136    136   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  137    137   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  138    138   
        >,
  139    139   
    >;
  140    140   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  141    141   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  142    142   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,

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

@@ -1,1 +87,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    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 GetObjectOutput {}
    7         -
impl GetObjectOutput {
    8         -
    /// Creates a new builder-style object to manufacture [`GetObjectOutput`](crate::output::GetObjectOutput).
    9         -
    pub fn builder() -> crate::output::get_object_output::Builder {
   10         -
        crate::output::get_object_output::Builder::default()
   11         -
    }
   12         -
}
   13         -
   14         -
#[allow(missing_docs)] // documentation missing in model
   15         -
#[derive(
   16         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   17         -
)]
   18         -
pub struct DeleteObjectTaggingOutput {
   19         -
    #[allow(missing_docs)] // documentation missing in model
   20         -
    pub version_id: ::std::option::Option<::std::string::String>,
   21         -
}
   22         -
impl DeleteObjectTaggingOutput {
   23         -
    #[allow(missing_docs)] // documentation missing in model
   24         -
    pub fn version_id(&self) -> ::std::option::Option<&str> {
   25         -
        self.version_id.as_deref()
   26         -
    }
   27         -
}
   28         -
impl DeleteObjectTaggingOutput {
   29         -
    /// Creates a new builder-style object to manufacture [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
   30         -
    pub fn builder() -> crate::output::delete_object_tagging_output::Builder {
   31         -
        crate::output::delete_object_tagging_output::Builder::default()
   32         -
    }
   33         -
}
   34         -
   35         -
#[allow(missing_docs)] // documentation missing in model
   36         -
#[derive(
   37         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   38         -
)]
   39         -
pub struct GetBucketLocationOutput {
   40         -
    #[allow(missing_docs)] // documentation missing in model
   41         -
    pub location_constraint: ::std::option::Option<crate::model::BucketLocationConstraint>,
   42         -
}
   43         -
impl GetBucketLocationOutput {
   44         -
    #[allow(missing_docs)] // documentation missing in model
   45         -
    pub fn location_constraint(
   46         -
        &self,
   47         -
    ) -> ::std::option::Option<&crate::model::BucketLocationConstraint> {
   48         -
        self.location_constraint.as_ref()
   49         -
    }
   50         -
}
   51         -
impl GetBucketLocationOutput {
   52         -
    /// Creates a new builder-style object to manufacture [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
   53         -
    pub fn builder() -> crate::output::get_bucket_location_output::Builder {
   54         -
        crate::output::get_bucket_location_output::Builder::default()
   55         -
    }
   56         -
}
   57         -
   58      2   
#[allow(missing_docs)] // documentation missing in model
   59      3   
#[derive(
   60      4   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   61      5   
)]
   62      6   
pub struct ListObjectsV2Output {
   63      7   
    #[allow(missing_docs)] // documentation missing in model
   64      8   
    pub is_truncated: ::std::option::Option<bool>,
   65      9   
    #[allow(missing_docs)] // documentation missing in model
   66     10   
    pub contents: ::std::option::Option<::std::vec::Vec<crate::model::Object>>,
   67     11   
    #[allow(missing_docs)] // documentation missing in model
@@ -114,58 +256,171 @@
  134     78   
    pub fn start_after(&self) -> ::std::option::Option<&str> {
  135     79   
        self.start_after.as_deref()
  136     80   
    }
  137     81   
}
  138     82   
impl ListObjectsV2Output {
  139     83   
    /// Creates a new builder-style object to manufacture [`ListObjectsV2Output`](crate::output::ListObjectsV2Output).
  140     84   
    pub fn builder() -> crate::output::list_objects_v2_output::Builder {
  141     85   
        crate::output::list_objects_v2_output::Builder::default()
  142     86   
    }
  143     87   
}
  144         -
/// See [`GetObjectOutput`](crate::output::GetObjectOutput).
  145         -
pub mod get_object_output {
  146     88   
  147         -
    impl ::std::convert::From<Builder> for crate::output::GetObjectOutput {
  148         -
        fn from(builder: Builder) -> Self {
  149         -
            builder.build()
  150         -
        }
  151         -
    }
  152         -
    /// A builder for [`GetObjectOutput`](crate::output::GetObjectOutput).
  153         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  154         -
    pub struct Builder {}
  155         -
    impl Builder {
  156         -
        /// Consumes the builder and constructs a [`GetObjectOutput`](crate::output::GetObjectOutput).
  157         -
        pub fn build(self) -> crate::output::GetObjectOutput {
  158         -
            self.build_enforcing_all_constraints()
  159         -
        }
  160         -
        fn build_enforcing_all_constraints(self) -> crate::output::GetObjectOutput {
  161         -
            crate::output::GetObjectOutput {}
  162         -
        }
  163         -
    }
          89  +
#[allow(missing_docs)] // documentation missing in model
          90  +
#[derive(
          91  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          92  +
)]
          93  +
pub struct GetBucketLocationOutput {
          94  +
    #[allow(missing_docs)] // documentation missing in model
          95  +
    pub location_constraint: ::std::option::Option<crate::model::BucketLocationConstraint>,
  164     96   
}
  165         -
/// See [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
  166         -
pub mod delete_object_tagging_output {
  167         -
  168         -
    impl ::std::convert::From<Builder> for crate::output::DeleteObjectTaggingOutput {
  169         -
        fn from(builder: Builder) -> Self {
  170         -
            builder.build()
  171         -
        }
  172         -
    }
  173         -
    /// A builder for [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
  174         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  175         -
    pub struct Builder {
  176         -
        pub(crate) version_id: ::std::option::Option<::std::string::String>,
  177         -
    }
  178         -
    impl Builder {
          97  +
impl GetBucketLocationOutput {
  179     98   
    #[allow(missing_docs)] // documentation missing in model
  180         -
        pub fn version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  181         -
            self.version_id = input;
  182         -
            self
  183         -
        }
  184         -
        /// Consumes the builder and constructs a [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
  185         -
        pub fn build(self) -> crate::output::DeleteObjectTaggingOutput {
  186         -
            self.build_enforcing_all_constraints()
  187         -
        }
  188         -
        fn build_enforcing_all_constraints(self) -> crate::output::DeleteObjectTaggingOutput {
  189         -
            crate::output::DeleteObjectTaggingOutput {
  190         -
                version_id: self.version_id,
  191         -
            }
          99  +
    pub fn location_constraint(
         100  +
        &self,
         101  +
    ) -> ::std::option::Option<&crate::model::BucketLocationConstraint> {
         102  +
        self.location_constraint.as_ref()
  192    103   
    }
         104  +
}
         105  +
impl GetBucketLocationOutput {
         106  +
    /// Creates a new builder-style object to manufacture [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
         107  +
    pub fn builder() -> crate::output::get_bucket_location_output::Builder {
         108  +
        crate::output::get_bucket_location_output::Builder::default()
  193    109   
    }
  194    110   
}
  195         -
/// See [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
  196         -
pub mod get_bucket_location_output {
  197    111   
  198         -
    impl ::std::convert::From<Builder> for crate::output::GetBucketLocationOutput {
  199         -
        fn from(builder: Builder) -> Self {
  200         -
            builder.build()
  201         -
        }
  202         -
    }
  203         -
    /// A builder for [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
  204         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  205         -
    pub struct Builder {
  206         -
        pub(crate) location_constraint:
  207         -
            ::std::option::Option<crate::model::BucketLocationConstraint>,
  208         -
    }
  209         -
    impl Builder {
         112  +
#[allow(missing_docs)] // documentation missing in model
         113  +
#[derive(
         114  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         115  +
)]
         116  +
pub struct DeleteObjectTaggingOutput {
  210    117   
    #[allow(missing_docs)] // documentation missing in model
  211         -
        pub fn location_constraint(
  212         -
            mut self,
  213         -
            input: ::std::option::Option<crate::model::BucketLocationConstraint>,
  214         -
        ) -> Self {
  215         -
            self.location_constraint = input;
  216         -
            self
  217         -
        }
  218         -
        /// Consumes the builder and constructs a [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
  219         -
        pub fn build(self) -> crate::output::GetBucketLocationOutput {
  220         -
            self.build_enforcing_all_constraints()
  221         -
        }
  222         -
        fn build_enforcing_all_constraints(self) -> crate::output::GetBucketLocationOutput {
  223         -
            crate::output::GetBucketLocationOutput {
  224         -
                location_constraint: self.location_constraint,
         118  +
    pub version_id: ::std::option::Option<::std::string::String>,
         119  +
}
         120  +
impl DeleteObjectTaggingOutput {
         121  +
    #[allow(missing_docs)] // documentation missing in model
         122  +
    pub fn version_id(&self) -> ::std::option::Option<&str> {
         123  +
        self.version_id.as_deref()
  225    124   
    }
         125  +
}
         126  +
impl DeleteObjectTaggingOutput {
         127  +
    /// Creates a new builder-style object to manufacture [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
         128  +
    pub fn builder() -> crate::output::delete_object_tagging_output::Builder {
         129  +
        crate::output::delete_object_tagging_output::Builder::default()
  226    130   
    }
         131  +
}
         132  +
         133  +
#[allow(missing_docs)] // documentation missing in model
         134  +
#[derive(
         135  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
         136  +
)]
         137  +
pub struct GetObjectOutput {}
         138  +
impl GetObjectOutput {
         139  +
    /// Creates a new builder-style object to manufacture [`GetObjectOutput`](crate::output::GetObjectOutput).
         140  +
    pub fn builder() -> crate::output::get_object_output::Builder {
         141  +
        crate::output::get_object_output::Builder::default()
  227    142   
    }
  228    143   
}
  229    144   
/// See [`ListObjectsV2Output`](crate::output::ListObjectsV2Output).
  230    145   
pub mod list_objects_v2_output {
  231    146   
  232    147   
    impl ::std::convert::From<Builder> for crate::output::ListObjectsV2Output {
  233    148   
        fn from(builder: Builder) -> Self {
  234    149   
            builder.build()
  235    150   
        }
  236    151   
    }
@@ -322,237 +0,351 @@
  342    257   
                common_prefixes: self.common_prefixes,
  343    258   
                encoding_type: self.encoding_type,
  344    259   
                key_count: self.key_count,
  345    260   
                continuation_token: self.continuation_token,
  346    261   
                next_continuation_token: self.next_continuation_token,
  347    262   
                start_after: self.start_after,
  348    263   
            }
  349    264   
        }
  350    265   
    }
  351    266   
}
         267  +
/// See [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
         268  +
pub mod get_bucket_location_output {
         269  +
         270  +
    impl ::std::convert::From<Builder> for crate::output::GetBucketLocationOutput {
         271  +
        fn from(builder: Builder) -> Self {
         272  +
            builder.build()
         273  +
        }
         274  +
    }
         275  +
    /// A builder for [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
         276  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         277  +
    pub struct Builder {
         278  +
        pub(crate) location_constraint:
         279  +
            ::std::option::Option<crate::model::BucketLocationConstraint>,
         280  +
    }
         281  +
    impl Builder {
         282  +
        #[allow(missing_docs)] // documentation missing in model
         283  +
        pub fn location_constraint(
         284  +
            mut self,
         285  +
            input: ::std::option::Option<crate::model::BucketLocationConstraint>,
         286  +
        ) -> Self {
         287  +
            self.location_constraint = input;
         288  +
            self
         289  +
        }
         290  +
        /// Consumes the builder and constructs a [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
         291  +
        pub fn build(self) -> crate::output::GetBucketLocationOutput {
         292  +
            self.build_enforcing_all_constraints()
         293  +
        }
         294  +
        fn build_enforcing_all_constraints(self) -> crate::output::GetBucketLocationOutput {
         295  +
            crate::output::GetBucketLocationOutput {
         296  +
                location_constraint: self.location_constraint,
         297  +
            }
         298  +
        }
         299  +
    }
         300  +
}
         301  +
/// See [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
         302  +
pub mod delete_object_tagging_output {
         303  +
         304  +
    impl ::std::convert::From<Builder> for crate::output::DeleteObjectTaggingOutput {
         305  +
        fn from(builder: Builder) -> Self {
         306  +
            builder.build()
         307  +
        }
         308  +
    }
         309  +
    /// A builder for [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
         310  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         311  +
    pub struct Builder {
         312  +
        pub(crate) version_id: ::std::option::Option<::std::string::String>,
         313  +
    }
         314  +
    impl Builder {
         315  +
        #[allow(missing_docs)] // documentation missing in model
         316  +
        pub fn version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         317  +
            self.version_id = input;
         318  +
            self
         319  +
        }
         320  +
        /// Consumes the builder and constructs a [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
         321  +
        pub fn build(self) -> crate::output::DeleteObjectTaggingOutput {
         322  +
            self.build_enforcing_all_constraints()
         323  +
        }
         324  +
        fn build_enforcing_all_constraints(self) -> crate::output::DeleteObjectTaggingOutput {
         325  +
            crate::output::DeleteObjectTaggingOutput {
         326  +
                version_id: self.version_id,
         327  +
            }
         328  +
        }
         329  +
    }
         330  +
}
         331  +
/// See [`GetObjectOutput`](crate::output::GetObjectOutput).
         332  +
pub mod get_object_output {
         333  +
         334  +
    impl ::std::convert::From<Builder> for crate::output::GetObjectOutput {
         335  +
        fn from(builder: Builder) -> Self {
         336  +
            builder.build()
         337  +
        }
         338  +
    }
         339  +
    /// A builder for [`GetObjectOutput`](crate::output::GetObjectOutput).
         340  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         341  +
    pub struct Builder {}
         342  +
    impl Builder {
         343  +
        /// Consumes the builder and constructs a [`GetObjectOutput`](crate::output::GetObjectOutput).
         344  +
        pub fn build(self) -> crate::output::GetObjectOutput {
         345  +
            self.build_enforcing_all_constraints()
         346  +
        }
         347  +
        fn build_enforcing_all_constraints(self) -> crate::output::GetObjectOutput {
         348  +
            crate::output::GetObjectOutput {}
         349  +
        }
         350  +
    }
         351  +
}

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

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

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

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

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

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

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

@@ -1,1 +61,107 @@
    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.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
///
           4  +
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
           5  +
/// [constraint traits]. Use [`SimpleSet::try_from`] to construct values of this type.
           6  +
///
           7  +
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
           8  +
///
    4      9   
#[derive(
    5     10   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    6     11   
)]
    7         -
pub struct ValidationExceptionField {
    8         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
    9         -
    pub path: ::std::string::String,
   10         -
    /// A detailed description of the validation failure.
   11         -
    pub message: ::std::string::String,
   12         -
}
   13         -
impl ValidationExceptionField {
   14         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   15         -
    pub fn path(&self) -> &str {
   16         -
        use std::ops::Deref;
   17         -
        self.path.deref()
          12  +
pub struct SimpleSet(pub(crate) ::std::vec::Vec<::std::string::String>);
          13  +
impl SimpleSet {
          14  +
    /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
          15  +
    pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
          16  +
        &self.0
          17  +
    }
          18  +
    /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
          19  +
    pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
          20  +
        self.0
          21  +
    }
          22  +
          23  +
    fn check_unique_items(
          24  +
        items: ::std::vec::Vec<::std::string::String>,
          25  +
    ) -> ::std::result::Result<
          26  +
        ::std::vec::Vec<::std::string::String>,
          27  +
        crate::model::simple_set::ConstraintViolation,
          28  +
    > {
          29  +
        let mut seen = ::std::collections::HashMap::new();
          30  +
        let mut duplicate_indices = ::std::vec::Vec::new();
          31  +
        for (idx, item) in items.iter().enumerate() {
          32  +
            if let Some(prev_idx) = seen.insert(item, idx) {
          33  +
                duplicate_indices.push(prev_idx);
          34  +
            }
          35  +
        }
          36  +
          37  +
        let mut last_duplicate_indices = ::std::vec::Vec::new();
          38  +
        for idx in &duplicate_indices {
          39  +
            if let Some(prev_idx) = seen.remove(&items[*idx]) {
          40  +
                last_duplicate_indices.push(prev_idx);
          41  +
            }
          42  +
        }
          43  +
        duplicate_indices.extend(last_duplicate_indices);
          44  +
          45  +
        if !duplicate_indices.is_empty() {
          46  +
            debug_assert!(duplicate_indices.len() >= 2);
          47  +
            Err(crate::model::simple_set::ConstraintViolation::UniqueItems {
          48  +
                duplicate_indices,
          49  +
                original: items,
          50  +
            })
          51  +
        } else {
          52  +
            Ok(items)
   18     53   
        }
   19         -
    /// A detailed description of the validation failure.
   20         -
    pub fn message(&self) -> &str {
   21         -
        use std::ops::Deref;
   22         -
        self.message.deref()
   23     54   
    }
   24     55   
}
   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()
          56  +
impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for SimpleSet {
          57  +
    type Error = crate::model::simple_set::ConstraintViolation;
          58  +
          59  +
    /// Constructs a `SimpleSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
          60  +
    fn try_from(
          61  +
        value: ::std::vec::Vec<::std::string::String>,
          62  +
    ) -> ::std::result::Result<Self, Self::Error> {
          63  +
        let value = Self::check_unique_items(value)?;
          64  +
          65  +
        Ok(Self(value))
   29     66   
    }
   30     67   
}
   31     68   
          69  +
impl ::std::convert::From<SimpleSet> for ::std::vec::Vec<::std::string::String> {
          70  +
    fn from(value: SimpleSet) -> Self {
          71  +
        value.into_inner()
          72  +
    }
          73  +
}
          74  +
impl crate::constrained::Constrained for SimpleSet {
          75  +
    type Unconstrained = crate::unconstrained::simple_set_unconstrained::SimpleSetUnconstrained;
          76  +
}
          77  +
   32     78   
#[allow(missing_docs)] // documentation missing in model
   33     79   
///
   34     80   
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
   35     81   
/// [constraint traits]. Use [`ComplexSet::try_from`] to construct values of this type.
   36     82   
///
   37     83   
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
   38     84   
///
   39     85   
#[derive(
   40     86   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   41     87   
)]
@@ -110,156 +306,285 @@
  130    176   
impl ComplexSetStruct {
  131    177   
    /// Creates a new builder-style object to manufacture [`ComplexSetStruct`](crate::model::ComplexSetStruct).
  132    178   
    pub fn builder() -> crate::model::complex_set_struct::Builder {
  133    179   
        crate::model::complex_set_struct::Builder::default()
  134    180   
    }
  135    181   
}
  136    182   
impl crate::constrained::Constrained for crate::model::ComplexSetStruct {
  137    183   
    type Unconstrained = crate::model::complex_set_struct::Builder;
  138    184   
}
  139    185   
  140         -
#[allow(missing_docs)] // documentation missing in model
  141         -
///
  142         -
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
  143         -
/// [constraint traits]. Use [`SimpleSet::try_from`] to construct values of this type.
  144         -
///
  145         -
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
  146         -
///
         186  +
/// Describes one specific validation failure for an input member.
  147    187   
#[derive(
  148    188   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  149    189   
)]
  150         -
pub struct SimpleSet(pub(crate) ::std::vec::Vec<::std::string::String>);
  151         -
impl SimpleSet {
  152         -
    /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
  153         -
    pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
  154         -
        &self.0
  155         -
    }
  156         -
    /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
  157         -
    pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
  158         -
        self.0
  159         -
    }
  160         -
  161         -
    fn check_unique_items(
  162         -
        items: ::std::vec::Vec<::std::string::String>,
  163         -
    ) -> ::std::result::Result<
  164         -
        ::std::vec::Vec<::std::string::String>,
  165         -
        crate::model::simple_set::ConstraintViolation,
  166         -
    > {
  167         -
        let mut seen = ::std::collections::HashMap::new();
  168         -
        let mut duplicate_indices = ::std::vec::Vec::new();
  169         -
        for (idx, item) in items.iter().enumerate() {
  170         -
            if let Some(prev_idx) = seen.insert(item, idx) {
  171         -
                duplicate_indices.push(prev_idx);
  172         -
            }
  173         -
        }
  174         -
  175         -
        let mut last_duplicate_indices = ::std::vec::Vec::new();
  176         -
        for idx in &duplicate_indices {
  177         -
            if let Some(prev_idx) = seen.remove(&items[*idx]) {
  178         -
                last_duplicate_indices.push(prev_idx);
  179         -
            }
  180         -
        }
  181         -
        duplicate_indices.extend(last_duplicate_indices);
  182         -
  183         -
        if !duplicate_indices.is_empty() {
  184         -
            debug_assert!(duplicate_indices.len() >= 2);
  185         -
            Err(crate::model::simple_set::ConstraintViolation::UniqueItems {
  186         -
                duplicate_indices,
  187         -
                original: items,
  188         -
            })
  189         -
        } else {
  190         -
            Ok(items)
  191         -
        }
  192         -
    }
         190  +
pub struct ValidationExceptionField {
         191  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         192  +
    pub path: ::std::string::String,
         193  +
    /// A detailed description of the validation failure.
         194  +
    pub message: ::std::string::String,
  193    195   
}
  194         -
impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for SimpleSet {
  195         -
    type Error = crate::model::simple_set::ConstraintViolation;
  196         -
  197         -
    /// Constructs a `SimpleSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
  198         -
    fn try_from(
  199         -
        value: ::std::vec::Vec<::std::string::String>,
  200         -
    ) -> ::std::result::Result<Self, Self::Error> {
  201         -
        let value = Self::check_unique_items(value)?;
  202         -
  203         -
        Ok(Self(value))
         196  +
impl ValidationExceptionField {
         197  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         198  +
    pub fn path(&self) -> &str {
         199  +
        use std::ops::Deref;
         200  +
        self.path.deref()
  204    201   
    }
  205         -
}
  206         -
  207         -
impl ::std::convert::From<SimpleSet> for ::std::vec::Vec<::std::string::String> {
  208         -
    fn from(value: SimpleSet) -> Self {
  209         -
        value.into_inner()
         202  +
    /// A detailed description of the validation failure.
         203  +
    pub fn message(&self) -> &str {
         204  +
        use std::ops::Deref;
         205  +
        self.message.deref()
  210    206   
    }
  211    207   
}
  212         -
impl crate::constrained::Constrained for SimpleSet {
  213         -
    type Unconstrained = crate::unconstrained::simple_set_unconstrained::SimpleSetUnconstrained;
         208  +
impl ValidationExceptionField {
         209  +
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         210  +
    pub fn builder() -> crate::model::validation_exception_field::Builder {
         211  +
        crate::model::validation_exception_field::Builder::default()
         212  +
    }
  214    213   
}
         214  +
/// See [`SimpleSet`](crate::model::SimpleSet).
         215  +
pub mod simple_set {
  215    216   
  216         -
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  217         -
pub mod validation_exception_field {
  218         -
  219         -
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  220         -
    /// Holds one variant for each of the ways the builder can fail.
  221         -
    #[non_exhaustive]
  222    217   
    #[allow(clippy::enum_variant_names)]
         218  +
    #[derive(Debug, PartialEq)]
  223    219   
    pub enum ConstraintViolation {
  224         -
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
  225         -
        MissingPath,
  226         -
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
  227         -
        MissingMessage,
         220  +
        /// Constraint violation error when the list does not contain unique items
         221  +
        UniqueItems {
         222  +
            /// A vector of indices into `original` pointing to all duplicate items. This vector has
         223  +
            /// at least two elements.
         224  +
            /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
         225  +
            /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
         226  +
            /// Nothing is guaranteed about the order of the indices.
         227  +
            duplicate_indices: ::std::vec::Vec<usize>,
         228  +
            /// The original vector, that contains duplicate items.
         229  +
            original: ::std::vec::Vec<::std::string::String>,
         230  +
        },
  228    231   
    }
         232  +
  229    233   
    impl ::std::fmt::Display for ConstraintViolation {
  230    234   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  231         -
            match self {
  232         -
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
  233         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
  234         -
            }
         235  +
            let message = match self {
         236  +
                                Self::UniqueItems { duplicate_indices, .. } =>
         237  +
                            format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SimpleSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
         238  +
                            };
         239  +
            write!(f, "{message}")
  235    240   
        }
  236    241   
    }
  237         -
    impl ::std::error::Error for ConstraintViolation {}
  238         -
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
  239         -
        type Error = ConstraintViolation;
  240    242   
  241         -
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  242         -
            builder.build()
  243         -
        }
  244         -
    }
  245         -
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  246         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  247         -
    pub struct Builder {
  248         -
        pub(crate) path: ::std::option::Option<::std::string::String>,
  249         -
        pub(crate) message: ::std::option::Option<::std::string::String>,
  250         -
    }
  251         -
    impl Builder {
  252         -
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
  253         -
        pub fn path(mut self, input: ::std::string::String) -> Self {
  254         -
            self.path = Some(input);
  255         -
            self
  256         -
        }
  257         -
        /// A detailed description of the validation failure.
  258         -
        pub fn message(mut self, input: ::std::string::String) -> Self {
  259         -
            self.message = Some(input);
  260         -
            self
  261         -
        }
  262         -
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  263         -
        ///
  264         -
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
  265         -
        ///
  266         -
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
  267         -
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  268         -
            self.build_enforcing_all_constraints()
  269         -
        }
  270         -
        fn build_enforcing_all_constraints(
         243  +
    impl ::std::error::Error for ConstraintViolation {}
         244  +
    impl ConstraintViolation {
         245  +
        pub(crate) fn as_validation_exception_field(
  271    246   
            self,
  272         -
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  273         -
            Ok(crate::model::ValidationExceptionField {
  274         -
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
  275         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  276         -
            })
         247  +
            path: ::std::string::String,
         248  +
        ) -> crate::model::ValidationExceptionField {
         249  +
            match self {
         250  +
                        Self::UniqueItems { duplicate_indices, .. } =>
         251  +
                                crate::model::ValidationExceptionField {
         252  +
                                    message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
         253  +
                                    path,
         254  +
                                },
         255  +
                    }
  277    256   
        }
  278    257   
    }
  279    258   
}
  280    259   
/// See [`ComplexSet`](crate::model::ComplexSet).
  281    260   
pub mod complex_set {
  282    261   
  283    262   
    #[allow(clippy::enum_variant_names)]
  284    263   
    #[derive(Debug, PartialEq)]
  285    264   
    pub enum ConstraintViolation {
  286    265   
        /// Constraint violation error when the list does not contain unique items
@@ -345,324 +419,417 @@
  365    344   
            self.build_enforcing_all_constraints()
  366    345   
        }
  367    346   
        fn build_enforcing_all_constraints(self) -> crate::model::ComplexSetStruct {
  368    347   
            crate::model::ComplexSetStruct {
  369    348   
                foo: self.foo,
  370    349   
                blob: self.blob,
  371    350   
            }
  372    351   
        }
  373    352   
    }
  374    353   
}
  375         -
/// See [`SimpleSet`](crate::model::SimpleSet).
  376         -
pub mod simple_set {
         354  +
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         355  +
pub mod validation_exception_field {
  377    356   
         357  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         358  +
    /// Holds one variant for each of the ways the builder can fail.
         359  +
    #[non_exhaustive]
  378    360   
    #[allow(clippy::enum_variant_names)]
  379         -
    #[derive(Debug, PartialEq)]
  380    361   
    pub enum ConstraintViolation {
  381         -
        /// Constraint violation error when the list does not contain unique items
  382         -
        UniqueItems {
  383         -
            /// A vector of indices into `original` pointing to all duplicate items. This vector has
  384         -
            /// at least two elements.
  385         -
            /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
  386         -
            /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
  387         -
            /// Nothing is guaranteed about the order of the indices.
  388         -
            duplicate_indices: ::std::vec::Vec<usize>,
  389         -
            /// The original vector, that contains duplicate items.
  390         -
            original: ::std::vec::Vec<::std::string::String>,
  391         -
        },
         362  +
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         363  +
        MissingPath,
         364  +
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         365  +
        MissingMessage,
  392    366   
    }
  393         -
  394    367   
    impl ::std::fmt::Display for ConstraintViolation {
  395    368   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  396         -
            let message = match self {
  397         -
                                Self::UniqueItems { duplicate_indices, .. } =>
  398         -
                            format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SimpleSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
  399         -
                            };
  400         -
            write!(f, "{message}")
         369  +
            match self {
         370  +
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         371  +
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         372  +
            }
  401    373   
        }
  402    374   
    }
  403         -
  404    375   
    impl ::std::error::Error for ConstraintViolation {}
  405         -
    impl ConstraintViolation {
  406         -
        pub(crate) fn as_validation_exception_field(
  407         -
            self,
  408         -
            path: ::std::string::String,
  409         -
        ) -> crate::model::ValidationExceptionField {
  410         -
            match self {
  411         -
                        Self::UniqueItems { duplicate_indices, .. } =>
  412         -
                                crate::model::ValidationExceptionField {
  413         -
                                    message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
  414         -
                                    path,
  415         -
                                },
         376  +
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
         377  +
        type Error = ConstraintViolation;
         378  +
         379  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         380  +
            builder.build()
         381  +
        }
         382  +
    }
         383  +
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         384  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         385  +
    pub struct Builder {
         386  +
        pub(crate) path: ::std::option::Option<::std::string::String>,
         387  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         388  +
    }
         389  +
    impl Builder {
         390  +
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         391  +
        pub fn path(mut self, input: ::std::string::String) -> Self {
         392  +
            self.path = Some(input);
         393  +
            self
         394  +
        }
         395  +
        /// A detailed description of the validation failure.
         396  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         397  +
            self.message = Some(input);
         398  +
            self
  416    399   
        }
         400  +
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         401  +
        ///
         402  +
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
         403  +
        ///
         404  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         405  +
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         406  +
            self.build_enforcing_all_constraints()
         407  +
        }
         408  +
        fn build_enforcing_all_constraints(
         409  +
            self,
         410  +
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         411  +
            Ok(crate::model::ValidationExceptionField {
         412  +
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
         413  +
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
         414  +
            })
  417    415   
        }
  418    416   
    }
  419    417   
}

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

@@ -1,1 +44,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
pub(crate) mod complex_set_unconstrained {
           3  +
pub(crate) mod simple_set_unconstrained {
    4      4   
    5      5   
    #[derive(Debug, Clone)]
    6         -
    pub(crate) struct ComplexSetUnconstrained(
    7         -
        pub(crate) std::vec::Vec<crate::model::ComplexSetStruct>,
    8         -
    );
           6  +
    pub(crate) struct SimpleSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
    9      7   
   10         -
    impl From<ComplexSetUnconstrained>
   11         -
        for crate::constrained::MaybeConstrained<crate::model::ComplexSet>
           8  +
    impl From<SimpleSetUnconstrained>
           9  +
        for crate::constrained::MaybeConstrained<crate::model::SimpleSet>
   12     10   
    {
   13         -
        fn from(value: ComplexSetUnconstrained) -> Self {
          11  +
        fn from(value: SimpleSetUnconstrained) -> Self {
   14     12   
            Self::Unconstrained(value)
   15     13   
        }
   16     14   
    }
   17         -
    impl std::convert::TryFrom<ComplexSetUnconstrained> for crate::model::ComplexSet {
   18         -
        type Error = crate::model::complex_set::ConstraintViolation;
   19         -
        fn try_from(value: ComplexSetUnconstrained) -> std::result::Result<Self, Self::Error> {
          15  +
    impl std::convert::TryFrom<SimpleSetUnconstrained> for crate::model::SimpleSet {
          16  +
        type Error = crate::model::simple_set::ConstraintViolation;
          17  +
        fn try_from(value: SimpleSetUnconstrained) -> std::result::Result<Self, Self::Error> {
   20     18   
            let inner = value.0;
   21     19   
            Self::try_from(inner)
   22     20   
        }
   23     21   
    }
   24     22   
}
   25         -
pub(crate) mod simple_set_unconstrained {
          23  +
pub(crate) mod complex_set_unconstrained {
   26     24   
   27     25   
    #[derive(Debug, Clone)]
   28         -
    pub(crate) struct SimpleSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
          26  +
    pub(crate) struct ComplexSetUnconstrained(
          27  +
        pub(crate) std::vec::Vec<crate::model::ComplexSetStruct>,
          28  +
    );
   29     29   
   30         -
    impl From<SimpleSetUnconstrained>
   31         -
        for crate::constrained::MaybeConstrained<crate::model::SimpleSet>
          30  +
    impl From<ComplexSetUnconstrained>
          31  +
        for crate::constrained::MaybeConstrained<crate::model::ComplexSet>
   32     32   
    {
   33         -
        fn from(value: SimpleSetUnconstrained) -> Self {
          33  +
        fn from(value: ComplexSetUnconstrained) -> Self {
   34     34   
            Self::Unconstrained(value)
   35     35   
        }
   36     36   
    }
   37         -
    impl std::convert::TryFrom<SimpleSetUnconstrained> for crate::model::SimpleSet {
   38         -
        type Error = crate::model::simple_set::ConstraintViolation;
   39         -
        fn try_from(value: SimpleSetUnconstrained) -> std::result::Result<Self, Self::Error> {
          37  +
    impl std::convert::TryFrom<ComplexSetUnconstrained> for crate::model::ComplexSet {
          38  +
        type Error = crate::model::complex_set::ConstraintViolation;
          39  +
        fn try_from(value: ComplexSetUnconstrained) -> std::result::Result<Self, Self::Error> {
   40     40   
            let inner = value.0;
   41     41   
            Self::try_from(inner)
   42     42   
        }
   43     43   
    }
   44     44   
}

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

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

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

@@ -1,1 +61,107 @@
    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.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
///
           4  +
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
           5  +
/// [constraint traits]. Use [`SimpleSet::try_from`] to construct values of this type.
           6  +
///
           7  +
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
           8  +
///
    4      9   
#[derive(
    5     10   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    6     11   
)]
    7         -
pub struct ValidationExceptionField {
    8         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
    9         -
    pub path: ::std::string::String,
   10         -
    /// A detailed description of the validation failure.
   11         -
    pub message: ::std::string::String,
   12         -
}
   13         -
impl ValidationExceptionField {
   14         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   15         -
    pub fn path(&self) -> &str {
   16         -
        use std::ops::Deref;
   17         -
        self.path.deref()
          12  +
pub struct SimpleSet(pub(crate) ::std::vec::Vec<::std::string::String>);
          13  +
impl SimpleSet {
          14  +
    /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
          15  +
    pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
          16  +
        &self.0
          17  +
    }
          18  +
    /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
          19  +
    pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
          20  +
        self.0
          21  +
    }
          22  +
          23  +
    fn check_unique_items(
          24  +
        items: ::std::vec::Vec<::std::string::String>,
          25  +
    ) -> ::std::result::Result<
          26  +
        ::std::vec::Vec<::std::string::String>,
          27  +
        crate::model::simple_set::ConstraintViolation,
          28  +
    > {
          29  +
        let mut seen = ::std::collections::HashMap::new();
          30  +
        let mut duplicate_indices = ::std::vec::Vec::new();
          31  +
        for (idx, item) in items.iter().enumerate() {
          32  +
            if let Some(prev_idx) = seen.insert(item, idx) {
          33  +
                duplicate_indices.push(prev_idx);
          34  +
            }
          35  +
        }
          36  +
          37  +
        let mut last_duplicate_indices = ::std::vec::Vec::new();
          38  +
        for idx in &duplicate_indices {
          39  +
            if let Some(prev_idx) = seen.remove(&items[*idx]) {
          40  +
                last_duplicate_indices.push(prev_idx);
          41  +
            }
          42  +
        }
          43  +
        duplicate_indices.extend(last_duplicate_indices);
          44  +
          45  +
        if !duplicate_indices.is_empty() {
          46  +
            debug_assert!(duplicate_indices.len() >= 2);
          47  +
            Err(crate::model::simple_set::ConstraintViolation::UniqueItems {
          48  +
                duplicate_indices,
          49  +
                original: items,
          50  +
            })
          51  +
        } else {
          52  +
            Ok(items)
   18     53   
        }
   19         -
    /// A detailed description of the validation failure.
   20         -
    pub fn message(&self) -> &str {
   21         -
        use std::ops::Deref;
   22         -
        self.message.deref()
   23     54   
    }
   24     55   
}
   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()
          56  +
impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for SimpleSet {
          57  +
    type Error = crate::model::simple_set::ConstraintViolation;
          58  +
          59  +
    /// Constructs a `SimpleSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
          60  +
    fn try_from(
          61  +
        value: ::std::vec::Vec<::std::string::String>,
          62  +
    ) -> ::std::result::Result<Self, Self::Error> {
          63  +
        let value = Self::check_unique_items(value)?;
          64  +
          65  +
        Ok(Self(value))
   29     66   
    }
   30     67   
}
   31     68   
          69  +
impl ::std::convert::From<SimpleSet> for ::std::vec::Vec<::std::string::String> {
          70  +
    fn from(value: SimpleSet) -> Self {
          71  +
        value.into_inner()
          72  +
    }
          73  +
}
          74  +
impl crate::constrained::Constrained for SimpleSet {
          75  +
    type Unconstrained = crate::unconstrained::simple_set_unconstrained::SimpleSetUnconstrained;
          76  +
}
          77  +
   32     78   
#[allow(missing_docs)] // documentation missing in model
   33     79   
///
   34     80   
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
   35     81   
/// [constraint traits]. Use [`ComplexSet::try_from`] to construct values of this type.
   36     82   
///
   37     83   
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
   38     84   
///
   39     85   
#[derive(
   40     86   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   41     87   
)]
@@ -110,156 +306,285 @@
  130    176   
impl ComplexSetStruct {
  131    177   
    /// Creates a new builder-style object to manufacture [`ComplexSetStruct`](crate::model::ComplexSetStruct).
  132    178   
    pub fn builder() -> crate::model::complex_set_struct::Builder {
  133    179   
        crate::model::complex_set_struct::Builder::default()
  134    180   
    }
  135    181   
}
  136    182   
impl crate::constrained::Constrained for crate::model::ComplexSetStruct {
  137    183   
    type Unconstrained = crate::model::complex_set_struct::Builder;
  138    184   
}
  139    185   
  140         -
#[allow(missing_docs)] // documentation missing in model
  141         -
///
  142         -
/// This is a constrained type because its corresponding modeled Smithy shape has one or more
  143         -
/// [constraint traits]. Use [`SimpleSet::try_from`] to construct values of this type.
  144         -
///
  145         -
/// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
  146         -
///
         186  +
/// Describes one specific validation failure for an input member.
  147    187   
#[derive(
  148    188   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  149    189   
)]
  150         -
pub struct SimpleSet(pub(crate) ::std::vec::Vec<::std::string::String>);
  151         -
impl SimpleSet {
  152         -
    /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
  153         -
    pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
  154         -
        &self.0
  155         -
    }
  156         -
    /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
  157         -
    pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
  158         -
        self.0
  159         -
    }
  160         -
  161         -
    fn check_unique_items(
  162         -
        items: ::std::vec::Vec<::std::string::String>,
  163         -
    ) -> ::std::result::Result<
  164         -
        ::std::vec::Vec<::std::string::String>,
  165         -
        crate::model::simple_set::ConstraintViolation,
  166         -
    > {
  167         -
        let mut seen = ::std::collections::HashMap::new();
  168         -
        let mut duplicate_indices = ::std::vec::Vec::new();
  169         -
        for (idx, item) in items.iter().enumerate() {
  170         -
            if let Some(prev_idx) = seen.insert(item, idx) {
  171         -
                duplicate_indices.push(prev_idx);
  172         -
            }
  173         -
        }
  174         -
  175         -
        let mut last_duplicate_indices = ::std::vec::Vec::new();
  176         -
        for idx in &duplicate_indices {
  177         -
            if let Some(prev_idx) = seen.remove(&items[*idx]) {
  178         -
                last_duplicate_indices.push(prev_idx);
  179         -
            }
  180         -
        }
  181         -
        duplicate_indices.extend(last_duplicate_indices);
  182         -
  183         -
        if !duplicate_indices.is_empty() {
  184         -
            debug_assert!(duplicate_indices.len() >= 2);
  185         -
            Err(crate::model::simple_set::ConstraintViolation::UniqueItems {
  186         -
                duplicate_indices,
  187         -
                original: items,
  188         -
            })
  189         -
        } else {
  190         -
            Ok(items)
  191         -
        }
  192         -
    }
         190  +
pub struct ValidationExceptionField {
         191  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         192  +
    pub path: ::std::string::String,
         193  +
    /// A detailed description of the validation failure.
         194  +
    pub message: ::std::string::String,
  193    195   
}
  194         -
impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for SimpleSet {
  195         -
    type Error = crate::model::simple_set::ConstraintViolation;
  196         -
  197         -
    /// Constructs a `SimpleSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
  198         -
    fn try_from(
  199         -
        value: ::std::vec::Vec<::std::string::String>,
  200         -
    ) -> ::std::result::Result<Self, Self::Error> {
  201         -
        let value = Self::check_unique_items(value)?;
  202         -
  203         -
        Ok(Self(value))
         196  +
impl ValidationExceptionField {
         197  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         198  +
    pub fn path(&self) -> &str {
         199  +
        use std::ops::Deref;
         200  +
        self.path.deref()
  204    201   
    }
  205         -
}
  206         -
  207         -
impl ::std::convert::From<SimpleSet> for ::std::vec::Vec<::std::string::String> {
  208         -
    fn from(value: SimpleSet) -> Self {
  209         -
        value.into_inner()
         202  +
    /// A detailed description of the validation failure.
         203  +
    pub fn message(&self) -> &str {
         204  +
        use std::ops::Deref;
         205  +
        self.message.deref()
  210    206   
    }
  211    207   
}
  212         -
impl crate::constrained::Constrained for SimpleSet {
  213         -
    type Unconstrained = crate::unconstrained::simple_set_unconstrained::SimpleSetUnconstrained;
         208  +
impl ValidationExceptionField {
         209  +
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         210  +
    pub fn builder() -> crate::model::validation_exception_field::Builder {
         211  +
        crate::model::validation_exception_field::Builder::default()
         212  +
    }
  214    213   
}
         214  +
/// See [`SimpleSet`](crate::model::SimpleSet).
         215  +
pub mod simple_set {
  215    216   
  216         -
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  217         -
pub mod validation_exception_field {
  218         -
  219         -
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  220         -
    /// Holds one variant for each of the ways the builder can fail.
  221         -
    #[non_exhaustive]
  222    217   
    #[allow(clippy::enum_variant_names)]
         218  +
    #[derive(Debug, PartialEq)]
  223    219   
    pub enum ConstraintViolation {
  224         -
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
  225         -
        MissingPath,
  226         -
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
  227         -
        MissingMessage,
         220  +
        /// Constraint violation error when the list does not contain unique items
         221  +
        UniqueItems {
         222  +
            /// A vector of indices into `original` pointing to all duplicate items. This vector has
         223  +
            /// at least two elements.
         224  +
            /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
         225  +
            /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
         226  +
            /// Nothing is guaranteed about the order of the indices.
         227  +
            duplicate_indices: ::std::vec::Vec<usize>,
         228  +
            /// The original vector, that contains duplicate items.
         229  +
            original: ::std::vec::Vec<::std::string::String>,
         230  +
        },
  228    231   
    }
         232  +
  229    233   
    impl ::std::fmt::Display for ConstraintViolation {
  230    234   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  231         -
            match self {
  232         -
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
  233         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
  234         -
            }
         235  +
            let message = match self {
         236  +
                                Self::UniqueItems { duplicate_indices, .. } =>
         237  +
                            format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SimpleSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
         238  +
                            };
         239  +
            write!(f, "{message}")
  235    240   
        }
  236    241   
    }
  237         -
    impl ::std::error::Error for ConstraintViolation {}
  238         -
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
  239         -
        type Error = ConstraintViolation;
  240    242   
  241         -
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  242         -
            builder.build()
  243         -
        }
  244         -
    }
  245         -
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  246         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  247         -
    pub struct Builder {
  248         -
        pub(crate) path: ::std::option::Option<::std::string::String>,
  249         -
        pub(crate) message: ::std::option::Option<::std::string::String>,
  250         -
    }
  251         -
    impl Builder {
  252         -
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
  253         -
        pub fn path(mut self, input: ::std::string::String) -> Self {
  254         -
            self.path = Some(input);
  255         -
            self
  256         -
        }
  257         -
        /// A detailed description of the validation failure.
  258         -
        pub fn message(mut self, input: ::std::string::String) -> Self {
  259         -
            self.message = Some(input);
  260         -
            self
  261         -
        }
  262         -
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  263         -
        ///
  264         -
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
  265         -
        ///
  266         -
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
  267         -
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  268         -
            self.build_enforcing_all_constraints()
  269         -
        }
  270         -
        fn build_enforcing_all_constraints(
         243  +
    impl ::std::error::Error for ConstraintViolation {}
         244  +
    impl ConstraintViolation {
         245  +
        pub(crate) fn as_validation_exception_field(
  271    246   
            self,
  272         -
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  273         -
            Ok(crate::model::ValidationExceptionField {
  274         -
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
  275         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  276         -
            })
         247  +
            path: ::std::string::String,
         248  +
        ) -> crate::model::ValidationExceptionField {
         249  +
            match self {
         250  +
                        Self::UniqueItems { duplicate_indices, .. } =>
         251  +
                                crate::model::ValidationExceptionField {
         252  +
                                    message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
         253  +
                                    path,
         254  +
                                },
         255  +
                    }
  277    256   
        }
  278    257   
    }
  279    258   
}
  280    259   
/// See [`ComplexSet`](crate::model::ComplexSet).
  281    260   
pub mod complex_set {
  282    261   
  283    262   
    #[allow(clippy::enum_variant_names)]
  284    263   
    #[derive(Debug, PartialEq)]
  285    264   
    pub enum ConstraintViolation {
  286    265   
        /// Constraint violation error when the list does not contain unique items
@@ -345,324 +419,417 @@
  365    344   
            self.build_enforcing_all_constraints()
  366    345   
        }
  367    346   
        fn build_enforcing_all_constraints(self) -> crate::model::ComplexSetStruct {
  368    347   
            crate::model::ComplexSetStruct {
  369    348   
                foo: self.foo,
  370    349   
                blob: self.blob,
  371    350   
            }
  372    351   
        }
  373    352   
    }
  374    353   
}
  375         -
/// See [`SimpleSet`](crate::model::SimpleSet).
  376         -
pub mod simple_set {
         354  +
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         355  +
pub mod validation_exception_field {
  377    356   
         357  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         358  +
    /// Holds one variant for each of the ways the builder can fail.
         359  +
    #[non_exhaustive]
  378    360   
    #[allow(clippy::enum_variant_names)]
  379         -
    #[derive(Debug, PartialEq)]
  380    361   
    pub enum ConstraintViolation {
  381         -
        /// Constraint violation error when the list does not contain unique items
  382         -
        UniqueItems {
  383         -
            /// A vector of indices into `original` pointing to all duplicate items. This vector has
  384         -
            /// at least two elements.
  385         -
            /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
  386         -
            /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
  387         -
            /// Nothing is guaranteed about the order of the indices.
  388         -
            duplicate_indices: ::std::vec::Vec<usize>,
  389         -
            /// The original vector, that contains duplicate items.
  390         -
            original: ::std::vec::Vec<::std::string::String>,
  391         -
        },
         362  +
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         363  +
        MissingPath,
         364  +
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         365  +
        MissingMessage,
  392    366   
    }
  393         -
  394    367   
    impl ::std::fmt::Display for ConstraintViolation {
  395    368   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  396         -
            let message = match self {
  397         -
                                Self::UniqueItems { duplicate_indices, .. } =>
  398         -
                            format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SimpleSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
  399         -
                            };
  400         -
            write!(f, "{message}")
         369  +
            match self {
         370  +
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         371  +
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         372  +
            }
  401    373   
        }
  402    374   
    }
  403         -
  404    375   
    impl ::std::error::Error for ConstraintViolation {}
  405         -
    impl ConstraintViolation {
  406         -
        pub(crate) fn as_validation_exception_field(
  407         -
            self,
  408         -
            path: ::std::string::String,
  409         -
        ) -> crate::model::ValidationExceptionField {
  410         -
            match self {
  411         -
                        Self::UniqueItems { duplicate_indices, .. } =>
  412         -
                                crate::model::ValidationExceptionField {
  413         -
                                    message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
  414         -
                                    path,
  415         -
                                },
         376  +
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
         377  +
        type Error = ConstraintViolation;
         378  +
         379  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         380  +
            builder.build()
         381  +
        }
         382  +
    }
         383  +
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         384  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         385  +
    pub struct Builder {
         386  +
        pub(crate) path: ::std::option::Option<::std::string::String>,
         387  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         388  +
    }
         389  +
    impl Builder {
         390  +
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         391  +
        pub fn path(mut self, input: ::std::string::String) -> Self {
         392  +
            self.path = Some(input);
         393  +
            self
         394  +
        }
         395  +
        /// A detailed description of the validation failure.
         396  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         397  +
            self.message = Some(input);
         398  +
            self
  416    399   
        }
         400  +
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         401  +
        ///
         402  +
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
         403  +
        ///
         404  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         405  +
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         406  +
            self.build_enforcing_all_constraints()
         407  +
        }
         408  +
        fn build_enforcing_all_constraints(
         409  +
            self,
         410  +
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         411  +
            Ok(crate::model::ValidationExceptionField {
         412  +
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
         413  +
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
         414  +
            })
  417    415   
        }
  418    416   
    }
  419    417   
}