Server Test Typescript

Server Test Typescript

rev. 7254d43655ed63111c94f599437f2b0d3f55446e (ignoring whitespace)

Files changed:

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

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

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

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

tmp-codegen-diff/codegen-server-test-typescript/pokemon-service-server-sdk/rust-server-codegen-typescript/src/ts_operation_adaptor.rs

@@ -1,1 +60,60 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/// Typescript handler for operation `GetPokemonSpecies`.
    3         -
pub(crate) async fn get_pokemon_species(
    4         -
    input: crate::input::GetPokemonSpeciesInput,
           2  +
/// Typescript handler for operation `GetServerStatistics`.
           3  +
pub(crate) async fn get_server_statistics(
           4  +
    input: crate::input::GetServerStatisticsInput,
    5      5   
    handlers: ::aws_smithy_http_server::Extension<crate::ts_server_application::Handlers>,
    6         -
) -> std::result::Result<crate::output::GetPokemonSpeciesOutput, crate::error::GetPokemonSpeciesError>
    7         -
{
           6  +
) -> std::result::Result<
           7  +
    crate::output::GetServerStatisticsOutput,
           8  +
    crate::error::GetServerStatisticsError,
           9  +
> {
    8     10   
    handlers
    9         -
        .get_pokemon_species
   10         -
        .call_async::<::napi::bindgen_prelude::Promise<crate::output::GetPokemonSpeciesOutput>>(
          11  +
        .get_server_statistics
          12  +
        .call_async::<::napi::bindgen_prelude::Promise<crate::output::GetServerStatisticsOutput>>(
   11     13   
            input,
   12     14   
        )
   13     15   
        .await?
   14     16   
        .await
   15     17   
        .map_err(|e| e.into())
   16     18   
}
   17     19   
   18         -
/// Typescript handler for operation `CheckHealth`.
   19         -
pub(crate) async fn check_health(
   20         -
    input: crate::input::CheckHealthInput,
          20  +
/// Typescript handler for operation `DoNothing`.
          21  +
pub(crate) async fn do_nothing(
          22  +
    input: crate::input::DoNothingInput,
   21     23   
    handlers: ::aws_smithy_http_server::Extension<crate::ts_server_application::Handlers>,
   22         -
) -> std::result::Result<crate::output::CheckHealthOutput, crate::error::CheckHealthError> {
          24  +
) -> std::result::Result<crate::output::DoNothingOutput, crate::error::DoNothingError> {
   23     25   
    handlers
   24         -
        .check_health
   25         -
        .call_async::<::napi::bindgen_prelude::Promise<crate::output::CheckHealthOutput>>(input)
          26  +
        .do_nothing
          27  +
        .call_async::<::napi::bindgen_prelude::Promise<crate::output::DoNothingOutput>>(input)
   26     28   
        .await?
   27     29   
        .await
   28     30   
        .map_err(|e| e.into())
   29     31   
}
   30     32   
   31         -
/// Typescript handler for operation `DoNothing`.
   32         -
pub(crate) async fn do_nothing(
   33         -
    input: crate::input::DoNothingInput,
          33  +
/// Typescript handler for operation `CheckHealth`.
          34  +
pub(crate) async fn check_health(
          35  +
    input: crate::input::CheckHealthInput,
   34     36   
    handlers: ::aws_smithy_http_server::Extension<crate::ts_server_application::Handlers>,
   35         -
) -> std::result::Result<crate::output::DoNothingOutput, crate::error::DoNothingError> {
          37  +
) -> std::result::Result<crate::output::CheckHealthOutput, crate::error::CheckHealthError> {
   36     38   
    handlers
   37         -
        .do_nothing
   38         -
        .call_async::<::napi::bindgen_prelude::Promise<crate::output::DoNothingOutput>>(input)
          39  +
        .check_health
          40  +
        .call_async::<::napi::bindgen_prelude::Promise<crate::output::CheckHealthOutput>>(input)
   39     41   
        .await?
   40     42   
        .await
   41     43   
        .map_err(|e| e.into())
   42     44   
}
   43     45   
   44         -
/// Typescript handler for operation `GetServerStatistics`.
   45         -
pub(crate) async fn get_server_statistics(
   46         -
    input: crate::input::GetServerStatisticsInput,
          46  +
/// Typescript handler for operation `GetPokemonSpecies`.
          47  +
pub(crate) async fn get_pokemon_species(
          48  +
    input: crate::input::GetPokemonSpeciesInput,
   47     49   
    handlers: ::aws_smithy_http_server::Extension<crate::ts_server_application::Handlers>,
   48         -
) -> std::result::Result<
   49         -
    crate::output::GetServerStatisticsOutput,
   50         -
    crate::error::GetServerStatisticsError,
   51         -
> {
          50  +
) -> std::result::Result<crate::output::GetPokemonSpeciesOutput, crate::error::GetPokemonSpeciesError>
          51  +
{
   52     52   
    handlers
   53         -
        .get_server_statistics
   54         -
        .call_async::<::napi::bindgen_prelude::Promise<crate::output::GetServerStatisticsOutput>>(
          53  +
        .get_pokemon_species
          54  +
        .call_async::<::napi::bindgen_prelude::Promise<crate::output::GetPokemonSpeciesOutput>>(
   55     55   
            input,
   56     56   
        )
   57     57   
        .await?
   58     58   
        .await
   59     59   
        .map_err(|e| e.into())
   60     60   
}