Server Test

Server Test

rev. d838bf488731ae5e751cce0fe13f339a5b9be858

Files changed:

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

@@ -1,1 +123,144 @@
    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 CheckHealthInput {}
    7         -
impl CheckHealthInput {
    8         -
    /// Creates a new builder-style object to manufacture [`CheckHealthInput`](crate::input::CheckHealthInput).
    9         -
    pub fn builder() -> crate::input::check_health_input::Builder {
   10         -
        crate::input::check_health_input::Builder::default()
           6  +
pub struct GetServerStatisticsInput {}
           7  +
impl GetServerStatisticsInput {
           8  +
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
           9  +
    pub fn builder() -> crate::input::get_server_statistics_input::Builder {
          10  +
        crate::input::get_server_statistics_input::Builder::default()
   11     11   
    }
   12     12   
}
   13         -
impl crate::constrained::Constrained for crate::input::CheckHealthInput {
   14         -
    type Unconstrained = crate::input::check_health_input::Builder;
          13  +
impl crate::constrained::Constrained for crate::input::GetServerStatisticsInput {
          14  +
    type Unconstrained = crate::input::get_server_statistics_input::Builder;
          15  +
}
          16  +
          17  +
#[allow(missing_docs)] // documentation missing in model
          18  +
#[derive(
          19  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          20  +
)]
          21  +
pub struct DoNothingInput {}
          22  +
impl DoNothingInput {
          23  +
    /// Creates a new builder-style object to manufacture [`DoNothingInput`](crate::input::DoNothingInput).
          24  +
    pub fn builder() -> crate::input::do_nothing_input::Builder {
          25  +
        crate::input::do_nothing_input::Builder::default()
          26  +
    }
          27  +
}
          28  +
impl crate::constrained::Constrained for crate::input::DoNothingInput {
          29  +
    type Unconstrained = crate::input::do_nothing_input::Builder;
   15     30   
}
   16     31   
   17     32   
#[allow(missing_docs)] // documentation missing in model
   18     33   
#[derive(::std::fmt::Debug)]
   19     34   
pub struct CapturePokemonInput {
   20     35   
    #[allow(missing_docs)] // documentation missing in model
   21     36   
    pub events: ::aws_smithy_legacy_http::event_stream::Receiver<
   22     37   
        crate::model::AttemptCapturingPokemonEvent,
   23     38   
        crate::error::AttemptCapturingPokemonEventError,
   24     39   
    >,
   25     40   
}
   26     41   
impl CapturePokemonInput {
   27     42   
    #[allow(missing_docs)] // documentation missing in model
   28     43   
    pub fn events(
   29     44   
        &self,
   30     45   
    ) -> &::aws_smithy_legacy_http::event_stream::Receiver<
   31     46   
        crate::model::AttemptCapturingPokemonEvent,
   32     47   
        crate::error::AttemptCapturingPokemonEventError,
   33     48   
    > {
   34     49   
        &self.events
   35     50   
    }
   36     51   
}
   37     52   
impl CapturePokemonInput {
   38     53   
    /// Creates a new builder-style object to manufacture [`CapturePokemonInput`](crate::input::CapturePokemonInput).
   39     54   
    pub fn builder() -> crate::input::capture_pokemon_input::Builder {
   40     55   
        crate::input::capture_pokemon_input::Builder::default()
   41     56   
    }
   42     57   
}
   43     58   
impl crate::constrained::Constrained for crate::input::CapturePokemonInput {
   44     59   
    type Unconstrained = crate::input::capture_pokemon_input::Builder;
   45     60   
}
   46     61   
   47     62   
#[allow(missing_docs)] // documentation missing in model
   48     63   
#[derive(
   49     64   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   50     65   
)]
   51         -
pub struct DoNothingInput {}
   52         -
