Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/error.rs

@@ -1,1 +13,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ClientRuntimeTypesReExportGenerator.kt:96 */
    2      3   
pub use ::aws_smithy_runtime_api::box_error::BoxError;
    3      4   
           5  +
/* RequiredCustomizations.kt:104 */
    4      6   
/// Error type returned by the client.
    5      7   
pub type SdkError<E, R = ::aws_smithy_runtime_api::client::orchestrator::HttpResponse> = ::aws_smithy_runtime_api::client::result::SdkError<E, R>;
    6      8   
pub use ::aws_smithy_runtime_api::client::result::ConnectorError;
    7      9   
pub use ::aws_smithy_types::error::operation::BuildError;
    8     10   
    9     11   
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
   10     12   
pub use ::aws_smithy_types::error::metadata::ErrorMetadata;
   11     13   
pub use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
   12     14   
   13     15   
pub(crate) mod sealed_unhandled;

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/error/sealed_unhandled.rs

@@ -1,1 +20,21 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServiceErrorGenerator.kt:277 */
    2      3   
/// This struct is not intended to be used.
    3      4   
///
    4      5   
/// This struct holds information about an unhandled error,
    5      6   
/// but that information should be obtained by using the
    6      7   
/// [`ProvideErrorMetadata`](::aws_smithy_types::error::metadata::ProvideErrorMetadata) trait
    7      8   
/// on the error type.
    8      9   
///
    9     10   
/// This struct intentionally doesn't yield any useful information itself.
   10     11   
#[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
   11     12   
variable wildcard pattern and check `.code()`:

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/error_meta.rs

@@ -1,1 +208,334 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServiceErrorGenerator.kt:252 */
    2      3   
/// All possible error types for this service.
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::fmt::Debug)]
    5         -
pub enum Error {
           8  +
pub /* ServiceErrorGenerator.kt:257 */ enum Error {
           9  +
    /* ServiceErrorGenerator.kt:259 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
          11  +
    /* ServiceErrorGenerator.kt:262 */
    7     12   
    InvalidPokeballError(crate::types::error::InvalidPokeballError),
          13  +
    /* ServiceErrorGenerator.kt:259 */
    8     14   
    #[allow(missing_docs)] // documentation missing in model
          15  +
    /* ServiceErrorGenerator.kt:262 */
    9     16   
    MasterBallUnsuccessful(crate::types::error::MasterBallUnsuccessful),
          17  +
    /* ServiceErrorGenerator.kt:259 */
   10     18   
    #[allow(missing_docs)] // documentation missing in model
          19  +
    /* ServiceErrorGenerator.kt:262 */
   11     20   
    ThrottlingError(crate::types::error::ThrottlingError),
          21  +
    /* ServiceErrorGenerator.kt:259 */
   12     22   
    #[allow(missing_docs)] // documentation missing in model
          23  +
    /* ServiceErrorGenerator.kt:262 */
   13     24   
    UnsupportedRegionError(crate::types::error::UnsupportedRegionError),
   14         -
    /// 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.
          25  +
    /// /* ServiceErrorGenerator.kt:259 */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.
          26  +
    /* ServiceErrorGenerator.kt:262 */
   15     27   
    ValidationError(crate::types::error::ValidationError),
   16         -
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
          28  +
    /// /* ServiceErrorGenerator.kt:264 */An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
          29  +
    /* ServiceErrorGenerator.kt:320 */
   17     30   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
   18     31   
    variable wildcard pattern and check `.code()`:
   19     32   
     \
   20     33   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
   21     34   
     \
   22     35   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
   23         -
    Unhandled(crate::error::sealed_unhandled::Unhandled),
          36  +
    /* ServiceErrorGenerator.kt:266 */
          37  +
    Unhandled(crate::error::sealed_unhandled::Unhandled), /* ServiceErrorGenerator.kt:257 */
   24     38   
}
          39  +
/* ServiceErrorGenerator.kt:131 */
   25     40   
impl ::std::fmt::Display for Error {
          41  +
    /* ServiceErrorGenerator.kt:132 */
   26     42   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          43  +
        /* ServiceErrorGenerator.kt:133 */
   27     44   
        match self {
   28         -
            Error::InvalidPokeballError(inner) => inner.fmt(f),
   29         -
            Error::MasterBallUnsuccessful(inner) => inner.fmt(f),
   30         -
            Error::ThrottlingError(inner) => inner.fmt(f),
   31         -
            Error::UnsupportedRegionError(inner) => inner.fmt(f),
   32         -
            Error::ValidationError(inner) => inner.fmt(f),
          45  +
            /* ServiceErrorGenerator.kt:135 */ Error::InvalidPokeballError(inner) => inner.fmt(f),
          46  +
            /* ServiceErrorGenerator.kt:135 */ Error::MasterBallUnsuccessful(inner) => inner.fmt(f),
          47  +
            /* ServiceErrorGenerator.kt:135 */ Error::ThrottlingError(inner) => inner.fmt(f),
          48  +
            /* ServiceErrorGenerator.kt:135 */ Error::UnsupportedRegionError(inner) => inner.fmt(f),
          49  +
            /* ServiceErrorGenerator.kt:135 */ Error::ValidationError(inner) => inner.fmt(f),
          50  +
            /* ServiceErrorGenerator.kt:137 */
   33     51   
            Error::Unhandled(_) => {
   34     52   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
   35     53   
                    write!(f, "unhandled error ({code})")
   36     54   
                } else {
   37     55   
                    f.write_str("unhandled error")
   38     56   
                }
          57  +
            } /* ServiceErrorGenerator.kt:133 */
   39     58   
        }
          59  +
        /* ServiceErrorGenerator.kt:132 */
   40     60   
    }
   41         -
    }
          61  +
    /* ServiceErrorGenerator.kt:131 */
   42     62   
}
          63  +
/* ServiceErrorGenerator.kt:154 */
   43     64   
impl From<::aws_smithy_types::error::operation::BuildError> for Error {
   44     65   
    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
   45     66   
        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
   46     67   
            source: value.into(),
   47     68   
            meta: ::std::default::Default::default(),
   48     69   
        })
   49     70   
    }
   50     71   
}
          72  +
/* ServiceErrorGenerator.kt:223 */
   51     73   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
   52     74   
    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
   53     75   
        match self {
   54     76   
            Self::InvalidPokeballError(inner) => inner.meta(),
   55     77   
            Self::MasterBallUnsuccessful(inner) => inner.meta(),
   56     78   
            Self::ThrottlingError(inner) => inner.meta(),
   57     79   
            Self::UnsupportedRegionError(inner) => inner.meta(),
   58     80   
            Self::ValidationError(inner) => inner.meta(),
   59     81   
            Self::Unhandled(inner) => &inner.meta,
   60     82   
        }
   61     83   
    }
   62     84   
}
          85  +
/* ServiceErrorGenerator.kt:174 */
   63     86   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::capture_pokemon::CapturePokemonError, R>> for Error
   64     87   
where
   65     88   
    R: Send + Sync + std::fmt::Debug + 'static,
   66     89   
{
          90  +
    /* ServiceErrorGenerator.kt:179 */
   67     91   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::capture_pokemon::CapturePokemonError, R>) -> Self {
          92  +
        /* ServiceErrorGenerator.kt:184 */
   68     93   
        match err {
          94  +
            /* ServiceErrorGenerator.kt:185 */
   69     95   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
          96  +
            /* ServiceErrorGenerator.kt:186 */
   70     97   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
   71     98   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
   72     99   
                source: err.into(),
   73    100   
            }),
         101  +
            /* ServiceErrorGenerator.kt:184 */
   74    102   
        }
         103  +
        /* ServiceErrorGenerator.kt:179 */
   75    104   
    }
         105  +
    /* ServiceErrorGenerator.kt:174 */
   76    106   
}
         107  +
/* ServiceErrorGenerator.kt:202 */
   77    108   
impl From<crate::operation::capture_pokemon::CapturePokemonError> for Error {
         109  +
    /* ServiceErrorGenerator.kt:203 */
   78    110   
    fn from(err: crate::operation::capture_pokemon::CapturePokemonError) -> Self {
         111  +
        /* ServiceErrorGenerator.kt:204 */
   79    112   
        match err {
         113  +
            /* ServiceErrorGenerator.kt:207 */
   80    114   
            crate::operation::capture_pokemon::CapturePokemonError::ValidationError(inner) => Error::ValidationError(inner),
         115  +
            /* ServiceErrorGenerator.kt:207 */
   81    116   
            crate::operation::capture_pokemon::CapturePokemonError::MasterBallUnsuccessful(inner) => Error::MasterBallUnsuccessful(inner),
         117  +
            /* ServiceErrorGenerator.kt:207 */
   82    118   
            crate::operation::capture_pokemon::CapturePokemonError::InvalidPokeballError(inner) => Error::InvalidPokeballError(inner),
         119  +
            /* ServiceErrorGenerator.kt:207 */
   83    120   
            crate::operation::capture_pokemon::CapturePokemonError::ThrottlingError(inner) => Error::ThrottlingError(inner),
         121  +
            /* ServiceErrorGenerator.kt:207 */
   84    122   
            crate::operation::capture_pokemon::CapturePokemonError::UnsupportedRegionError(inner) => Error::UnsupportedRegionError(inner),
         123  +
            /* ServiceErrorGenerator.kt:212 */
   85    124   
            crate::operation::capture_pokemon::CapturePokemonError::Unhandled(inner) => Error::Unhandled(inner),
         125  +
            /* ServiceErrorGenerator.kt:204 */
   86    126   
        }
         127  +
        /* ServiceErrorGenerator.kt:203 */
   87    128   
    }
         129  +
    /* ServiceErrorGenerator.kt:202 */
   88    130   
}
         131  +
/* ServiceErrorGenerator.kt:174 */
   89    132   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::check_health::CheckHealthError, R>> for Error
   90    133   
where
   91    134   
    R: Send + Sync + std::fmt::Debug + 'static,
   92    135   
{
         136  +
    /* ServiceErrorGenerator.kt:179 */
   93    137   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::check_health::CheckHealthError, R>) -> Self {
         138  +
        /* ServiceErrorGenerator.kt:184 */
   94    139   
        match err {
         140  +
            /* ServiceErrorGenerator.kt:185 */
   95    141   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         142  +
            /* ServiceErrorGenerator.kt:186 */
   96    143   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
   97    144   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
   98    145   
                source: err.into(),
   99    146   
            }),
         147  +
            /* ServiceErrorGenerator.kt:184 */
  100    148   
        }
         149  +
        /* ServiceErrorGenerator.kt:179 */
  101    150   
    }
         151  +
    /* ServiceErrorGenerator.kt:174 */
  102    152   
}
         153  +
/* ServiceErrorGenerator.kt:202 */
  103    154   
impl From<crate::operation::check_health::CheckHealthError> for Error {
         155  +
    /* ServiceErrorGenerator.kt:203 */
  104    156   
    fn from(err: crate::operation::check_health::CheckHealthError) -> Self {
         157  +
        /* ServiceErrorGenerator.kt:204 */
  105    158   
        match err {
         159  +
            /* ServiceErrorGenerator.kt:212 */
  106    160   
            crate::operation::check_health::CheckHealthError::Unhandled(inner) => Error::Unhandled(inner),
         161  +
            /* ServiceErrorGenerator.kt:204 */
  107    162   
        }
         163  +
        /* ServiceErrorGenerator.kt:203 */
  108    164   
    }
         165  +
    /* ServiceErrorGenerator.kt:202 */
  109    166   
}
         167  +
/* ServiceErrorGenerator.kt:174 */
  110    168   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::do_nothing::DoNothingError, R>> for Error
  111    169   
where
  112    170   
    R: Send + Sync + std::fmt::Debug + 'static,
  113    171   
{
         172  +
    /* ServiceErrorGenerator.kt:179 */
  114    173   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::do_nothing::DoNothingError, R>) -> Self {
         174  +
        /* ServiceErrorGenerator.kt:184 */
  115    175   
        match err {
         176  +
            /* ServiceErrorGenerator.kt:185 */
  116    177   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         178  +
            /* ServiceErrorGenerator.kt:186 */
  117    179   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  118    180   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  119    181   
                source: err.into(),
  120    182   
            }),
         183  +
            /* ServiceErrorGenerator.kt:184 */
  121    184   
        }
         185  +
        /* ServiceErrorGenerator.kt:179 */
  122    186   
    }
         187  +
    /* ServiceErrorGenerator.kt:174 */
  123    188   
}
         189  +
/* ServiceErrorGenerator.kt:202 */
  124    190   
impl From<crate::operation::do_nothing::DoNothingError> for Error {
         191  +
    /* ServiceErrorGenerator.kt:203 */
  125    192   
    fn from(err: crate::operation::do_nothing::DoNothingError) -> Self {
         193  +
        /* ServiceErrorGenerator.kt:204 */
  126    194   
        match err {
         195  +
            /* ServiceErrorGenerator.kt:212 */
  127    196   
            crate::operation::do_nothing::DoNothingError::Unhandled(inner) => Error::Unhandled(inner),
         197  +
            /* ServiceErrorGenerator.kt:204 */
  128    198   
        }
         199  +
        /* ServiceErrorGenerator.kt:203 */
  129    200   
    }
         201  +
    /* ServiceErrorGenerator.kt:202 */
  130    202   
}
         203  +
/* ServiceErrorGenerator.kt:174 */
  131    204   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_server_statistics::GetServerStatisticsError, R>> for Error
  132    205   
where
  133    206   
    R: Send + Sync + std::fmt::Debug + 'static,
  134    207   
{
         208  +
    /* ServiceErrorGenerator.kt:179 */
  135    209   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_server_statistics::GetServerStatisticsError, R>) -> Self {
         210  +
        /* ServiceErrorGenerator.kt:184 */
  136    211   
        match err {
         212  +
            /* ServiceErrorGenerator.kt:185 */
  137    213   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         214  +
            /* ServiceErrorGenerator.kt:186 */
  138    215   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  139    216   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  140    217   
                source: err.into(),
  141    218   
            }),
         219  +
            /* ServiceErrorGenerator.kt:184 */
  142    220   
        }
         221  +
        /* ServiceErrorGenerator.kt:179 */
  143    222   
    }
         223  +
    /* ServiceErrorGenerator.kt:174 */
  144    224   
}
         225  +
/* ServiceErrorGenerator.kt:202 */
  145    226   
impl From<crate::operation::get_server_statistics::GetServerStatisticsError> for Error {
         227  +
    /* ServiceErrorGenerator.kt:203 */
  146    228   
    fn from(err: crate::operation::get_server_statistics::GetServerStatisticsError) -> Self {
         229  +
        /* ServiceErrorGenerator.kt:204 */
  147    230   
        match err {
         231  +
            /* ServiceErrorGenerator.kt:212 */
  148    232   
            crate::operation::get_server_statistics::GetServerStatisticsError::Unhandled(inner) => Error::Unhandled(inner),
         233  +
            /* ServiceErrorGenerator.kt:204 */
  149    234   
        }
         235  +
        /* ServiceErrorGenerator.kt:203 */
  150    236   
    }
         237  +
    /* ServiceErrorGenerator.kt:202 */
  151    238   
}
         239  +
/* ServiceErrorGenerator.kt:174 */
  152    240   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::AttemptCapturingPokemonEventError, R>> for Error
  153    241   
