Server Test

Server Test

rev. d838bf488731ae5e751cce0fe13f339a5b9be858 (ignoring whitespace)

Files changed:

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

@@ -1,1 +189,189 @@
    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 RpcEcho;
           3  +
pub struct ReservedWordsAsMembers;
    4      4   
    5         -
impl ::aws_smithy_http_server::operation::OperationShape for RpcEcho {
           5  +
impl ::aws_smithy_http_server::operation::OperationShape for ReservedWordsAsMembers {
    6      6   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
    7         -
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#RPCEcho", "crate", "RPCEcho");
           7  +
        ::aws_smithy_http_server::shape_id::ShapeId::new(
           8  +
            "crate#ReservedWordsAsMembers",
           9  +
            "crate",
          10  +
            "ReservedWordsAsMembers",
          11  +
        );
    8     12   
    9         -
    type Input = crate::input::RpcEchoInput;
   10         -
    type Output = crate::output::RpcEchoOutput;
   11         -
    type Error = crate::error::RPCEchoError;
          13  +
    type Input = crate::input::ReservedWordsAsMembersInput;
          14  +
    type Output = crate::output::ReservedWordsAsMembersOutput;
          15  +
    type Error = crate::error::ReservedWordsAsMembersError;
   12     16   
}
   13     17   
   14         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for RpcEcho {
          18  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity
          19  +
    for ReservedWordsAsMembers
          20  +
{
   15     21   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   16     22   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   17     23   
   18     24   
    fn request_fmt() -> Self::RequestFmt {
   19     25   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   20     26   
    }
   21     27   
   22     28   
    fn response_fmt() -> Self::ResponseFmt {
   23     29   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   24     30   
    }
   25     31   
}
   26     32   
   27     33   
#[allow(missing_docs)] // documentation missing in model
   28         -
pub struct Match;
          34  +
pub struct StructureNamePunning;
   29     35   
   30         -
impl ::aws_smithy_http_server::operation::OperationShape for Match {
          36  +
impl ::aws_smithy_http_server::operation::OperationShape for StructureNamePunning {
   31     37   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   32         -
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#Match", "crate", "Match");
          38  +
        ::aws_smithy_http_server::shape_id::ShapeId::new(
          39  +
            "crate#StructureNamePunning",
          40  +
            "crate",
          41  +
            "StructureNamePunning",
          42  +
        );
   33     43   
   34         -
    type Input = crate::input::MatchInput;
   35         -
    type Output = crate::output::MatchOutput;
   36         -
    type Error = crate::error::MatchError;
          44  +
    type Input = crate::input::StructureNamePunningInput;
          45  +
    type Output = crate::output::StructureNamePunningOutput;
          46  +
    type Error = std::convert::Infallible;
   37     47   
}
   38     48   
   39         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Match {
          49  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for StructureNamePunning {
   40     50   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   41     51   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   42     52   
   43     53   
    fn request_fmt() -> Self::RequestFmt {
   44     54   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   45     55   
    }
   46     56   
   47     57   
    fn response_fmt() -> Self::ResponseFmt {
   48     58   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   49     59   
    }
   50     60   
}
   51     61   
   52     62   
#[allow(missing_docs)] // documentation missing in model
   53         -
pub struct Option;
          63  +
pub struct ErrCollisions;
   54     64   
   55         -
impl ::aws_smithy_http_server::operation::OperationShape for Option {
          65  +
impl ::aws_smithy_http_server::operation::OperationShape for ErrCollisions {
   56     66   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   57         -
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#Option", "crate", "Option");
          67  +
        ::aws_smithy_http_server::shape_id::ShapeId::new(
          68  +
            "crate#ErrCollisions",
          69  +
            "crate",
          70  +
            "ErrCollisions",
          71  +
        );
   58     72   
   59         -
    type Input = crate::input::OptionInput;
   60         -
    type Output = crate::output::OptionOutput;
   61         -
    type Error = std::convert::Infallible;
          73  +
    type Input = crate::input::ErrCollisionsInput;
          74  +
    type Output = crate::output::ErrCollisionsOutput;
          75  +
    type Error = crate::error::ErrCollisionsError;
   62     76   
}
   63     77   
   64         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Option {
          78  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for ErrCollisions {
   65     79   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   66     80   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   67     81   
   68     82   
    fn request_fmt() -> Self::RequestFmt {
   69     83   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   70     84   
    }
   71     85   
   72     86   
    fn response_fmt() -> Self::ResponseFmt {
   73     87   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   74     88   
    }
   75     89   
}
   76     90   
   77     91   
#[allow(missing_docs)] // documentation missing in model
   78     92   
pub struct Result;
   79     93   
   80     94   
impl ::aws_smithy_http_server::operation::OperationShape for Result {
   81     95   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   82     96   
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#Result", "crate", "Result");
   83     97   
   84     98   
    type Input = crate::input::ResultInput;
   85     99   
    type Output = crate::output::ResultOutput;
   86    100   
    type Error = std::convert::Infallible;
   87    101   
}
   88    102   
   89    103   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Result {
   90    104   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   91    105   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   92    106   
   93    107   
    fn request_fmt() -> Self::RequestFmt {
   94    108   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   95    109   
    }
   96    110   
   97    111   
    fn response_fmt() -> Self::ResponseFmt {
   98    112   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   99    113   
    }
  100    114   
}
  101    115   
  102    116   
#[allow(missing_docs)] // documentation missing in model
  103         -
pub struct ErrCollisions;
         117  +
pub struct Option;
  104    118   
  105         -
impl ::aws_smithy_http_server::operation::OperationShape for ErrCollisions {
         119  +
impl ::aws_smithy_http_server::operation::OperationShape for Option {
  106    120   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  107         -
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  108         -
            "crate#ErrCollisions",
  109         -
            "crate",
  110         -
            "ErrCollisions",
  111         -
        );
         121  +
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#Option", "crate", "Option");
  112    122   
  113         -
    type Input = crate::input::ErrCollisionsInput;
  114         -
    type Output = crate::output::ErrCollisionsOutput;
  115         -
    type Error = crate::error::ErrCollisionsError;
         123  +
    type Input = crate::input::OptionInput;
         124  +
    type Output = crate::output::OptionOutput;
         125  +
    type Error = std::convert::Infallible;
  116    126   
}
  117    127   
  118         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for ErrCollisions {
         128  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Option {
  119    129   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  120    130   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  121    131   
  122    132   
    fn request_fmt() -> Self::RequestFmt {
  123    133   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  124    134   
    }
  125    135   
  126    136   
    fn response_fmt() -> Self::ResponseFmt {
  127    137   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  128    138   
    }
  129    139   
}
  130    140   
  131    141   
#[allow(missing_docs)] // documentation missing in model
  132         -
pub struct StructureNamePunning;
         142  +
pub struct Match;
  133    143   
  134         -
impl ::aws_smithy_http_server::operation::OperationShape for StructureNamePunning {
         144  +
impl ::aws_smithy_http_server::operation::OperationShape for Match {
  135    145   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  136         -
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  137         -
            "crate#StructureNamePunning",
  138         -
            "crate",
  139         -
            "StructureNamePunning",
  140         -
        );
         146  +
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#Match", "crate", "Match");
  141    147   
  142         -
    type Input = crate::input::StructureNamePunningInput;
  143         -
    type Output = crate::output::StructureNamePunningOutput;
  144         -
    type Error = std::convert::Infallible;
         148  +
    type Input = crate::input::MatchInput;
         149  +
    type Output = crate::output::MatchOutput;
         150  +
    type Error = crate::error::MatchError;
  145    151   
}
  146    152   
  147         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for StructureNamePunning {
         153  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Match {
  148    154   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  149    155   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  150    156   
  151    157   
    fn request_fmt() -> Self::RequestFmt {
  152    158   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  153    159   
    }
  154    160   
  155    161   
    fn response_fmt() -> Self::ResponseFmt {
  156    162   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  157    163   
    }
  158    164   
}
  159    165   
  160    166   
#[allow(missing_docs)] // documentation missing in model
  161         -
pub struct ReservedWordsAsMembers;
         167  +
pub struct RpcEcho;
  162    168   
  163         -
impl ::aws_smithy_http_server::operation::OperationShape for ReservedWordsAsMembers {
         169  +
impl ::aws_smithy_http_server::operation::OperationShape for RpcEcho {
  164    170   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  165         -
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  166         -
            "crate#ReservedWordsAsMembers",
  167         -
            "crate",
  168         -
            "ReservedWordsAsMembers",
  169         -
        );
         171  +
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#RPCEcho", "crate", "RPCEcho");
  170    172   
  171         -
    type Input = crate::input::ReservedWordsAsMembersInput;
  172         -
    type Output = crate::output::ReservedWordsAsMembersOutput;
  173         -
    type Error = crate::error::ReservedWordsAsMembersError;
         173  +
    type Input = crate::input::RpcEchoInput;
         174  +
    type Output = crate::output::RpcEchoOutput;
         175  +
    type Error = crate::error::RPCEchoError;
  174    176   
}
  175    177   
  176         -
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity
  177         -
    for ReservedWordsAsMembers
  178         -
{
         178  +
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for RpcEcho {
  179    179   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  180    180   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  181    181   
  182    182   
    fn request_fmt() -> Self::RequestFmt {
  183    183   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  184    184   
    }
  185    185   
  186    186   
    fn response_fmt() -> Self::ResponseFmt {
  187    187   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  188    188   
    }

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

@@ -1,1 +249,249 @@
    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      3   
#[derive(
    4      4   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5      5   
)]
    6         -
pub struct RpcEchoOutput {}
    7         -
impl RpcEchoOutput {
    8         -
    /// Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
    9         -
    pub fn builder() -> crate::output::rpc_echo_output::Builder {
   10         -
        crate::output::rpc_echo_output::Builder::default()
           6  +
pub struct ReservedWordsAsMembersOutput {}
           7  +
impl ReservedWordsAsMembersOutput {
           8  +
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
           9  +
    pub fn builder() -> crate::output::reserved_words_as_members_output::Builder {
          10  +
        crate::output::reserved_words_as_members_output::Builder::default()
   11     11   
    }
   12     12   
}
   13     13   
   14     14   
#[allow(missing_docs)] // documentation missing in model
   15     15   
#[derive(
   16     16   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   17     17   
)]
   18         -
pub struct MatchOutput {}
   19         -
impl MatchOutput {
   20         -
    /// Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
   21         -
    pub fn builder() -> crate::output::match_output::Builder {
   22         -
        crate::output::match_output::Builder::default()
          18  +
pub struct StructureNamePunningOutput {}
          19  +
impl StructureNamePunningOutput {
          20  +
    /// Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
          21  +
    pub fn builder() -> crate::output::structure_name_punning_output::Builder {
          22  +
        crate::output::structure_name_punning_output::Builder::default()
   23     23   
    }
   24     24   
}
   25     25   
   26     26   
#[allow(missing_docs)] // documentation missing in model
   27     27   
#[derive(
   28     28   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   29     29   
)]
   30         -
pub struct OptionOutput {}
   31         -
impl OptionOutput {
   32         -
    /// Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
   33         -
    pub fn builder() -> crate::output::option_output::Builder {
   34         -
        crate::output::option_output::Builder::default()
          30  +
pub struct ErrCollisionsOutput {}
          31  +
impl ErrCollisionsOutput {
          32  +
    /// Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
          33  +
    pub fn builder() -> crate::output::err_collisions_output::Builder {
          34  +
        crate::output::err_collisions_output::Builder::default()
   35     35   
    }
   36     36   
}
   37     37   
   38     38   
#[allow(missing_docs)] // documentation missing in model
   39     39   
#[derive(
   40     40   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   41     41   
)]
   42     42   
pub struct ResultOutput {
   43     43   
    #[allow(missing_docs)] // documentation missing in model
   44     44   
    pub pv_member: ::std::option::Option<bool>,
   45     45   
}
   46     46   
impl ResultOutput {
   47     47   
    #[allow(missing_docs)] // documentation missing in model
   48     48   
    pub fn pv_member(&self) -> ::std::option::Option<bool> {
   49     49   
        self.pv_member
   50     50   
    }
   51     51   
}
   52     52   
impl ResultOutput {
   53     53   
    /// Creates a new builder-style object to manufacture [`ResultOutput`](crate::output::ResultOutput).
   54     54   
    pub fn builder() -> crate::output::result_output::Builder {
   55     55   
        crate::output::result_output::Builder::default()
   56     56   
    }
   57     57   
}
   58     58   
   59     59   
#[allow(missing_docs)] // documentation missing in model
   60     60   
#[derive(
   61     61   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   62     62   
)]
   63         -
pub struct ErrCollisionsOutput {}
   64         -
impl ErrCollisionsOutput {
   65         -
    /// Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
   66         -
    pub fn builder() -> crate::output::err_collisions_output::Builder {
   67         -
        crate::output::err_collisions_output::Builder::default()
          63  +
pub struct OptionOutput {}
          64  +
impl OptionOutput {
          65  +
    /// Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
          66  +
    pub fn builder() -> crate::output::option_output::Builder {
          67  +
        crate::output::option_output::Builder::default()
   68     68   
    }
   69     69   
}
   70     70   
   71     71   
#[allow(missing_docs)] // documentation missing in model
   72     72   
#[derive(
   73     73   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   74     74   
)]
   75         -
pub struct StructureNamePunningOutput {}
   76         -
impl StructureNamePunningOutput {
   77         -
    /// Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
   78         -
    pub fn builder() -> crate::output::structure_name_punning_output::Builder {
   79         -
        crate::output::structure_name_punning_output::Builder::default()
          75  +
pub struct MatchOutput {}
          76  +
impl MatchOutput {
          77  +
    /// Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
          78  +
    pub fn builder() -> crate::output::match_output::Builder {
          79  +
        crate::output::match_output::Builder::default()
   80     80   
    }
   81     81   
}
   82     82   
   83     83   
#[allow(missing_docs)] // documentation missing in model
   84     84   
#[derive(
   85     85   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   86     86   
)]
   87         -
pub struct ReservedWordsAsMembersOutput {}
   88         -
impl ReservedWordsAsMembersOutput {
   89         -
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
   90         -
    pub fn builder() -> crate::output::reserved_words_as_members_output::Builder {
   91         -
        crate::output::reserved_words_as_members_output::Builder::default()
          87  +
pub struct RpcEchoOutput {}
          88  +
impl RpcEchoOutput {
          89  +
    /// Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
          90  +
    pub fn builder() -> crate::output::rpc_echo_output::Builder {
          91  +
        crate::output::rpc_echo_output::Builder::default()
   92     92   
    }
   93     93   
}
   94         -
/// See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
   95         -
pub mod rpc_echo_output {
          94  +
/// See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
          95  +
pub mod reserved_words_as_members_output {
   96     96   
   97         -
    impl ::std::convert::From<Builder> for crate::output::RpcEchoOutput {
          97  +
    impl ::std::convert::From<Builder> for crate::output::ReservedWordsAsMembersOutput {
   98     98   
        fn from(builder: Builder) -> Self {
   99     99   
            builder.build()
  100    100   
        }
  101    101   
    }
  102         -
    /// A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         102  +
    /// A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  103    103   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  104    104   
    pub struct Builder {}
  105    105   
    impl Builder {
  106         -
        /// Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
  107         -
        pub fn build(self) -> crate::output::RpcEchoOutput {
         106  +
        /// Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         107  +
        pub fn build(self) -> crate::output::ReservedWordsAsMembersOutput {
  108    108   
            self.build_enforcing_all_constraints()
  109    109   
        }
  110         -
        fn build_enforcing_all_constraints(self) -> crate::output::RpcEchoOutput {
  111         -
            crate::output::RpcEchoOutput {}
         110  +
        fn build_enforcing_all_constraints(self) -> crate::output::ReservedWordsAsMembersOutput {
         111  +
            crate::output::ReservedWordsAsMembersOutput {}
  112    112   
        }
  113    113   
    }
  114    114   
}
  115         -
/// See [`MatchOutput`](crate::output::MatchOutput).
  116         -
pub mod match_output {
         115  +
/// See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         116  +
pub mod structure_name_punning_output {
  117    117   
  118         -
    impl ::std::convert::From<Builder> for crate::output::MatchOutput {
         118  +
    impl ::std::convert::From<Builder> for crate::output::StructureNamePunningOutput {
  119    119   
        fn from(builder: Builder) -> Self {
  120    120   
            builder.build()
  121    121   
        }
  122    122   
    }
  123         -
    /// A builder for [`MatchOutput`](crate::output::MatchOutput).
         123  +
    /// A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  124    124   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  125    125   
    pub struct Builder {}
  126    126   
    impl Builder {
  127         -
        /// Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
  128         -
        pub fn build(self) -> crate::output::MatchOutput {
         127  +
        /// Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         128  +
        pub fn build(self) -> crate::output::StructureNamePunningOutput {
  129    129   
            self.build_enforcing_all_constraints()
  130    130   
        }
  131         -
        fn build_enforcing_all_constraints(self) -> crate::output::MatchOutput {
  132         -
            crate::output::MatchOutput {}
         131  +
        fn build_enforcing_all_constraints(self) -> crate::output::StructureNamePunningOutput {
         132  +
            crate::output::StructureNamePunningOutput {}
  133    133   
        }
  134    134   
    }
  135    135   
}
  136         -
/// See [`OptionOutput`](crate::output::OptionOutput).
  137         -
pub mod option_output {
         136  +
/// See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         137  +
pub mod err_collisions_output {
  138    138   
  139         -
    impl ::std::convert::From<Builder> for crate::output::OptionOutput {
         139  +
    impl ::std::convert::From<Builder> for crate::output::ErrCollisionsOutput {
  140    140   
        fn from(builder: Builder) -> Self {
  141    141   
            builder.build()
  142    142   
        }
  143    143   
    }
  144         -
    /// A builder for [`OptionOutput`](crate::output::OptionOutput).
         144  +
    /// A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  145    145   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  146    146   
    pub struct Builder {}
  147    147   
    impl Builder {
  148         -
        /// Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
  149         -
        pub fn build(self) -> crate::output::OptionOutput {
         148  +
        /// Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         149  +
        pub fn build(self) -> crate::output::ErrCollisionsOutput {
  150    150   
            self.build_enforcing_all_constraints()
  151    151   
        }
  152         -
        fn build_enforcing_all_constraints(self) -> crate::output::OptionOutput {
  153         -
            crate::output::OptionOutput {}
         152  +
        fn build_enforcing_all_constraints(self) -> crate::output::ErrCollisionsOutput {
         153  +
            crate::output::ErrCollisionsOutput {}
  154    154   
        }
  155    155   
    }
  156    156   
}
  157    157   
/// See [`ResultOutput`](crate::output::ResultOutput).
  158    158   
pub mod result_output {
  159    159   
  160    160   
    impl ::std::convert::From<Builder> for crate::output::ResultOutput {
  161    161   
        fn from(builder: Builder) -> Self {
  162    162   
            builder.build()
  163    163   
        }
  164    164   
    }
  165    165   
    /// A builder for [`ResultOutput`](crate::output::ResultOutput).
  166    166   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  167    167   
    pub struct Builder {
  168    168   
        pub(crate) pv_member: ::std::option::Option<bool>,
  169    169   
    }
  170    170   
    impl Builder {
  171    171   
        #[allow(missing_docs)] // documentation missing in model
  172    172   
        pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
  173    173   
            self.pv_member = input;
  174    174   
            self
  175    175   
        }
  176    176   
        /// Consumes the builder and constructs a [`ResultOutput`](crate::output::ResultOutput).
  177    177   
        pub fn build(self) -> crate::output::ResultOutput {
  178    178   
            self.build_enforcing_all_constraints()
  179    179   
        }
  180    180   
        fn build_enforcing_all_constraints(self) -> crate::output::ResultOutput {
  181    181   
            crate::output::ResultOutput {
  182    182   
                pv_member: self.pv_member,
  183    183   
            }
  184    184   
        }
  185    185   
    }
  186    186   
}
  187         -
/// See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  188         -
pub mod err_collisions_output {
         187  +
/// See [`OptionOutput`](crate::output::OptionOutput).
         188  +
pub mod option_output {
  189    189   
  190         -
    impl ::std::convert::From<Builder> for crate::output::ErrCollisionsOutput {
         190  +
    impl ::std::convert::From<Builder> for crate::output::OptionOutput {
  191    191   
        fn from(builder: Builder) -> Self {
  192    192   
            builder.build()
  193    193   
        }
  194    194   
    }
  195         -
    /// A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         195  +
    /// A builder for [`OptionOutput`](crate::output::OptionOutput).
  196    196   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  197    197   
    pub struct Builder {}
  198    198   
    impl Builder {
  199         -
        /// Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  200         -
        pub fn build(self) -> crate::output::ErrCollisionsOutput {
         199  +
        /// Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
         200  +
        pub fn build(self) -> crate::output::OptionOutput {
  201    201   
            self.build_enforcing_all_constraints()
  202    202   
        }
  203         -
        fn build_enforcing_all_constraints(self) -> crate::output::ErrCollisionsOutput {
  204         -
            crate::output::ErrCollisionsOutput {}
         203  +
        fn build_enforcing_all_constraints(self) -> crate::output::OptionOutput {
         204  +
            crate::output::OptionOutput {}
  205    205   
        }
  206    206   
    }
  207    207   
}
  208         -
/// See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  209         -
pub mod structure_name_punning_output {
         208  +
/// See [`MatchOutput`](crate::output::MatchOutput).
         209  +
pub mod match_output {
  210    210   
  211         -
    impl ::std::convert::From<Builder> for crate::output::StructureNamePunningOutput {
         211  +
    impl ::std::convert::From<Builder> for crate::output::MatchOutput {
  212    212   
        fn from(builder: Builder) -> Self {
  213    213   
            builder.build()
  214    214   
        }
  215    215   
    }
  216         -
    /// A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         216  +
    /// A builder for [`MatchOutput`](crate::output::MatchOutput).
  217    217   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  218    218   
    pub struct Builder {}
  219    219   
    impl Builder {
  220         -
        /// Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  221         -
        pub fn build(self) -> crate::output::StructureNamePunningOutput {
         220  +
        /// Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
         221  +
        pub fn build(self) -> crate::output::MatchOutput {
  222    222   
            self.build_enforcing_all_constraints()
  223    223   
        }
  224         -
        fn build_enforcing_all_constraints(self) -> crate::output::StructureNamePunningOutput {
  225         -
            crate::output::StructureNamePunningOutput {}
         224  +
        fn build_enforcing_all_constraints(self) -> crate::output::MatchOutput {
         225  +
            crate::output::MatchOutput {}
  226    226   
        }
  227    227   
    }
  228    228   
}
  229         -
/// See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  230         -
pub mod reserved_words_as_members_output {
         229  +
/// See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         230  +
pub mod rpc_echo_output {
  231    231   
  232         -
    impl ::std::convert::From<Builder> for crate::output::ReservedWordsAsMembersOutput {
         232  +
    impl ::std::convert::From<Builder> for crate::output::RpcEchoOutput {
  233    233   
        fn from(builder: Builder) -> Self {
  234    234   
            builder.build()
  235    235   
        }
  236    236   
    }
  237         -
    /// A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         237  +
    /// A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
  238    238   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  239    239   
    pub struct Builder {}
  240    240   
    impl Builder {
  241         -
        /// Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  242         -
        pub fn build(self) -> crate::output::ReservedWordsAsMembersOutput {
         241  +
        /// Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         242  +
        pub fn build(self) -> crate::output::RpcEchoOutput {
  243    243   
            self.build_enforcing_all_constraints()
  244    244   
        }
  245         -
        fn build_enforcing_all_constraints(self) -> crate::output::ReservedWordsAsMembersOutput {
  246         -
            crate::output::ReservedWordsAsMembersOutput {}
         245  +
        fn build_enforcing_all_constraints(self) -> crate::output::RpcEchoOutput {
         246  +
            crate::output::RpcEchoOutput {}
  247    247   
        }
  248    248   
    }
  249    249   
}

tmp-codegen-diff/codegen-server-test/naming_test_structs-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   
//! Confounds model generation machinery with lots of problematic names
   24     25   

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

@@ -1,1 +31,79 @@
    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 Result {
           7  +
    #[allow(missing_docs)] // documentation missing in model
           8  +
    pub value: ::std::option::Option<::std::string::String>,
           9  +
}
          10  +
impl Result {
          11  +
    #[allow(missing_docs)] // documentation missing in model
          12  +
    pub fn value(&self) -> ::std::option::Option<&str> {
          13  +
        self.value.as_deref()
          14  +
    }
          15  +
}
          16  +
impl Result {
          17  +
    /// Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
          18  +
    pub fn builder() -> crate::model::result::Builder {
          19  +
        crate::model::result::Builder::default()
          20  +
    }
          21  +
}
          22  +
impl crate::constrained::Constrained for crate::model::Result {
          23  +
    type Unconstrained = crate::model::result::Builder;
          24  +
}
          25  +
          26  +
#[allow(missing_docs)] // documentation missing in model
          27  +
#[derive(
          28  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          29  +
)]
          30  +
pub struct Option {
          31  +
    #[allow(missing_docs)] // documentation missing in model
          32  +
    pub value: ::std::option::Option<::std::string::String>,
          33  +
}
          34  +
impl Option {
          35  +
    #[allow(missing_docs)] // documentation missing in model
          36  +
    pub fn value(&self) -> ::std::option::Option<&str> {
          37  +
        self.value.as_deref()
          38  +
    }
          39  +
}
          40  +
impl Option {
          41  +
    /// Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
          42  +
    pub fn builder() -> crate::model::option::Builder {
          43  +
        crate::model::option::Builder::default()
          44  +
    }
          45  +
}
          46  +
impl crate::constrained::Constrained for crate::model::Option {
          47  +
    type Unconstrained = crate::model::option::Builder;
          48  +
}
          49  +
    2     50   
#[allow(missing_docs)] // documentation missing in model
    3     51   
#[derive(
    4     52   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5     53   
)]
    6     54   
pub struct SomethingElse {
    7     55   
    #[allow(missing_docs)] // documentation missing in model
    8     56   
    pub result: ::std::option::Option<crate::model::Result>,
    9     57   
    #[allow(missing_docs)] // documentation missing in model
   10     58   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
   11     59   
    #[allow(missing_docs)] // documentation missing in model
@@ -58,106 +164,236 @@
   78    126   
            ::std::result::Result::Ok(val)
   79    127   
        } else {
   80    128   
            ::std::result::Result::Err(self)
   81    129   
        }
   82    130   
    }
   83    131   
    /// Returns true if this is a [`Result`](crate::model::SomeUnion::Result).
   84    132   
    pub fn is_result(&self) -> bool {
   85    133   
        self.as_result().is_ok()
   86    134   
    }
   87    135   
}
         136  +
/// See [`Result`](crate::model::Result).
         137  +
pub mod result {
   88    138   
   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 Option {
         139  +
    impl ::std::convert::From<Builder> for crate::model::Result {
         140  +
        fn from(builder: Builder) -> Self {
         141  +
            builder.build()
         142  +
        }
         143  +
    }
         144  +
    /// A builder for [`Result`](crate::model::Result).
         145  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         146  +
    pub struct Builder {
         147  +
        pub(crate) value: ::std::option::Option<::std::string::String>,
         148  +
    }
         149  +
    impl Builder {
   94    150   
        #[allow(missing_docs)] // documentation missing in model
   95         -
    pub value: ::std::option::Option<::std::string::String>,
   96         -
}
   97         -
impl Option {
         151  +
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         152  +
            self.value = input;
         153  +
            self
         154  +
        }
   98    155   
        #[allow(missing_docs)] // documentation missing in model
   99         -
    pub fn value(&self) -> ::std::option::Option<&str> {
  100         -
        self.value.as_deref()
         156  +
        pub(crate) fn set_value(
         157  +
            mut self,
         158  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         159  +
        ) -> Self {
         160  +
            self.value = input.map(|v| v.into());
         161  +
            self
         162  +
        }
         163  +
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
         164  +
        pub fn build(self) -> crate::model::Result {
         165  +
            self.build_enforcing_all_constraints()
         166  +
        }
         167  +
        fn build_enforcing_all_constraints(self) -> crate::model::Result {
         168  +
            crate::model::Result { value: self.value }
  101    169   
        }
  102         -
}
  103         -
impl Option {
  104         -
    /// Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
  105         -
    pub fn builder() -> crate::model::option::Builder {
  106         -
        crate::model::option::Builder::default()
  107    170   
    }
  108    171   
}
  109         -
impl crate::constrained::Constrained for crate::model::Option {
  110         -
    type Unconstrained = crate::model::option::Builder;
  111         -
}
         172  +
/// See [`Option`](crate::model::Option).
         173  +
pub mod option {
  112    174   
  113         -
#[allow(missing_docs)] // documentation missing in model
  114         -
#[derive(
  115         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  116         -
)]
  117         -
pub struct Result {
         175  +
    impl ::std::convert::From<Builder> for crate::model::Option {
         176  +
        fn from(builder: Builder) -> Self {
         177  +
            builder.build()
         178  +
        }
         179  +
    }
         180  +
    /// A builder for [`Option`](crate::model::Option).
         181  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         182  +
    pub struct Builder {
         183  +
        pub(crate) value: ::std::option::Option<::std::string::String>,
         184  +
    }
         185  +
    impl Builder {
  118    186   
        #[allow(missing_docs)] // documentation missing in model
  119         -
    pub value: ::std::option::Option<::std::string::String>,
  120         -
}
  121         -
impl Result {
         187  +
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         188  +
            self.value = input;
         189  +
            self
         190  +
        }
  122    191   
        #[allow(missing_docs)] // documentation missing in model
  123         -
    pub fn value(&self) -> ::std::option::Option<&str> {
  124         -
        self.value.as_deref()
         192  +
        pub(crate) fn set_value(
         193  +
            mut self,
         194  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         195  +
        ) -> Self {
         196  +
            self.value = input.map(|v| v.into());
         197  +
            self
         198  +
        }
         199  +
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
         200  +
        pub fn build(self) -> crate::model::Option {
         201  +
            self.build_enforcing_all_constraints()
         202  +
        }
         203  +
        fn build_enforcing_all_constraints(self) -> crate::model::Option {
         204  +
            crate::model::Option { value: self.value }
  125    205   
        }
  126         -
}
  127         -
impl Result {
  128         -
    /// Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
  129         -
    pub fn builder() -> crate::model::result::Builder {
  130         -
        crate::model::result::Builder::default()
  131    206   
    }
  132         -
}
  133         -
impl crate::constrained::Constrained for crate::model::Result {
  134         -
    type Unconstrained = crate::model::result::Builder;
  135    207   
}
  136    208   
/// See [`SomethingElse`](crate::model::SomethingElse).
  137    209   
pub mod something_else {
  138    210   
  139    211   
    impl ::std::convert::From<Builder> for crate::model::SomethingElse {
  140    212   
        fn from(builder: Builder) -> Self {
  141    213   
            builder.build()
  142    214   
        }
  143    215   
    }
  144    216   
    /// A builder for [`SomethingElse`](crate::model::SomethingElse).
@@ -210,282 +311,0 @@
  230    302   
            crate::model::SomethingElse {
  231    303   
                result: self.result,
  232    304   
                result_list: self.result_list,
  233    305   
                option: self.option,
  234    306   
                option_list: self.option_list,
  235    307   
                some_union: self.some_union,
  236    308   
            }
  237    309   
        }
  238    310   
    }
  239    311   
}
  240         -
/// See [`Option`](crate::model::Option).
  241         -
pub mod option {
  242         -
  243         -
    impl ::std::convert::From<Builder> for crate::model::Option {
  244         -
        fn from(builder: Builder) -> Self {
  245         -
            builder.build()
  246         -
        }
  247         -
    }
  248         -
    /// A builder for [`Option`](crate::model::Option).
  249         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  250         -
    pub struct Builder {
  251         -
        pub(crate) value: ::std::option::Option<::std::string::String>,
  252         -
    }
  253         -
    impl Builder {
  254         -
        #[allow(missing_docs)] // documentation missing in model
  255         -
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  256         -
            self.value = input;
  257         -
            self
  258         -
        }
  259         -
        #[allow(missing_docs)] // documentation missing in model
  260         -
        pub(crate) fn set_value(
  261         -
            mut self,
  262         -
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  263         -
        ) -> Self {
  264         -
            self.value = input.map(|v| v.into());
  265         -
            self
  266         -
        }
  267         -
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
  268         -
        pub fn build(self) -> crate::model::Option {
  269         -
            self.build_enforcing_all_constraints()
  270         -
        }
  271         -
        fn build_enforcing_all_constraints(self) -> crate::model::Option {
  272         -
            crate::model::Option { value: self.value }
  273         -
        }
  274         -
    }
  275         -
}
  276         -
/// See [`Result`](crate::model::Result).
  277         -
pub mod result {
  278         -
  279         -
    impl ::std::convert::From<Builder> for crate::model::Result {
  280         -
        fn from(builder: Builder) -> Self {
  281         -
            builder.build()
  282         -
        }
  283         -
    }
  284         -
    /// A builder for [`Result`](crate::model::Result).
  285         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  286         -
    pub struct Builder {
  287         -
        pub(crate) value: ::std::option::Option<::std::string::String>,
  288         -
    }
  289         -
    impl Builder {
  290         -
        #[allow(missing_docs)] // documentation missing in model
  291         -
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  292         -
            self.value = input;
  293         -
            self
  294         -
        }
  295         -
        #[allow(missing_docs)] // documentation missing in model
  296         -
        pub(crate) fn set_value(
  297         -
            mut self,
  298         -
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  299         -
        ) -> Self {
  300         -
            self.value = input.map(|v| v.into());
  301         -
            self
  302         -
        }
  303         -
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
  304         -
        pub fn build(self) -> crate::model::Result {
  305         -
            self.build_enforcing_all_constraints()
  306         -
        }
  307         -
        fn build_enforcing_all_constraints(self) -> crate::model::Result {
  308         -
            crate::model::Result { value: self.value }
  309         -
        }
  310         -
    }
  311         -
}

tmp-codegen-diff/codegen-server-test/naming_test_structs/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   
//! Confounds model generation machinery with lots of problematic names
   24     25   

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

@@ -1,1 +31,79 @@
    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 Result {
           7  +
    #[allow(missing_docs)] // documentation missing in model
           8  +
    pub value: ::std::option::Option<::std::string::String>,
           9  +
}
          10  +
impl Result {
          11  +
    #[allow(missing_docs)] // documentation missing in model
          12  +
    pub fn value(&self) -> ::std::option::Option<&str> {
          13  +
        self.value.as_deref()
          14  +
    }
          15  +
}
          16  +
impl Result {
          17  +
    /// Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
          18  +
    pub fn builder() -> crate::model::result::Builder {
          19  +
        crate::model::result::Builder::default()
          20  +
    }
          21  +
}
          22  +
impl crate::constrained::Constrained for crate::model::Result {
          23  +
    type Unconstrained = crate::model::result::Builder;
          24  +
}
          25  +
          26  +
#[allow(missing_docs)] // documentation missing in model
          27  +
#[derive(
          28  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          29  +
)]
          30  +
pub struct Option {
          31  +
    #[allow(missing_docs)] // documentation missing in model
          32  +
    pub value: ::std::option::Option<::std::string::String>,
          33  +
}
          34  +
impl Option {
          35  +
    #[allow(missing_docs)] // documentation missing in model
          36  +
    pub fn value(&self) -> ::std::option::Option<&str> {
          37  +
        self.value.as_deref()
          38  +
    }
          39  +
}
          40  +
impl Option {
          41  +
    /// Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
          42  +
    pub fn builder() -> crate::model::option::Builder {
          43  +
        crate::model::option::Builder::default()
          44  +
    }
          45  +
}
          46  +
impl crate::constrained::Constrained for crate::model::Option {
          47  +
    type Unconstrained = crate::model::option::Builder;
          48  +
}
          49  +
    2     50   
#[allow(missing_docs)] // documentation missing in model
    3     51   
#[derive(
    4     52   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5     53   
)]
    6     54   
pub struct SomethingElse {
    7     55   
    #[allow(missing_docs)] // documentation missing in model
    8     56   
    pub result: ::std::option::Option<crate::model::Result>,
    9     57   
    #[allow(missing_docs)] // documentation missing in model
   10     58   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
   11     59   
    #[allow(missing_docs)] // documentation missing in model
@@ -58,106 +164,236 @@
   78    126   
            ::std::result::Result::Ok(val)
   79    127   
        } else {
   80    128   
            ::std::result::Result::Err(self)
   81    129   
        }
   82    130   
    }
   83    131   
    /// Returns true if this is a [`Result`](crate::model::SomeUnion::Result).
   84    132   
    pub fn is_result(&self) -> bool {
   85    133   
        self.as_result().is_ok()
   86    134   
    }
   87    135   
}
         136  +
/// See [`Result`](crate::model::Result).
         137  +
pub mod result {
   88    138   
   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 Option {
         139  +
    impl ::std::convert::From<Builder> for crate::model::Result {
         140  +
        fn from(builder: Builder) -> Self {
         141  +
            builder.build()
         142  +
        }
         143  +
    }
         144  +
    /// A builder for [`Result`](crate::model::Result).
         145  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         146  +
    pub struct Builder {
         147  +
        pub(crate) value: ::std::option::Option<::std::string::String>,
         148  +
    }
         149  +
    impl Builder {
   94    150   
        #[allow(missing_docs)] // documentation missing in model
   95         -
    pub value: ::std::option::Option<::std::string::String>,
   96         -
}
   97         -
impl Option {
         151  +
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         152  +
            self.value = input;
         153  +
            self
         154  +
        }
   98    155   
        #[allow(missing_docs)] // documentation missing in model
   99         -
    pub fn value(&self) -> ::std::option::Option<&str> {
  100         -
        self.value.as_deref()
         156  +
        pub(crate) fn set_value(
         157  +
            mut self,
         158  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         159  +
        ) -> Self {
         160  +
            self.value = input.map(|v| v.into());
         161  +
            self
         162  +
        }
         163  +
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
         164  +
        pub fn build(self) -> crate::model::Result {
         165  +
            self.build_enforcing_all_constraints()
         166  +
        }
         167  +
        fn build_enforcing_all_constraints(self) -> crate::model::Result {
         168  +
            crate::model::Result { value: self.value }
  101    169   
        }
  102         -
}
  103         -
impl Option {
  104         -
    /// Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
  105         -
    pub fn builder() -> crate::model::option::Builder {
  106         -
        crate::model::option::Builder::default()
  107    170   
    }
  108    171   
}
  109         -
impl crate::constrained::Constrained for crate::model::Option {
  110         -
    type Unconstrained = crate::model::option::Builder;
  111         -
}
         172  +
/// See [`Option`](crate::model::Option).
         173  +
pub mod option {
  112    174   
  113         -
#[allow(missing_docs)] // documentation missing in model
  114         -
#[derive(
  115         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  116         -
)]
  117         -
pub struct Result {
         175  +
    impl ::std::convert::From<Builder> for crate::model::Option {
         176  +
        fn from(builder: Builder) -> Self {
         177  +
            builder.build()
         178  +
        }
         179  +
    }
         180  +
    /// A builder for [`Option`](crate::model::Option).
         181  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         182  +
    pub struct Builder {
         183  +
        pub(crate) value: ::std::option::Option<::std::string::String>,
         184  +
    }
         185  +
    impl Builder {
  118    186   
        #[allow(missing_docs)] // documentation missing in model
  119         -
    pub value: ::std::option::Option<::std::string::String>,
  120         -
}
  121         -
impl Result {
         187  +
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         188  +
            self.value = input;
         189  +
            self
         190  +
        }
  122    191   
        #[allow(missing_docs)] // documentation missing in model
  123         -
    pub fn value(&self) -> ::std::option::Option<&str> {
  124         -
        self.value.as_deref()
         192  +
        pub(crate) fn set_value(
         193  +
            mut self,
         194  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         195  +
        ) -> Self {
         196  +
            self.value = input.map(|v| v.into());
         197  +
            self
         198  +
        }
         199  +
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
         200  +
        pub fn build(self) -> crate::model::Option {
         201  +
            self.build_enforcing_all_constraints()
         202  +
        }
         203  +
        fn build_enforcing_all_constraints(self) -> crate::model::Option {
         204  +
            crate::model::Option { value: self.value }
  125    205   
        }
  126         -
}
  127         -
impl Result {
  128         -
    /// Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
  129         -
    pub fn builder() -> crate::model::result::Builder {
  130         -
        crate::model::result::Builder::default()
  131    206   
    }
  132         -
}
  133         -
impl crate::constrained::Constrained for crate::model::Result {
  134         -
    type Unconstrained = crate::model::result::Builder;
  135    207   
}
  136    208   
/// See [`SomethingElse`](crate::model::SomethingElse).
  137    209   
pub mod something_else {
  138    210   
  139    211   
    impl ::std::convert::From<Builder> for crate::model::SomethingElse {
  140    212   
        fn from(builder: Builder) -> Self {
  141    213   
            builder.build()
  142    214   
        }
  143    215   
    }
  144    216   
    /// A builder for [`SomethingElse`](crate::model::SomethingElse).
@@ -210,282 +311,0 @@
  230    302   
            crate::model::SomethingElse {
  231    303   
                result: self.result,
  232    304   
                result_list: self.result_list,
  233    305   
                option: self.option,
  234    306   
                option_list: self.option_list,
  235    307   
                some_union: self.some_union,
  236    308   
            }
  237    309   
        }
  238    310   
    }
  239    311   
}
  240         -
/// See [`Option`](crate::model::Option).
  241         -
pub mod option {
  242         -
  243         -
    impl ::std::convert::From<Builder> for crate::model::Option {
  244         -
        fn from(builder: Builder) -> Self {
  245         -
            builder.build()
  246         -
        }
  247         -
    }
  248         -
    /// A builder for [`Option`](crate::model::Option).
  249         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  250         -
    pub struct Builder {
  251         -
        pub(crate) value: ::std::option::Option<::std::string::String>,
  252         -
    }
  253         -
    impl Builder {
  254         -
        #[allow(missing_docs)] // documentation missing in model
  255         -
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  256         -
            self.value = input;
  257         -
            self
  258         -
        }
  259         -
        #[allow(missing_docs)] // documentation missing in model
  260         -
        pub(crate) fn set_value(
  261         -
            mut self,
  262         -
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  263         -
        ) -> Self {
  264         -
            self.value = input.map(|v| v.into());
  265         -
            self
  266         -
        }
  267         -
        /// Consumes the builder and constructs a [`Option`](crate::model::Option).
  268         -
        pub fn build(self) -> crate::model::Option {
  269         -
            self.build_enforcing_all_constraints()
  270         -
        }
  271         -
        fn build_enforcing_all_constraints(self) -> crate::model::Option {
  272         -
            crate::model::Option { value: self.value }
  273         -
        }
  274         -
    }
  275         -
}
  276         -
/// See [`Result`](crate::model::Result).
  277         -
pub mod result {
  278         -
  279         -
    impl ::std::convert::From<Builder> for crate::model::Result {
  280         -
        fn from(builder: Builder) -> Self {
  281         -
            builder.build()
  282         -
        }
  283         -
    }
  284         -
    /// A builder for [`Result`](crate::model::Result).
  285         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  286         -
    pub struct Builder {
  287         -
        pub(crate) value: ::std::option::Option<::std::string::String>,
  288         -
    }
  289         -
    impl Builder {
  290         -
        #[allow(missing_docs)] // documentation missing in model
  291         -
        pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  292         -
            self.value = input;
  293         -
            self
  294         -
        }
  295         -
        #[allow(missing_docs)] // documentation missing in model
  296         -
        pub(crate) fn set_value(
  297         -
            mut self,
  298         -
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  299         -
        ) -> Self {
  300         -
            self.value = input.map(|v| v.into());
  301         -
            self
  302         -
        }
  303         -
        /// Consumes the builder and constructs a [`Result`](crate::model::Result).
  304         -
        pub fn build(self) -> crate::model::Result {
  305         -
            self.build_enforcing_all_constraints()
  306         -
        }
  307         -
        fn build_enforcing_all_constraints(self) -> crate::model::Result {
  308         -
            crate::model::Result { value: self.value }
  309         -
        }
  310         -
    }
  311         -
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/error.rs

@@ -78,78 +313,359 @@
   98     98   
{
   99     99   
    fn from(variant: crate::error::InvalidPokeballError) -> crate::error::CapturePokemonError {
  100    100   
        Self::InvalidPokeballError(variant)
  101    101   
    }
  102    102   
}
  103    103   
  104    104   
#[allow(missing_docs)] // documentation missing in model
  105    105   
#[derive(
  106    106   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  107    107   
)]
  108         -
pub struct InvalidPokeballError {
         108  +
pub struct UnsupportedRegionError {
  109    109   
    #[allow(missing_docs)] // documentation missing in model
  110         -
    pub pokeball: ::std::string::String,
         110  +
    pub region: ::std::string::String,
  111    111   
}
  112         -
impl InvalidPokeballError {
         112  +
impl UnsupportedRegionError {
  113    113   
    #[allow(missing_docs)] // documentation missing in model
  114         -
    pub fn pokeball(&self) -> &str {
         114  +
    pub fn region(&self) -> &str {
  115    115   
        use std::ops::Deref;
  116         -
        self.pokeball.deref()
         116  +
        self.region.deref()
  117    117   
    }
  118    118   
}
  119         -
impl InvalidPokeballError {
         119  +
impl UnsupportedRegionError {
  120    120   
    #[doc(hidden)]
  121    121   
    /// Returns the error name.
  122    122   
    pub fn name(&self) -> &'static str {
  123         -
        "InvalidPokeballError"
         123  +
        "UnsupportedRegionError"
  124    124   
    }
  125    125   
}
  126         -
impl ::std::fmt::Display for InvalidPokeballError {
         126  +
impl ::std::fmt::Display for UnsupportedRegionError {
  127    127   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  128         -
        ::std::write!(f, "InvalidPokeballError")?;
         128  +
        ::std::write!(f, "UnsupportedRegionError")?;
  129    129   
        Ok(())
  130    130   
    }
  131    131   
}
  132         -
impl ::std::error::Error for InvalidPokeballError {}
  133         -
impl InvalidPokeballError {
  134         -
    /// Creates a new builder-style object to manufacture [`InvalidPokeballError`](crate::error::InvalidPokeballError).
  135         -
    pub fn builder() -> crate::error::invalid_pokeball_error::Builder {
  136         -
        crate::error::invalid_pokeball_error::Builder::default()
         132  +
impl ::std::error::Error for UnsupportedRegionError {}
         133  +
impl UnsupportedRegionError {
         134  +
    /// Creates a new builder-style object to manufacture [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         135  +
    pub fn builder() -> crate::error::unsupported_region_error::Builder {
         136  +
        crate::error::unsupported_region_error::Builder::default()
  137    137   
    }
  138    138   
}
  139    139   
  140    140   
#[allow(missing_docs)] // documentation missing in model
  141    141   
#[derive(
  142    142   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  143    143   
)]
  144         -
pub struct MasterBallUnsuccessful {
  145         -
    #[allow(missing_docs)] // documentation missing in model
  146         -
    pub message: ::std::option::Option<::std::string::String>,
  147         -
}
  148         -
impl MasterBallUnsuccessful {
  149         -
    /// Returns the error message.
  150         -
    pub fn message(&self) -> ::std::option::Option<&str> {
  151         -
        self.message.as_deref()
  152         -
    }
         144  +
pub struct ThrottlingError {}
         145  +
impl ThrottlingError {
  153    146   
    #[doc(hidden)]
  154    147   
    /// Returns the error name.
  155    148   
    pub fn name(&self) -> &'static str {
  156         -
        "MasterBallUnsuccessful"
         149  +
        "ThrottlingError"
  157    150   
    }
  158    151   
}
  159         -
impl ::std::fmt::Display for MasterBallUnsuccessful {
         152  +
impl ::std::fmt::Display for ThrottlingError {
  160    153   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  161         -
        ::std::write!(f, "MasterBallUnsuccessful")?;
  162         -
        if let ::std::option::Option::Some(inner_1) = &self.message {
  163         -
            {
  164         -
                ::std::write!(f, ": {inner_1}")?;
  165         -
            }
  166         -
        }
         154  +
        ::std::write!(f, "ThrottlingError")?;
  167    155   
        Ok(())
  168    156   
    }
  169    157   
}
  170         -
impl ::std::error::Error for MasterBallUnsuccessful {}
  171         -
impl MasterBallUnsuccessful {
  172         -
    /// Creates a new builder-style object to manufacture [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
  173         -
    pub fn builder() -> crate::error::master_ball_unsuccessful::Builder {
  174         -
        crate::error::master_ball_unsuccessful::Builder::default()
         158  +
impl ::std::error::Error for ThrottlingError {}
         159  +
impl ThrottlingError {
         160  +
    /// Creates a new builder-style object to manufacture [`ThrottlingError`](crate::error::ThrottlingError).
         161  +
    pub fn builder() -> crate::error::throttling_error::Builder {
         162  +
        crate::error::throttling_error::Builder::default()
  175    163   
    }
  176    164   
}
  177         -
impl crate::constrained::Constrained for crate::error::MasterBallUnsuccessful {
  178         -
    type Unconstrained = crate::error::master_ball_unsuccessful::Builder;
  179         -
}
  180    165   
  181    166   
/// 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.
  182    167   
#[derive(
  183    168   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  184    169   
)]
  185    170   
pub struct ValidationException {
  186    171   
    /// A summary of the validation failure.
  187    172   
    pub message: ::std::string::String,
  188    173   
    /// 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.
  189    174   
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
  190    175   
}
  191    176   
impl ValidationException {
  192    177   
    /// 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.
  193    178   
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
  194    179   
        self.field_list.as_deref()
  195    180   
    }
  196    181   
}
  197    182   
impl ValidationException {
  198    183   
    /// Returns the error message.
  199    184   
    pub fn message(&self) -> &str {
  200    185   
        &self.message
  201    186   
    }
  202    187   
    #[doc(hidden)]
  203    188   
    /// Returns the error name.
  204    189   
    pub fn name(&self) -> &'static str {
  205    190   
        "ValidationException"
  206    191   
    }
  207    192   
}
  208    193   
impl ::std::fmt::Display for ValidationException {
  209    194   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  210    195   
        ::std::write!(f, "ValidationException")?;
  211    196   
        {
  212    197   
            ::std::write!(f, ": {}", &self.message)?;
  213    198   
        }
  214    199   
        Ok(())
  215    200   
    }
  216    201   
}
  217    202   
impl ::std::error::Error for ValidationException {}
  218    203   
impl ValidationException {
  219    204   
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
  220    205   
    pub fn builder() -> crate::error::validation_exception::Builder {
  221    206   
        crate::error::validation_exception::Builder::default()
  222    207   
    }
  223    208   
}
  224    209   
  225    210   
#[allow(missing_docs)] // documentation missing in model
  226    211   
#[derive(
  227    212   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  228    213   
)]
  229         -
pub struct ThrottlingError {}
  230         -
impl ThrottlingError {
         214  +
pub struct MasterBallUnsuccessful {
         215  +
    #[allow(missing_docs)] // documentation missing in model
         216  +
    pub message: ::std::option::Option<::std::string::String>,
         217  +
}
         218  +
impl MasterBallUnsuccessful {
         219  +
    /// Returns the error message.
         220  +
    pub fn message(&self) -> ::std::option::Option<&str> {
         221  +
        self.message.as_deref()
         222  +
    }
  231    223   
    #[doc(hidden)]
  232    224   
    /// Returns the error name.
  233    225   
    pub fn name(&self) -> &'static str {
  234         -
        "ThrottlingError"
         226  +
        "MasterBallUnsuccessful"
  235    227   
    }
  236    228   
}
  237         -
impl ::std::fmt::Display for ThrottlingError {
         229  +
impl ::std::fmt::Display for MasterBallUnsuccessful {
  238    230   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  239         -
        ::std::write!(f, "ThrottlingError")?;
         231  +
        ::std::write!(f, "MasterBallUnsuccessful")?;
         232  +
        if let ::std::option::Option::Some(inner_1) = &self.message {
         233  +
            {
         234  +
                ::std::write!(f, ": {inner_1}")?;
         235  +
            }
         236  +
        }
  240    237   
        Ok(())
  241    238   
    }
  242    239   
}
  243         -
impl ::std::error::Error for ThrottlingError {}
  244         -
impl ThrottlingError {
  245         -
    /// Creates a new builder-style object to manufacture [`ThrottlingError`](crate::error::ThrottlingError).
  246         -
    pub fn builder() -> crate::error::throttling_error::Builder {
  247         -
        crate::error::throttling_error::Builder::default()
         240  +
impl ::std::error::Error for MasterBallUnsuccessful {}
         241  +
impl MasterBallUnsuccessful {
         242  +
    /// Creates a new builder-style object to manufacture [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
         243  +
    pub fn builder() -> crate::error::master_ball_unsuccessful::Builder {
         244  +
        crate::error::master_ball_unsuccessful::Builder::default()
  248    245   
    }
  249    246   
}
         247  +
impl crate::constrained::Constrained for crate::error::MasterBallUnsuccessful {
         248  +
    type Unconstrained = crate::error::master_ball_unsuccessful::Builder;
         249  +
}
  250    250   
  251    251   
#[allow(missing_docs)] // documentation missing in model
  252    252   
#[derive(
  253    253   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  254    254   
)]
  255         -
pub struct UnsupportedRegionError {
         255  +
pub struct InvalidPokeballError {
  256    256   
    #[allow(missing_docs)] // documentation missing in model
  257         -
    pub region: ::std::string::String,
         257  +
    pub pokeball: ::std::string::String,
  258    258   
}
  259         -
impl UnsupportedRegionError {
         259  +
impl InvalidPokeballError {
  260    260   
    #[allow(missing_docs)] // documentation missing in model
  261         -
    pub fn region(&self) -> &str {
         261  +
    pub fn pokeball(&self) -> &str {
  262    262   
        use std::ops::Deref;
  263         -
        self.region.deref()
         263  +
        self.pokeball.deref()
  264    264   
    }
  265    265   
}
  266         -
impl UnsupportedRegionError {
         266  +
impl InvalidPokeballError {
  267    267   
    #[doc(hidden)]
  268    268   
    /// Returns the error name.
  269    269   
    pub fn name(&self) -> &'static str {
  270         -
        "UnsupportedRegionError"
         270  +
        "InvalidPokeballError"
  271    271   
    }
  272    272   
}
  273         -
impl ::std::fmt::Display for UnsupportedRegionError {
         273  +
impl ::std::fmt::Display for InvalidPokeballError {
  274    274   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  275         -
        ::std::write!(f, "UnsupportedRegionError")?;
         275  +
        ::std::write!(f, "InvalidPokeballError")?;
  276    276   
        Ok(())
  277    277   
    }
  278    278   
}
  279         -
impl ::std::error::Error for UnsupportedRegionError {}
  280         -
impl UnsupportedRegionError {
  281         -
    /// Creates a new builder-style object to manufacture [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
  282         -
    pub fn builder() -> crate::error::unsupported_region_error::Builder {
  283         -
        crate::error::unsupported_region_error::Builder::default()
         279  +
impl ::std::error::Error for InvalidPokeballError {}
         280  +
impl InvalidPokeballError {
         281  +
    /// Creates a new builder-style object to manufacture [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         282  +
    pub fn builder() -> crate::error::invalid_pokeball_error::Builder {
         283  +
        crate::error::invalid_pokeball_error::Builder::default()
         284  +
    }
         285  +
}
         286  +
         287  +
/// Error type for the `AttemptCapturingPokemonEvent` operation.
         288  +
/// Each variant represents an error that can occur for the `AttemptCapturingPokemonEvent` operation.
         289  +
#[derive(::std::fmt::Debug)]
         290  +
pub enum AttemptCapturingPokemonEventError {
         291  +
    #[allow(missing_docs)] // documentation missing in model
         292  +
    MasterBallUnsuccessful(crate::error::MasterBallUnsuccessful),
         293  +
}
         294  +
impl ::std::fmt::Display for AttemptCapturingPokemonEventError {
         295  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         296  +
        match &self {
         297  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) => _inner.fmt(f),
         298  +
        }
         299  +
    }
         300  +
}
         301  +
impl AttemptCapturingPokemonEventError {
         302  +
    /// Returns `true` if the error kind is `AttemptCapturingPokemonEventError::MasterBallUnsuccessful`.
         303  +
    pub fn is_master_ball_unsuccessful(&self) -> bool {
         304  +
        matches!(
         305  +
            &self,
         306  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_)
         307  +
        )
         308  +
    }
         309  +
    /// Returns the error name string by matching the correct variant.
         310  +
    pub fn name(&self) -> &'static str {
         311  +
        match &self {
         312  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) => _inner.name(),
         313  +
        }
         314  +
    }
         315  +
}
         316  +
impl ::std::error::Error for AttemptCapturingPokemonEventError {
         317  +
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         318  +
        match &self {
         319  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) => Some(_inner),
         320  +
        }
         321  +
    }
         322  +
}
         323  +
impl ::std::convert::From<crate::error::MasterBallUnsuccessful>
         324  +
    for crate::error::AttemptCapturingPokemonEventError
         325  +
{
         326  +
    fn from(
         327  +
        variant: crate::error::MasterBallUnsuccessful,
         328  +
    ) -> crate::error::AttemptCapturingPokemonEventError {
         329  +
        Self::MasterBallUnsuccessful(variant)
  284    330   
    }
  285    331   
}
  286    332   
  287    333   
/// Error type for the `CapturePokemonEvents` operation.
  288    334   
/// Each variant represents an error that can occur for the `CapturePokemonEvents` operation.
  289    335   
#[derive(::std::fmt::Debug)]
  290    336   
pub enum CapturePokemonEventsError {
  291    337   
    #[allow(missing_docs)] // documentation missing in model
  292    338   
    InvalidPokeballError(crate::error::InvalidPokeballError),
  293    339   
    #[allow(missing_docs)] // documentation missing in model
@@ -315,361 +509,491 @@
  335    381   
        Self::InvalidPokeballError(variant)
  336    382   
    }
  337    383   
}
  338    384   
impl ::std::convert::From<crate::error::ThrottlingError>
  339    385   
    for crate::error::CapturePokemonEventsError
  340    386   
{
  341    387   
    fn from(variant: crate::error::ThrottlingError) -> crate::error::CapturePokemonEventsError {
  342    388   
        Self::ThrottlingError(variant)
  343    389   
    }
  344    390   
}
  345         -
  346         -
/// Error type for the `AttemptCapturingPokemonEvent` operation.
  347         -
/// Each variant represents an error that can occur for the `AttemptCapturingPokemonEvent` operation.
  348         -
#[derive(::std::fmt::Debug)]
  349         -
pub enum AttemptCapturingPokemonEventError {
  350         -
    #[allow(missing_docs)] // documentation missing in model
  351         -
    MasterBallUnsuccessful(crate::error::MasterBallUnsuccessful),
  352         -
}
  353         -
impl ::std::fmt::Display for AttemptCapturingPokemonEventError {
  354         -
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  355         -
        match &self {
  356         -
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) => _inner.fmt(f),
  357         -
        }
  358         -
    }
  359         -
}
  360         -
impl AttemptCapturingPokemonEventError {
  361         -
    /// Returns `true` if the error kind is `AttemptCapturingPokemonEventError::MasterBallUnsuccessful`.
  362         -
    pub fn is_master_ball_unsuccessful(&self) -> bool {
  363         -
        matches!(
  364         -
            &self,
  365         -
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_)
  366         -
        )
  367         -
    }
  368         -
    /// Returns the error name string by matching the correct variant.
  369         -
    pub fn name(&self) -> &'static str {
  370         -
        match &self {
  371         -
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) => _inner.name(),
  372         -
        }
  373         -
    }
  374         -
}
  375         -
impl ::std::error::Error for AttemptCapturingPokemonEventError {
  376         -
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
  377         -
        match &self {
  378         -
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) => Some(_inner),
  379         -
        }
  380         -
    }
  381         -
}
  382         -
impl ::std::convert::From<crate::error::MasterBallUnsuccessful>
  383         -
    for crate::error::AttemptCapturingPokemonEventError
  384         -
{
  385         -
    fn from(
  386         -
        variant: crate::error::MasterBallUnsuccessful,
  387         -
    ) -> crate::error::AttemptCapturingPokemonEventError {
  388         -
        Self::MasterBallUnsuccessful(variant)
  389         -
    }
  390         -
}
  391         -
  392         -
/// See [`InvalidPokeballError`](crate::error::InvalidPokeballError).
  393         -
pub mod invalid_pokeball_error {
         391  +
/// See [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         392  +
pub mod unsupported_region_error {
  394    393   
  395    394   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  396    395   
    /// Holds one variant for each of the ways the builder can fail.
  397    396   
    #[non_exhaustive]
  398    397   
    #[allow(clippy::enum_variant_names)]
  399    398   
    pub enum ConstraintViolation {
  400         -
        /// `pokeball` was not provided but it is required when building `InvalidPokeballError`.
  401         -
        MissingPokeball,
         399  +
        /// `region` was not provided but it is required when building `UnsupportedRegionError`.
         400  +
        MissingRegion,
  402    401   
    }
  403    402   
    impl ::std::fmt::Display for ConstraintViolation {
  404    403   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  405    404   
            match self {
  406         -
                ConstraintViolation::MissingPokeball => write!(f, "`pokeball` was not provided but it is required when building `InvalidPokeballError`"),
         405  +
                ConstraintViolation::MissingRegion => write!(f, "`region` was not provided but it is required when building `UnsupportedRegionError`"),
  407    406   
            }
  408    407   
        }
  409    408   
    }
  410    409   
    impl ::std::error::Error for ConstraintViolation {}
  411         -
    impl ::std::convert::TryFrom<Builder> for crate::error::InvalidPokeballError {
         410  +
    impl ::std::convert::TryFrom<Builder> for crate::error::UnsupportedRegionError {
  412    411   
        type Error = ConstraintViolation;
  413    412   
  414    413   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  415    414   
            builder.build()
  416    415   
        }
  417    416   
    }
  418         -
    /// A builder for [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         417  +
    /// A builder for [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
  419    418   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  420    419   
    pub struct Builder {
  421         -
        pub(crate) pokeball: ::std::option::Option<::std::string::String>,
         420  +
        pub(crate) region: ::std::option::Option<::std::string::String>,
  422    421   
    }
  423    422   
    impl Builder {
  424    423   
        #[allow(missing_docs)] // documentation missing in model
  425         -
        pub fn pokeball(mut self, input: ::std::string::String) -> Self {
  426         -
            self.pokeball = Some(input);
         424  +
        pub fn region(mut self, input: ::std::string::String) -> Self {
         425  +
            self.region = Some(input);
  427    426   
            self
  428    427   
        }
  429         -
        /// Consumes the builder and constructs a [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         428  +
        /// Consumes the builder and constructs a [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
  430    429   
        ///
  431         -
        /// The builder fails to construct a [`InvalidPokeballError`](crate::error::InvalidPokeballError) if a [`ConstraintViolation`] occurs.
         430  +
        /// The builder fails to construct a [`UnsupportedRegionError`](crate::error::UnsupportedRegionError) if a [`ConstraintViolation`] occurs.
  432    431   
        ///
  433         -
        pub fn build(self) -> Result<crate::error::InvalidPokeballError, ConstraintViolation> {
         432  +
        pub fn build(self) -> Result<crate::error::UnsupportedRegionError, ConstraintViolation> {
  434    433   
            self.build_enforcing_all_constraints()
  435    434   
        }
  436    435   
        fn build_enforcing_all_constraints(
  437    436   
            self,
  438         -
        ) -> Result<crate::error::InvalidPokeballError, ConstraintViolation> {
  439         -
            Ok(crate::error::InvalidPokeballError {
  440         -
                pokeball: self.pokeball.ok_or(ConstraintViolation::MissingPokeball)?,
         437  +
        ) -> Result<crate::error::UnsupportedRegionError, ConstraintViolation> {
         438  +
            Ok(crate::error::UnsupportedRegionError {
         439  +
                region: self.region.ok_or(ConstraintViolation::MissingRegion)?,
  441    440   
            })
  442    441   
        }
  443    442   
    }
  444    443   
}
  445         -
/// See [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
  446         -
pub mod master_ball_unsuccessful {
         444  +
/// See [`ThrottlingError`](crate::error::ThrottlingError).
         445  +
pub mod throttling_error {
  447    446   
  448         -
    impl ::std::convert::From<Builder> for crate::error::MasterBallUnsuccessful {
         447  +
    impl ::std::convert::From<Builder> for crate::error::ThrottlingError {
  449    448   
        fn from(builder: Builder) -> Self {
  450    449   
            builder.build()
  451    450   
        }
  452    451   
    }
  453         -
    /// A builder for [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
         452  +
    /// A builder for [`ThrottlingError`](crate::error::ThrottlingError).
  454    453   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  455         -
    pub struct Builder {
  456         -
        pub(crate) message: ::std::option::Option<::std::string::String>,
  457         -
    }
         454  +
    pub struct Builder {}
  458    455   
    impl Builder {
  459         -
        #[allow(missing_docs)] // documentation missing in model
  460         -
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  461         -
            self.message = input;
  462         -
            self
  463         -
        }
  464         -
        #[allow(missing_docs)] // documentation missing in model
  465         -
        pub(crate) fn set_message(
  466         -
            mut self,
  467         -
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  468         -
        ) -> Self {
  469         -
            self.message = input.map(|v| v.into());
  470         -
            self
  471         -
        }
  472         -
        /// Consumes the builder and constructs a [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
  473         -
        pub fn build(self) -> crate::error::MasterBallUnsuccessful {
         456  +
        /// Consumes the builder and constructs a [`ThrottlingError`](crate::error::ThrottlingError).
         457  +
        pub fn build(self) -> crate::error::ThrottlingError {
  474    458   
            self.build_enforcing_all_constraints()
  475    459   
        }
  476         -
        fn build_enforcing_all_constraints(self) -> crate::error::MasterBallUnsuccessful {
  477         -
            crate::error::MasterBallUnsuccessful {
  478         -
                message: self.message,
  479         -
            }
         460  +
        fn build_enforcing_all_constraints(self) -> crate::error::ThrottlingError {
         461  +
            crate::error::ThrottlingError {}
  480    462   
        }
  481    463   
    }
  482    464   
}
  483    465   
/// See [`ValidationException`](crate::error::ValidationException).
  484    466   
pub mod validation_exception {
  485    467   
  486    468   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  487    469   
    /// Holds one variant for each of the ways the builder can fail.
  488    470   
    #[non_exhaustive]
  489    471   
    #[allow(clippy::enum_variant_names)]
@@ -517,499 +620,619 @@
  537    519   
        fn build_enforcing_all_constraints(
  538    520   
            self,
  539    521   
        ) -> Result<crate::error::ValidationException, ConstraintViolation> {
  540    522   
            Ok(crate::error::ValidationException {
  541    523   
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  542    524   
                field_list: self.field_list,
  543    525   
            })
  544    526   
        }
  545    527   
    }
  546    528   
}
  547         -
/// See [`ThrottlingError`](crate::error::ThrottlingError).
  548         -
pub mod throttling_error {
         529  +
/// See [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
         530  +
pub mod master_ball_unsuccessful {
  549    531   
  550         -
    impl ::std::convert::From<Builder> for crate::error::ThrottlingError {
         532  +
    impl ::std::convert::From<Builder> for crate::error::MasterBallUnsuccessful {
  551    533   
        fn from(builder: Builder) -> Self {
  552    534   
            builder.build()
  553    535   
        }
  554    536   
    }
  555         -
    /// A builder for [`ThrottlingError`](crate::error::ThrottlingError).
         537  +
    /// A builder for [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
  556    538   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  557         -
    pub struct Builder {}
         539  +
    pub struct Builder {
         540  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
         541  +
    }
  558    542   
    impl Builder {
  559         -
        /// Consumes the builder and constructs a [`ThrottlingError`](crate::error::ThrottlingError).
  560         -
        pub fn build(self) -> crate::error::ThrottlingError {
         543  +
        #[allow(missing_docs)] // documentation missing in model
         544  +
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         545  +
            self.message = input;
         546  +
            self
         547  +
        }
         548  +
        #[allow(missing_docs)] // documentation missing in model
         549  +
        pub(crate) fn set_message(
         550  +
            mut self,
         551  +
            input: Option<impl ::std::convert::Into<::std::string::String>>,
         552  +
        ) -> Self {
         553  +
            self.message = input.map(|v| v.into());
         554  +
            self
         555  +
        }
         556  +
        /// Consumes the builder and constructs a [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
         557  +
        pub fn build(self) -> crate::error::MasterBallUnsuccessful {
  561    558   
            self.build_enforcing_all_constraints()
  562    559   
        }
  563         -
        fn build_enforcing_all_constraints(self) -> crate::error::ThrottlingError {
  564         -
            crate::error::ThrottlingError {}
         560  +
        fn build_enforcing_all_constraints(self) -> crate::error::MasterBallUnsuccessful {
         561  +
            crate::error::MasterBallUnsuccessful {
         562  +
                message: self.message,
         563  +
            }
  565    564   
        }
  566    565   
    }
  567    566   
}
  568         -
/// See [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
  569         -
pub mod unsupported_region_error {
         567  +
/// See [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         568  +
pub mod invalid_pokeball_error {
  570    569   
  571    570   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  572    571   
    /// Holds one variant for each of the ways the builder can fail.
  573    572   
    #[non_exhaustive]
  574    573   
    #[allow(clippy::enum_variant_names)]
  575    574   
    pub enum ConstraintViolation {
  576         -
        /// `region` was not provided but it is required when building `UnsupportedRegionError`.
  577         -
        MissingRegion,
         575  +
        /// `pokeball` was not provided but it is required when building `InvalidPokeballError`.
         576  +
        MissingPokeball,
  578    577   
    }
  579    578   
    impl ::std::fmt::Display for ConstraintViolation {
  580    579   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  581    580   
            match self {
  582         -
                ConstraintViolation::MissingRegion => write!(f, "`region` was not provided but it is required when building `UnsupportedRegionError`"),
         581  +
                ConstraintViolation::MissingPokeball => write!(f, "`pokeball` was not provided but it is required when building `InvalidPokeballError`"),
  583    582   
            }
  584    583   
        }
  585    584   
    }
  586    585   
    impl ::std::error::Error for ConstraintViolation {}
  587         -
    impl ::std::convert::TryFrom<Builder> for crate::error::UnsupportedRegionError {
         586  +
    impl ::std::convert::TryFrom<Builder> for crate::error::InvalidPokeballError {
  588    587   
        type Error = ConstraintViolation;
  589    588   
  590    589   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  591    590   
            builder.build()
  592    591   
        }
  593    592   
    }
  594         -
    /// A builder for [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         593  +
    /// A builder for [`InvalidPokeballError`](crate::error::InvalidPokeballError).
  595    594   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  596    595   
    pub struct Builder {
  597         -
        pub(crate) region: ::std::option::Option<::std::string::String>,
         596  +
        pub(crate) pokeball: ::std::option::Option<::std::string::String>,
  598    597   
    }
  599    598   
    impl Builder {
  600    599   
        #[allow(missing_docs)] // documentation missing in model
  601         -
        pub fn region(mut self, input: ::std::string::String) -> Self {
  602         -
            self.region = Some(input);
         600  +
        pub fn pokeball(mut self, input: ::std::string::String) -> Self {
         601  +
            self.pokeball = Some(input);
  603    602   
            self
  604    603   
        }
  605         -
        /// Consumes the builder and constructs a [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         604  +
        /// Consumes the builder and constructs a [`InvalidPokeballError`](crate::error::InvalidPokeballError).
  606    605   
        ///
  607         -
        /// The builder fails to construct a [`UnsupportedRegionError`](crate::error::UnsupportedRegionError) if a [`ConstraintViolation`] occurs.
         606  +
        /// The builder fails to construct a [`InvalidPokeballError`](crate::error::InvalidPokeballError) if a [`ConstraintViolation`] occurs.
  608    607   
        ///
  609         -
        pub fn build(self) -> Result<crate::error::UnsupportedRegionError, ConstraintViolation> {
         608  +
        pub fn build(self) -> Result<crate::error::InvalidPokeballError, ConstraintViolation> {
  610    609   
            self.build_enforcing_all_constraints()
  611    610   
        }
  612    611   
        fn build_enforcing_all_constraints(
  613    612   
            self,
  614         -
        ) -> Result<crate::error::UnsupportedRegionError, ConstraintViolation> {
  615         -
            Ok(crate::error::UnsupportedRegionError {
  616         -
                region: self.region.ok_or(ConstraintViolation::MissingRegion)?,
         613  +
        ) -> Result<crate::error::InvalidPokeballError, ConstraintViolation> {
         614  +
            Ok(crate::error::InvalidPokeballError {
         615  +
                pokeball: self.pokeball.ok_or(ConstraintViolation::MissingPokeball)?,
  617    616   
            })
  618    617   
        }
  619    618   
    }
  620    619   
}