impl DoNothingInput {
   53         -
    /// Creates a new builder-style object to manufacture [`DoNothingInput`](crate::input::DoNothingInput).
   54         -
    pub fn builder() -> crate::input::do_nothing_input::Builder {
   55         -
        crate::input::do_nothing_input::Builder::default()
          66  +
pub struct CheckHealthInput {}
          67  +
impl CheckHealthInput {
          68  +
    /// Creates a new builder-style object to manufacture [`CheckHealthInput`](crate::input::CheckHealthInput).
          69  +
    pub fn builder() -> crate::input::check_health_input::Builder {
          70  +
        crate::input::check_health_input::Builder::default()
   56     71   
    }
   57     72   
}
   58         -
impl crate::constrained::Constrained for crate::input::DoNothingInput {
   59         -
    type Unconstrained = crate::input::do_nothing_input::Builder;
          73  +
impl crate::constrained::Constrained for crate::input::CheckHealthInput {
          74  +
    type Unconstrained = crate::input::check_health_input::Builder;
   60     75   
}
          76  +
/// See [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
          77  +
pub mod get_server_statistics_input {
   61     78   
   62         -
#[allow(missing_docs)] // documentation missing in model
   63         -
#[derive(
   64         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   65         -
)]
   66         -
pub struct GetServerStatisticsInput {}
   67         -
impl GetServerStatisticsInput {
   68         -
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
   69         -
    pub fn builder() -> crate::input::get_server_statistics_input::Builder {
   70         -
        crate::input::get_server_statistics_input::Builder::default()
          79  +
    impl ::std::convert::From<Builder> for crate::input::GetServerStatisticsInput {
          80  +
        fn from(builder: Builder) -> Self {
          81  +
            builder.build()
          82  +
        }
          83  +
    }
          84  +
    /// A builder for [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
          85  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
          86  +
    pub struct Builder {}
          87  +
    impl Builder {
          88  +
        /// Consumes the builder and constructs a [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
          89  +
        pub fn build(self) -> crate::input::GetServerStatisticsInput {
          90  +
            self.build_enforcing_all_constraints()
          91  +
        }
          92  +
        fn build_enforcing_all_constraints(self) -> crate::input::GetServerStatisticsInput {
          93  +
            crate::input::GetServerStatisticsInput {}
          94  +
        }
   71     95   
    }
   72     96   
}
   73         -
impl crate::constrained::Constrained for crate::input::GetServerStatisticsInput {
   74         -
    type Unconstrained = crate::input::get_server_statistics_input::Builder;
   75         -
}
   76         -
/// See [`CheckHealthInput`](crate::input::CheckHealthInput).
   77         -
pub mod check_health_input {
          97  +
/// See [`DoNothingInput`](crate::input::DoNothingInput).
          98  +
pub mod do_nothing_input {
   78     99   
   79         -
    impl ::std::convert::From<Builder> for crate::input::CheckHealthInput {
         100  +
    impl ::std::convert::From<Builder> for crate::input::DoNothingInput {
   80    101   
        fn from(builder: Builder) -> Self {
   81    102   
            builder.build()
   82    103   
        }
   83    104   
    }
   84         -
    /// A builder for [`CheckHealthInput`](crate::input::CheckHealthInput).
         105  +
    /// A builder for [`DoNothingInput`](crate::input::DoNothingInput).
   85    106   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
   86    107   
    pub struct Builder {}
   87    108   
    impl Builder {
   88         -
        /// Consumes the builder and constructs a [`CheckHealthInput`](crate::input::CheckHealthInput).
   89         -
        pub fn build(self) -> crate::input::CheckHealthInput {
         109  +
        /// Consumes the builder and constructs a [`DoNothingInput`](crate::input::DoNothingInput).
         110  +
        pub fn build(self) -> crate::input::DoNothingInput {
   90    111   
            self.build_enforcing_all_constraints()
   91    112   
        }
   92         -
        fn build_enforcing_all_constraints(self) -> crate::input::CheckHealthInput {
   93         -
            crate::input::CheckHealthInput {}
         113  +
        fn build_enforcing_all_constraints(self) -> crate::input::DoNothingInput {
         114  +
            crate::input::DoNothingInput {}
   94    115   
        }
   95    116   
    }
   96    117   
}
   97    118   
/// See [`CapturePokemonInput`](crate::input::CapturePokemonInput).
   98    119   
pub mod capture_pokemon_input {
   99    120   
  100    121   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  101    122   
    /// Holds one variant for each of the ways the builder can fail.
  102    123   
    #[non_exhaustive]
  103    124   
    #[allow(clippy::enum_variant_names)]
@@ -183,204 +254,254 @@
  203    224   
        }
  204    225   
        fn build_enforcing_all_constraints(
  205    226   
            self,
  206    227   
        ) -> Result<crate::input::CapturePokemonInput, ConstraintViolation> {
  207    228   
            Ok(crate::input::CapturePokemonInput {
  208    229   
                events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
  209    230   
            })
  210    231   
        }
  211    232   
    }
  212    233   
}
  213         -
/// See [`DoNothingInput`](crate::input::DoNothingInput).
  214         -
pub mod do_nothing_input {
  215         -
  216         -
    impl ::std::convert::From<Builder> for crate::input::DoNothingInput {
  217         -
        fn from(builder: Builder) -> Self {
  218         -
            builder.build()
  219         -
        }
  220         -
    }
  221         -
    /// A builder for [`DoNothingInput`](crate::input::DoNothingInput).
  222         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  223         -
    pub struct Builder {}
  224         -
    impl Builder {
  225         -
        /// Consumes the builder and constructs a [`DoNothingInput`](crate::input::DoNothingInput).
  226         -
        pub fn build(self) -> crate::input::DoNothingInput {
  227         -
            self.build_enforcing_all_constraints()
  228         -
        }
  229         -
        fn build_enforcing_all_constraints(self) -> crate::input::DoNothingInput {
  230         -
            crate::input::DoNothingInput {}
  231         -
        }
  232         -
    }
  233         -
}
  234         -
/// See [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
  235         -
pub mod get_server_statistics_input {
         234  +
/// See [`CheckHealthInput`](crate::input::CheckHealthInput).
         235  +
pub mod check_health_input {
  236    236   
  237         -
    impl ::std::convert::From<Builder> for crate::input::GetServerStatisticsInput {
         237  +
    impl ::std::convert::From<Builder> for crate::input::CheckHealthInput {
  238    238   
        fn from(builder: Builder) -> Self {
  239    239   
            builder.build()
  240    240   
        }
  241    241   
    }
  242         -
    /// A builder for [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
         242  +
    /// A builder for [`CheckHealthInput`](crate::input::CheckHealthInput).
  243    243   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  244    244   
    pub struct Builder {}
  245    245   
    impl Builder {
  246         -
        /// Consumes the builder and constructs a [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
  247         -
        pub fn build(self) -> crate::input::GetServerStatisticsInput {
         246  +
        /// Consumes the builder and constructs a [`CheckHealthInput`](crate::input::CheckHealthInput).
         247  +
        pub fn build(self) -> crate::input::CheckHealthInput {
  248    248   
            self.build_enforcing_all_constraints()
  249    249   
        }
  250         -
        fn build_enforcing_all_constraints(self) -> crate::input::GetServerStatisticsInput {
  251         -
            crate::input::GetServerStatisticsInput {}
         250  +
        fn build_enforcing_all_constraints(self) -> crate::input::CheckHealthInput {
         251  +
            crate::input::CheckHealthInput {}
  252    252   
        }
  253    253   
    }
  254    254   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-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   
//! The Pokémon Service allows you to retrieve information about Pokémon species.
   24     25   

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

@@ -1,1 +355,354 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Describes one specific validation failure for an input member.
    4         -
#[derive(
    5         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    6         -
)]
    7         -
pub struct ValidationExceptionField {
    8         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
    9         -
    pub path: ::std::string::String,
   10         -
    /// A detailed description of the validation failure.
   11         -
    pub message: ::std::string::String,
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           4  +
pub enum AttemptCapturingPokemonEvent {
           5  +
    #[allow(missing_docs)] // documentation missing in model
           6  +
    Event(crate::model::CapturingEvent),
   12      7   
}
   13         -
impl ValidationExceptionField {
   14         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   15         -
    pub fn path(&self) -> &str {
   16         -
        use std::ops::Deref;
   17         -
        self.path.deref()
   18         -
    }
   19         -
    /// A detailed description of the validation failure.
   20         -
    pub fn message(&self) -> &str {
   21         -
        use std::ops::Deref;
   22         -
        self.message.deref()
           8  +
impl AttemptCapturingPokemonEvent {
           9  +
    #[allow(irrefutable_let_patterns)]
          10  +
    /// Tries to convert the enum instance into [`Event`](crate::model::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::model::CapturingEvent).
          11  +
    /// Returns `Err(&Self)` if it can't be converted.
          12  +
    pub fn as_event(&self) -> ::std::result::Result<&crate::model::CapturingEvent, &Self> {
          13  +
        if let AttemptCapturingPokemonEvent::Event(val) = &self {
          14  +
            ::std::result::Result::Ok(val)
          15  +
        } else {
          16  +
            ::std::result::Result::Err(self)
          17  +
        }
   23     18   
    }
   24         -
}
   25         -
impl ValidationExceptionField {
   26         -
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
   27         -
    pub fn builder() -> crate::model::validation_exception_field::Builder {
   28         -
        crate::model::validation_exception_field::Builder::default()
          19  +
    /// Returns true if this is a [`Event`](crate::model::AttemptCapturingPokemonEvent::Event).
          20  +
    pub fn is_event(&self) -> bool {
          21  +
        self.as_event().is_ok()
   29     22   
    }
   30     23   
}
   31     24   
   32     25   
#[allow(missing_docs)] // documentation missing in model
   33     26   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   34     27   
pub enum CapturePokemonEvents {
   35     28   
    #[allow(missing_docs)] // documentation missing in model
   36     29   
    Event(crate::model::CaptureEvent),
   37     30   
}
   38     31   
impl CapturePokemonEvents {
   39     32   
    #[allow(irrefutable_let_patterns)]
   40     33   
    /// Tries to convert the enum instance into [`Event`](crate::model::CapturePokemonEvents::Event), extracting the inner [`CaptureEvent`](crate::model::CaptureEvent).
   41     34   
    /// Returns `Err(&Self)` if it can't be converted.
   42     35   
    pub fn as_event(&self) -> ::std::result::Result<&crate::model::CaptureEvent, &Self> {
   43     36   
        if let CapturePokemonEvents::Event(val) = &self {
   44     37   
            ::std::result::Result::Ok(val)
   45     38   
        } else {
   46     39   
            ::std::result::Result::Err(self)
   47     40   
        }
   48     41   
    }
   49     42   
    /// Returns true if this is a [`Event`](crate::model::CapturePokemonEvents::Event).
   50     43   
    pub fn is_event(&self) -> bool {
   51     44   
        self.as_event().is_ok()
   52     45   
    }
   53     46   
}
   54     47   
          48  +
#[allow(missing_docs)] // documentation missing in model
          49  +
#[derive(
          50  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          51  +
)]
          52  +
pub struct CapturingEvent {
          53  +
    #[allow(missing_docs)] // documentation missing in model
          54  +
    pub payload: ::std::option::Option<crate::model::CapturingPayload>,
          55  +
}
          56  +
impl CapturingEvent {
          57  +
    #[allow(missing_docs)] // documentation missing in model
          58  +
    pub fn payload(&self) -> ::std::option::Option<&crate::model::CapturingPayload> {
          59  +
        self.payload.as_ref()
          60  +
    }
          61  +
}
          62  +
impl CapturingEvent {
          63  +
    /// Creates a new builder-style object to manufacture [`CapturingEvent`](crate::model::CapturingEvent).
          64  +
    pub fn builder() -> crate::model::capturing_event::Builder {
          65  +
        crate::model::capturing_event::Builder::default()
          66  +
    }
          67  +
}
          68  +
impl crate::constrained::Constrained for crate::model::CapturingEvent {
          69  +
    type Unconstrained = crate::model::capturing_event::Builder;
          70  +
}
          71  +
   55     72   
#[allow(missing_docs)] // documentation missing in model
   56     73   
#[derive(
   57     74   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   58     75   
)]
   59     76   
pub struct CaptureEvent {
   60     77   
    #[allow(missing_docs)] // documentation missing in model
   61     78   
    pub name: ::std::option::Option<::std::string::String>,
   62     79   
    #[allow(missing_docs)] // documentation missing in model
   63     80   
    pub captured: ::std::option::Option<bool>,
   64     81   
    #[allow(missing_docs)] // documentation missing in model
   65     82   
    pub shiny: ::std::option::Option<bool>,
   66     83   
    #[allow(missing_docs)] // documentation missing in model
   67     84   
    pub pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
   68     85   
}
   69     86   
impl CaptureEvent {
   70     87   
    #[allow(missing_docs)] // documentation missing in model
   71     88   
    pub fn name(&self) -> ::std::option::Option<&str> {
   72     89   
        self.name.as_deref()
   73     90   
    }
   74     91   
    #[allow(missing_docs)] // documentation missing in model
   75     92   
    pub fn captured(&self) -> ::std::option::Option<bool> {
   76     93   
        self.captured
   77     94   
    }
   78     95   
    #[allow(missing_docs)] // documentation missing in model
   79     96   
    pub fn shiny(&self) -> ::std::option::Option<bool> {
   80     97   
        self.shiny
   81     98   
    }
   82     99   
    #[allow(missing_docs)] // documentation missing in model
   83    100   
    pub fn pokedex_update(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
   84    101   
        self.pokedex_update.as_ref()
   85    102   
    }
   86    103   
}
   87    104   
impl CaptureEvent {
   88    105   
    /// Creates a new builder-style object to manufacture [`CaptureEvent`](crate::model::CaptureEvent).
   89    106   
    pub fn builder() -> crate::model::capture_event::Builder {
   90    107   
        crate::model::capture_event::Builder::default()
   91    108   
    }
   92    109   
}
   93    110   
   94         -
#[allow(missing_docs)] // documentation missing in model
   95         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   96         -
pub enum AttemptCapturingPokemonEvent {
   97         -
    #[allow(missing_docs)] // documentation missing in model
   98         -
    Event(crate::model::CapturingEvent),
   99         -
}
  100         -
impl AttemptCapturingPokemonEvent {
  101         -
    #[allow(irrefutable_let_patterns)]
  102         -
    /// Tries to convert the enum instance into [`Event`](crate::model::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::model::CapturingEvent).
  103         -
    /// Returns `Err(&Self)` if it can't be converted.
  104         -
    pub fn as_event(&self) -> ::std::result::Result<&crate::model::CapturingEvent, &Self> {
  105         -
        if let AttemptCapturingPokemonEvent::Event(val) = &self {
  106         -
            ::std::result::Result::Ok(val)
  107         -
        } else {
  108         -
            ::std::result::Result::Err(self)
  109         -
        }
  110         -
    }
  111         -
    /// Returns true if this is a [`Event`](crate::model::AttemptCapturingPokemonEvent::Event).
  112         -
    pub fn is_event(&self) -> bool {
  113         -
        self.as_event().is_ok()
  114         -
    }
  115         -
}
  116         -
  117         -
#[allow(missing_docs)] // documentation missing in model
         111  +
/// Describes one specific validation failure for an input member.
  118    112   
#[derive(
  119    113   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  120    114   
)]
  121         -
pub struct CapturingEvent {
  122         -
    #[allow(missing_docs)] // documentation missing in model
  123         -
    pub payload: ::std::option::Option<crate::model::CapturingPayload>,
         115  +
pub struct ValidationExceptionField {
         116  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         117  +
    pub path: ::std::string::String,
         118  +
    /// A detailed description of the validation failure.
         119  +
    pub message: ::std::string::String,
  124    120   
}
  125         -
impl CapturingEvent {
  126         -
    #[allow(missing_docs)] // documentation missing in model
  127         -
    pub fn payload(&self) -> ::std::option::Option<&crate::model::CapturingPayload> {
  128         -
        self.payload.as_ref()
         121  +
impl ValidationExceptionField {
         122  +
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         123  +
    pub fn path(&self) -> &str {
         124  +
        use std::ops::Deref;
         125  +
        self.path.deref()
  129    126   
    }
  130         -
}
  131         -
impl CapturingEvent {
  132         -
    /// Creates a new builder-style object to manufacture [`CapturingEvent`](crate::model::CapturingEvent).
  133         -
    pub fn builder() -> crate::model::capturing_event::Builder {
  134         -
        crate::model::capturing_event::Builder::default()
         127  +
    /// A detailed description of the validation failure.
         128  +
    pub fn message(&self) -> &str {
         129  +
        use std::ops::Deref;
         130  +
        self.message.deref()
  135    131   
    }
  136    132   
}
  137         -
impl crate::constrained::Constrained for crate::model::CapturingEvent {
  138         -
    type Unconstrained = crate::model::capturing_event::Builder;
         133  +
impl ValidationExceptionField {
         134  +
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         135  +
    pub fn builder() -> crate::model::validation_exception_field::Builder {
         136  +
        crate::model::validation_exception_field::Builder::default()
         137  +
    }
  139    138   
}
  140    139   
  141    140   
#[allow(missing_docs)] // documentation missing in model
  142    141   
#[derive(
  143    142   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  144    143   
)]
  145    144   
pub struct CapturingPayload {
  146    145   
    #[allow(missing_docs)] // documentation missing in model
  147    146   
    pub name: ::std::option::Option<::std::string::String>,
  148    147   
    #[allow(missing_docs)] // documentation missing in model
  149    148   
    pub pokeball: ::std::option::Option<::std::string::String>,
  150    149   
}
  151    150   
impl CapturingPayload {
  152    151   
    #[allow(missing_docs)] // documentation missing in model
  153    152   
    pub fn name(&self) -> ::std::option::Option<&str> {
  154    153   
        self.name.as_deref()
  155    154   
    }
  156    155   
    #[allow(missing_docs)] // documentation missing in model
  157    156   
    pub fn pokeball(&self) -> ::std::option::Option<&str> {
  158    157   
        self.pokeball.as_deref()
  159    158   
    }
  160    159   
}
  161    160   
impl CapturingPayload {
  162    161   
    /// Creates a new builder-style object to manufacture [`CapturingPayload`](crate::model::CapturingPayload).
  163    162   
    pub fn builder() -> crate::model::capturing_payload::Builder {
  164    163   
        crate::model::capturing_payload::Builder::default()
  165    164   
    }
  166    165   
}
  167    166   
impl crate::constrained::Constrained for crate::model::CapturingPayload {
  168    167   
    type Unconstrained = crate::model::capturing_payload::Builder;
  169    168   
}
  170         -
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  171         -
pub mod validation_exception_field {
  172         -
  173         -
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  174         -
    /// Holds one variant for each of the ways the builder can fail.
  175         -
    #[non_exhaustive]
  176         -
    #[allow(clippy::enum_variant_names)]
  177         -
    pub enum ConstraintViolation {
  178         -
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
  179         -
        MissingPath,
  180         -
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
  181         -
        MissingMessage,
  182         -
    }
  183         -
    impl ::std::fmt::Display for ConstraintViolation {
  184         -
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  185         -
            match self {
  186         -
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
  187         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
  188         -
            }
  189         -
        }
  190         -
    }
  191         -
    impl ::std::error::Error for ConstraintViolation {}
  192         -
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
  193         -
        type Error = ConstraintViolation;
         169  +
/// See [`CapturingEvent`](crate::model::CapturingEvent).
         170  +
pub mod capturing_event {
  194    171   
  195         -
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         172  +
    impl ::std::convert::From<Builder> for crate::model::CapturingEvent {
         173  +
        fn from(builder: Builder) -> Self {
  196    174   
            builder.build()
  197    175   
        }
  198    176   
    }
  199         -
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         177  +
    /// A builder for [`CapturingEvent`](crate::model::CapturingEvent).
  200    178   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  201    179   
    pub struct Builder {
  202         -
        pub(crate) path: ::std::option::Option<::std::string::String>,
  203         -
        pub(crate) message: ::std::option::Option<::std::string::String>,
         180  +
        pub(crate) payload: ::std::option::Option<crate::model::CapturingPayload>,
  204    181   
    }
  205    182   
    impl Builder {
  206         -
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
  207         -
        pub fn path(mut self, input: ::std::string::String) -> Self {
  208         -
            self.path = Some(input);
         183  +
        #[allow(missing_docs)] // documentation missing in model
         184  +
        pub fn payload(
         185  +
            mut self,
         186  +
            input: ::std::option::Option<crate::model::CapturingPayload>,
         187  +
        ) -> Self {
         188  +
            self.payload = input;
  209    189   
            self
  210    190   
        }
  211         -
        /// A detailed description of the validation failure.
  212         -
        pub fn message(mut self, input: ::std::string::String) -> Self {
  213         -
            self.message = Some(input);
         191  +
        #[allow(missing_docs)] // documentation missing in model
         192  +
        pub(crate) fn set_payload(
         193  +
            mut self,
         194  +
            input: Option<impl ::std::convert::Into<crate::model::CapturingPayload>>,
         195  +
        ) -> Self {
         196  +
            self.payload = input.map(|v| v.into());
  214    197   
            self
  215    198   
        }
  216         -
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  217         -
        ///
  218         -
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
  219         -
        ///
  220         -
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
  221         -
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         199  +
        /// Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
         200  +
        pub fn build(self) -> crate::model::CapturingEvent {
  222    201   
            self.build_enforcing_all_constraints()
  223    202   
        }
  224         -
        fn build_enforcing_all_constraints(
  225         -
            self,
  226         -
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  227         -
            Ok(crate::model::ValidationExceptionField {
  228         -
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
  229         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  230         -
            })
         203  +
        fn build_enforcing_all_constraints(self) -> crate::model::CapturingEvent {
         204  +
            crate::model::CapturingEvent {
         205  +
                payload: self.payload,
         206  +
            }
  231    207   
        }
  232    208   
    }
  233    209   
}
  234    210   
/// See [`CaptureEvent`](crate::model::CaptureEvent).
  235    211   
pub mod capture_event {
  236    212   
  237    213   
    impl ::std::convert::From<Builder> for crate::model::CaptureEvent {
  238    214   
        fn from(builder: Builder) -> Self {
  239    215   
            builder.build()
  240    216   
        }
  241    217   
    }
  242    218   
    /// A builder for [`CaptureEvent`](crate::model::CaptureEvent).
  243    219   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  244    220   
    pub struct Builder {
  245    221   
        pub(crate) name: ::std::option::Option<::std::string::String>,
  246    222   
        pub(crate) captured: ::std::option::Option<bool>,
  247    223   
        pub(crate) shiny: ::std::option::Option<bool>,
  248    224   
        pub(crate) pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
  249    225   
    }
  250    226   
    impl Builder {
  251    227   
        #[allow(missing_docs)] // documentation missing in model
  252    228   
        pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  253    229   
            self.name = input;
  254    230   
            self
  255    231   
        }
  256    232   
        #[allow(missing_docs)] // documentation missing in model
  257    233   
        pub fn captured(mut self, input: ::std::option::Option<bool>) -> Self {
  258    234   
            self.captured = input;
  259    235   
            self
  260    236   
        }
  261    237   
        #[allow(missing_docs)] // documentation missing in model
  262    238   
        pub fn shiny(mut self, input: ::std::option::Option<bool>) -> Self {
  263    239   
            self.shiny = input;
  264    240   
            self
  265    241   
        }
  266    242   
        #[allow(missing_docs)] // documentation missing in model
  267    243   
        pub fn pokedex_update(
  268    244   
            mut self,
  269    245   
            input: ::std::option::Option<::aws_smithy_types::Blob>,
  270    246   
        ) -> Self {
  271    247   
            self.pokedex_update = input;
  272    248   
            self
  273    249   
        }
  274    250   
        /// Consumes the builder and constructs a [`CaptureEvent`](crate::model::CaptureEvent).
  275    251   
        pub fn build(self) -> crate::model::CaptureEvent {
  276    252   
            self.build_enforcing_all_constraints()
  277    253   
        }
  278    254   
        fn build_enforcing_all_constraints(self) -> crate::model::CaptureEvent {
  279    255   
            crate::model::CaptureEvent {
  280    256   
                name: self.name,
  281    257   
                captured: self.captured,
  282    258   
                shiny: self.shiny,
  283    259   
                pokedex_update: self.pokedex_update,
  284    260   
            }
  285    261   
        }
  286    262   
    }
  287    263   
}
  288         -
/// See [`CapturingEvent`](crate::model::CapturingEvent).
  289         -
pub mod capturing_event {
         264  +
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         265  +
pub mod validation_exception_field {
  290    266   
  291         -
    impl ::std::convert::From<Builder> for crate::model::CapturingEvent {
  292         -
        fn from(builder: Builder) -> Self {
         267  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         268  +
    /// Holds one variant for each of the ways the builder can fail.
         269  +
    #[non_exhaustive]
         270  +
    #[allow(clippy::enum_variant_names)]
         271  +
    pub enum ConstraintViolation {
         272  +
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         273  +
        MissingPath,
         274  +
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         275  +
        MissingMessage,
         276  +
    }
         277  +
    impl ::std::fmt::Display for ConstraintViolation {
         278  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         279  +
            match self {
         280  +
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         281  +
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         282  +
            }
         283  +
        }
         284  +
    }
         285  +
    impl ::std::error::Error for ConstraintViolation {}
         286  +
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
         287  +
        type Error = ConstraintViolation;
         288  +
         289  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  293    290   
            builder.build()
  294    291   
        }
  295    292   
    }
  296         -
    /// A builder for [`CapturingEvent`](crate::model::CapturingEvent).
         293  +
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  297    294   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  298    295   
    pub struct Builder {
  299         -
        pub(crate) payload: ::std::option::Option<crate::model::CapturingPayload>,
         296  +
        pub(crate) path: ::std::option::Option<::std::string::String>,
         297  +
        pub(crate) message: ::std::option::Option<::std::string::String>,
  300    298   
    }
  301    299   
    impl Builder {
  302         -
        #[allow(missing_docs)] // documentation missing in model
  303         -
        pub fn payload(
  304         -
            mut self,
  305         -
            input: ::std::option::Option<crate::model::CapturingPayload>,
  306         -
        ) -> Self {
  307         -
            self.payload = input;
         300  +
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         301  +
        pub fn path(mut self, input: ::std::string::String) -> Self {
         302  +
            self.path = Some(input);
  308    303   
            self
  309    304   
        }
  310         -
        #[allow(missing_docs)] // documentation missing in model
  311         -
        pub(crate) fn set_payload(
  312         -
            mut self,
  313         -
            input: Option<impl ::std::convert::Into<crate::model::CapturingPayload>>,
  314         -
        ) -> Self {
  315         -
            self.payload = input.map(|v| v.into());
         305  +
        /// A detailed description of the validation failure.
         306  +
        pub fn message(mut self, input: ::std::string::String) -> Self {
         307  +
            self.message = Some(input);
  316    308   
            self
  317    309   
        }
  318         -
        /// Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
  319         -
        pub fn build(self) -> crate::model::CapturingEvent {
         310  +
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         311  +
        ///
         312  +
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
         313  +
        ///
         314  +
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         315  +
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  320    316   
            self.build_enforcing_all_constraints()
  321    317   
        }
  322         -
        fn build_enforcing_all_constraints(self) -> crate::model::CapturingEvent {
  323         -
            crate::model::CapturingEvent {
  324         -
                payload: self.payload,
  325         -
            }
         318  +
        fn build_enforcing_all_constraints(
         319  +
            self,
         320  +
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
         321  +
            Ok(crate::model::ValidationExceptionField {
         322  +
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
         323  +
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
         324  +
            })
  326    325   
        }
  327    326   
    }
  328    327   
}
  329    328   
/// See [`CapturingPayload`](crate::model::CapturingPayload).
  330    329   
pub mod capturing_payload {
  331    330   
  332    331   
    impl ::std::convert::From<Builder> for crate::model::CapturingPayload {
  333    332   
        fn from(builder: Builder) -> Self {
  334    333   
            builder.build()
  335    334   
        }

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

@@ -1,1 +330,330 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
::pin_project_lite::pin_project! {
    3      3   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    4         -
    /// [`CheckHealthInput`](crate::input::CheckHealthInput) using modelled bindings.
    5         -
    pub struct CheckHealthInputFuture {
    6         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::CheckHealthInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
           4  +
    /// [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput) using modelled bindings.
           5  +
    pub struct GetServerStatisticsInputFuture {
           6  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetServerStatisticsInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
    7      7   
    }
    8      8   
}
    9      9   
   10         -
impl std::future::Future for CheckHealthInputFuture {
          10  +
impl std::future::Future for GetServerStatisticsInputFuture {
   11     11   
    type Output = Result<
   12         -
        crate::input::CheckHealthInput,
          12  +
        crate::input::GetServerStatisticsInput,
   13     13   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
   14     14   
    >;
   15     15   
   16     16   
    fn poll(
   17     17   
        self: std::pin::Pin<&mut Self>,
   18     18   
        cx: &mut std::task::Context<'_>,
   19     19   
    ) -> std::task::Poll<Self::Output> {
   20     20   
        let this = self.project();
   21     21   
        this.inner.as_mut().poll(cx)
   22     22   
    }
   23     23   
}
   24     24   
   25     25   
impl<B>
   26     26   
    ::aws_smithy_legacy_http_server::request::FromRequest<
   27     27   
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
   28     28   
        B,
   29         -
    > for crate::input::CheckHealthInput
          29  +
    > for crate::input::GetServerStatisticsInput
   30     30   
where
   31     31   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   32     32   
    B: 'static,
   33     33   
   34     34   
    B::Data: Send,
   35     35   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
   36     36   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   37     37   
{
   38     38   
    type Rejection =
   39     39   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
   40         -
    type Future = CheckHealthInputFuture;
          40  +
    type Future = GetServerStatisticsInputFuture;
   41     41   
   42     42   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   43     43   
        let fut = async move {
   44     44   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
   45     45   
                request.headers(),
   46     46   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_0,
   47     47   
            ) {
   48     48   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
   49     49   
            }
   50         -
            crate::protocol_serde::shape_check_health::de_check_health_http_request(request).await
          50  +
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_request(request)
          51  +
                            .await
   51     52   
        };
   52     53   
        use ::futures_util::future::TryFutureExt;
   53     54   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
   54     55   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
   55     56   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
   56     57   
                    });
   57         -
        CheckHealthInputFuture {
          58  +
        GetServerStatisticsInputFuture {
   58     59   
            inner: Box::pin(fut),
   59     60   
        }
   60     61   
    }
   61     62   
}
   62     63   
impl
   63     64   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
   64     65   
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
   65         -
    > for crate::output::CheckHealthOutput
          66  +
    > for crate::output::GetServerStatisticsOutput
   66     67   
{
   67     68   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
   68         -
        match crate::protocol_serde::shape_check_health::ser_check_health_http_response(self) {
   69         -
            Ok(response) => response,
   70         -
            Err(e) => {
   71         -
                ::tracing::error!(error = %e, "failed to serialize response");
   72         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
   73         -
            }
   74         -
        }
          69  +
        match crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_http_response(self) {
          70  +
                        Ok(response) => response,
          71  +
                        Err(e) => {
          72  +
                            ::tracing::error!(error = %e, "failed to serialize response");
          73  +
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
          74  +
                        }
          75  +
                    }
   75     76   
    }
   76     77   
}
   77     78   
   78     79   
::pin_project_lite::pin_project! {
   79     80   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
   80         -
    /// [`CapturePokemonInput`](crate::input::CapturePokemonInput) using modelled bindings.
   81         -
    pub struct CapturePokemonInputFuture {
   82         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::CapturePokemonInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
          81  +
    /// [`DoNothingInput`](crate::input::DoNothingInput) using modelled bindings.
          82  +
    pub struct DoNothingInputFuture {
          83  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DoNothingInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
   83     84   
    }
   84     85   
}
   85     86   
   86         -
impl std::future::Future for CapturePokemonInputFuture {
          87  +
impl std::future::Future for DoNothingInputFuture {
   87     88   
    type Output = Result<
   88         -
        crate::input::CapturePokemonInput,
          89  +
        crate::input::DoNothingInput,
   89     90   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
   90     91   
    >;
   91     92   
   92     93   
    fn poll(
   93     94   
        self: std::pin::Pin<&mut Self>,
   94     95   
        cx: &mut std::task::Context<'_>,
   95     96   
    ) -> std::task::Poll<Self::Output> {
   96     97   
        let this = self.project();
   97     98   
        this.inner.as_mut().poll(cx)
   98     99   
    }
   99    100   
}
  100    101   
  101    102   
impl<B>
  102    103   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  103    104   
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
  104    105   
        B,
  105         -
    > for crate::input::CapturePokemonInput
         106  +
    > for crate::input::DoNothingInput
  106    107   
where
  107    108   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  108    109   
    B: 'static,
  109    110   
  110         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
  111    111   
    B::Data: Send,
  112    112   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  113    113   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  114    114   
{
  115    115   
    type Rejection =
  116    116   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  117         -
    type Future = CapturePokemonInputFuture;
         117  +
    type Future = DoNothingInputFuture;
  118    118   
  119    119   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  120    120   
        let fut = async move {
  121    121   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  122    122   
                request.headers(),
  123    123   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_0,
  124    124   
            ) {
  125    125   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  126    126   
            }
  127         -
            crate::protocol_serde::shape_capture_pokemon::de_capture_pokemon_http_request(request)
  128         -
                .await
         127  +
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request).await
  129    128   
        };
  130    129   
        use ::futures_util::future::TryFutureExt;
  131    130   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  132    131   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  133    132   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  134    133   
                    });
  135         -
        CapturePokemonInputFuture {
         134  +
        DoNothingInputFuture {
  136    135   
            inner: Box::pin(fut),
  137    136   
        }
  138    137   
    }
  139    138   
}
  140    139   
impl
  141    140   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  142    141   
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
  143         -
    > for crate::output::CapturePokemonOutput
         142  +
    > for crate::output::DoNothingOutput
  144    143   
{
  145    144   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  146         -
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_response(self)
  147         -
        {
         145  +
        match crate::protocol_serde::shape_do_nothing::ser_do_nothing_http_response(self) {
  148    146   
            Ok(response) => response,
  149    147   
            Err(e) => {
  150    148   
                ::tracing::error!(error = %e, "failed to serialize response");
  151    149   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  152    150   
            }
  153    151   
        }
  154    152   
    }
  155    153   
}
  156         -
impl
  157         -
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  158         -
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
  159         -
    > for crate::error::CapturePokemonError
  160         -
{
  161         -
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  162         -
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_error(&self) {
  163         -
            Ok(mut response) => {
  164         -
                response.extensions_mut().insert(
  165         -
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
  166         -
                        self.name(),
  167         -
                    ),
  168         -
                );
  169         -
                response
  170         -
            }
  171         -
            Err(e) => {
  172         -
                ::tracing::error!(error = %e, "failed to serialize response");
  173         -
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  174         -
            }
  175         -
        }
  176         -
    }
  177         -
}
  178    154   
  179    155   
::pin_project_lite::pin_project! {
  180    156   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  181         -
    /// [`DoNothingInput`](crate::input::DoNothingInput) using modelled bindings.
  182         -
    pub struct DoNothingInputFuture {
  183         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DoNothingInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         157  +
    /// [`CapturePokemonInput`](crate::input::CapturePokemonInput) using modelled bindings.
         158  +
    pub struct CapturePokemonInputFuture {
         159  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::CapturePokemonInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  184    160   
    }
  185    161   
}
  186    162   
  187         -
impl std::future::Future for DoNothingInputFuture {
         163  +
impl std::future::Future for CapturePokemonInputFuture {
  188    164   
    type Output = Result<
  189         -
        crate::input::DoNothingInput,
         165  +
        crate::input::CapturePokemonInput,
  190    166   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  191    167   
    >;
  192    168   
  193    169   
    fn poll(
  194    170   
        self: std::pin::Pin<&mut Self>,
  195    171   
        cx: &mut std::task::Context<'_>,
  196    172   
    ) -> std::task::Poll<Self::Output> {
  197    173   
        let this = self.project();
  198    174   
        this.inner.as_mut().poll(cx)
  199    175   
    }
  200    176   
}
  201    177   
  202    178   
impl<B>
  203    179   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  204    180   
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
  205    181   
        B,
  206         -
    > for crate::input::DoNothingInput
         182  +
    > for crate::input::CapturePokemonInput
  207    183   
where
  208    184   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  209    185   
    B: 'static,
  210    186   
         187  +
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
  211    188   
    B::Data: Send,
  212    189   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  213    190   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  214    191   
{
  215    192   
    type Rejection =
  216    193   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  217         -
    type Future = DoNothingInputFuture;
         194  +
    type Future = CapturePokemonInputFuture;
  218    195   
  219    196   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  220    197   
        let fut = async move {
  221    198   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  222    199   
                request.headers(),
  223    200   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_0,
  224    201   
            ) {
  225    202   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  226    203   
            }
  227         -
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request).await
         204  +
            crate::protocol_serde::shape_capture_pokemon::de_capture_pokemon_http_request(request)
         205  +
                .await
  228    206   
        };
  229    207   
        use ::futures_util::future::TryFutureExt;
  230    208   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  231    209   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  232    210   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  233    211   
                    });
  234         -
        DoNothingInputFuture {
         212  +
        CapturePokemonInputFuture {
  235    213   
            inner: Box::pin(fut),
  236    214   
        }
  237    215   
    }
  238    216   
}
  239    217   
impl
  240    218   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  241    219   
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
  242         -
    > for crate::output::DoNothingOutput
         220  +
    > for crate::output::CapturePokemonOutput
  243    221   
{
  244    222   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  245         -
        match crate::protocol_serde::shape_do_nothing::ser_do_nothing_http_response(self) {
         223  +
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_response(self)
         224  +
        {
  246    225   
            Ok(response) => response,
  247    226   
            Err(e) => {
  248    227   
                ::tracing::error!(error = %e, "failed to serialize response");
  249    228   
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  250    229   
            }
  251    230   
        }
  252    231   
    }
  253    232   
}
         233  +
impl
         234  +
    ::aws_smithy_legacy_http_server::response::IntoResponse<
         235  +
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
         236  +
    > for crate::error::CapturePokemonError
         237  +
{
         238  +
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
         239  +
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_error(&self) {
         240  +
            Ok(mut response) => {
         241  +
                response.extensions_mut().insert(
         242  +
                    ::aws_smithy_legacy_http_server::extension::ModeledErrorExtension::new(
         243  +
                        self.name(),
         244  +
                    ),
         245  +
                );
         246  +
                response
         247  +
            }
         248  +
            Err(e) => {
         249  +
                ::tracing::error!(error = %e, "failed to serialize response");
         250  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         251  +
            }
         252  +
        }
         253  +
    }
         254  +
}
  254    255   
  255    256   
::pin_project_lite::pin_project! {
  256    257   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  257         -
    /// [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput) using modelled bindings.
  258         -
    pub struct GetServerStatisticsInputFuture {
  259         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetServerStatisticsInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
         258  +
    /// [`CheckHealthInput`](crate::input::CheckHealthInput) using modelled bindings.
         259  +
    pub struct CheckHealthInputFuture {
         260  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::CheckHealthInput, ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
  260    261   
    }
  261    262   
}
  262    263   
  263         -
impl std::future::Future for GetServerStatisticsInputFuture {
         264  +
impl std::future::Future for CheckHealthInputFuture {
  264    265   
    type Output = Result<
  265         -
        crate::input::GetServerStatisticsInput,
         266  +
        crate::input::CheckHealthInput,
  266    267   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError,
  267    268   
    >;
  268    269   
  269    270   
    fn poll(
  270    271   
        self: std::pin::Pin<&mut Self>,
  271    272   
        cx: &mut std::task::Context<'_>,
  272    273   
    ) -> std::task::Poll<Self::Output> {
  273    274   
        let this = self.project();
  274    275   
        this.inner.as_mut().poll(cx)
  275    276   
    }
  276    277   
}
  277    278   
  278    279   
impl<B>
  279    280   
    ::aws_smithy_legacy_http_server::request::FromRequest<
  280    281   
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
  281    282   
        B,
  282         -
    > for crate::input::GetServerStatisticsInput
         283  +
    > for crate::input::CheckHealthInput
  283    284   
where
  284    285   
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
  285    286   
    B: 'static,
  286    287   
  287    288   
    B::Data: Send,
  288    289   
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
  289    290   
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
  290    291   
{
  291    292   
    type Rejection =
  292    293   
        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  293         -
    type Future = GetServerStatisticsInputFuture;
         294  +
    type Future = CheckHealthInputFuture;
  294    295   
  295    296   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  296    297   
        let fut = async move {
  297    298   
            if !::aws_smithy_legacy_http_server::protocol::accept_header_classifier(
  298    299   
                request.headers(),
  299    300   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_0,
  300    301   
            ) {
  301    302   
                return Err(::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  302    303   
            }
  303         -
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_request(request)
  304         -
                            .await
         304  +
            crate::protocol_serde::shape_check_health::de_check_health_http_request(request).await
  305    305   
        };
  306    306   
        use ::futures_util::future::TryFutureExt;
  307    307   
        let fut = fut.map_err(|e: ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection| {
  308    308   
                        ::tracing::debug!(error = %e, "failed to deserialize request");
  309    309   
                        ::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  310    310   
                    });
  311         -
        GetServerStatisticsInputFuture {
         311  +
        CheckHealthInputFuture {
  312    312   
            inner: Box::pin(fut),
  313    313   
        }
  314    314   
    }
  315    315   
}
  316    316   
impl
  317    317   
    ::aws_smithy_legacy_http_server::response::IntoResponse<
  318    318   
        ::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0,
  319         -
    > for crate::output::GetServerStatisticsOutput
         319  +
    > for crate::output::CheckHealthOutput
  320    320   
{
  321    321   
    fn into_response(self) -> ::aws_smithy_legacy_http_server::response::Response {
  322         -
        match crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_http_response(self) {
  323         -
                        Ok(response) => response,
  324         -
                        Err(e) => {
  325         -
                            ::tracing::error!(error = %e, "failed to serialize response");
  326         -
                            ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  327         -
                        }
  328         -
                    }
         322  +
        match crate::protocol_serde::shape_check_health::ser_check_health_http_response(self) {
         323  +
            Ok(response) => response,
         324  +
            Err(e) => {
         325  +
                ::tracing::error!(error = %e, "failed to serialize response");
         326  +
                ::aws_smithy_legacy_http_server::response::IntoResponse::<::aws_smithy_legacy_http_server::protocol::aws_json_10::AwsJson1_0>::into_response(::aws_smithy_legacy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
         327  +
            }
         328  +
        }
  329    329   
    }
  330    330   
}

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

@@ -1,1 +148,148 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// Health check operation, to check the service is up Not yet a deep check
    4         -
pub struct CheckHealth;
           3  +
/// Retrieve HTTP server statistiscs, such as calls count.
           4  +
pub struct GetServerStatistics;
    5      5   
    6         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for CheckHealth {
           6  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for GetServerStatistics {
    7      7   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
    8      8   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
    9         -
            "com.aws.example#CheckHealth",
           9  +
            "com.aws.example#GetServerStatistics",
   10     10   
            "com.aws.example",
   11         -
            "CheckHealth",
          11  +
            "GetServerStatistics",
   12     12   
        );
   13     13   
   14         -
    type Input = crate::input::CheckHealthInput;
   15         -
    type Output = crate::output::CheckHealthOutput;
          14  +
    type Input = crate::input::GetServerStatisticsInput;
          15  +
    type Output = crate::output::GetServerStatisticsOutput;
   16     16   
    type Error = std::convert::Infallible;
   17     17   
}
   18     18   
   19         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for CheckHealth {
          19  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
          20  +
    for GetServerStatistics
          21  +
{
   20     22   
    type RequestFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt<
   21     23   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   22     24   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::uri::MakeUri<
   23     25   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   24     26   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   25     27   
        >,
   26     28   
    >;
   27     29   
    type ResponseFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt<
   28     30   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   29     31   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   30     32   
    >;
   31     33   
   32     34   
    fn request_fmt() -> Self::RequestFmt {
   33     35   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   34     36   
    }
   35     37   
   36     38   
    fn response_fmt() -> Self::ResponseFmt {
   37     39   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   38     40   
    }
   39     41   
}
   40     42   
   41         -
/// Capture Pokémons via event streams.
   42         -
pub struct CapturePokemon;
   43         -
   44         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for CapturePokemon {
   45         -
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   46         -
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
   47         -
            "com.aws.example#CapturePokemon",
   48         -
            "com.aws.example",
   49         -
            "CapturePokemon",
   50         -
        );
   51         -
   52         -
    type Input = crate::input::CapturePokemonInput;
   53         -
    type Output = crate::output::CapturePokemonOutput;
   54         -
    type Error = crate::error::CapturePokemonError;
   55         -
}
   56         -
   57         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for CapturePokemon {
   58         -
    type RequestFmt =
   59         -
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   60         -
    type ResponseFmt =
   61         -
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   62         -
   63         -
    fn request_fmt() -> Self::RequestFmt {
   64         -
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
   65         -
    }
   66         -
   67         -
    fn response_fmt() -> Self::ResponseFmt {
   68         -
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   69         -
    }
   70         -
}
   71         -
   72     43   
/// DoNothing operation, used to stress test the framework.
   73     44   
pub struct DoNothing;
   74     45   
   75     46   
impl ::aws_smithy_legacy_http_server::operation::OperationShape for DoNothing {
   76     47   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
   77     48   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
   78     49   
            "com.aws.example#DoNothing",
   79     50   
            "com.aws.example",
   80     51   
            "DoNothing",
   81     52   
        );
   82     53   
   83     54   
    type Input = crate::input::DoNothingInput;
   84     55   
    type Output = crate::output::DoNothingOutput;
   85     56   
    type Error = std::convert::Infallible;
   86     57   
}
   87     58   
   88     59   
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for DoNothing {
   89     60   
    type RequestFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt<
   90     61   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   91     62   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::uri::MakeUri<
   92     63   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   93     64   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   94     65   
        >,
   95     66   
    >;
   96     67   
    type ResponseFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt<
   97     68   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   98     69   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
   99     70   
    >;
  100     71   
  101     72   
    fn request_fmt() -> Self::RequestFmt {
  102     73   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
  103     74   
    }
  104     75   
  105     76   
    fn response_fmt() -> Self::ResponseFmt {
  106     77   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  107     78   
    }
  108     79   
}
  109     80   
  110         -
/// Retrieve HTTP server statistiscs, such as calls count.
  111         -
pub struct GetServerStatistics;
          81  +
/// Capture Pokémons via event streams.
          82  +
pub struct CapturePokemon;
  112     83   
  113         -
impl ::aws_smithy_legacy_http_server::operation::OperationShape for GetServerStatistics {
          84  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for CapturePokemon {
  114     85   
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
  115     86   
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
  116         -
            "com.aws.example#GetServerStatistics",
          87  +
            "com.aws.example#CapturePokemon",
  117     88   
            "com.aws.example",
  118         -
            "GetServerStatistics",
          89  +
            "CapturePokemon",
  119     90   
        );
  120     91   
  121         -
    type Input = crate::input::GetServerStatisticsInput;
  122         -
    type Output = crate::output::GetServerStatisticsOutput;
          92  +
    type Input = crate::input::CapturePokemonInput;
          93  +
    type Output = crate::output::CapturePokemonOutput;
          94  +
    type Error = crate::error::CapturePokemonError;
          95  +
}
          96  +
          97  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for CapturePokemon {
          98  +
    type RequestFmt =
          99  +
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
         100  +
    type ResponseFmt =
         101  +
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
         102  +
         103  +
    fn request_fmt() -> Self::RequestFmt {
         104  +
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt::new()
         105  +
    }
         106  +
         107  +
    fn response_fmt() -> Self::ResponseFmt {
         108  +
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt::new()
         109  +
    }
         110  +
}
         111  +
         112  +
/// Health check operation, to check the service is up Not yet a deep check
         113  +
pub struct CheckHealth;
         114  +
         115  +
impl ::aws_smithy_legacy_http_server::operation::OperationShape for CheckHealth {
         116  +
    const ID: ::aws_smithy_legacy_http_server::shape_id::ShapeId =
         117  +
        ::aws_smithy_legacy_http_server::shape_id::ShapeId::new(
         118  +
            "com.aws.example#CheckHealth",
         119  +
            "com.aws.example",
         120  +
            "CheckHealth",
         121  +
        );
         122  +
         123  +
    type Input = crate::input::CheckHealthInput;
         124  +
    type Output = crate::output::CheckHealthOutput;
  123    125   
    type Error = std::convert::Infallible;
  124    126   
}
  125    127   
  126         -
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity
  127         -
    for GetServerStatistics
  128         -
{
         128  +
impl ::aws_smithy_legacy_http_server::instrumentation::sensitivity::Sensitivity for CheckHealth {
  129    129   
    type RequestFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::RequestFmt<
  130    130   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  131    131   
        ::aws_smithy_legacy_http_server::instrumentation::sensitivity::uri::MakeUri<
  132    132   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  133    133   
            ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  134    134   
        >,
  135    135   
    >;
  136    136   
    type ResponseFmt = ::aws_smithy_legacy_http_server::instrumentation::sensitivity::ResponseFmt<
  137    137   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,
  138    138   
        ::aws_smithy_legacy_http_server::instrumentation::MakeIdentity,

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

@@ -1,1 +120,177 @@
    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 CheckHealthOutput {}
    7         -
impl CheckHealthOutput {
    8         -
    /// Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::output::CheckHealthOutput).
    9         -
    pub fn builder() -> crate::output::check_health_output::Builder {
   10         -
        crate::output::check_health_output::Builder::default()
           6  +
pub struct GetServerStatisticsOutput {
           7  +
    /// The number of calls executed by the server.
           8  +
    pub calls_count: i64,
           9  +
}
          10  +
impl GetServerStatisticsOutput {
          11  +
    /// The number of calls executed by the server.
          12  +
    pub fn calls_count(&self) -> i64 {
          13  +
        self.calls_count
          14  +
    }
          15  +
}
          16  +
impl GetServerStatisticsOutput {
          17  +
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
          18  +
    pub fn builder() -> crate::output::get_server_statistics_output::Builder {
          19  +
        crate::output::get_server_statistics_output::Builder::default()
          20  +
    }
          21  +
}
          22  +
          23  +
#[allow(missing_docs)] // documentation missing in model
          24  +
#[derive(
          25  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          26  +
)]
          27  +
pub struct DoNothingOutput {}
          28  +
impl DoNothingOutput {
          29  +
    /// Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::output::DoNothingOutput).
          30  +
    pub fn builder() -> crate::output::do_nothing_output::Builder {
          31  +
        crate::output::do_nothing_output::Builder::default()
   11     32   
    }
   12     33   
}
   13     34   
   14     35   
#[allow(missing_docs)] // documentation missing in model
   15     36   
#[derive(::std::fmt::Debug)]
   16     37   
pub struct CapturePokemonOutput {
   17     38   
    #[allow(missing_docs)] // documentation missing in model
   18     39   
    pub events: ::aws_smithy_legacy_http::event_stream::EventStreamSender<
   19     40   
        crate::model::CapturePokemonEvents,
   20     41   
        crate::error::CapturePokemonEventsError,
   21     42   
    >,
   22     43   
}
   23     44   
impl CapturePokemonOutput {
   24     45   
    #[allow(missing_docs)] // documentation missing in model
   25     46   
    pub fn events(
   26     47   
        &self,
   27     48   
    ) -> &::aws_smithy_legacy_http::event_stream::EventStreamSender<
   28     49   
        crate::model::CapturePokemonEvents,
   29     50   
        crate::error::CapturePokemonEventsError,
   30     51   
    > {
   31     52   
        &self.events
   32     53   
    }
   33     54   
}
   34     55   
impl CapturePokemonOutput {
   35     56   
    /// Creates a new builder-style object to manufacture [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
   36     57   
    pub fn builder() -> crate::output::capture_pokemon_output::Builder {
   37     58   
        crate::output::capture_pokemon_output::Builder::default()
   38     59   
    }
   39     60   
}
   40     61   
   41     62   
#[allow(missing_docs)] // documentation missing in model
   42     63   
#[derive(
   43     64   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   44     65   
)]
   45         -
pub struct DoNothingOutput {}
   46         -
impl DoNothingOutput {
   47         -
    /// Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::output::DoNothingOutput).
   48         -
    pub fn builder() -> crate::output::do_nothing_output::Builder {
   49         -
        crate::output::do_nothing_output::Builder::default()
          66  +
pub struct CheckHealthOutput {}
          67  +
impl CheckHealthOutput {
          68  +
    /// Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::output::CheckHealthOutput).
          69  +
    pub fn builder() -> crate::output::check_health_output::Builder {
          70  +
        crate::output::check_health_output::Builder::default()
   50     71   
    }
   51     72   
}
          73  +
/// See [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
          74  +
pub mod get_server_statistics_output {
   52     75   
   53         -
#[allow(missing_docs)] // documentation missing in model
   54         -
#[derive(
   55         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   56         -
)]
   57         -
pub struct GetServerStatisticsOutput {
   58         -
    /// The number of calls executed by the server.
   59         -
    pub calls_count: i64,
   60         -
}
   61         -
impl GetServerStatisticsOutput {
   62         -
    /// The number of calls executed by the server.
   63         -
    pub fn calls_count(&self) -> i64 {
   64         -
        self.calls_count
          76  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
          77  +
    /// Holds one variant for each of the ways the builder can fail.
          78  +
    #[non_exhaustive]
          79  +
    #[allow(clippy::enum_variant_names)]
          80  +
    pub enum ConstraintViolation {
          81  +
        /// `calls_count` was not provided but it is required when building `GetServerStatisticsOutput`.
          82  +
        MissingCallsCount,
   65     83   
    }
   66         -
}
   67         -
impl GetServerStatisticsOutput {
   68         -
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
   69         -
    pub fn builder() -> crate::output::get_server_statistics_output::Builder {
   70         -
        crate::output::get_server_statistics_output::Builder::default()
          84  +
    impl ::std::fmt::Display for ConstraintViolation {
          85  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          86  +
            match self {
          87  +
                ConstraintViolation::MissingCallsCount => write!(f, "`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`"),
          88  +
            }
          89  +
        }
          90  +
    }
          91  +
    impl ::std::error::Error for ConstraintViolation {}
          92  +
    impl ::std::convert::TryFrom<Builder> for crate::output::GetServerStatisticsOutput {
          93  +
        type Error = ConstraintViolation;
          94  +
          95  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
          96  +
            builder.build()
          97  +
        }
          98  +
    }
          99  +
    /// A builder for [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         100  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         101  +
    pub struct Builder {
         102  +
        pub(crate) calls_count: ::std::option::Option<i64>,
         103  +
    }
         104  +
    impl Builder {
         105  +
        /// The number of calls executed by the server.
         106  +
        pub fn calls_count(mut self, input: i64) -> Self {
         107  +
            self.calls_count = Some(input);
         108  +
            self
         109  +
        }
         110  +
        /// Consumes the builder and constructs a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         111  +
        ///
         112  +
        /// The builder fails to construct a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput) if a [`ConstraintViolation`] occurs.
         113  +
        ///
         114  +
        pub fn build(
         115  +
            self,
         116  +
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
         117  +
            self.build_enforcing_all_constraints()
         118  +
        }
         119  +
        fn build_enforcing_all_constraints(
         120  +
            self,
         121  +
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
         122  +
            Ok(crate::output::GetServerStatisticsOutput {
         123  +
                calls_count: self
         124  +
                    .calls_count
         125  +
                    .ok_or(ConstraintViolation::MissingCallsCount)?,
         126  +
            })
         127  +
        }
   71    128   
    }
   72    129   
}
   73         -
/// See [`CheckHealthOutput`](crate::output::CheckHealthOutput).
   74         -
pub mod check_health_output {
         130  +
/// See [`DoNothingOutput`](crate::output::DoNothingOutput).
         131  +
pub mod do_nothing_output {
   75    132   
   76         -
    impl ::std::convert::From<Builder> for crate::output::CheckHealthOutput {
         133  +
    impl ::std::convert::From<Builder> for crate::output::DoNothingOutput {
   77    134   
        fn from(builder: Builder) -> Self {
   78    135   
            builder.build()
   79    136   
        }
   80    137   
    }
   81         -
    /// A builder for [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         138  +
    /// A builder for [`DoNothingOutput`](crate::output::DoNothingOutput).
   82    139   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
   83    140   
    pub struct Builder {}
   84    141   
    impl Builder {
   85         -
        /// Consumes the builder and constructs a [`CheckHealthOutput`](crate::output::CheckHealthOutput).
   86         -
        pub fn build(self) -> crate::output::CheckHealthOutput {
         142  +
        /// Consumes the builder and constructs a [`DoNothingOutput`](crate::output::DoNothingOutput).
         143  +
        pub fn build(self) -> crate::output::DoNothingOutput {
   87    144   
            self.build_enforcing_all_constraints()
   88    145   
        }
   89         -
        fn build_enforcing_all_constraints(self) -> crate::output::CheckHealthOutput {
   90         -
            crate::output::CheckHealthOutput {}
         146  +
        fn build_enforcing_all_constraints(self) -> crate::output::DoNothingOutput {
         147  +
            crate::output::DoNothingOutput {}
   91    148   
        }
   92    149   
    }
   93    150   
}
   94    151   
/// See [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
   95    152   
pub mod capture_pokemon_output {
   96    153   
   97    154   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
   98    155   
    /// Holds one variant for each of the ways the builder can fail.
   99    156   
    #[non_exhaustive]
  100    157   
    #[allow(clippy::enum_variant_names)]
@@ -128,185 +235,235 @@
  148    205   
        }
  149    206   
        fn build_enforcing_all_constraints(
  150    207   
            self,
  151    208   
        ) -> Result<crate::output::CapturePokemonOutput, ConstraintViolation> {
  152    209   
            Ok(crate::output::CapturePokemonOutput {
  153    210   
                events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
  154    211   
            })
  155    212   
        }
  156    213   
    }
  157    214   
}
  158         -
/// See [`DoNothingOutput`](crate::output::DoNothingOutput).
  159         -
pub mod do_nothing_output {
         215  +
/// See [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         216  +
pub mod check_health_output {
  160    217   
  161         -
    impl ::std::convert::From<Builder> for crate::output::DoNothingOutput {
         218  +
    impl ::std::convert::From<Builder> for crate::output::CheckHealthOutput {
  162    219   
        fn from(builder: Builder) -> Self {
  163    220   
            builder.build()
  164    221   
        }
  165    222   
    }
  166         -
    /// A builder for [`DoNothingOutput`](crate::output::DoNothingOutput).
         223  +
    /// A builder for [`CheckHealthOutput`](crate::output::CheckHealthOutput).
  167    224   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  168    225   
    pub struct Builder {}
  169    226   
    impl Builder {
  170         -
        /// Consumes the builder and constructs a [`DoNothingOutput`](crate::output::DoNothingOutput).
  171         -
        pub fn build(self) -> crate::output::DoNothingOutput {
  172         -
            self.build_enforcing_all_constraints()
  173         -
        }
  174         -
        fn build_enforcing_all_constraints(self) -> crate::output::DoNothingOutput {
  175         -
            crate::output::DoNothingOutput {}
  176         -
        }
  177         -
    }
  178         -
}
  179         -
/// See [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
  180         -
pub mod get_server_statistics_output {
  181         -
  182         -
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  183         -
    /// Holds one variant for each of the ways the builder can fail.
  184         -
    #[non_exhaustive]
  185         -
    #[allow(clippy::enum_variant_names)]
  186         -
    pub enum ConstraintViolation {
  187         -
        /// `calls_count` was not provided but it is required when building `GetServerStatisticsOutput`.
  188         -
        MissingCallsCount,
  189         -
    }
  190         -
    impl ::std::fmt::Display for ConstraintViolation {
  191         -
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  192         -
            match self {
  193         -
                ConstraintViolation::MissingCallsCount => write!(f, "`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`"),
  194         -
            }
  195         -
        }
  196         -
    }
  197         -
    impl ::std::error::Error for ConstraintViolation {}
  198         -
    impl ::std::convert::TryFrom<Builder> for crate::output::GetServerStatisticsOutput {
  199         -
        type Error = ConstraintViolation;
  200         -
  201         -
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  202         -
            builder.build()
  203         -
        }
  204         -
    }
  205         -
    /// A builder for [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
  206         -
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  207         -
    pub struct Builder {
  208         -
        pub(crate) calls_count: ::std::option::Option<i64>,
  209         -
    }
  210         -
    impl Builder {
  211         -
        /// The number of calls executed by the server.
  212         -
        pub fn calls_count(mut self, input: i64) -> Self {
  213         -
            self.calls_count = Some(input);
  214         -
            self
  215         -
        }
  216         -
        /// Consumes the builder and constructs a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
  217         -
        ///
  218         -
        /// The builder fails to construct a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput) if a [`ConstraintViolation`] occurs.
  219         -
        ///
  220         -
        pub fn build(
  221         -
            self,
  222         -
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
         227  +
        /// Consumes the builder and constructs a [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         228  +
        pub fn build(self) -> crate::output::CheckHealthOutput {
  223    229   
            self.build_enforcing_all_constraints()
  224    230   
        }
  225         -
        fn build_enforcing_all_constraints(
  226         -
            self,
  227         -
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
  228         -
            Ok(crate::output::GetServerStatisticsOutput {
  229         -
                calls_count: self
  230         -
                    .calls_count
  231         -
                    .ok_or(ConstraintViolation::MissingCallsCount)?,
  232         -
            })
         231  +
        fn build_enforcing_all_constraints(self) -> crate::output::CheckHealthOutput {
         232  +
            crate::output::CheckHealthOutput {}
  233    233   
        }
  234    234   
    }
  235    235   
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/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   
}