where
  154    242   
    R: Send + Sync + std::fmt::Debug + 'static,
  155    243   
{
         244  +
    /* ServiceErrorGenerator.kt:179 */
  156    245   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::AttemptCapturingPokemonEventError, R>) -> Self {
         246  +
        /* ServiceErrorGenerator.kt:184 */
  157    247   
        match err {
         248  +
            /* ServiceErrorGenerator.kt:185 */
  158    249   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         250  +
            /* ServiceErrorGenerator.kt:186 */
  159    251   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  160    252   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  161    253   
                source: err.into(),
  162    254   
            }),
         255  +
            /* ServiceErrorGenerator.kt:184 */
  163    256   
        }
         257  +
        /* ServiceErrorGenerator.kt:179 */
  164    258   
    }
         259  +
    /* ServiceErrorGenerator.kt:174 */
  165    260   
}
         261  +
/* ServiceErrorGenerator.kt:202 */
  166    262   
impl From<crate::types::error::AttemptCapturingPokemonEventError> for Error {
         263  +
    /* ServiceErrorGenerator.kt:203 */
  167    264   
    fn from(err: crate::types::error::AttemptCapturingPokemonEventError) -> Self {
         265  +
        /* ServiceErrorGenerator.kt:204 */
  168    266   
        match err {
         267  +
            /* ServiceErrorGenerator.kt:207 */
  169    268   
            crate::types::error::AttemptCapturingPokemonEventError::MasterBallUnsuccessful(inner) => Error::MasterBallUnsuccessful(inner),
         269  +
            /* ServiceErrorGenerator.kt:212 */
  170    270   
            crate::types::error::AttemptCapturingPokemonEventError::Unhandled(inner) => Error::Unhandled(inner),
         271  +
            /* ServiceErrorGenerator.kt:204 */
  171    272   
        }
         273  +
        /* ServiceErrorGenerator.kt:203 */
  172    274   
    }
         275  +
    /* ServiceErrorGenerator.kt:202 */
  173    276   
}
         277  +
/* ServiceErrorGenerator.kt:174 */
  174    278   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::CapturePokemonEventsError, R>> for Error
  175    279   
where
  176    280   
    R: Send + Sync + std::fmt::Debug + 'static,
  177    281   
{
         282  +
    /* ServiceErrorGenerator.kt:179 */
  178    283   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::CapturePokemonEventsError, R>) -> Self {
         284  +
        /* ServiceErrorGenerator.kt:184 */
  179    285   
        match err {
         286  +
            /* ServiceErrorGenerator.kt:185 */
  180    287   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         288  +
            /* ServiceErrorGenerator.kt:186 */
  181    289   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  182    290   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  183    291   
                source: err.into(),
  184    292   
            }),
         293  +
            /* ServiceErrorGenerator.kt:184 */
  185    294   
        }
         295  +
        /* ServiceErrorGenerator.kt:179 */
  186    296   
    }
         297  +
    /* ServiceErrorGenerator.kt:174 */
  187    298   
}
         299  +
/* ServiceErrorGenerator.kt:202 */
  188    300   
impl From<crate::types::error::CapturePokemonEventsError> for Error {
         301  +
    /* ServiceErrorGenerator.kt:203 */
  189    302   
    fn from(err: crate::types::error::CapturePokemonEventsError) -> Self {
         303  +
        /* ServiceErrorGenerator.kt:204 */
  190    304   
        match err {
         305  +
            /* ServiceErrorGenerator.kt:207 */
  191    306   
            crate::types::error::CapturePokemonEventsError::InvalidPokeballError(inner) => Error::InvalidPokeballError(inner),
         307  +
            /* ServiceErrorGenerator.kt:207 */
  192    308   
            crate::types::error::CapturePokemonEventsError::ThrottlingError(inner) => Error::ThrottlingError(inner),
         309  +
            /* ServiceErrorGenerator.kt:212 */
  193    310   
            crate::types::error::CapturePokemonEventsError::Unhandled(inner) => Error::Unhandled(inner),
         311  +
            /* ServiceErrorGenerator.kt:204 */
  194    312   
        }
         313  +
        /* ServiceErrorGenerator.kt:203 */
  195    314   
    }
         315  +
    /* ServiceErrorGenerator.kt:202 */
  196    316   
}
         317  +
/* ServiceErrorGenerator.kt:115 */
  197    318   
impl ::std::error::Error for Error {
         319  +
    /* ServiceErrorGenerator.kt:116 */
  198    320   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         321  +
        /* ServiceErrorGenerator.kt:117 */
  199    322   
        match self {
  200         -
            Error::InvalidPokeballError(inner) => inner.source(),
  201         -
            Error::MasterBallUnsuccessful(inner) => inner.source(),
  202         -
            Error::ThrottlingError(inner) => inner.source(),
  203         -
            Error::UnsupportedRegionError(inner) => inner.source(),
  204         -
            Error::ValidationError(inner) => inner.source(),
  205         -
            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
         323  +
            /* ServiceErrorGenerator.kt:119 */ Error::InvalidPokeballError(inner) => inner.source(),
         324  +
            /* ServiceErrorGenerator.kt:119 */ Error::MasterBallUnsuccessful(inner) => inner.source(),
         325  +
            /* ServiceErrorGenerator.kt:119 */ Error::ThrottlingError(inner) => inner.source(),
         326  +
            /* ServiceErrorGenerator.kt:119 */ Error::UnsupportedRegionError(inner) => inner.source(),
         327  +
            /* ServiceErrorGenerator.kt:119 */ Error::ValidationError(inner) => inner.source(),
         328  +
            /* ServiceErrorGenerator.kt:121 */
         329  +
            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source), /* ServiceErrorGenerator.kt:117 */
  206    330   
        }
         331  +
        /* ServiceErrorGenerator.kt:116 */
  207    332   
    }
         333  +
    /* ServiceErrorGenerator.kt:115 */
  208    334   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/event_stream_serde.rs

@@ -1,1 +186,282 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* EventStreamErrorMarshallerGenerator.kt:79 */
    2      3   
#[non_exhaustive]
    3      4   
#[derive(Debug)]
    4      5   
pub struct AttemptCapturingPokemonEventErrorMarshaller;
    5      6   
    6      7   
impl AttemptCapturingPokemonEventErrorMarshaller {
    7      8   
    pub fn new() -> Self {
    8      9   
        AttemptCapturingPokemonEventErrorMarshaller
    9     10   
    }
   10     11   
}
          12  +
/* EventStreamErrorMarshallerGenerator.kt:93 */
   11     13   
impl ::aws_smithy_eventstream::frame::MarshallMessage for AttemptCapturingPokemonEventErrorMarshaller {
          14  +
    /* EventStreamErrorMarshallerGenerator.kt:97 */
   12     15   
    type Input = crate::types::error::AttemptCapturingPokemonEventError;
          16  +
    /* EventStreamErrorMarshallerGenerator.kt:99 */
   13     17   
    fn marshall(
   14     18   
        &self,
   15     19   
        _input: Self::Input,
   16     20   
    ) -> std::result::Result<::aws_smithy_types::event_stream::Message, ::aws_smithy_eventstream::error::Error> {
          21  +
        /* EventStreamErrorMarshallerGenerator.kt:103 */
   17     22   
        let mut headers = Vec::new();
          23  +
        /* EventStreamMarshallerGenerator.kt:322 */
   18     24   
        headers.push(::aws_smithy_types::event_stream::Header::new(
   19     25   
            ":message-type",
   20     26   
            ::aws_smithy_types::event_stream::HeaderValue::String("exception".into()),
   21     27   
        ));
          28  +
        /* EventStreamErrorMarshallerGenerator.kt:108 */
   22     29   
        let payload = match _input {
   23         -
            crate::types::error::AttemptCapturingPokemonEventError::MasterBallUnsuccessful(inner) =>  {
   24         -
                headers.push(::aws_smithy_types::event_stream::Header::new(":exception-type", ::aws_smithy_types::event_stream::HeaderValue::String("masterball_unsuccessful".into())));
   25         -
                headers.push(::aws_smithy_types::event_stream::Header::new(":content-type", ::aws_smithy_types::event_stream::HeaderValue::String("application/json".into())));
   26         -
                crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful_error(&inner)
          30  +
            /* EventStreamErrorMarshallerGenerator.kt:113 */crate::types::error::AttemptCapturingPokemonEventError::MasterBallUnsuccessful(inner) =>  {
          31  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":exception-type", ::aws_smithy_types::event_stream::HeaderValue::String("masterball_unsuccessful".into())));
          32  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":content-type", ::aws_smithy_types::event_stream::HeaderValue::String("application/json".into())));
          33  +
                /* EventStreamMarshallerGenerator.kt:283 */crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful_error(&inner)
   27     34   
                                            .map_err(|err| ::aws_smithy_eventstream::error::Error::marshalling(format!("{}", err)))?
   28         -
            }
   29         -
            crate::types::error::AttemptCapturingPokemonEventError::Unhandled(_inner) => return Err(
          35  +
            /* EventStreamErrorMarshallerGenerator.kt:113 */}
          36  +
            /* EventStreamErrorMarshallerGenerator.kt:119 */crate::types::error::AttemptCapturingPokemonEventError::Unhandled(_inner) => return Err(
   30     37   
                                                ::aws_smithy_eventstream::error::Error::marshalling("Cannot serialize `AttemptCapturingPokemonEvent::Unknown` for the request. The `Unknown` variant is intended for responses only. It occurs when an outdated client is used after a new enum variant was added on the server side.".to_owned())
   31     38   
                                            ),
   32         -
        }
   33         -
        ;
          39  +
        /* EventStreamErrorMarshallerGenerator.kt:108 */}
          40  +
        /* EventStreamErrorMarshallerGenerator.kt:131 */;
   34     41   
        Ok(::aws_smithy_types::event_stream::Message::new_from_parts(headers, payload))
          42  +
        /* EventStreamErrorMarshallerGenerator.kt:99 */
   35     43   
    }
          44  +
    /* EventStreamErrorMarshallerGenerator.kt:93 */
   36     45   
}
   37     46   
          47  +
/* EventStreamMarshallerGenerator.kt:115 */
   38     48   
#[non_exhaustive]
   39     49   
#[derive(Debug)]
   40     50   
pub struct AttemptCapturingPokemonEventMarshaller;
   41     51   
   42     52   
impl AttemptCapturingPokemonEventMarshaller {
   43     53   
    pub fn new() -> Self {
   44     54   
        AttemptCapturingPokemonEventMarshaller
   45     55   
    }
   46     56   
}
          57  +
/* EventStreamMarshallerGenerator.kt:129 */
   47     58   
impl ::aws_smithy_eventstream::frame::MarshallMessage for AttemptCapturingPokemonEventMarshaller {
          59  +
    /* EventStreamMarshallerGenerator.kt:133 */
   48     60   
    type Input = crate::types::AttemptCapturingPokemonEvent;
          61  +
    /* EventStreamMarshallerGenerator.kt:135 */
   49     62   
    fn marshall(&self, input: Self::Input) -> std::result::Result<::aws_smithy_types::event_stream::Message, ::aws_smithy_eventstream::error::Error> {
          63  +
        /* EventStreamMarshallerGenerator.kt:139 */
   50     64   
        let mut headers = Vec::new();
          65  +
        /* EventStreamMarshallerGenerator.kt:322 */
   51     66   
        headers.push(::aws_smithy_types::event_stream::Header::new(
   52     67   
            ":message-type",
   53     68   
            ::aws_smithy_types::event_stream::HeaderValue::String("event".into()),
   54     69   
        ));
          70  +
        /* EventStreamMarshallerGenerator.kt:141 */
   55     71   
        let payload = match input {
   56         -
            Self::Input::Event(inner) =>  {
   57         -
                headers.push(::aws_smithy_types::event_stream::Header::new(":event-type", ::aws_smithy_types::event_stream::HeaderValue::String("event".into())));
   58         -
                headers.push(::aws_smithy_types::event_stream::Header::new(":content-type", ::aws_smithy_types::event_stream::HeaderValue::String("application/json".into())));
   59         -
                if let Some(inner_payload) = inner.payload {
   60         -
                    crate::protocol_serde::shape_capturing_event::ser_payload_payload(&inner_payload)
          72  +
            /* EventStreamMarshallerGenerator.kt:152 */Self::Input::Event(inner) =>  {
          73  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":event-type", ::aws_smithy_types::event_stream::HeaderValue::String("event".into())));
          74  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":content-type", ::aws_smithy_types::event_stream::HeaderValue::String("application/json".into())));
          75  +
                /* EventStreamMarshallerGenerator.kt:305 */if let Some(inner_payload) = inner.payload {
          76  +
                    /* EventStreamMarshallerGenerator.kt:283 */crate::protocol_serde::shape_capturing_event::ser_payload_payload(&inner_payload)
   61     77   
                                                .map_err(|err| ::aws_smithy_eventstream::error::Error::marshalling(format!("{}", err)))?
   62         -
                }
   63         -
                 else  {
   64         -
                    unimplemented!("TODO(EventStream): Figure out what to do when there's no payload")
   65         -
                }
   66         -
            }
   67         -
            Self::Input::Unknown => return Err(
          78  +
                /* EventStreamMarshallerGenerator.kt:305 */}
          79  +
                /* EventStreamMarshallerGenerator.kt:309 */ else  {
          80  +
                    /* EventStreamMarshallerGenerator.kt:292 */unimplemented!("TODO(EventStream): Figure out what to do when there's no payload")
          81  +
                /* EventStreamMarshallerGenerator.kt:309 */}
          82  +
            /* EventStreamMarshallerGenerator.kt:152 */}
          83  +
            /* EventStreamMarshallerGenerator.kt:159 */Self::Input::Unknown => return Err(
   68     84   
                                            ::aws_smithy_eventstream::error::Error::marshalling("Cannot serialize `AttemptCapturingPokemonEvent::Unknown` for the request. The `Unknown` variant is intended for responses only. It occurs when an outdated client is used after a new enum variant was added on the server side.".to_owned())
   69     85   
                                        )
   70         -
        }
   71         -
        ;
          86  +
        /* EventStreamMarshallerGenerator.kt:141 */}
          87  +
        /* EventStreamMarshallerGenerator.kt:169 */;
   72     88   
        Ok(::aws_smithy_types::event_stream::Message::new_from_parts(headers, payload))
          89  +
        /* EventStreamMarshallerGenerator.kt:135 */
   73     90   
    }
          91  +
    /* EventStreamMarshallerGenerator.kt:129 */
   74     92   
}
   75     93   
          94  +
/* EventStreamUnmarshallerGenerator.kt:98 */
   76     95   
#[non_exhaustive]
   77     96   
#[derive(Debug)]
   78     97   
pub struct CapturePokemonEventsUnmarshaller;
   79     98   
   80     99   
impl CapturePokemonEventsUnmarshaller {
   81    100   
    pub fn new() -> Self {
   82    101   
        CapturePokemonEventsUnmarshaller
   83    102   
    }
   84    103   
}
         104  +
/* EventStreamUnmarshallerGenerator.kt:112 */
   85    105   
impl ::aws_smithy_eventstream::frame::UnmarshallMessage for CapturePokemonEventsUnmarshaller {
         106  +
    /* EventStreamUnmarshallerGenerator.kt:116 */
   86    107   
    type Output = crate::types::CapturePokemonEvents;
         108  +
    /* EventStreamUnmarshallerGenerator.kt:117 */
   87    109   
    type Error = crate::types::error::CapturePokemonEventsError;
         110  +
    /* EventStreamUnmarshallerGenerator.kt:119 */
   88    111   
    fn unmarshall(
   89    112   
        &self,
   90    113   
        message: &::aws_smithy_types::event_stream::Message,
   91    114   
    ) -> std::result::Result<::aws_smithy_eventstream::frame::UnmarshalledMessage<Self::Output, Self::Error>, ::aws_smithy_eventstream::error::Error>
   92    115   
    {
         116  +
        /* EventStreamUnmarshallerGenerator.kt:128 */
   93    117   
        let response_headers = ::aws_smithy_eventstream::smithy::parse_response_headers(message)?;
         118  +
        /* EventStreamUnmarshallerGenerator.kt:129 */
   94    119   
        match response_headers.message_type.as_str() {
         120  +
            /* EventStreamUnmarshallerGenerator.kt:130 */
   95    121   
            "event" => {
         122  +
                /* EventStreamUnmarshallerGenerator.kt:155 */
   96    123   
                match response_headers.smithy_type.as_str() {
         124  +
                    /* EventStreamUnmarshallerGenerator.kt:158 */
   97    125   
                    "event" => {
         126  +
                        /* EventStreamUnmarshallerGenerator.kt:221 */
   98    127   
                        let mut builder = crate::types::builders::CaptureEventBuilder::default();
         128  +
                        /* EventStreamUnmarshallerGenerator.kt:275 */
   99    129   
                        let content_type = response_headers.content_type().unwrap_or_default();
  100    130   
                        if content_type != "application/octet-stream" {
  101    131   
                            return Err(::aws_smithy_eventstream::error::Error::unmarshalling(format!(
  102    132   
                                "expected :content-type to be 'application/octet-stream', but was '{}'",
  103    133   
                                content_type
  104    134   
                            )));
  105    135   
                        }
  106         -
                        builder = builder.set_pokedex_update(Some(::aws_smithy_types::Blob::new(message.payload().as_ref())));
         136  +
                        /* EventStreamUnmarshallerGenerator.kt:288 */
         137  +
                        builder = builder.set_pokedex_update(
         138  +
                            /* EventStreamUnmarshallerGenerator.kt:289 */
         139  +
                            Some(
         140  +
                                /* EventStreamUnmarshallerGenerator.kt:292 */
         141  +
                                ::aws_smithy_types::Blob::new(message.payload().as_ref()), /* EventStreamUnmarshallerGenerator.kt:289 */
         142  +
                            ), /* EventStreamUnmarshallerGenerator.kt:288 */
         143  +
                        );
         144  +
                        /* EventStreamUnmarshallerGenerator.kt:228 */
  107    145   
                        for header in message.headers() {
         146  +
                            /* EventStreamUnmarshallerGenerator.kt:229 */
  108    147   
                            match header.name().as_str() {
         148  +
                                /* EventStreamUnmarshallerGenerator.kt:231 */
  109    149   
                                "name" => {
  110         -
                                    builder = builder.set_name(Some(::aws_smithy_eventstream::smithy::expect_string(header)?));
         150  +
                                    /* EventStreamUnmarshallerGenerator.kt:255 */
         151  +
                                    builder = builder.set_name(
         152  +
                                        /* EventStreamUnmarshallerGenerator.kt:256 */
         153  +
                                        Some(
         154  +
                                            /* EventStreamUnmarshallerGenerator.kt:264 */
         155  +
                                            ::aws_smithy_eventstream::smithy::expect_string(header)?, /* EventStreamUnmarshallerGenerator.kt:256 */
         156  +
                                        ), /* EventStreamUnmarshallerGenerator.kt:255 */
         157  +
                                    );
         158  +
                                    /* EventStreamUnmarshallerGenerator.kt:231 */
  111    159   
                                }
         160  +
                                /* EventStreamUnmarshallerGenerator.kt:231 */
  112    161   
                                "captured" => {
  113         -
                                    builder = builder.set_captured(Some(::aws_smithy_eventstream::smithy::expect_bool(header)?));
         162  +
                                    /* EventStreamUnmarshallerGenerator.kt:255 */
         163  +
                                    builder = builder.set_captured(
         164  +
                                        /* EventStreamUnmarshallerGenerator.kt:256 */
         165  +
                                        Some(
         166  +
                                            /* EventStreamUnmarshallerGenerator.kt:258 */
         167  +
                                            ::aws_smithy_eventstream::smithy::expect_bool(header)?, /* EventStreamUnmarshallerGenerator.kt:256 */
         168  +
                                        ), /* EventStreamUnmarshallerGenerator.kt:255 */
         169  +
                                    );
         170  +
                                    /* EventStreamUnmarshallerGenerator.kt:231 */
  114    171   
                                }
         172  +
                                /* EventStreamUnmarshallerGenerator.kt:231 */
  115    173   
                                "shiny" => {
  116         -
                                    builder = builder.set_shiny(Some(::aws_smithy_eventstream::smithy::expect_bool(header)?));
         174  +
                                    /* EventStreamUnmarshallerGenerator.kt:255 */
         175  +
                                    builder = builder.set_shiny(
         176  +
                                        /* EventStreamUnmarshallerGenerator.kt:256 */
         177  +
                                        Some(
         178  +
                                            /* EventStreamUnmarshallerGenerator.kt:258 */
         179  +
                                            ::aws_smithy_eventstream::smithy::expect_bool(header)?, /* EventStreamUnmarshallerGenerator.kt:256 */
         180  +
                                        ), /* EventStreamUnmarshallerGenerator.kt:255 */
         181  +
                                    );
         182  +
                                    /* EventStreamUnmarshallerGenerator.kt:231 */
  117    183   
                                }
  118         -
                                // Event stream protocol headers start with ':'
         184  +
                                /* EventStreamUnmarshallerGenerator.kt:235 */// Event stream protocol headers start with ':'
         185  +
                                /* EventStreamUnmarshallerGenerator.kt:236 */
  119    186   
                                name => {
  120    187   
                                    if !name.starts_with(':') {
         188  +
                                        /* EventStreamUnmarshallerGenerator.kt:237 */
  121    189   
                                        ::tracing::trace!("Unrecognized event stream message header: {}", name);
         190  +
                                        /* EventStreamUnmarshallerGenerator.kt:236 */
  122    191   
                                    }
         192  +
                                } /* EventStreamUnmarshallerGenerator.kt:229 */
  123    193   
                            }
         194  +
                            /* EventStreamUnmarshallerGenerator.kt:228 */
  124    195   
                        }
  125         -
                        }
         196  +
                        /* EventStreamUnmarshallerGenerator.kt:245 */
  126    197   
                        Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
  127    198   
                            crate::types::CapturePokemonEvents::Event(builder.build()),
  128    199   
                        ))
         200  +
                        /* EventStreamUnmarshallerGenerator.kt:158 */
  129    201   
                    }
  130         -
                    _unknown_variant => Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
         202  +
                    /* EventStreamUnmarshallerGenerator.kt:162 */
         203  +
                    _unknown_variant => {
         204  +
                        /* EventStreamUnmarshallerGenerator.kt:165 */
         205  +
                        Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
  131    206   
                            crate::types::CapturePokemonEvents::Unknown,
  132         -
                    )),
         207  +
                        ))
         208  +
                        /* EventStreamUnmarshallerGenerator.kt:162 */
         209  +
                    } /* EventStreamUnmarshallerGenerator.kt:155 */
  133    210   
                }
         211  +
                /* EventStreamUnmarshallerGenerator.kt:130 */
  134    212   
            }
         213  +
            /* EventStreamUnmarshallerGenerator.kt:133 */
  135    214   
            "exception" => {
         215  +
                /* EventStreamUnmarshallerGenerator.kt:332 */
  136    216   
                let generic = match crate::protocol_serde::parse_event_stream_error_metadata(message.payload()) {
  137    217   
                    Ok(builder) => builder.build(),
  138    218   
                    Err(err) => {
  139    219   
                        return Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  140    220   
                            crate::types::error::CapturePokemonEventsError::unhandled(err),
  141    221   
                        ))
  142    222   
                    }
  143    223   
                };
         224  +
                /* EventStreamUnmarshallerGenerator.kt:356 */
  144    225   
                match response_headers.smithy_type.as_str() {
         226  +
                    /* EventStreamUnmarshallerGenerator.kt:358 */
  145    227   
                    "invalid_pokeball" => {
         228  +
                        /* EventStreamUnmarshallerGenerator.kt:367 */
  146    229   
                        let mut builder = crate::types::error::builders::InvalidPokeballErrorBuilder::default();
         230  +
                        /* EventStreamUnmarshallerGenerator.kt:368 */
  147    231   
                        builder =
  148    232   
                            crate::protocol_serde::shape_invalid_pokeball_error::de_invalid_pokeball_error_json_err(&message.payload()[..], builder)
  149    233   
                                .map_err(|err| {
  150    234   
                                    ::aws_smithy_eventstream::error::Error::unmarshalling(format!("failed to unmarshall invalid_pokeball: {}", err))
  151    235   
                                })?;
  152    236   
                        builder.set_meta(Some(generic));
  153    237   
                        return Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  154    238   
                            crate::types::error::CapturePokemonEventsError::InvalidPokeballError(
  155    239   
                                crate::serde_util::invalid_pokeball_error_correct_errors(builder)
  156    240   
                                    .build()
  157    241   
                                    .map_err(|err| ::aws_smithy_eventstream::error::Error::unmarshalling(format!("{}", err)))?,
  158    242   
                            ),
  159    243   
                        ));
         244  +
                        /* EventStreamUnmarshallerGenerator.kt:358 */
  160    245   
                    }
         246  +
                    /* EventStreamUnmarshallerGenerator.kt:358 */
  161    247   
                    "throttlingError" => {
         248  +
                        /* EventStreamUnmarshallerGenerator.kt:367 */
  162    249   
                        let mut builder = crate::types::error::builders::ThrottlingErrorBuilder::default();
         250  +
                        /* EventStreamUnmarshallerGenerator.kt:368 */
  163    251   
                        builder = crate::protocol_serde::shape_throttling_error::de_throttling_error_json_err(&message.payload()[..], builder)
  164    252   
                            .map_err(|err| {
  165    253   
                                ::aws_smithy_eventstream::error::Error::unmarshalling(format!("failed to unmarshall throttlingError: {}", err))
  166    254   
                            })?;
  167    255   
                        builder.set_meta(Some(generic));
  168    256   
                        return Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  169    257   
                            crate::types::error::CapturePokemonEventsError::ThrottlingError(builder.build()),
  170    258   
                        ));
         259  +
                        /* EventStreamUnmarshallerGenerator.kt:358 */
  171    260   
                    }
  172         -
                    _ => {}
         261  +
                    /* EventStreamUnmarshallerGenerator.kt:434 */ _ => {} /* EventStreamUnmarshallerGenerator.kt:435 */
  173    262   
                }
         263  +
                /* EventStreamUnmarshallerGenerator.kt:440 */
  174    264   
                Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  175    265   
                    crate::types::error::CapturePokemonEventsError::generic(generic),
  176    266   
                ))
         267  +
                /* EventStreamUnmarshallerGenerator.kt:133 */
  177    268   
            }
         269  +
            /* EventStreamUnmarshallerGenerator.kt:136 */
  178    270   
            value => {
         271  +
                /* EventStreamUnmarshallerGenerator.kt:137 */
  179    272   
                return Err(::aws_smithy_eventstream::error::Error::unmarshalling(format!(
  180    273   
                    "unrecognized :message-type: {}",
  181    274   
                    value
  182    275   
                )));
         276  +
                /* EventStreamUnmarshallerGenerator.kt:136 */
         277  +
            } /* EventStreamUnmarshallerGenerator.kt:129 */
  183    278   
        }
         279  +
        /* EventStreamUnmarshallerGenerator.kt:119 */
  184    280   
    }
  185         -
    }
         281  +
    /* EventStreamUnmarshallerGenerator.kt:112 */
  186    282   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/lib.rs

@@ -18,18 +118,130 @@
   38     38   
//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
   39     39   
//! is the input, output, and error type for that API, as well as builders to construct each of those.
   40     40   
//!
   41     41   
//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
   42     42   
//! client can return. Any other error type can be converted to this `Error` type via the
   43     43   
//! [`From`](std::convert::From) trait.
   44     44   
//!
   45     45   
//! The other modules within this crate are not required for normal usage.
   46     46   
   47     47   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          48  +
/* ServiceErrorGenerator.kt:127 */
   48     49   
pub use error_meta::Error;
   49     50   
          51  +
/* RustType.kt:516 */
   50     52   
#[doc(inline)]
          53  +
/* ServiceGenerator.kt:63 */
   51     54   
pub use config::Config;
   52     55   
   53         -
/// Client for calling Pokémon Service.
          56  +
/// /* FluentClientDocs.kt:24 */Client for calling Pokémon Service.
   54     57   
///
   55     58   
/// ## Constructing a `Client`
   56     59   
///
   57     60   
/// A `Client` requires a config in order to be constructed. With the default set of Cargo features,
   58     61   
/// this config will only require an endpoint to produce a functioning client. However, some Smithy
   59     62   
/// features will require additional configuration. For example, `@auth` requires some kind of identity
   60     63   
/// or identity resolver to be configured. The config is used to customize various aspects of the client,
   61     64   
/// such as:
   62     65   
///
   63     66   
///   - [The underlying HTTP client](crate::config::Builder::http_client)
   64     67   
///   - [Retries](crate::config::Builder::retry_config)
   65     68   
///   - [Timeouts](crate::config::Builder::timeout_config)
   66     69   
///   - [... and more](crate::config::Builder)
   67     70   
///
   68     71   
/// Below is a minimal example of how to create a client:
   69     72   
///
   70     73   
/// ```rust,no_run
   71     74   
/// let config = pokemon_service_awsjson_client::Config::builder()
   72     75   
///     .endpoint_url("http://localhost:1234")
   73     76   
///     .build();
   74     77   
/// let client = pokemon_service_awsjson_client::Client::from_conf(config);
   75     78   
/// ```
   76     79   
///
   77     80   
/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should be done
   78     81   
/// once at application start-up. Cloning a client is cheap (it's just an [`Arc`](std::sync::Arc) under the hood),
   79     82   
/// so creating it once at start-up and cloning it around the application as needed is recommended.
   80     83   
pub mod client;
   81     84   
   82         -
/// Configuration for Pokémon Service.
          85  +
/// /* ClientRustModule.kt:121 */Configuration for Pokémon Service.
   83     86   
pub mod config;
   84     87   
   85         -
/// Common errors and error handling utilities.
          88  +
/// /* ClientRustModule.kt:121 */Common errors and error handling utilities.
   86     89   
pub mod error;
   87     90   
          91  +
/* RustModule.kt:172 */
   88     92   
mod error_meta;
   89     93   
   90         -
/// Information about this crate.
          94  +
/// /* ClientRustModule.kt:121 */Information about this crate.
   91     95   
pub mod meta;
   92     96   
   93         -
/// Primitives such as `Blob` or `DateTime` used by other types.
          97  +
/// /* ClientRustModule.kt:121 */Primitives such as `Blob` or `DateTime` used by other types.
   94     98   
pub mod primitives;
   95     99   
   96         -
/// Data structures used by operation inputs/outputs.
         100  +
/// /* ClientRustModule.kt:121 */Data structures used by operation inputs/outputs.
   97    101   
pub mod types;
   98    102   
         103  +
/* RustModule.kt:172 */
   99    104   
mod auth_plugin;
  100    105   
         106  +
/* RustModule.kt:172 */
  101    107   
mod event_receiver;
  102    108   
         109  +
/* RustModule.kt:172 */
  103    110   
mod event_stream_serde;
  104    111   
  105         -
/// All operations that this crate can perform.
         112  +
/// /* ClientRustModule.kt:121 */All operations that this crate can perform.
  106    113   
pub mod operation;
  107    114   
  108    115   
pub(crate) mod protocol_serde;
  109    116   
         117  +
/* RustModule.kt:172 */
  110    118   
mod sdk_feature_tracker;
  111    119   
         120  +
/* RustModule.kt:172 */
  112    121   
mod serialization_settings;
  113    122   
         123  +
/* RustModule.kt:172 */
  114    124   
mod serde_util;
  115    125   
         126  +
/* RustModule.kt:172 */
  116    127   
mod json_errors;
  117    128   
         129  +
/* FluentClientDecorator.kt:76 */
  118    130   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/meta.rs

@@ -1,1 +4,5 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* CrateVersionCustomization.kt:23 */
    3      4   
/// Crate version number.
    4      5   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation.rs

@@ -1,1 +13,13 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Types for the `CapturePokemon` operation.
           2  +
/* CodegenDelegator.kt:51 */
           3  +
/// /* CodegenDelegator.kt:51 */Types for the `CapturePokemon` operation.
    4      4   
pub mod capture_pokemon;
    5      5   
    6         -
/// Types for the `CheckHealth` operation.
           6  +
/// /* CodegenDelegator.kt:51 */Types for the `CheckHealth` operation.
    7      7   
pub mod check_health;
    8      8   
    9         -
/// Types for the `DoNothing` operation.
           9  +
/// /* CodegenDelegator.kt:51 */Types for the `DoNothing` operation.
   10     10   
pub mod do_nothing;
   11     11   
   12         -
/// Types for the `GetServerStatistics` operation.
          12  +
/// /* CodegenDelegator.kt:51 */Types for the `GetServerStatistics` operation.
   13     13   
pub mod get_server_statistics;

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/capture_pokemon.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `CapturePokemon`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct CapturePokemon;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl CapturePokemon {
    7         -
    /// Creates a new `CapturePokemon`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `CapturePokemon`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::capture_pokemon::CapturePokemonInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::capture_pokemon::CapturePokemonOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::capture_pokemon::CapturePokemonError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +190,203 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CapturePokemon {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CapturePokemon");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            CapturePokemonRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            CapturePokemonResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "CapturePokemon",
  105    116   
            "PokemonService",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CapturePokemon")
  117    128   
            .with_interceptor(CapturePokemonEndpointParamsInterceptor)
  118    129   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  119    130   
                crate::operation::capture_pokemon::CapturePokemonError,
  120    131   
            >::new())
  121    132   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  122    133   
                crate::operation::capture_pokemon::CapturePokemonError,
  123    134   
            >::new());
  124    135   
  125    136   
        ::std::borrow::Cow::Owned(rcb)
  126    137   
    }
  127    138   
}
  128    139   
         140  +
/* ResponseDeserializerGenerator.kt:64 */
  129    141   
#[derive(Debug)]
  130    142   
struct CapturePokemonResponseDeserializer;
  131    143   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CapturePokemonResponseDeserializer {
  132    144   
    fn deserialize_streaming(
  133    145   
        &self,
  134    146   
        response: &mut ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  135    147   
    ) -> ::std::option::Option<::aws_smithy_runtime_api::client::interceptors::context::OutputOrError> {
  136    148   
        #[allow(unused_mut)]
  137    149   
        let mut force_error = false;
  138    150   
  139    151   
        // If this is an error, defer to the non-streaming parser
  140    152   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  141    153   
            return ::std::option::Option::None;
  142    154   
        }
  143    155   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  144    156   
            crate::protocol_serde::shape_capture_pokemon::de_capture_pokemon_http_response(response),
  145    157   
        ))
  146    158   
    }
  147    159   
  148    160   
    fn deserialize_nonstreaming(
  149    161   
        &self,
  150    162   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  151    163   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  152    164   
        // For streaming operations, we only hit this case if its an error
  153    165   
        let body = response.body().bytes().expect("body loaded");
  154    166   
        crate::protocol_serde::type_erase_result(crate::protocol_serde::shape_capture_pokemon::de_capture_pokemon_http_error(
  155    167   
            response.status().as_u16(),
  156    168   
            response.headers(),
  157    169   
            body,
  158    170   
        ))
  159    171   
    }
  160    172   
}
         173  +
/* RequestSerializerGenerator.kt:67 */
  161    174   
#[derive(Debug)]
  162    175   
struct CapturePokemonRequestSerializer;
  163    176   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CapturePokemonRequestSerializer {
  164    177   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  165    178   
    fn serialize_input(
  166    179   
        &self,
  167    180   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  168    181   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  169    182   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  170    183   
        let input = input
@@ -192,205 +404,597 @@
  212    225   
                signer,
  213    226   
            )))
  214    227   
        });
  215    228   
        if let Some(content_length) = body.content_length() {
  216    229   
            let content_length = content_length.to_string();
  217    230   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  218    231   
        }
  219    232   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  220    233   
    }
  221    234   
}
         235  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  222    236   
#[derive(Debug)]
  223    237   
struct CapturePokemonEndpointParamsInterceptor;
  224    238   
  225    239   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CapturePokemonEndpointParamsInterceptor {
  226    240   
    fn name(&self) -> &'static str {
  227    241   
        "CapturePokemonEndpointParamsInterceptor"
  228    242   
    }
  229    243   
  230    244   
    fn read_before_execution(
  231    245   
        &self,
  232    246   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  233    247   
            '_,
  234    248   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  235    249   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  236    250   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  237    251   
        >,
  238    252   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  239    253   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  240    254   
        let _input = context
  241    255   
            .input()
  242    256   
            .downcast_ref::<CapturePokemonInput>()
  243    257   
            .ok_or("failed to downcast to CapturePokemonInput")?;
  244    258   
  245    259   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  246    260   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  247    261   
        })?;
  248    262   
        cfg.interceptor_state()
  249    263   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  250    264   
        ::std::result::Result::Ok(())
  251    265   
    }
  252    266   
}
  253    267   
  254    268   
// The get_* functions below are generated from JMESPath expressions in the
  255    269   
// operationContextParams trait. They target the operation's input shape.
  256    270   
         271  +
/* OperationErrorGenerator.kt:79 */
  257    272   
/// Error type for the `CapturePokemonError` operation.
         273  +
/* RustType.kt:516 */
  258    274   
#[non_exhaustive]
         275  +
/* RustType.kt:516 */
  259    276   
#[derive(::std::fmt::Debug)]
  260         -
pub enum CapturePokemonError {
  261         -
    /// 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.
         277  +
pub /* OperationErrorGenerator.kt:81 */ enum CapturePokemonError {
         278  +
    /// /* OperationErrorGenerator.kt:83 */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.
         279  +
    /* OperationErrorGenerator.kt:86 */
  262    280   
    ValidationError(crate::types::error::ValidationError),
         281  +
    /* OperationErrorGenerator.kt:83 */
  263    282   
    #[allow(missing_docs)] // documentation missing in model
         283  +
    /* OperationErrorGenerator.kt:86 */
  264    284   
    MasterBallUnsuccessful(crate::types::error::MasterBallUnsuccessful),
         285  +
    /* OperationErrorGenerator.kt:83 */
  265    286   
    #[allow(missing_docs)] // documentation missing in model
         287  +
    /* OperationErrorGenerator.kt:86 */
  266    288   
    InvalidPokeballError(crate::types::error::InvalidPokeballError),
         289  +
    /* OperationErrorGenerator.kt:83 */
  267    290   
    #[allow(missing_docs)] // documentation missing in model
         291  +
    /* OperationErrorGenerator.kt:86 */
  268    292   
    ThrottlingError(crate::types::error::ThrottlingError),
         293  +
    /* OperationErrorGenerator.kt:83 */
  269    294   
    #[allow(missing_docs)] // documentation missing in model
         295  +
    /* OperationErrorGenerator.kt:86 */
  270    296   
    UnsupportedRegionError(crate::types::error::UnsupportedRegionError),
         297  +
    /* OperationErrorGenerator.kt:88 */
  271    298   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  272    299   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  273    300   
    variable wildcard pattern and check `.code()`:
  274    301   
     \
  275    302   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  276    303   
     \
  277    304   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CapturePokemonError) for what information is available for the error.")]
  278    305   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         306  +
    /* OperationErrorGenerator.kt:81 */
  279    307   
}
         308  +
/* OperationErrorGenerator.kt:218 */
  280    309   
impl CapturePokemonError {
         310  +
    /* OperationErrorGenerator.kt:219 */
  281    311   
    /// Creates the `CapturePokemonError::Unhandled` variant from any error type.
  282    312   
    pub fn unhandled(
  283    313   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  284    314   
    ) -> Self {
  285    315   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  286    316   
            source: err.into(),
  287    317   
            meta: ::std::default::Default::default(),
  288    318   
        })
  289    319   
    }
  290    320   
  291    321   
    /// Creates the `CapturePokemonError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  292    322   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  293    323   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  294    324   
            source: err.clone().into(),
  295    325   
            meta: err,
  296    326   
        })
  297    327   
    }
  298         -
    ///
         328  +
    /// /* OperationErrorGenerator.kt:236 */
  299    329   
    /// Returns error metadata, which includes the error code, message,
  300    330   
    /// request ID, and potentially additional information.
  301    331   
    ///
         332  +
    /* OperationErrorGenerator.kt:242 */
  302    333   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         334  +
        /* OperationErrorGenerator.kt:243 */
  303    335   
        match self {
  304         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         336  +
            /* OperationErrorGenerator.kt:246 */ Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         337  +
            /* OperationErrorGenerator.kt:246 */
  305    338   
            Self::MasterBallUnsuccessful(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         339  +
            /* OperationErrorGenerator.kt:246 */
  306    340   
            Self::InvalidPokeballError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  307         -
            Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         341  +
            /* OperationErrorGenerator.kt:246 */ Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         342  +
            /* OperationErrorGenerator.kt:246 */
  308    343   
            Self::UnsupportedRegionError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  309         -
            Self::Unhandled(e) => &e.meta,
         344  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         345  +
            /* OperationErrorGenerator.kt:243 */
  310    346   
        }
         347  +
        /* OperationErrorGenerator.kt:242 */
  311    348   
    }
         349  +
    /* OperationErrorGenerator.kt:257 */
  312    350   
    /// Returns `true` if the error kind is `CapturePokemonError::ValidationError`.
         351  +
    /* OperationErrorGenerator.kt:258 */
  313    352   
    pub fn is_validation_error(&self) -> bool {
         353  +
        /* OperationErrorGenerator.kt:259 */
  314    354   
        matches!(self, Self::ValidationError(_))
         355  +
        /* OperationErrorGenerator.kt:258 */
  315    356   
    }
         357  +
    /* OperationErrorGenerator.kt:257 */
  316    358   
    /// Returns `true` if the error kind is `CapturePokemonError::MasterBallUnsuccessful`.
         359  +
    /* OperationErrorGenerator.kt:258 */
  317    360   
    pub fn is_master_ball_unsuccessful(&self) -> bool {
         361  +
        /* OperationErrorGenerator.kt:259 */
  318    362   
        matches!(self, Self::MasterBallUnsuccessful(_))
         363  +
        /* OperationErrorGenerator.kt:258 */
  319    364   
    }
         365  +
    /* OperationErrorGenerator.kt:257 */
  320    366   
    /// Returns `true` if the error kind is `CapturePokemonError::InvalidPokeballError`.
         367  +
    /* OperationErrorGenerator.kt:258 */
  321    368   
    pub fn is_invalid_pokeball_error(&self) -> bool {
         369  +
        /* OperationErrorGenerator.kt:259 */
  322    370   
        matches!(self, Self::InvalidPokeballError(_))
         371  +
        /* OperationErrorGenerator.kt:258 */
  323    372   
    }
         373  +
    /* OperationErrorGenerator.kt:257 */
  324    374   
    /// Returns `true` if the error kind is `CapturePokemonError::ThrottlingError`.
         375  +
    /* OperationErrorGenerator.kt:258 */
  325    376   
    pub fn is_throttling_error(&self) -> bool {
         377  +
        /* OperationErrorGenerator.kt:259 */
  326    378   
        matches!(self, Self::ThrottlingError(_))
         379  +
        /* OperationErrorGenerator.kt:258 */
  327    380   
    }
         381  +
    /* OperationErrorGenerator.kt:257 */
  328    382   
    /// Returns `true` if the error kind is `CapturePokemonError::UnsupportedRegionError`.
         383  +
    /* OperationErrorGenerator.kt:258 */
  329    384   
    pub fn is_unsupported_region_error(&self) -> bool {
         385  +
        /* OperationErrorGenerator.kt:259 */
  330    386   
        matches!(self, Self::UnsupportedRegionError(_))
         387  +
        /* OperationErrorGenerator.kt:258 */
  331    388   
    }
         389  +
    /* OperationErrorGenerator.kt:218 */
  332    390   
}
         391  +
/* OperationErrorGenerator.kt:269 */
  333    392   
impl ::std::error::Error for CapturePokemonError {
         393  +
    /* OperationErrorGenerator.kt:270 */
  334    394   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         395  +
        /* OperationErrorGenerator.kt:318 */
  335    396   
        match self {
  336         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  337         -
            Self::MasterBallUnsuccessful(_inner) => ::std::option::Option::Some(_inner),
  338         -
            Self::InvalidPokeballError(_inner) => ::std::option::Option::Some(_inner),
  339         -
            Self::ThrottlingError(_inner) => ::std::option::Option::Some(_inner),
  340         -
            Self::UnsupportedRegionError(_inner) => ::std::option::Option::Some(_inner),
  341         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         397  +
            /* OperationErrorGenerator.kt:321 */
         398  +
            Self::ValidationError(_inner) =>
         399  +
            /* OperationErrorGenerator.kt:283 */
         400  +
            {
         401  +
                ::std::option::Option::Some(_inner)
         402  +
            }
         403  +
            ,
         404  +
            /* OperationErrorGenerator.kt:321 */
         405  +
            Self::MasterBallUnsuccessful(_inner) =>
         406  +
            /* OperationErrorGenerator.kt:283 */
         407  +
            {
         408  +
                ::std::option::Option::Some(_inner)
         409  +
            }
         410  +
            ,
         411  +
            /* OperationErrorGenerator.kt:321 */
         412  +
            Self::InvalidPokeballError(_inner) =>
         413  +
            /* OperationErrorGenerator.kt:283 */
         414  +
            {
         415  +
                ::std::option::Option::Some(_inner)
         416  +
            }
         417  +
            ,
         418  +
            /* OperationErrorGenerator.kt:321 */
         419  +
            Self::ThrottlingError(_inner) =>
         420  +
            /* OperationErrorGenerator.kt:283 */
         421  +
            {
         422  +
                ::std::option::Option::Some(_inner)
         423  +
            }
         424  +
            ,
         425  +
            /* OperationErrorGenerator.kt:321 */
         426  +
            Self::UnsupportedRegionError(_inner) =>
         427  +
            /* OperationErrorGenerator.kt:283 */
         428  +
            {
         429  +
                ::std::option::Option::Some(_inner)
         430  +
            }
         431  +
            ,
         432  +
            /* OperationErrorGenerator.kt:326 */
         433  +
            Self::Unhandled(_inner) => {
         434  +
                /* OperationErrorGenerator.kt:279 */
         435  +
                ::std::option::Option::Some(&*_inner.source)
         436  +
                /* OperationErrorGenerator.kt:326 */
         437  +
            } /* OperationErrorGenerator.kt:318 */
  342    438   
        }
         439  +
        /* OperationErrorGenerator.kt:270 */
  343    440   
    }
         441  +
    /* OperationErrorGenerator.kt:269 */
  344    442   
}
         443  +
/* OperationErrorGenerator.kt:133 */
  345    444   
impl ::std::fmt::Display for CapturePokemonError {
         445  +
    /* OperationErrorGenerator.kt:134 */
  346    446   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         447  +
        /* OperationErrorGenerator.kt:318 */
  347    448   
        match self {
  348         -
            Self::ValidationError(_inner) => _inner.fmt(f),
  349         -
            Self::MasterBallUnsuccessful(_inner) => _inner.fmt(f),
  350         -
            Self::InvalidPokeballError(_inner) => _inner.fmt(f),
  351         -
            Self::ThrottlingError(_inner) => _inner.fmt(f),
  352         -
            Self::UnsupportedRegionError(_inner) => _inner.fmt(f),
         449  +
            /* OperationErrorGenerator.kt:321 */
         450  +
            Self::ValidationError(_inner) =>
         451  +
            /* OperationErrorGenerator.kt:151 */
         452  +
            {
         453  +
                _inner.fmt(f)
         454  +
            }
         455  +
            ,
         456  +
            /* OperationErrorGenerator.kt:321 */
         457  +
            Self::MasterBallUnsuccessful(_inner) =>
         458  +
            /* OperationErrorGenerator.kt:151 */
         459  +
            {
         460  +
                _inner.fmt(f)
         461  +
            }
         462  +
            ,
         463  +
            /* OperationErrorGenerator.kt:321 */
         464  +
            Self::InvalidPokeballError(_inner) =>
         465  +
            /* OperationErrorGenerator.kt:151 */
         466  +
            {
         467  +
                _inner.fmt(f)
         468  +
            }
         469  +
            ,
         470  +
            /* OperationErrorGenerator.kt:321 */
         471  +
            Self::ThrottlingError(_inner) =>
         472  +
            /* OperationErrorGenerator.kt:151 */
         473  +
            {
         474  +
                _inner.fmt(f)
         475  +
            }
         476  +
            ,
         477  +
            /* OperationErrorGenerator.kt:321 */
         478  +
            Self::UnsupportedRegionError(_inner) =>
         479  +
            /* OperationErrorGenerator.kt:151 */
         480  +
            {
         481  +
                _inner.fmt(f)
         482  +
            }
         483  +
            ,
         484  +
            /* OperationErrorGenerator.kt:326 */
  353    485   
            Self::Unhandled(_inner) => {
         486  +
                /* OperationErrorGenerator.kt:139 */
  354    487   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  355    488   
                    write!(f, "unhandled error ({code})")
  356    489   
                } else {
  357    490   
                    f.write_str("unhandled error")
  358    491   
                }
         492  +
                /* OperationErrorGenerator.kt:326 */
         493  +
            } /* OperationErrorGenerator.kt:318 */
  359    494   
        }
         495  +
        /* OperationErrorGenerator.kt:134 */
  360    496   
    }
  361         -
    }
         497  +
    /* OperationErrorGenerator.kt:133 */
  362    498   
}
         499  +
/* OperationErrorGenerator.kt:182 */
  363    500   
impl ::aws_smithy_types::retry::ProvideErrorKind for CapturePokemonError {
         501  +
    /* OperationErrorGenerator.kt:186 */
  364    502   
    fn code(&self) -> ::std::option::Option<&str> {
         503  +
        /* OperationErrorGenerator.kt:187 */
  365    504   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         505  +
        /* OperationErrorGenerator.kt:186 */
  366    506   
    }
         507  +
    /* OperationErrorGenerator.kt:190 */
  367    508   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         509  +
        /* OperationErrorGenerator.kt:197 */
  368    510   
        ::std::option::Option::None
         511  +
        /* OperationErrorGenerator.kt:190 */
  369    512   
    }
         513  +
    /* OperationErrorGenerator.kt:182 */
  370    514   
}
         515  +
/* OperationErrorGenerator.kt:163 */
  371    516   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CapturePokemonError {
         517  +
    /* OperationErrorGenerator.kt:164 */
  372    518   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         519  +
        /* OperationErrorGenerator.kt:318 */
  373    520   
        match self {
  374         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  375         -
            Self::MasterBallUnsuccessful(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  376         -
            Self::InvalidPokeballError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  377         -
            Self::ThrottlingError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  378         -
            Self::UnsupportedRegionError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  379         -
            Self::Unhandled(_inner) => &_inner.meta,
         521  +
            /* OperationErrorGenerator.kt:321 */
         522  +
            Self::ValidationError(_inner) =>
         523  +
            /* OperationErrorGenerator.kt:169 */
         524  +
            {
         525  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         526  +
            }
         527  +
            ,
         528  +
            /* OperationErrorGenerator.kt:321 */
         529  +
            Self::MasterBallUnsuccessful(_inner) =>
         530  +
            /* OperationErrorGenerator.kt:169 */
         531  +
            {
         532  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         533  +
            }
         534  +
            ,
         535  +
            /* OperationErrorGenerator.kt:321 */
         536  +
            Self::InvalidPokeballError(_inner) =>
         537  +
            /* OperationErrorGenerator.kt:169 */
         538  +
            {
         539  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         540  +
            }
         541  +
            ,
         542  +
            /* OperationErrorGenerator.kt:321 */
         543  +
            Self::ThrottlingError(_inner) =>
         544  +
            /* OperationErrorGenerator.kt:169 */
         545  +
            {
         546  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         547  +
            }
         548  +
            ,
         549  +
            /* OperationErrorGenerator.kt:321 */
         550  +
            Self::UnsupportedRegionError(_inner) =>
         551  +
            /* OperationErrorGenerator.kt:169 */
         552  +
            {
         553  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         554  +
            }
         555  +
            ,
         556  +
            /* OperationErrorGenerator.kt:326 */
         557  +
            Self::Unhandled(_inner) => {
         558  +
                /* OperationErrorGenerator.kt:168 */
         559  +
                &_inner.meta
         560  +
                /* OperationErrorGenerator.kt:326 */
         561  +
            } /* OperationErrorGenerator.kt:318 */
  380    562   
        }
         563  +
        /* OperationErrorGenerator.kt:164 */
  381    564   
    }
         565  +
    /* OperationErrorGenerator.kt:163 */
  382    566   
}
         567  +
/* OperationErrorGenerator.kt:109 */
  383    568   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CapturePokemonError {
         569  +
    /* OperationErrorGenerator.kt:110 */
  384    570   
    fn create_unhandled_error(
  385    571   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  386    572   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  387    573   
    ) -> Self {
         574  +
        /* OperationErrorGenerator.kt:121 */
  388    575   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  389    576   
            source,
  390    577   
            meta: meta.unwrap_or_default(),
  391    578   
        })
         579  +
        /* OperationErrorGenerator.kt:110 */
  392    580   
    }
         581  +
    /* OperationErrorGenerator.kt:109 */
  393    582   
}
  394    583   
         584  +
/* CodegenDelegator.kt:255 */
  395    585   
pub use crate::operation::capture_pokemon::_capture_pokemon_output::CapturePokemonOutput;
  396    586   
         587  +
/* CodegenDelegator.kt:255 */
  397    588   
pub use crate::operation::capture_pokemon::_capture_pokemon_input::CapturePokemonInput;
  398    589   
         590  +
/* RustModule.kt:172 */
  399    591   
mod _capture_pokemon_input;
  400    592   
         593  +
/* RustModule.kt:172 */
  401    594   
mod _capture_pokemon_output;
  402    595   
  403         -
/// Builders
         596  +
/// /* CodegenDelegator.kt:51 */Builders
  404    597   
pub mod builders;

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/capture_pokemon/_capture_pokemon_input.rs

@@ -1,1 +96,142 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::fmt::Debug)]
    5         -
pub struct CapturePokemonInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct CapturePokemonInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub events: ::aws_smithy_http::event_stream::EventStreamSender<
    8     12   
        crate::types::AttemptCapturingPokemonEvent,
    9     13   
        crate::types::error::AttemptCapturingPokemonEventError,
   10     14   
    >,
          15  +
    /* StructureGenerator.kt:201 */
   11     16   
}
          17  +
/* StructureGenerator.kt:135 */
   12     18   
impl CapturePokemonInput {
          19  +
    /* StructureGenerator.kt:231 */
   13     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   14     22   
    pub fn events(
   15     23   
        &self,
   16     24   
    ) -> &::aws_smithy_http::event_stream::EventStreamSender<
   17     25   
        crate::types::AttemptCapturingPokemonEvent,
   18     26   
        crate::types::error::AttemptCapturingPokemonEventError,
   19     27   
    > {
          28  +
        /* StructureGenerator.kt:172 */
   20     29   
        &self.events
          30  +
        /* StructureGenerator.kt:166 */
   21     31   
    }
          32  +
    /* StructureGenerator.kt:135 */
   22     33   
}
          34  +
/* ClientCodegenVisitor.kt:237 */
   23     35   
impl CapturePokemonInput {
   24         -
    /// Creates a new builder-style object to manufacture [`CapturePokemonInput`](crate::operation::capture_pokemon::CapturePokemonInput).
          36  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CapturePokemonInput`](crate::operation::capture_pokemon::CapturePokemonInput).
          37  +
    /* BuilderGenerator.kt:175 */
   25     38   
    pub fn builder() -> crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder {
          39  +
        /* BuilderGenerator.kt:176 */
   26     40   
        crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder::default()
          41  +
        /* BuilderGenerator.kt:175 */
   27     42   
    }
          43  +
    /* RustType.kt:516 */
   28     44   
    #[allow(unused)]
          45  +
    /* BuilderGenerator.kt:189 */
   29     46   
    pub(crate) fn into_builder(self) -> crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder {
   30         -
        Self::builder().events(self.events)
          47  +
        /* BuilderGenerator.kt:190 */
          48  +
        Self::builder()
          49  +
            /* BuilderGenerator.kt:199 */
          50  +
            .events(self.events)
          51  +
        /* BuilderGenerator.kt:189 */
   31     52   
    }
          53  +
    /* ClientCodegenVisitor.kt:237 */
   32     54   
}
   33     55   
   34         -
/// A builder for [`CapturePokemonInput`](crate::operation::capture_pokemon::CapturePokemonInput).
          56  +
/// /* BuilderGenerator.kt:342 */A builder for [`CapturePokemonInput`](crate::operation::capture_pokemon::CapturePokemonInput).
          57  +
/* RustType.kt:516 */
   35     58   
#[derive(::std::default::Default, ::std::fmt::Debug)]
          59  +
/* RustType.kt:516 */
   36     60   
#[non_exhaustive]
          61  +
/* BuilderGenerator.kt:345 */
   37     62   
pub struct CapturePokemonInputBuilder {
          63  +
    /* BuilderGenerator.kt:275 */
   38     64   
    pub(crate) events: ::std::option::Option<
   39     65   
        ::aws_smithy_http::event_stream::EventStreamSender<
   40     66   
            crate::types::AttemptCapturingPokemonEvent,
   41     67   
            crate::types::error::AttemptCapturingPokemonEventError,
   42     68   
        >,
   43     69   
    >,
          70  +
    /* BuilderGenerator.kt:345 */
   44     71   
}
          72  +
/* BuilderGenerator.kt:355 */
   45     73   
impl CapturePokemonInputBuilder {
          74  +
    /* BuilderGenerator.kt:286 */
   46     75   
    #[allow(missing_docs)] // documentation missing in model
          76  +
                           /* BuilderGenerator.kt:291 */
   47     77   
    pub fn events(
   48     78   
        mut self,
   49     79   
        input: ::aws_smithy_http::event_stream::EventStreamSender<
   50     80   
            crate::types::AttemptCapturingPokemonEvent,
   51     81   
            crate::types::error::AttemptCapturingPokemonEventError,
   52     82   
        >,
   53     83   
    ) -> Self {
          84  +
        /* BuilderGenerator.kt:292 */
   54     85   
        self.events = ::std::option::Option::Some(input);
          86  +
        /* BuilderGenerator.kt:293 */
   55     87   
        self
          88  +
        /* BuilderGenerator.kt:291 */
   56     89   
    }
          90  +
    /* BuilderGenerator.kt:312 */
   57     91   
    #[allow(missing_docs)] // documentation missing in model
          92  +
                           /* BuilderGenerator.kt:314 */
   58     93   
    pub fn set_events(
   59     94   
        mut self,
   60     95   
        input: ::std::option::Option<
   61     96   
            ::aws_smithy_http::event_stream::EventStreamSender<
   62     97   
                crate::types::AttemptCapturingPokemonEvent,
   63     98   
                crate::types::error::AttemptCapturingPokemonEventError,
   64     99   
            >,
   65    100   
        >,
   66    101   
    ) -> Self {
         102  +
        /* BuilderGenerator.kt:315 */
   67    103   
        self.events = input;
   68    104   
        self
         105  +
        /* BuilderGenerator.kt:314 */
   69    106   
    }
         107  +
    /* BuilderGenerator.kt:334 */
   70    108   
    #[allow(missing_docs)] // documentation missing in model
         109  +
                           /* BuilderGenerator.kt:336 */
   71    110   
    pub fn get_events(
   72    111   
        &self,
   73    112   
    ) -> &::std::option::Option<
   74    113   
        ::aws_smithy_http::event_stream::EventStreamSender<
   75    114   
            crate::types::AttemptCapturingPokemonEvent,
   76    115   
            crate::types::error::AttemptCapturingPokemonEventError,
   77    116   
        >,
   78    117   
    > {
         118  +
        /* BuilderGenerator.kt:337 */
   79    119   
        &self.events
         120  +
        /* BuilderGenerator.kt:336 */
   80    121   
    }
   81         -
    /// Consumes the builder and constructs a [`CapturePokemonInput`](crate::operation::capture_pokemon::CapturePokemonInput).
   82         -
    /// This method will fail if any of the following fields are not set:
   83         -
    /// - [`events`](crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder::events)
         122  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CapturePokemonInput`](crate::operation::capture_pokemon::CapturePokemonInput).
         123  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         124  +
    /// /* BuilderGenerator.kt:246 */- [`events`](crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder::events)
         125  +
    /* BuilderGenerator.kt:253 */
   84    126   
    pub fn build(
   85    127   
        self,
   86    128   
    ) -> ::std::result::Result<crate::operation::capture_pokemon::CapturePokemonInput, ::aws_smithy_types::error::operation::BuildError> {
   87         -
        ::std::result::Result::Ok(crate::operation::capture_pokemon::CapturePokemonInput {
   88         -
            events: self.events.ok_or_else(|| {
   89         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   90         -
                    "events",
   91         -
                    "events was not specified but it is required when building CapturePokemonInput",
   92         -
                )
   93         -
            })?,
   94         -
        })
         129  +
        /* BuilderGenerator.kt:254 */
         130  +
        ::std::result::Result::Ok(
         131  +
            /* BuilderGenerator.kt:477 */crate::operation::capture_pokemon::CapturePokemonInput {
         132  +
                /* BuilderGenerator.kt:481 */events: self.events
         133  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         134  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("events", "events was not specified but it is required when building CapturePokemonInput")
         135  +
                    /* BuilderGenerator.kt:494 */)?
         136  +
                ,
         137  +
            /* BuilderGenerator.kt:477 */}
         138  +
        /* BuilderGenerator.kt:254 */)
         139  +
        /* BuilderGenerator.kt:253 */
   95    140   
    }
         141  +
    /* BuilderGenerator.kt:355 */
   96    142   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/capture_pokemon/_capture_pokemon_output.rs

@@ -1,1 +78,124 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::fmt::Debug)]
    5         -
pub struct CapturePokemonOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct CapturePokemonOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub events: crate::event_receiver::EventReceiver<crate::types::CapturePokemonEvents, crate::types::error::CapturePokemonEventsError>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl CapturePokemonOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn events(
   12     20   
        &self,
   13     21   
    ) -> &crate::event_receiver::EventReceiver<crate::types::CapturePokemonEvents, crate::types::error::CapturePokemonEventsError> {
          22  +
        /* StructureGenerator.kt:172 */
   14     23   
        &self.events
          24  +
        /* StructureGenerator.kt:166 */
   15     25   
    }
          26  +
    /* StructureGenerator.kt:135 */
   16     27   
}
          28  +
/* ClientCodegenVisitor.kt:237 */
   17     29   
impl CapturePokemonOutput {
   18         -
    /// Creates a new builder-style object to manufacture [`CapturePokemonOutput`](crate::operation::capture_pokemon::CapturePokemonOutput).
          30  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CapturePokemonOutput`](crate::operation::capture_pokemon::CapturePokemonOutput).
          31  +
    /* BuilderGenerator.kt:175 */
   19     32   
    pub fn builder() -> crate::operation::capture_pokemon::builders::CapturePokemonOutputBuilder {
          33  +
        /* BuilderGenerator.kt:176 */
   20     34   
        crate::operation::capture_pokemon::builders::CapturePokemonOutputBuilder::default()
          35  +
        /* BuilderGenerator.kt:175 */
   21     36   
    }
          37  +
    /* RustType.kt:516 */
   22     38   
    #[allow(unused)]
          39  +
    /* BuilderGenerator.kt:189 */
   23     40   
    pub(crate) fn into_builder(self) -> crate::operation::capture_pokemon::builders::CapturePokemonOutputBuilder {
   24         -
        Self::builder().events(self.events)
          41  +
        /* BuilderGenerator.kt:190 */
          42  +
        Self::builder()
          43  +
            /* BuilderGenerator.kt:199 */
          44  +
            .events(self.events)
          45  +
        /* BuilderGenerator.kt:189 */
   25     46   
    }
          47  +
    /* ClientCodegenVisitor.kt:237 */
   26     48   
}
   27     49   
   28         -
/// A builder for [`CapturePokemonOutput`](crate::operation::capture_pokemon::CapturePokemonOutput).
          50  +
/// /* BuilderGenerator.kt:342 */A builder for [`CapturePokemonOutput`](crate::operation::capture_pokemon::CapturePokemonOutput).
          51  +
/* RustType.kt:516 */
   29     52   
#[derive(::std::default::Default, ::std::fmt::Debug)]
          53  +
/* RustType.kt:516 */
   30     54   
#[non_exhaustive]
          55  +
/* BuilderGenerator.kt:345 */
   31     56   
pub struct CapturePokemonOutputBuilder {
          57  +
    /* BuilderGenerator.kt:275 */
   32     58   
    pub(crate) events: ::std::option::Option<
   33     59   
        crate::event_receiver::EventReceiver<crate::types::CapturePokemonEvents, crate::types::error::CapturePokemonEventsError>,
   34     60   
    >,
          61  +
    /* BuilderGenerator.kt:345 */
   35     62   
}
          63  +
/* BuilderGenerator.kt:355 */
   36     64   
impl CapturePokemonOutputBuilder {
          65  +
    /* BuilderGenerator.kt:286 */
   37     66   
    #[allow(missing_docs)] // documentation missing in model
          67  +
                           /* BuilderGenerator.kt:291 */
   38     68   
    pub fn events(
   39     69   
        mut self,
   40     70   
        input: crate::event_receiver::EventReceiver<crate::types::CapturePokemonEvents, crate::types::error::CapturePokemonEventsError>,
   41     71   
    ) -> Self {
          72  +
        /* BuilderGenerator.kt:292 */
   42     73   
        self.events = ::std::option::Option::Some(input);
          74  +
        /* BuilderGenerator.kt:293 */
   43     75   
        self
          76  +
        /* BuilderGenerator.kt:291 */
   44     77   
    }
          78  +
    /* BuilderGenerator.kt:312 */
   45     79   
    #[allow(missing_docs)] // documentation missing in model
          80  +
                           /* BuilderGenerator.kt:314 */
   46     81   
    pub fn set_events(
   47     82   
        mut self,
   48     83   
        input: ::std::option::Option<
   49     84   
            crate::event_receiver::EventReceiver<crate::types::CapturePokemonEvents, crate::types::error::CapturePokemonEventsError>,
   50     85   
        >,
   51     86   
    ) -> Self {
          87  +
        /* BuilderGenerator.kt:315 */
   52     88   
        self.events = input;
   53     89   
        self
          90  +
        /* BuilderGenerator.kt:314 */
   54     91   
    }
          92  +
    /* BuilderGenerator.kt:334 */
   55     93   
    #[allow(missing_docs)] // documentation missing in model
          94  +
                           /* BuilderGenerator.kt:336 */
   56     95   
    pub fn get_events(
   57     96   
        &self,
   58     97   
    ) -> &::std::option::Option<
   59     98   
        crate::event_receiver::EventReceiver<crate::types::CapturePokemonEvents, crate::types::error::CapturePokemonEventsError>,
   60     99   
    > {
         100  +
        /* BuilderGenerator.kt:337 */
   61    101   
        &self.events
         102  +
        /* BuilderGenerator.kt:336 */
   62    103   
    }
   63         -
    /// Consumes the builder and constructs a [`CapturePokemonOutput`](crate::operation::capture_pokemon::CapturePokemonOutput).
   64         -
    /// This method will fail if any of the following fields are not set:
   65         -
    /// - [`events`](crate::operation::capture_pokemon::builders::CapturePokemonOutputBuilder::events)
         104  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CapturePokemonOutput`](crate::operation::capture_pokemon::CapturePokemonOutput).
         105  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         106  +
    /// /* BuilderGenerator.kt:246 */- [`events`](crate::operation::capture_pokemon::builders::CapturePokemonOutputBuilder::events)
         107  +
    /* BuilderGenerator.kt:253 */
   66    108   
    pub fn build(
   67    109   
        self,
   68    110   
    ) -> ::std::result::Result<crate::operation::capture_pokemon::CapturePokemonOutput, ::aws_smithy_types::error::operation::BuildError> {
   69         -
        ::std::result::Result::Ok(crate::operation::capture_pokemon::CapturePokemonOutput {
   70         -
            events: self.events.ok_or_else(|| {
   71         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   72         -
                    "events",
   73         -
                    "events was not specified but it is required when building CapturePokemonOutput",
   74         -
                )
   75         -
            })?,
   76         -
        })
         111  +
        /* BuilderGenerator.kt:254 */
         112  +
        ::std::result::Result::Ok(
         113  +
            /* BuilderGenerator.kt:477 */crate::operation::capture_pokemon::CapturePokemonOutput {
         114  +
                /* BuilderGenerator.kt:481 */events: self.events
         115  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         116  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("events", "events was not specified but it is required when building CapturePokemonOutput")
         117  +
                    /* BuilderGenerator.kt:494 */)?
         118  +
                ,
         119  +
            /* BuilderGenerator.kt:477 */}
         120  +
        /* BuilderGenerator.kt:254 */)
         121  +
        /* BuilderGenerator.kt:253 */
   77    122   
    }
         123  +
    /* BuilderGenerator.kt:355 */
   78    124   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/capture_pokemon/builders.rs

@@ -1,1 +98,108 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::capture_pokemon::_capture_pokemon_output::CapturePokemonOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::capture_pokemon::_capture_pokemon_input::CapturePokemonInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::capture_pokemon::CapturePokemonOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::capture_pokemon::CapturePokemonError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.capture_pokemon();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `CapturePokemon`.
   24         -
///
   25         -
/// Capture Pokémons via event streams.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `CapturePokemon`.
   26     27   
///
          28  +
/// /* FluentBuilderGenerator.kt:130 */Capture Pokémons via event streams.
          29  +
/// /* FluentBuilderGenerator.kt:132 */
   27     30   
/// [`CapturePokemonOutput`](crate::operation::capture_pokemon::CapturePokemonOutput) contains an event stream field as well as one or more non-event stream fields.
   28     31   
/// Due to its current implementation, the non-event stream fields are not fully deserialized
   29     32   
/// until the [`send`](Self::send) method completes. As a result, accessing these fields of the operation
   30     33   
/// output struct within an interceptor may return uninitialized values.
   31     34   
///
          35  +
/* RustType.kt:516 */
   32     36   
#[derive(::std::fmt::Debug)]
          37  +
/* FluentBuilderGenerator.kt:270 */
   33     38   
pub struct CapturePokemonFluentBuilder {
   34     39   
    handle: ::std::sync::Arc<crate::client::Handle>,
   35     40   
    inner: crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder,
   36     41   
    config_override: ::std::option::Option<crate::config::Builder>,
   37     42   
}
          43  +
/* FluentBuilderGenerator.kt:381 */
   38     44   
impl
   39     45   
    crate::client::customize::internal::CustomizableSend<
   40     46   
        crate::operation::capture_pokemon::CapturePokemonOutput,
   41     47   
        crate::operation::capture_pokemon::CapturePokemonError,
   42     48   
    > for CapturePokemonFluentBuilder
   43     49   
{
   44     50   
    fn send(
   45     51   
        self,
   46     52   
        config_override: crate::config::Builder,
   47     53   
    ) -> crate::client::customize::internal::BoxFuture<
   48     54   
        crate::client::customize::internal::SendResult<
   49     55   
            crate::operation::capture_pokemon::CapturePokemonOutput,
   50     56   
            crate::operation::capture_pokemon::CapturePokemonError,
   51     57   
        >,
   52     58   
    > {
   53     59   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   54     60   
    }
   55     61   
}
          62  +
/* FluentBuilderGenerator.kt:282 */
   56     63   
impl CapturePokemonFluentBuilder {
          64  +
    /* FluentBuilderGenerator.kt:288 */
   57     65   
    /// Creates a new `CapturePokemonFluentBuilder`.
   58     66   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   59     67   
        Self {
   60     68   
            handle,
   61     69   
            inner: ::std::default::Default::default(),
   62     70   
            config_override: ::std::option::Option::None,
   63     71   
        }
   64     72   
    }
          73  +
    /* FluentBuilderGenerator.kt:301 */
   65     74   
    /// Access the CapturePokemon as a reference.
   66     75   
    pub fn as_input(&self) -> &crate::operation::capture_pokemon::builders::CapturePokemonInputBuilder {
   67     76   
        &self.inner
   68     77   
    }
          78  +
    /* FluentBuilderGenerator.kt:145 */
   69     79   
    /// Sends the request and returns the response.
   70     80   
    ///
   71     81   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   72     82   
    /// can be matched against.
   73     83   
    ///
   74     84   
    /// By default, any retryable failures will be retried twice. Retry behavior
   75     85   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   76     86   
    /// set when configuring the client.
   77     87   
    pub async fn send(
   78     88   
        self,
@@ -108,118 +182,200 @@
  128    138   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
  129    139   
    pub fn customize(
  130    140   
        self,
  131    141   
    ) -> crate::client::customize::CustomizableOperation<
  132    142   
        crate::operation::capture_pokemon::CapturePokemonOutput,
  133    143   
        crate::operation::capture_pokemon::CapturePokemonError,
  134    144   
        Self,
  135    145   
    > {
  136    146   
        crate::client::customize::CustomizableOperation::new(self)
  137    147   
    }
         148  +
    /* FluentBuilderGenerator.kt:315 */
  138    149   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  139    150   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  140    151   
        self
  141    152   
    }
  142    153   
  143    154   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  144    155   
        self.config_override = config_override;
  145    156   
        self
  146    157   
    }
         158  +
    /* FluentBuilderGenerator.kt:498 */
  147    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* FluentBuilderGenerator.kt:500 */
  148    161   
    pub fn events(
  149    162   
        mut self,
  150    163   
        input: ::aws_smithy_http::event_stream::EventStreamSender<
  151    164   
            crate::types::AttemptCapturingPokemonEvent,
  152    165   
            crate::types::error::AttemptCapturingPokemonEventError,
  153    166   
        >,
  154    167   
    ) -> Self {
  155    168   
        self.inner = self.inner.events(input);
  156    169   
        self
  157    170   
    }
         171  +
    /* FluentBuilderGenerator.kt:498 */
  158    172   
    #[allow(missing_docs)] // documentation missing in model
         173  +
                           /* FluentBuilderGenerator.kt:500 */
  159    174   
    pub fn set_events(
  160    175   
        mut self,
  161    176   
        input: ::std::option::Option<
  162    177   
            ::aws_smithy_http::event_stream::EventStreamSender<
  163    178   
                crate::types::AttemptCapturingPokemonEvent,
  164    179   
                crate::types::error::AttemptCapturingPokemonEventError,
  165    180   
            >,
  166    181   
        >,
  167    182   
    ) -> Self {
  168    183   
        self.inner = self.inner.set_events(input);
  169    184   
        self
  170    185   
    }
         186  +
    /* FluentBuilderGenerator.kt:518 */
  171    187   
    #[allow(missing_docs)] // documentation missing in model
         188  +
                           /* FluentBuilderGenerator.kt:520 */
  172    189   
    pub fn get_events(
  173    190   
        &self,
  174    191   
    ) -> &::std::option::Option<
  175    192   
        ::aws_smithy_http::event_stream::EventStreamSender<
  176    193   
            crate::types::AttemptCapturingPokemonEvent,
  177    194   
            crate::types::error::AttemptCapturingPokemonEventError,
  178    195   
        >,
  179    196   
    > {
  180    197   
        self.inner.get_events()
  181    198   
    }
         199  +
    /* FluentBuilderGenerator.kt:282 */
  182    200   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/check_health.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `CheckHealth`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct CheckHealth;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl CheckHealth {
    7         -
    /// Creates a new `CheckHealth`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `CheckHealth`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::check_health::CheckHealthInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::check_health::CheckHealthOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::check_health::CheckHealthError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +331,402 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CheckHealth {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CheckHealth");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            CheckHealthRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            CheckHealthResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "CheckHealth",
  105    116   
            "PokemonService",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CheckHealth")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(CheckHealthEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::check_health::CheckHealthError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::check_health::CheckHealthError,
  124    135   
            >::new());
  125    136   
  126    137   
        ::std::borrow::Cow::Owned(rcb)
  127    138   
    }
  128    139   
}
  129    140   
         141  +
/* ResponseDeserializerGenerator.kt:64 */
  130    142   
#[derive(Debug)]
  131    143   
struct CheckHealthResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CheckHealthResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_check_health::de_check_health_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_check_health::de_check_health_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct CheckHealthRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CheckHealthRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input
  161    174   
            .downcast::<crate::operation::check_health::CheckHealthInput>()
  162    175   
            .expect("correct type");
  163    176   
        let _header_serialization_settings = _cfg
  164    177   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  165    178   
            .cloned()
  166    179   
            .unwrap_or_default();
  167    180   
        let mut request_builder = {
  168    181   
            fn uri_base(
  169    182   
                _input: &crate::operation::check_health::CheckHealthInput,
  170    183   
                output: &mut ::std::string::String,
  171    184   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  172    185   
                use ::std::fmt::Write as _;
  173    186   
                ::std::write!(output, "/").expect("formatting should succeed");
  174    187   
                ::std::result::Result::Ok(())
  175    188   
            }
  176    189   
            #[allow(clippy::unnecessary_wraps)]
  177    190   
            fn update_http_builder(
  178    191   
                input: &crate::operation::check_health::CheckHealthInput,
  179    192   
                builder: ::http::request::Builder,
  180    193   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  181    194   
                let mut uri = ::std::string::String::new();
  182    195   
                uri_base(input, &mut uri)?;
  183    196   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  184    197   
            }
  185    198   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  186    199   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  187    200   
            builder = _header_serialization_settings.set_default_header(
  188    201   
                builder,
  189    202   
                ::http::header::HeaderName::from_static("x-amz-target"),
  190    203   
                "PokemonService.CheckHealth",
  191    204   
            );
  192    205   
            builder
  193    206   
        };
  194    207   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_check_health::ser_check_health_input(&input)?);
  195    208   
  196    209   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  197    210   
    }
  198    211   
}
         212  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  199    213   
#[derive(Debug)]
  200    214   
struct CheckHealthEndpointParamsInterceptor;
  201    215   
  202    216   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CheckHealthEndpointParamsInterceptor {
  203    217   
    fn name(&self) -> &'static str {
  204    218   
        "CheckHealthEndpointParamsInterceptor"
  205    219   
    }
  206    220   
  207    221   
    fn read_before_execution(
  208    222   
        &self,
  209    223   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  210    224   
            '_,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  212    226   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  213    227   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  214    228   
        >,
  215    229   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  216    230   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  217    231   
        let _input = context
  218    232   
            .input()
  219    233   
            .downcast_ref::<CheckHealthInput>()
  220    234   
            .ok_or("failed to downcast to CheckHealthInput")?;
  221    235   
  222    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  223    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  224    238   
        })?;
  225    239   
        cfg.interceptor_state()
  226    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  227    241   
        ::std::result::Result::Ok(())
  228    242   
    }
  229    243   
}
  230    244   
  231    245   
// The get_* functions below are generated from JMESPath expressions in the
  232    246   
// operationContextParams trait. They target the operation's input shape.
  233    247   
         248  +
/* OperationErrorGenerator.kt:79 */
  234    249   
/// Error type for the `CheckHealthError` operation.
         250  +
/* RustType.kt:516 */
  235    251   
#[non_exhaustive]
         252  +
/* RustType.kt:516 */
  236    253   
#[derive(::std::fmt::Debug)]
  237         -
pub enum CheckHealthError {
         254  +
pub /* OperationErrorGenerator.kt:81 */ enum CheckHealthError {
         255  +
    /* OperationErrorGenerator.kt:88 */
  238    256   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  239    257   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  240    258   
    variable wildcard pattern and check `.code()`:
  241    259   
     \
  242    260   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  243    261   
     \
  244    262   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CheckHealthError) for what information is available for the error.")]
  245    263   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         264  +
    /* OperationErrorGenerator.kt:81 */
  246    265   
}
         266  +
/* OperationErrorGenerator.kt:218 */
  247    267   
impl CheckHealthError {
         268  +
    /* OperationErrorGenerator.kt:219 */
  248    269   
    /// Creates the `CheckHealthError::Unhandled` variant from any error type.
  249    270   
    pub fn unhandled(
  250    271   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  251    272   
    ) -> Self {
  252    273   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  253    274   
            source: err.into(),
  254    275   
            meta: ::std::default::Default::default(),
  255    276   
        })
  256    277   
    }
  257    278   
  258    279   
    /// Creates the `CheckHealthError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  259    280   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  260    281   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  261    282   
            source: err.clone().into(),
  262    283   
            meta: err,
  263    284   
        })
  264    285   
    }
  265         -
    ///
         286  +
    /// /* OperationErrorGenerator.kt:236 */
  266    287   
    /// Returns error metadata, which includes the error code, message,
  267    288   
    /// request ID, and potentially additional information.
  268    289   
    ///
         290  +
    /* OperationErrorGenerator.kt:242 */
  269    291   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         292  +
        /* OperationErrorGenerator.kt:243 */
  270    293   
        match self {
  271         -
            Self::Unhandled(e) => &e.meta,
         294  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         295  +
            /* OperationErrorGenerator.kt:243 */
  272    296   
        }
         297  +
        /* OperationErrorGenerator.kt:242 */
  273    298   
    }
         299  +
    /* OperationErrorGenerator.kt:218 */
  274    300   
}
         301  +
/* OperationErrorGenerator.kt:269 */
  275    302   
impl ::std::error::Error for CheckHealthError {
         303  +
    /* OperationErrorGenerator.kt:270 */
  276    304   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         305  +
        /* OperationErrorGenerator.kt:318 */
  277    306   
        match self {
  278         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         307  +
            /* OperationErrorGenerator.kt:326 */
         308  +
            Self::Unhandled(_inner) => {
         309  +
                /* OperationErrorGenerator.kt:279 */
         310  +
                ::std::option::Option::Some(&*_inner.source)
         311  +
                /* OperationErrorGenerator.kt:326 */
         312  +
            } /* OperationErrorGenerator.kt:318 */
  279    313   
        }
         314  +
        /* OperationErrorGenerator.kt:270 */
  280    315   
    }
         316  +
    /* OperationErrorGenerator.kt:269 */
  281    317   
}
         318  +
/* OperationErrorGenerator.kt:133 */
  282    319   
impl ::std::fmt::Display for CheckHealthError {
         320  +
    /* OperationErrorGenerator.kt:134 */
  283    321   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         322  +
        /* OperationErrorGenerator.kt:318 */
  284    323   
        match self {
         324  +
            /* OperationErrorGenerator.kt:326 */
  285    325   
            Self::Unhandled(_inner) => {
         326  +
                /* OperationErrorGenerator.kt:139 */
  286    327   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  287    328   
                    write!(f, "unhandled error ({code})")
  288    329   
                } else {
  289    330   
                    f.write_str("unhandled error")
  290    331   
                }
         332  +
                /* OperationErrorGenerator.kt:326 */
         333  +
            } /* OperationErrorGenerator.kt:318 */
  291    334   
        }
         335  +
        /* OperationErrorGenerator.kt:134 */
  292    336   
    }
  293         -
    }
         337  +
    /* OperationErrorGenerator.kt:133 */
  294    338   
}
         339  +
/* OperationErrorGenerator.kt:182 */
  295    340   
impl ::aws_smithy_types::retry::ProvideErrorKind for CheckHealthError {
         341  +
    /* OperationErrorGenerator.kt:186 */
  296    342   
    fn code(&self) -> ::std::option::Option<&str> {
         343  +
        /* OperationErrorGenerator.kt:187 */
  297    344   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         345  +
        /* OperationErrorGenerator.kt:186 */
  298    346   
    }
         347  +
    /* OperationErrorGenerator.kt:190 */
  299    348   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         349  +
        /* OperationErrorGenerator.kt:197 */
  300    350   
        ::std::option::Option::None
         351  +
        /* OperationErrorGenerator.kt:190 */
  301    352   
    }
         353  +
    /* OperationErrorGenerator.kt:182 */
  302    354   
}
         355  +
/* OperationErrorGenerator.kt:163 */
  303    356   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CheckHealthError {
         357  +
    /* OperationErrorGenerator.kt:164 */
  304    358   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         359  +
        /* OperationErrorGenerator.kt:318 */
  305    360   
        match self {
  306         -
            Self::Unhandled(_inner) => &_inner.meta,
         361  +
            /* OperationErrorGenerator.kt:326 */
         362  +
            Self::Unhandled(_inner) => {
         363  +
                /* OperationErrorGenerator.kt:168 */
         364  +
                &_inner.meta
         365  +
                /* OperationErrorGenerator.kt:326 */
         366  +
            } /* OperationErrorGenerator.kt:318 */
  307    367   
        }
         368  +
        /* OperationErrorGenerator.kt:164 */
  308    369   
    }
         370  +
    /* OperationErrorGenerator.kt:163 */
  309    371   
}
         372  +
/* OperationErrorGenerator.kt:109 */
  310    373   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CheckHealthError {
         374  +
    /* OperationErrorGenerator.kt:110 */
  311    375   
    fn create_unhandled_error(
  312    376   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  313    377   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  314    378   
    ) -> Self {
         379  +
        /* OperationErrorGenerator.kt:121 */
  315    380   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  316    381   
            source,
  317    382   
            meta: meta.unwrap_or_default(),
  318    383   
        })
         384  +
        /* OperationErrorGenerator.kt:110 */
  319    385   
    }
         386  +
    /* OperationErrorGenerator.kt:109 */
  320    387   
}
  321    388   
         389  +
/* CodegenDelegator.kt:255 */
  322    390   
pub use crate::operation::check_health::_check_health_output::CheckHealthOutput;
  323    391   
         392  +
/* CodegenDelegator.kt:255 */
  324    393   
pub use crate::operation::check_health::_check_health_input::CheckHealthInput;
  325    394   
         395  +
/* RustModule.kt:172 */
  326    396   
mod _check_health_input;
  327    397   
         398  +
/* RustModule.kt:172 */
  328    399   
mod _check_health_output;
  329    400   
  330         -
/// Builders
         401  +
/// /* CodegenDelegator.kt:51 */Builders
  331    402   
pub mod builders;

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/check_health/_check_health_input.rs

@@ -1,1 +22,42 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct CheckHealthInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct CheckHealthInput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl CheckHealthInput {
    7         -
    /// Creates a new builder-style object to manufacture [`CheckHealthInput`](crate::operation::check_health::CheckHealthInput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CheckHealthInput`](crate::operation::check_health::CheckHealthInput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::check_health::builders::CheckHealthInputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::check_health::builders::CheckHealthInputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`CheckHealthInput`](crate::operation::check_health::CheckHealthInput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`CheckHealthInput`](crate::operation::check_health::CheckHealthInput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct CheckHealthInputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct CheckHealthInputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl CheckHealthInputBuilder {
   18         -
    /// Consumes the builder and constructs a [`CheckHealthInput`](crate::operation::check_health::CheckHealthInput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CheckHealthInput`](crate::operation::check_health::CheckHealthInput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> ::std::result::Result<crate::operation::check_health::CheckHealthInput, ::aws_smithy_types::error::operation::BuildError> {
   20         -
        ::std::result::Result::Ok(crate::operation::check_health::CheckHealthInput {})
          33  +
        /* BuilderGenerator.kt:254 */
          34  +
        ::std::result::Result::Ok(
          35  +
            /* BuilderGenerator.kt:477 */
          36  +
            crate::operation::check_health::CheckHealthInput {
          37  +
            /* BuilderGenerator.kt:477 */}, /* BuilderGenerator.kt:254 */
          38  +
        )
          39  +
        /* BuilderGenerator.kt:253 */
   21     40   
    }
          41  +
    /* BuilderGenerator.kt:355 */
   22     42   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/check_health/_check_health_output.rs

@@ -1,1 +22,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct CheckHealthOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct CheckHealthOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl CheckHealthOutput {
    7         -
    /// Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::operation::check_health::builders::CheckHealthOutputBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::operation::check_health::builders::CheckHealthOutputBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct CheckHealthOutputBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct CheckHealthOutputBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl CheckHealthOutputBuilder {
   18         -
    /// Consumes the builder and constructs a [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CheckHealthOutput`](crate::operation::check_health::CheckHealthOutput).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::operation::check_health::CheckHealthOutput {
   20         -
        crate::operation::check_health::CheckHealthOutput {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::operation::check_health::CheckHealthOutput {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/check_health/builders.rs

@@ -1,1 +111,123 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::check_health::_check_health_output::CheckHealthOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::check_health::_check_health_input::CheckHealthInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::check_health::builders::CheckHealthInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::check_health::CheckHealthOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::check_health::CheckHealthError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.check_health();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `CheckHealth`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `CheckHealth`.
   24     27   
///
   25         -
/// Health check operation, to check the service is up Not yet a deep check
          28  +
/// /* FluentBuilderGenerator.kt:130 */Health check operation, to check the service is up Not yet a deep check
          29  +
/* RustType.kt:516 */
   26     30   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          31  +
/* FluentBuilderGenerator.kt:270 */
   27     32   
pub struct CheckHealthFluentBuilder {
   28     33   
    handle: ::std::sync::Arc<crate::client::Handle>,
   29     34   
    inner: crate::operation::check_health::builders::CheckHealthInputBuilder,
   30     35   
    config_override: ::std::option::Option<crate::config::Builder>,
   31     36   
}
          37  +
/* FluentBuilderGenerator.kt:381 */
   32     38   
impl
   33     39   
    crate::client::customize::internal::CustomizableSend<
   34     40   
        crate::operation::check_health::CheckHealthOutput,
   35     41   
        crate::operation::check_health::CheckHealthError,
   36     42   
    > for CheckHealthFluentBuilder
   37     43   
{
   38     44   
    fn send(
   39     45   
        self,
   40     46   
        config_override: crate::config::Builder,
   41     47   
    ) -> crate::client::customize::internal::BoxFuture<
   42     48   
        crate::client::customize::internal::SendResult<
   43     49   
            crate::operation::check_health::CheckHealthOutput,
   44     50   
            crate::operation::check_health::CheckHealthError,
   45     51   
        >,
   46     52   
    > {
   47     53   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   48     54   
    }
   49     55   
}
          56  +
/* FluentBuilderGenerator.kt:282 */
   50     57   
impl CheckHealthFluentBuilder {
          58  +
    /* FluentBuilderGenerator.kt:288 */
   51     59   
    /// Creates a new `CheckHealthFluentBuilder`.
   52     60   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   53     61   
        Self {
   54     62   
            handle,
   55     63   
            inner: ::std::default::Default::default(),
   56     64   
            config_override: ::std::option::Option::None,
   57     65   
        }
   58     66   
    }
          67  +
    /* FluentBuilderGenerator.kt:301 */
   59     68   
    /// Access the CheckHealth as a reference.
   60     69   
    pub fn as_input(&self) -> &crate::operation::check_health::builders::CheckHealthInputBuilder {
   61     70   
        &self.inner
   62     71   
    }
          72  +
    /* FluentBuilderGenerator.kt:145 */
   63     73   
    /// Sends the request and returns the response.
   64     74   
    ///
   65     75   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   66     76   
    /// can be matched against.
   67     77   
    ///
   68     78   
    /// By default, any retryable failures will be retried twice. Retry behavior
   69     79   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   70     80   
    /// set when configuring the client.
   71     81   
    pub async fn send(
   72     82   
        self,
   73     83   
    ) -> ::std::result::Result<
   74     84   
        crate::operation::check_health::CheckHealthOutput,
   75     85   
        ::aws_smithy_runtime_api::client::result::SdkError<
   76     86   
            crate::operation::check_health::CheckHealthError,
   77     87   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   78     88   
        >,
   79     89   
    > {
   80     90   
        let input = self
   81     91   
            .inner
   82     92   
            .build()
   83     93   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   84     94   
        let runtime_plugins = crate::operation::check_health::CheckHealth::operation_runtime_plugins(
   85     95   
            self.handle.runtime_plugins.clone(),
   86     96   
            &self.handle.conf,
   87     97   
            self.config_override,
   88     98   
        );
   89     99   
        crate::operation::check_health::CheckHealth::orchestrate(&runtime_plugins, input).await
   90    100   
    }
   91    101   
   92    102   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   93    103   
    pub fn customize(
   94    104   
        self,
   95    105   
    ) -> crate::client::customize::CustomizableOperation<
   96    106   
        crate::operation::check_health::CheckHealthOutput,
   97    107   
        crate::operation::check_health::CheckHealthError,
   98    108   
        Self,
   99    109   
    > {
  100    110   
        crate::client::customize::CustomizableOperation::new(self)
  101    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:315 */
  102    113   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  103    114   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  104    115   
        self
  105    116   
    }
  106    117   
  107    118   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  108    119   
        self.config_override = config_override;
  109    120   
        self
  110    121   
    }
         122  +
    /* FluentBuilderGenerator.kt:282 */
  111    123   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/operation/do_nothing.rs

@@ -1,1 +40,49 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* OperationGenerator.kt:77 */
    2      3   
/// Orchestration and serialization glue logic for `DoNothing`.
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           6  +
/* RustType.kt:516 */
    4      7   
#[non_exhaustive]
           8  +
/* OperationGenerator.kt:84 */
    5      9   
pub struct DoNothing;
          10  +
/* OperationGenerator.kt:85 */
    6     11   
impl DoNothing {
    7         -
    /// Creates a new `DoNothing`
          12  +
    /// /* OperationGenerator.kt:86 */Creates a new `DoNothing`
          13  +
    /* OperationGenerator.kt:87 */
    8     14   
    pub fn new() -> Self {
          15  +
        /* OperationGenerator.kt:88 */
    9     16   
        Self
          17  +
        /* OperationGenerator.kt:87 */
   10     18   
    }
          19  +
    /* OperationGenerator.kt:138 */
   11     20   
    pub(crate) async fn orchestrate(
   12     21   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     22   
        input: crate::operation::do_nothing::DoNothingInput,
   14     23   
    ) -> ::std::result::Result<
   15     24   
        crate::operation::do_nothing::DoNothingOutput,
   16     25   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     26   
            crate::operation::do_nothing::DoNothingError,
   18     27   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     28   
        >,
   20     29   
    > {
@@ -57,66 +329,400 @@
   77     86   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   78     87   
            }
   79     88   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   80     89   
                config_override,
   81     90   
                client_config.config.clone(),
   82     91   
                &client_config.runtime_components,
   83     92   
            ));
   84     93   
        }
   85     94   
        runtime_plugins
   86     95   
    }
          96  +
    /* OperationGenerator.kt:85 */
   87     97   
}
          98  +
/* OperationRuntimePluginGenerator.kt:55 */
   88     99   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DoNothing {
   89    100   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   90    101   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DoNothing");
   91    102   
   92    103   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   93    104   
            DoNothingRequestSerializer,
   94    105   
        ));
   95    106   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   96    107   
            DoNothingResponseDeserializer,
   97    108   
        ));
   98    109   
   99    110   
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
  100    111   
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
  101    112   
        ));
  102    113   
  103    114   
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
  104    115   
            "DoNothing",
  105    116   
            "PokemonService",
  106    117   
        ));
  107    118   
  108    119   
        ::std::option::Option::Some(cfg.freeze())
  109    120   
    }
  110    121   
  111    122   
    fn runtime_components(
  112    123   
        &self,
  113    124   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  114    125   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  115    126   
        #[allow(unused_mut)]
  116    127   
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DoNothing")
  117    128   
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
  118    129   
            .with_interceptor(DoNothingEndpointParamsInterceptor)
  119    130   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
  120    131   
                crate::operation::do_nothing::DoNothingError,
  121    132   
            >::new())
  122    133   
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
  123    134   
                crate::operation::do_nothing::DoNothingError,
  124    135   
            >::new());
  125    136   
  126    137   
        ::std::borrow::Cow::Owned(rcb)
  127    138   
    }
  128    139   
}
  129    140   
         141  +
/* ResponseDeserializerGenerator.kt:64 */
  130    142   
#[derive(Debug)]
  131    143   
struct DoNothingResponseDeserializer;
  132    144   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DoNothingResponseDeserializer {
  133    145   
    fn deserialize_nonstreaming(
  134    146   
        &self,
  135    147   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  136    148   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  137    149   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  138    150   
        let headers = response.headers();
  139    151   
        let body = response.body().bytes().expect("body loaded");
  140    152   
        #[allow(unused_mut)]
  141    153   
        let mut force_error = false;
  142    154   
  143    155   
        let parse_result = if !success && status != 200 || force_error {
  144    156   
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_error(status, headers, body)
  145    157   
        } else {
  146    158   
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_response(status, headers, body)
  147    159   
        };
  148    160   
        crate::protocol_serde::type_erase_result(parse_result)
  149    161   
    }
  150    162   
}
         163  +
/* RequestSerializerGenerator.kt:67 */
  151    164   
#[derive(Debug)]
  152    165   
struct DoNothingRequestSerializer;
  153    166   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DoNothingRequestSerializer {
  154    167   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  155    168   
    fn serialize_input(
  156    169   
        &self,
  157    170   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  158    171   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  159    172   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  160    173   
        let input = input.downcast::<crate::operation::do_nothing::DoNothingInput>().expect("correct type");
  161    174   
        let _header_serialization_settings = _cfg
  162    175   
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  163    176   
            .cloned()
  164    177   
            .unwrap_or_default();
  165    178   
        let mut request_builder = {
  166    179   
            fn uri_base(
  167    180   
                _input: &crate::operation::do_nothing::DoNothingInput,
  168    181   
                output: &mut ::std::string::String,
  169    182   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  170    183   
                use ::std::fmt::Write as _;
  171    184   
                ::std::write!(output, "/").expect("formatting should succeed");
  172    185   
                ::std::result::Result::Ok(())
  173    186   
            }
  174    187   
            #[allow(clippy::unnecessary_wraps)]
  175    188   
            fn update_http_builder(
  176    189   
                input: &crate::operation::do_nothing::DoNothingInput,
  177    190   
                builder: ::http::request::Builder,
  178    191   
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  179    192   
                let mut uri = ::std::string::String::new();
  180    193   
                uri_base(input, &mut uri)?;
  181    194   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  182    195   
            }
  183    196   
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  184    197   
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
  185    198   
            builder = _header_serialization_settings.set_default_header(
  186    199   
                builder,
  187    200   
                ::http::header::HeaderName::from_static("x-amz-target"),
  188    201   
                "PokemonService.DoNothing",
  189    202   
            );
  190    203   
            builder
  191    204   
        };
  192    205   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_do_nothing::ser_do_nothing_input(&input)?);
  193    206   
  194    207   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  195    208   
    }
  196    209   
}
         210  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  197    211   
#[derive(Debug)]
  198    212   
struct DoNothingEndpointParamsInterceptor;
  199    213   
  200    214   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DoNothingEndpointParamsInterceptor {
  201    215   
    fn name(&self) -> &'static str {
  202    216   
        "DoNothingEndpointParamsInterceptor"
  203    217   
    }
  204    218   
  205    219   
    fn read_before_execution(
  206    220   
        &self,
  207    221   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  208    222   
            '_,
  209    223   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  210    224   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  211    225   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  212    226   
        >,
  213    227   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  214    228   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  215    229   
        let _input = context
  216    230   
            .input()
  217    231   
            .downcast_ref::<DoNothingInput>()
  218    232   
            .ok_or("failed to downcast to DoNothingInput")?;
  219    233   
  220    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  221    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  222    236   
        })?;
  223    237   
        cfg.interceptor_state()
  224    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  225    239   
        ::std::result::Result::Ok(())
  226    240   
    }
  227    241   
}
  228    242   
  229    243   
// The get_* functions below are generated from JMESPath expressions in the
  230    244   
// operationContextParams trait. They target the operation's input shape.
  231    245   
         246  +
/* OperationErrorGenerator.kt:79 */
  232    247   
/// Error type for the `DoNothingError` operation.
         248  +
/* RustType.kt:516 */
  233    249   
#[non_exhaustive]
         250  +
/* RustType.kt:516 */
  234    251   
#[derive(::std::fmt::Debug)]
  235         -
pub enum DoNothingError {
         252  +
pub /* OperationErrorGenerator.kt:81 */ enum DoNothingError {
         253  +
    /* OperationErrorGenerator.kt:88 */
  236    254   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  237    255   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  238    256   
    variable wildcard pattern and check `.code()`:
  239    257   
     \
  240    258   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  241    259   
     \
  242    260   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DoNothingError) for what information is available for the error.")]
  243    261   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         262  +
    /* OperationErrorGenerator.kt:81 */
  244    263   
}
         264  +
/* OperationErrorGenerator.kt:218 */
  245    265   
impl DoNothingError {
         266  +
    /* OperationErrorGenerator.kt:219 */
  246    267   
    /// Creates the `DoNothingError::Unhandled` variant from any error type.
  247    268   
    pub fn unhandled(
  248    269   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  249    270   
    ) -> Self {
  250    271   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  251    272   
            source: err.into(),
  252    273   
            meta: ::std::default::Default::default(),
  253    274   
        })
  254    275   
    }
  255    276   
  256    277   
    /// Creates the `DoNothingError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  257    278   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  258    279   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  259    280   
            source: err.clone().into(),
  260    281   
            meta: err,
  261    282   
        })
  262    283   
    }
  263         -
    ///
         284  +
    /// /* OperationErrorGenerator.kt:236 */
  264    285   
    /// Returns error metadata, which includes the error code, message,
  265    286   
    /// request ID, and potentially additional information.
  266    287   
    ///
         288  +
    /* OperationErrorGenerator.kt:242 */
  267    289   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         290  +
        /* OperationErrorGenerator.kt:243 */
  268    291   
        match self {
  269         -
            Self::Unhandled(e) => &e.meta,
         292  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         293  +
            /* OperationErrorGenerator.kt:243 */
  270    294   
        }
         295  +
        /* OperationErrorGenerator.kt:242 */
  271    296   
    }
         297  +
    /* OperationErrorGenerator.kt:218 */
  272    298   
}
         299  +
/* OperationErrorGenerator.kt:269 */
  273    300   
impl ::std::error::Error for DoNothingError {
         301  +
    /* OperationErrorGenerator.kt:270 */
  274    302   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         303  +
        /* OperationErrorGenerator.kt:318 */
  275    304   
        match self {
  276         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         305  +
            /* OperationErrorGenerator.kt:326 */
         306  +
            Self::Unhandled(_inner) => {
         307  +
                /* OperationErrorGenerator.kt:279 */
         308  +
                ::std::option::Option::Some(&*_inner.source)
         309  +
                /* OperationErrorGenerator.kt:326 */
         310  +
            } /* OperationErrorGenerator.kt:318 */
  277    311   
        }
         312  +
        /* OperationErrorGenerator.kt:270 */
  278    313   
    }
         314  +
    /* OperationErrorGenerator.kt:269 */
  279    315   
}
         316  +
/* OperationErrorGenerator.kt:133 */
  280    317   
impl ::std::fmt::Display for DoNothingError {
         318  +
    /* OperationErrorGenerator.kt:134 */
  281    319   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         320  +
        /* OperationErrorGenerator.kt:318 */
  282    321   
        match self {
         322  +
            /* OperationErrorGenerator.kt:326 */
  283    323   
            Self::Unhandled(_inner) => {
         324  +
                /* OperationErrorGenerator.kt:139 */
  284    325   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  285    326   
                    write!(f, "unhandled error ({code})")
  286    327   
                } else {
  287    328   
                    f.write_str("unhandled error")
  288    329   
                }
         330  +
                /* OperationErrorGenerator.kt:326 */
         331  +
            } /* OperationErrorGenerator.kt:318 */
  289    332   
        }
         333  +
        /* OperationErrorGenerator.kt:134 */
  290    334   
    }
  291         -
    }
         335  +
    /* OperationErrorGenerator.kt:133 */
  292    336   
}
         337  +
/* OperationErrorGenerator.kt:182 */
  293    338   
impl ::aws_smithy_types::retry::ProvideErrorKind for DoNothingError {
         339  +
    /* OperationErrorGenerator.kt:186 */
  294    340   
    fn code(&self) -> ::std::option::Option<&str> {
         341  +
        /* OperationErrorGenerator.kt:187 */
  295    342   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         343  +
        /* OperationErrorGenerator.kt:186 */
  296    344   
    }
         345  +
    /* OperationErrorGenerator.kt:190 */
  297    346   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         347  +
        /* OperationErrorGenerator.kt:197 */
  298    348   
        ::std::option::Option::None
         349  +
        /* OperationErrorGenerator.kt:190 */
  299    350   
    }
         351  +
    /* OperationErrorGenerator.kt:182 */
  300    352   
}
         353  +
/* OperationErrorGenerator.kt:163 */
  301    354   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DoNothingError {
         355  +
    /* OperationErrorGenerator.kt:164 */
  302    356   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         357  +
        /* OperationErrorGenerator.kt:318 */
  303    358   
        match self {
  304         -
            Self::Unhandled(_inner) => &_inner.meta,
         359  +
            /* OperationErrorGenerator.kt:326 */
         360  +
            Self::Unhandled(_inner) => {
         361  +
                /* OperationErrorGenerator.kt:168 */
         362  +
                &_inner.meta
         363  +
                /* OperationErrorGenerator.kt:326 */
         364  +
            } /* OperationErrorGenerator.kt:318 */
  305    365   
        }
         366  +
        /* OperationErrorGenerator.kt:164 */
  306    367   
    }
         368  +
    /* OperationErrorGenerator.kt:163 */
  307    369   
}
         370  +
/* OperationErrorGenerator.kt:109 */
  308    371   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DoNothingError {
         372  +
    /* OperationErrorGenerator.kt:110 */
  309    373   
    fn create_unhandled_error(
  310    374   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  311    375   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  312    376   
    ) -> Self {
         377  +
        /* OperationErrorGenerator.kt:121 */
  313    378   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  314    379   
            source,
  315    380   
            meta: meta.unwrap_or_default(),
  316    381   
        })
         382  +
        /* OperationErrorGenerator.kt:110 */
  317    383   
    }
         384  +
    /* OperationErrorGenerator.kt:109 */
  318    385   
}
  319    386   
         387  +
/* CodegenDelegator.kt:255 */
  320    388   
pub use crate::operation::do_nothing::_do_nothing_output::DoNothingOutput;
  321    389   
         390  +
/* CodegenDelegator.kt:255 */
  322    391   
pub use crate::operation::do_nothing::_do_nothing_input::DoNothingInput;
  323    392   
         393  +
/* RustModule.kt:172 */
  324    394   
mod _do_nothing_input;
  325    395   
         396  +
/* RustModule.kt:172 */
  326    397   
mod _do_nothing_output;
  327    398   
  328         -
/// Builders
         399  +
/// /* CodegenDelegator.kt:51 */Builders
  329    400   
pub mod builders;