Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -1,1 +14,18 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* FluentClientGenerator.kt:187 */
    2      3   
impl super::Client {
           4  +
    /* FluentClientGenerator.kt:221 */
    3      5   
    /// Constructs a fluent builder for the [`GetStorage`](crate::operation::get_storage::builders::GetStorageFluentBuilder) operation.
    4      6   
    ///
    5      7   
    /// - The fluent builder is configurable:
    6      8   
    ///   - [`user(impl Into<String>)`](crate::operation::get_storage::builders::GetStorageFluentBuilder::user) / [`set_user(Option<String>)`](crate::operation::get_storage::builders::GetStorageFluentBuilder::set_user):<br>required: **true**<br>(undocumented)<br>
    7      9   
    ///   - [`passcode(impl Into<String>)`](crate::operation::get_storage::builders::GetStorageFluentBuilder::passcode) / [`set_passcode(Option<String>)`](crate::operation::get_storage::builders::GetStorageFluentBuilder::set_passcode):<br>required: **true**<br>(undocumented)<br>
    8     10   
    /// - On success, responds with [`GetStorageOutput`](crate::operation::get_storage::GetStorageOutput) with field(s):
    9     11   
    ///   - [`collection(Vec::<String>)`](crate::operation::get_storage::GetStorageOutput::collection): A list of Pokémon species.
   10     12   
    /// - On failure, responds with [`SdkError<GetStorageError>`](crate::operation::get_storage::GetStorageError)
          13  +
    /* FluentClientGenerator.kt:234 */
   11     14   
    pub fn get_storage(&self) -> crate::operation::get_storage::builders::GetStorageFluentBuilder {
   12     15   
        crate::operation::get_storage::builders::GetStorageFluentBuilder::new(self.handle.clone())
   13     16   
    }
          17  +
    /* FluentClientGenerator.kt:187 */
   14     18   
}

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

@@ -1,1 +12,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* FluentClientGenerator.kt:187 */
    2      3   
impl super::Client {
           4  +
    /* FluentClientGenerator.kt:221 */
    3      5   
    /// Constructs a fluent builder for the [`StreamPokemonRadio`](crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioFluentBuilder) operation.
    4      6   
    ///
    5      7   
    /// - The fluent builder takes no input, just [`send`](crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioFluentBuilder::send) it.
    6      8   
    /// - On success, responds with [`StreamPokemonRadioOutput`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput) with field(s):
    7      9   
    ///   - [`data(ByteStream)`](crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput::data): (undocumented)
    8     10   
    /// - On failure, responds with [`SdkError<StreamPokemonRadioError>`](crate::operation::stream_pokemon_radio::StreamPokemonRadioError)
          11  +
    /* FluentClientGenerator.kt:234 */
    9     12   
    pub fn stream_pokemon_radio(&self) -> crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioFluentBuilder {
   10     13   
        crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioFluentBuilder::new(self.handle.clone())
   11     14   
    }
          15  +
    /* FluentClientGenerator.kt:187 */
   12     16   
}

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

@@ -1,1 +171,209 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Configuration for a pokemon_service_client service client.
           2  +
/* ServiceConfigGenerator.kt:409 */
           3  +
/// /* ServiceConfigGenerator.kt:409 */Configuration for a pokemon_service_client service client.
    4      4   
///
           5  +
/* RustType.kt:516 */
    5      6   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
           7  +
/* ServiceConfigGenerator.kt:414 */
    6      8   
pub struct Config {
    7         -
    // Both `config` and `cloneable` are the same config, but the cloneable one
           9  +
    /* ServiceConfigGenerator.kt:415 */// Both `config` and `cloneable` are the same config, but the cloneable one
    8     10   
    // is kept around so that it is possible to convert back into a builder. This can be
    9     11   
    // optimized in the future.
   10     12   
    pub(crate) config: crate::config::FrozenLayer,
   11     13   
    cloneable: ::aws_smithy_types::config_bag::CloneableLayer,
   12     14   
    pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder,
   13     15   
    pub(crate) runtime_plugins: ::std::vec::Vec<crate::config::SharedRuntimePlugin>,
   14     16   
    pub(crate) behavior_version: ::std::option::Option<crate::config::BehaviorVersion>,
          17  +
    /* ServiceConfigGenerator.kt:414 */
   15     18   
}
          19  +
/* ServiceConfigGenerator.kt:433 */
   16     20   
impl Config {
   17         -
    ///
          21  +
    /// /* ServiceConfigGenerator.kt:434 */
   18     22   
    /// Constructs a config builder.
   19     23   
    /// <div class="warning">
   20     24   
    /// Note that a config created from this builder will not have the same safe defaults as one created by
   21     25   
    /// the <a href="https://crates.io/crates/aws-config" target="_blank">aws-config</a> crate.
   22     26   
    /// </div>
   23     27   
    ///
          28  +
    /* ServiceConfigGenerator.kt:435 */
   24     29   
    pub fn builder() -> Builder {
   25     30   
        Builder::default()
   26     31   
    }
          32  +
    /* ServiceConfigGenerator.kt:440 */
   27     33   
    /// Converts this config back into a builder so that it can be tweaked.
   28     34   
    pub fn to_builder(&self) -> Builder {
   29     35   
        Builder {
   30     36   
            config: self.cloneable.clone(),
   31     37   
            runtime_components: self.runtime_components.clone(),
   32     38   
            runtime_plugins: self.runtime_plugins.clone(),
   33     39   
            behavior_version: self.behavior_version,
   34     40   
        }
   35     41   
    }
          42  +
    /* StalledStreamProtectionConfigCustomization.kt:57 */
   36     43   
    /// Return a reference to the stalled stream protection configuration contained in this config, if any.
   37     44   
    pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> {
   38     45   
        self.config.load::<crate::config::StalledStreamProtectionConfig>()
   39     46   
    }
          47  +
    /* HttpConnectorConfigDecorator.kt:52 */
   40     48   
    /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any.
   41     49   
    pub fn http_client(&self) -> Option<crate::config::SharedHttpClient> {
   42     50   
        self.runtime_components.http_client()
   43     51   
    }
          52  +
    /* EndpointConfigCustomization.kt:47 */
   44     53   
    /// Returns the endpoint resolver.
   45     54   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   46     55   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   47     56   
    }
          57  +
    /* ResiliencyConfigCustomization.kt:51 */
   48     58   
    /// Return a reference to the retry configuration contained in this config, if any.
   49     59   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   50     60   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   51     61   
    }
   52     62   
   53     63   
    /// Return a cloned shared async sleep implementation from this config, if any.
   54     64   
    pub fn sleep_impl(&self) -> ::std::option::Option<crate::config::SharedAsyncSleep> {
   55     65   
        self.runtime_components.sleep_impl()
   56     66   
    }
   57     67   
   58     68   
    /// Return a reference to the timeout configuration contained in this config, if any.
   59     69   
    pub fn timeout_config(&self) -> ::std::option::Option<&::aws_smithy_types::timeout::TimeoutConfig> {
   60     70   
        self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>()
   61     71   
    }
   62     72   
   63     73   
    /// Returns a reference to the retry partition contained in this config, if any.
   64     74   
    ///
   65     75   
    /// WARNING: This method is unstable and may be removed at any time. Do not rely on this
   66     76   
    /// method for anything!
   67     77   
    pub fn retry_partition(&self) -> ::std::option::Option<&::aws_smithy_runtime::client::retries::RetryPartition> {
   68     78   
        self.config.load::<::aws_smithy_runtime::client::retries::RetryPartition>()
   69     79   
    }
          80  +
    /* IdentityCacheDecorator.kt:96 */
   70     81   
    /// Returns the configured identity cache for auth.
   71     82   
    pub fn identity_cache(&self) -> ::std::option::Option<crate::config::SharedIdentityCache> {
   72     83   
        self.runtime_components.identity_cache()
   73     84   
    }
          85  +
    /* InterceptorConfigCustomization.kt:30 */
   74     86   
    /// Returns interceptors currently registered by the user.
   75     87   
    pub fn interceptors(&self) -> impl Iterator<Item = crate::config::SharedInterceptor> + '_ {
   76     88   
        self.runtime_components.interceptors()
   77     89   
    }
          90  +
    /* TimeSourceCustomization.kt:34 */
   78     91   
    /// Return time source used for this service.
          92  +
    /* TimeSourceCustomization.kt:35 */
   79     93   
    pub fn time_source(&self) -> ::std::option::Option<::aws_smithy_async::time::SharedTimeSource> {
          94  +
        /* TimeSourceCustomization.kt:39 */
   80     95   
        self.runtime_components.time_source()
          96  +
        /* TimeSourceCustomization.kt:35 */
   81     97   
    }
          98  +
    /* RetryClassifierConfigCustomization.kt:39 */
   82     99   
    /// Returns retry classifiers currently registered by the user.
   83    100   
    pub fn retry_classifiers(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier> + '_ {
   84    101   
        self.runtime_components.retry_classifiers()
   85    102   
    }
         103  +
    /* ServiceConfigGenerator.kt:433 */
   86    104   
}
   87         -
/// Builder for creating a `Config`.
         105  +
/// /* ServiceConfigGenerator.kt:458 */Builder for creating a `Config`.
         106  +
/* RustType.kt:516 */
   88    107   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
         108  +
/* ServiceConfigGenerator.kt:460 */
   89    109   
pub struct Builder {
   90         -
    pub(crate) config: ::aws_smithy_types::config_bag::CloneableLayer,
         110  +
    /* ServiceConfigGenerator.kt:461 */ pub(crate) config: ::aws_smithy_types::config_bag::CloneableLayer,
   91    111   
    pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder,
   92    112   
    pub(crate) runtime_plugins: ::std::vec::Vec<crate::config::SharedRuntimePlugin>,
   93    113   
    pub(crate) behavior_version: ::std::option::Option<crate::config::BehaviorVersion>,
         114  +
    /* ServiceConfigGenerator.kt:460 */
   94    115   
}
         116  +
/* ServiceConfigGenerator.kt:476 */
   95    117   
impl ::std::default::Default for Builder {
         118  +
    /* ServiceConfigGenerator.kt:477 */
   96    119   
    fn default() -> Self {
   97    120   
        Self {
   98    121   
            config: ::std::default::Default::default(),
   99    122   
            runtime_components: crate::config::RuntimeComponentsBuilder::new("service config"),
  100    123   
            runtime_plugins: ::std::default::Default::default(),
  101    124   
            behavior_version: ::std::default::Default::default(),
  102    125   
        }
  103    126   
    }
         127  +
    /* ServiceConfigGenerator.kt:476 */
  104    128   
}
         129  +
/* ServiceConfigGenerator.kt:492 */
  105    130   
impl Builder {
  106         -
    ///
         131  +
    /// /* ServiceConfigGenerator.kt:493 */
  107    132   
    /// Constructs a config builder.
  108    133   
    /// <div class="warning">
  109    134   
    /// Note that a config created from this builder will not have the same safe defaults as one created by
  110    135   
    /// the <a href="https://crates.io/crates/aws-config" target="_blank">aws-config</a> crate.
  111    136   
    /// </div>
  112    137   
    ///
         138  +
    /* ServiceConfigGenerator.kt:494 */
  113    139   
    pub fn new() -> Self {
  114    140   
        Self::default()
  115    141   
    }
  116         -
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  117         -
    /// but not those in runtime components.
         142  +
    /// /* ServiceConfigGenerator.kt:327 */Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
         143  +
    /// /* ServiceConfigGenerator.kt:328 */but not those in runtime components.
         144  +
    /* RustType.kt:516 */
  118    145   
    #[allow(unused)]
         146  +
    /* ServiceConfigGenerator.kt:330 */
  119    147   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
         148  +
        /* ServiceConfigGenerator.kt:334 */
  120    149   
        let mut builder = Self::new();
         150  +
        /* StalledStreamProtectionConfigCustomization.kt:102 */
  121    151   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         152  +
        /* ResiliencyConfigCustomization.kt:294 */
  122    153   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
         154  +
        /* ResiliencyConfigCustomization.kt:298 */
  123    155   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
         156  +
        /* ResiliencyConfigCustomization.kt:302 */
  124    157   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
         158  +
        /* ServiceConfigGenerator.kt:338 */
  125    159   
        builder
         160  +
        /* ServiceConfigGenerator.kt:330 */
  126    161   
    }
         162  +
    /* StalledStreamProtectionConfigCustomization.kt:69 */
  127    163   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  128    164   
    /// to configure protection for stalled streams.
  129    165   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  130    166   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  131    167   
        self
  132    168   
    }
         169  +
    /* StalledStreamProtectionConfigCustomization.kt:84 */
  133    170   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  134    171   
    /// to configure protection for stalled streams.
  135    172   
    pub fn set_stalled_stream_protection(
  136    173   
        &mut self,
  137    174   
        stalled_stream_protection_config: ::std::option::Option<crate::config::StalledStreamProtectionConfig>,
  138    175   
    ) -> &mut Self {
  139    176   
        self.config.store_or_unset(stalled_stream_protection_config);
  140    177   
        self
  141    178   
    }
         179  +
    /* HttpConnectorConfigDecorator.kt:65 */
  142    180   
    /// Sets the HTTP client to use when making requests.
  143    181   
    ///
  144    182   
    /// # Examples
  145    183   
    /// ```no_run
  146    184   
    /// # #[cfg(test)]
  147    185   
    /// # mod tests {
  148    186   
    /// # #[test]
  149    187   
    /// # fn example() {
  150    188   
    /// use std::time::Duration;
  151    189   
    /// use pokemon_service_client::config::Config;
@@ -179,217 +461,511 @@
  199    237   
    /// let mut builder = pokemon_service_client::Config::builder();
  200    238   
    /// override_http_client(&mut builder);
  201    239   
    /// let config = builder.build();
  202    240   
    /// # }
  203    241   
    /// # }
  204    242   
    /// ```
  205    243   
    pub fn set_http_client(&mut self, http_client: Option<crate::config::SharedHttpClient>) -> &mut Self {
  206    244   
        self.runtime_components.set_http_client(http_client);
  207    245   
        self
  208    246   
    }
         247  +
    /* EndpointConfigCustomization.kt:73 */
  209    248   
    /// Set the endpoint URL to use when making requests.
  210    249   
    ///
  211    250   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  212    251   
    ///
  213    252   
    /// # Panics
  214    253   
    /// Panics if an invalid URL is given.
  215    254   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  216    255   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  217    256   
        self
  218    257   
    }
  219    258   
  220    259   
    /// Set the endpoint URL to use when making requests.
  221    260   
    ///
  222    261   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  223    262   
    ///
  224    263   
    /// # Panics
  225    264   
    /// Panics if an invalid URL is given.
  226    265   
    pub fn set_endpoint_url(&mut self, endpoint_url: ::std::option::Option<::std::string::String>) -> &mut Self {
  227    266   
        #[allow(deprecated)]
  228    267   
        self.set_endpoint_resolver(endpoint_url.map(|url| {
  229    268   
            ::aws_smithy_runtime_api::shared::IntoShared::into_shared(
  230    269   
                ::aws_smithy_runtime::client::orchestrator::endpoints::StaticUriEndpointResolver::uri(url),
  231    270   
            )
  232    271   
        }));
  233    272   
        self
  234    273   
    }
         274  +
    /* EndpointConfigCustomization.kt:105 */
  235    275   
    /// Sets the endpoint resolver to use when making requests.
  236    276   
    ///
  237    277   
    /// This service does not define a default endpoint resolver.
  238    278   
    ///
  239    279   
    /// Note: setting an endpoint resolver will replace any endpoint URL that has been set.
  240    280   
    /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to
  241    281   
    /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`].
  242    282   
    ///
  243    283   
    /// # Examples
  244    284   
    /// Create a custom endpoint resolver that resolves a different endpoing per-stage, e.g. staging vs. production.
  245    285   
    /// ```no_run
  246    286   
    /// use pokemon_service_client::config::endpoint::{ResolveEndpoint, EndpointFuture, Params, Endpoint};
  247    287   
    /// #[derive(Debug)]
  248    288   
    /// struct StageResolver { stage: String }
  249    289   
    /// impl ResolveEndpoint for StageResolver {
  250    290   
    ///     fn resolve_endpoint(&self, params: &Params) -> EndpointFuture<'_> {
  251    291   
    ///         let stage = &self.stage;
  252    292   
    ///         EndpointFuture::ready(Ok(Endpoint::builder().url(format!("{stage}.myservice.com")).build()))
  253    293   
    ///     }
  254    294   
    /// }
  255    295   
    /// let resolver = StageResolver { stage: std::env::var("STAGE").unwrap() };
  256    296   
    /// let config = pokemon_service_client::Config::builder().endpoint_resolver(resolver).build();
  257    297   
    /// let client = pokemon_service_client::Client::from_conf(config);
  258    298   
    /// ```
  259    299   
    pub fn endpoint_resolver(mut self, endpoint_resolver: impl crate::config::endpoint::ResolveEndpoint + 'static) -> Self {
  260    300   
        self.set_endpoint_resolver(::std::option::Option::Some(endpoint_resolver.into_shared_resolver()));
  261    301   
        self
  262    302   
    }
  263    303   
  264    304   
    /// Sets the endpoint resolver to use when making requests.
  265    305   
    ///
  266    306   
    /// This service does not define a default endpoint resolver.
         307  +
    /* EndpointConfigCustomization.kt:143 */
  267    308   
    pub fn set_endpoint_resolver(
  268    309   
        &mut self,
  269    310   
        endpoint_resolver: ::std::option::Option<::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver>,
  270    311   
    ) -> &mut Self {
  271    312   
        self.runtime_components.set_endpoint_resolver(endpoint_resolver);
  272    313   
        self
  273    314   
    }
         315  +
    /* ResiliencyConfigCustomization.kt:81 */
  274    316   
    /// Set the retry_config for the builder
  275    317   
    ///
  276    318   
    /// # Examples
  277    319   
    /// ```no_run
  278    320   
    /// use pokemon_service_client::config::Config;
  279    321   
    /// use pokemon_service_client::config::retry::RetryConfig;
  280    322   
    ///
  281    323   
    /// let retry_config = RetryConfig::standard().with_max_attempts(5);
  282    324   
    /// let config = Config::builder().retry_config(retry_config).build();
  283    325   
    /// ```
  284    326   
    pub fn retry_config(mut self, retry_config: ::aws_smithy_types::retry::RetryConfig) -> Self {
  285    327   
        self.set_retry_config(Some(retry_config));
  286    328   
        self
  287    329   
    }
  288    330   
  289    331   
    /// Set the retry_config for the builder
  290    332   
    ///
  291    333   
    /// # Examples
  292    334   
    /// ```no_run
  293    335   
    /// use pokemon_service_client::config::{Builder, Config};
  294    336   
    /// use pokemon_service_client::config::retry::RetryConfig;
  295    337   
    ///
  296    338   
    /// fn disable_retries(builder: &mut Builder) {
  297    339   
    ///     let retry_config = RetryConfig::standard().with_max_attempts(1);
  298    340   
    ///     builder.set_retry_config(Some(retry_config));
  299    341   
    /// }
  300    342   
    ///
  301    343   
    /// let mut builder = Config::builder();
  302    344   
    /// disable_retries(&mut builder);
  303    345   
    /// let config = builder.build();
  304    346   
    /// ```
         347  +
    /* ResiliencyConfigCustomization.kt:118 */
  305    348   
    pub fn set_retry_config(&mut self, retry_config: ::std::option::Option<::aws_smithy_types::retry::RetryConfig>) -> &mut Self {
  306    349   
        retry_config.map(|r| self.config.store_put(r));
  307    350   
        self
  308    351   
    }
         352  +
    /* ResiliencyConfigCustomization.kt:128 */
  309    353   
    /// Set the sleep_impl for the builder
  310    354   
    ///
  311    355   
    /// # Examples
  312    356   
    ///
  313    357   
    /// ```no_run
  314    358   
    /// use pokemon_service_client::config::{AsyncSleep, Config, SharedAsyncSleep, Sleep};
  315    359   
    ///
  316    360   
    /// #[derive(Debug)]
  317    361   
    /// pub struct ForeverSleep;
  318    362   
    ///
  319    363   
    /// impl AsyncSleep for ForeverSleep {
  320    364   
    ///     fn sleep(&self, duration: std::time::Duration) -> Sleep {
  321    365   
    ///         Sleep::new(std::future::pending())
  322    366   
    ///     }
  323    367   
    /// }
  324    368   
    ///
  325    369   
    /// let sleep_impl = SharedAsyncSleep::new(ForeverSleep);
  326    370   
    /// let config = Config::builder().sleep_impl(sleep_impl).build();
  327    371   
    /// ```
  328    372   
    pub fn sleep_impl(mut self, sleep_impl: impl crate::config::AsyncSleep + 'static) -> Self {
  329    373   
        self.set_sleep_impl(Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared(sleep_impl)));
  330    374   
        self
  331    375   
    }
  332    376   
  333    377   
    /// Set the sleep_impl for the builder
  334    378   
    ///
  335    379   
    /// # Examples
  336    380   
    ///
  337    381   
    /// ```no_run
  338    382   
    /// use pokemon_service_client::config::{AsyncSleep, Builder, Config, SharedAsyncSleep, Sleep};
  339    383   
    ///
  340    384   
    /// #[derive(Debug)]
  341    385   
    /// pub struct ForeverSleep;
  342    386   
    ///
  343    387   
    /// impl AsyncSleep for ForeverSleep {
  344    388   
    ///     fn sleep(&self, duration: std::time::Duration) -> Sleep {
  345    389   
    ///         Sleep::new(std::future::pending())
  346    390   
    ///     }
  347    391   
    /// }
  348    392   
    ///
  349    393   
    /// fn set_never_ending_sleep_impl(builder: &mut Builder) {
  350    394   
    ///     let sleep_impl = SharedAsyncSleep::new(ForeverSleep);
  351    395   
    ///     builder.set_sleep_impl(Some(sleep_impl));
  352    396   
    /// }
  353    397   
    ///
  354    398   
    /// let mut builder = Config::builder();
  355    399   
    /// set_never_ending_sleep_impl(&mut builder);
  356    400   
    /// let config = builder.build();
  357    401   
    /// ```
         402  +
    /* ResiliencyConfigCustomization.kt:184 */
  358    403   
    pub fn set_sleep_impl(&mut self, sleep_impl: ::std::option::Option<crate::config::SharedAsyncSleep>) -> &mut Self {
  359    404   
        self.runtime_components.set_sleep_impl(sleep_impl);
  360    405   
        self
  361    406   
    }
         407  +
    /* ResiliencyConfigCustomization.kt:194 */
  362    408   
    /// Set the timeout_config for the builder
  363    409   
    ///
  364    410   
    /// # Examples
  365    411   
    ///
  366    412   
    /// ```no_run
  367    413   
    /// # use std::time::Duration;
  368    414   
    /// use pokemon_service_client::config::Config;
  369    415   
    /// use pokemon_service_client::config::timeout::TimeoutConfig;
  370    416   
    ///
  371    417   
    /// let timeout_config = TimeoutConfig::builder()
  372    418   
    ///     .operation_attempt_timeout(Duration::from_secs(1))
  373    419   
    ///     .build();
  374    420   
    /// let config = Config::builder().timeout_config(timeout_config).build();
  375    421   
    /// ```
  376    422   
    pub fn timeout_config(mut self, timeout_config: ::aws_smithy_types::timeout::TimeoutConfig) -> Self {
  377    423   
        self.set_timeout_config(Some(timeout_config));
  378    424   
        self
  379    425   
    }
  380    426   
  381    427   
    /// Set the timeout_config for the builder.
  382    428   
    ///
  383    429   
    /// Setting this to `None` has no effect if another source of configuration has set timeouts. If you
  384    430   
    /// are attempting to disable timeouts, use [`TimeoutConfig::disabled`](::aws_smithy_types::timeout::TimeoutConfig::disabled)
  385    431   
    ///
  386    432   
    ///
  387    433   
    /// # Examples
  388    434   
    ///
  389    435   
    /// ```no_run
  390    436   
    /// # use std::time::Duration;
  391    437   
    /// use pokemon_service_client::config::{Builder, Config};
  392    438   
    /// use pokemon_service_client::config::timeout::TimeoutConfig;
  393    439   
    ///
  394    440   
    /// fn set_request_timeout(builder: &mut Builder) {
  395    441   
    ///     let timeout_config = TimeoutConfig::builder()
  396    442   
    ///         .operation_attempt_timeout(Duration::from_secs(1))
  397    443   
    ///         .build();
  398    444   
    ///     builder.set_timeout_config(Some(timeout_config));
  399    445   
    /// }
  400    446   
    ///
  401    447   
    /// let mut builder = Config::builder();
  402    448   
    /// set_request_timeout(&mut builder);
  403    449   
    /// let config = builder.build();
  404    450   
    /// ```
         451  +
    /* ResiliencyConfigCustomization.kt:248 */
  405    452   
    pub fn set_timeout_config(&mut self, timeout_config: ::std::option::Option<::aws_smithy_types::timeout::TimeoutConfig>) -> &mut Self {
  406    453   
        // passing None has no impact.
  407    454   
        let Some(mut timeout_config) = timeout_config else { return self };
  408    455   
  409    456   
        if let Some(base) = self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>() {
  410    457   
            timeout_config.take_defaults_from(base);
  411    458   
        }
  412    459   
        self.config.store_put(timeout_config);
  413    460   
        self
  414    461   
    }
         462  +
    /* ResiliencyConfigCustomization.kt:266 */
  415    463   
    /// Set the partition for retry-related state. When clients share a retry partition, they will
  416    464   
    /// also share things like token buckets and client rate limiters. By default, all clients
  417    465   
    /// for the same service will share a partition.
  418    466   
    pub fn retry_partition(mut self, retry_partition: ::aws_smithy_runtime::client::retries::RetryPartition) -> Self {
  419    467   
        self.set_retry_partition(Some(retry_partition));
  420    468   
        self
  421    469   
    }
         470  +
    /* ResiliencyConfigCustomization.kt:279 */
  422    471   
    /// Set the partition for retry-related state. When clients share a retry partition, they will
  423    472   
    /// also share things like token buckets and client rate limiters. By default, all clients
  424    473   
    /// for the same service will share a partition.
  425    474   
    pub fn set_retry_partition(
  426    475   
        &mut self,
  427    476   
        retry_partition: ::std::option::Option<::aws_smithy_runtime::client::retries::RetryPartition>,
  428    477   
    ) -> &mut Self {
  429    478   
        retry_partition.map(|r| self.config.store_put(r));
  430    479   
        self
  431    480   
    }
         481  +
    /* IdentityCacheDecorator.kt:77 */
  432    482   
    /// Set the identity cache for auth.
  433    483   
    ///
  434    484   
    /// The identity cache defaults to a lazy caching implementation that will resolve
  435    485   
    /// an identity when it is requested, and place it in the cache thereafter. Subsequent
  436    486   
    /// requests will take the value from the cache while it is still valid. Once it expires,
  437    487   
    /// the next request will result in refreshing the identity.
  438    488   
    ///
  439    489   
    /// This configuration allows you to disable or change the default caching mechanism.
  440    490   
    /// To use a custom caching mechanism, implement the [`ResolveCachedIdentity`](crate::config::ResolveCachedIdentity)
  441    491   
    /// trait and pass that implementation into this function.
@@ -493,543 +552,603 @@
  513    563   
    ///     )
  514    564   
    ///     // ...
  515    565   
    ///     .build();
  516    566   
    /// let client = pokemon_service_client::Client::from_conf(config);
  517    567   
    /// ```
  518    568   
  519    569   
    pub fn set_identity_cache(&mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> &mut Self {
  520    570   
        self.runtime_components.set_identity_cache(::std::option::Option::Some(identity_cache));
  521    571   
        self
  522    572   
    }
         573  +
    /* InterceptorConfigCustomization.kt:41 */
  523    574   
    /// Add an [interceptor](crate::config::Intercept) that runs at specific stages of the request execution pipeline.
  524    575   
    ///
  525    576   
    /// Interceptors targeted at a certain stage are executed according to the pre-defined priority.
  526    577   
    /// The SDK provides a default set of interceptors. An interceptor configured by this method
  527    578   
    /// will run after those default interceptors.
  528    579   
    ///
  529    580   
    /// # Examples
  530    581   
    /// ```no_run
  531    582   
    /// # #[cfg(test)]
  532    583   
    /// # mod tests {
@@ -599,650 +670,724 @@
  619    670   
    pub fn push_interceptor(&mut self, interceptor: crate::config::SharedInterceptor) -> &mut Self {
  620    671   
        self.runtime_components.push_interceptor(interceptor);
  621    672   
        self
  622    673   
    }
  623    674   
  624    675   
    /// Set [`SharedInterceptor`](crate::config::SharedInterceptor)s for the builder.
  625    676   
    pub fn set_interceptors(&mut self, interceptors: impl IntoIterator<Item = crate::config::SharedInterceptor>) -> &mut Self {
  626    677   
        self.runtime_components.set_interceptors(interceptors.into_iter());
  627    678   
        self
  628    679   
    }
         680  +
    /* TimeSourceCustomization.kt:47 */
  629    681   
    /// Sets the time source used for this service
  630    682   
    pub fn time_source(mut self, time_source: impl ::aws_smithy_async::time::TimeSource + 'static) -> Self {
  631    683   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared(
  632    684   
            time_source,
  633    685   
        )));
  634    686   
        self
  635    687   
    }
         688  +
    /* TimeSourceCustomization.kt:61 */
  636    689   
    /// Sets the time source used for this service
  637    690   
    pub fn set_time_source(&mut self, time_source: ::std::option::Option<::aws_smithy_async::time::SharedTimeSource>) -> &mut Self {
  638    691   
        self.runtime_components.set_time_source(time_source);
  639    692   
        self
  640    693   
    }
         694  +
    /* RetryClassifierConfigCustomization.kt:50 */
  641    695   
    /// Add type implementing [`ClassifyRetry`](::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry) that will be used by the
  642    696   
    /// [`RetryStrategy`](::aws_smithy_runtime_api::client::retries::RetryStrategy) to determine what responses should be retried.
  643    697   
    ///
  644    698   
    /// A retry classifier configured by this method will run according to its [priority](::aws_smithy_runtime_api::client::retries::classifiers::RetryClassifierPriority).
  645    699   
    ///
  646    700   
    /// # Examples
  647    701   
    /// ```no_run
  648    702   
    /// # #[cfg(test)]
  649    703   
    /// # mod tests {
  650    704   
    /// # #[test]
@@ -805,859 +864,919 @@
  825    879   
  826    880   
    /// Set [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier)s for the builder, replacing any that
  827    881   
    /// were previously set.
  828    882   
    pub fn set_retry_classifiers(
  829    883   
        &mut self,
  830    884   
        retry_classifiers: impl IntoIterator<Item = ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier>,
  831    885   
    ) -> &mut Self {
  832    886   
        self.runtime_components.set_retry_classifiers(retry_classifiers.into_iter());
  833    887   
        self
  834    888   
    }
         889  +
    /* ServiceConfigGenerator.kt:375 */
  835    890   
    /// Sets the [`behavior major version`](crate::config::BehaviorVersion).
  836    891   
    ///
  837    892   
    /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards
  838    893   
    /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for
  839    894   
    /// all operations might be the ideal behavior but could break existing applications.
  840    895   
    ///
  841    896   
    /// # Examples
  842    897   
    ///
  843    898   
    /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature.
  844    899   
    /// ```no_run
@@ -882,937 +1139,1238 @@
  902    957   
        self
  903    958   
    }
  904    959   
  905    960   
    /// Convenience method to set the latest behavior major version
  906    961   
    ///
  907    962   
    /// This is equivalent to enabling the `behavior-version-latest` Cargo feature
  908    963   
    pub fn behavior_version_latest(mut self) -> Self {
  909    964   
        self.set_behavior_version(Some(crate::config::BehaviorVersion::latest()));
  910    965   
        self
  911    966   
    }
  912         -
    /// Adds a runtime plugin to the config.
         967  +
    /// /* ServiceConfigGenerator.kt:509 */Adds a runtime plugin to the config.
         968  +
    /* ServiceConfigGenerator.kt:513 */
  913    969   
    pub fn runtime_plugin(mut self, plugin: impl crate::config::RuntimePlugin + 'static) -> Self {
  914    970   
        self.push_runtime_plugin(crate::config::SharedRuntimePlugin::new(plugin));
  915    971   
        self
  916    972   
    }
  917         -
    /// Adds a runtime plugin to the config.
         973  +
    /// /* ServiceConfigGenerator.kt:522 */Adds a runtime plugin to the config.
         974  +
    /* ServiceConfigGenerator.kt:526 */
  918    975   
    pub fn push_runtime_plugin(&mut self, plugin: crate::config::SharedRuntimePlugin) -> &mut Self {
  919    976   
        self.runtime_plugins.push(plugin);
  920    977   
        self
  921    978   
    }
         979  +
    /* RustType.kt:516 */
  922    980   
    #[cfg(any(feature = "test-util", test))]
         981  +
    /* RustType.kt:516 */
  923    982   
    #[allow(unused_mut)]
  924         -
    /// Apply test defaults to the builder
         983  +
    /// /* ServiceConfigGenerator.kt:541 */Apply test defaults to the builder
         984  +
    /* ServiceConfigGenerator.kt:542 */
  925    985   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
         986  +
        /* TimeSourceCustomization.kt:88 */
  926    987   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
  927    988   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
  928    989   
        )));
         990  +
        /* ServiceConfigGenerator.kt:544 */
  929    991   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
         992  +
        /* ServiceConfigGenerator.kt:545 */
  930    993   
        self
         994  +
        /* ServiceConfigGenerator.kt:542 */
  931    995   
    }
         996  +
    /* RustType.kt:516 */
  932    997   
    #[cfg(any(feature = "test-util", test))]
         998  +
    /* RustType.kt:516 */
  933    999   
    #[allow(unused_mut)]
  934         -
    /// Apply test defaults to the builder
        1000  +
    /// /* ServiceConfigGenerator.kt:550 */Apply test defaults to the builder
        1001  +
    /* ServiceConfigGenerator.kt:551 */
  935   1002   
    pub fn with_test_defaults(mut self) -> Self {
        1003  +
        /* ServiceConfigGenerator.kt:552 */
  936   1004   
        self.apply_test_defaults();
  937   1005   
        self
        1006  +
        /* ServiceConfigGenerator.kt:551 */
  938   1007   
    }
  939         -
    /// Builds a [`Config`].
        1008  +
    /// /* ServiceConfigGenerator.kt:555 */Builds a [`Config`].
        1009  +
    /* ServiceConfigGenerator.kt:556 */
  940   1010   
    #[allow(unused_mut)]
        1011  +
    /* ServiceConfigGenerator.kt:557 */
  941   1012   
    pub fn build(mut self) -> Config {
        1013  +
        /* ServiceConfigGenerator.kt:558 */
  942   1014   
        let mut layer = self.config;
        1015  +
        /* TimeSourceCustomization.kt:77 */
  943   1016   
        if self.runtime_components.time_source().is_none() {
  944   1017   
            self.runtime_components
  945   1018   
                .set_time_source(::std::option::Option::Some(::std::default::Default::default()));
  946   1019   
        }
        1020  +
        /* ServiceConfigGenerator.kt:567 */
  947   1021   
        Config {
        1022  +
            /* ServiceConfigGenerator.kt:568 */
  948   1023   
            config: crate::config::Layer::from(layer.clone())
  949   1024   
                .with_name("pokemon_service_client::config::Config")
  950   1025   
                .freeze(),
  951   1026   
            cloneable: layer,
  952   1027   
            runtime_components: self.runtime_components,
  953   1028   
            runtime_plugins: self.runtime_plugins,
  954   1029   
            behavior_version: self.behavior_version,
        1030  +
            /* ServiceConfigGenerator.kt:567 */
  955   1031   
        }
        1032  +
        /* ServiceConfigGenerator.kt:557 */
  956   1033   
    }
        1034  +
    /* ServiceConfigGenerator.kt:492 */
  957   1035   
}
        1036  +
/* ServiceRuntimePluginGenerator.kt:116 */
  958   1037   
#[derive(::std::fmt::Debug)]
  959   1038   
pub(crate) struct ServiceRuntimePlugin {
  960   1039   
    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
  961   1040   
    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  962   1041   
}
  963   1042   
  964   1043   
impl ServiceRuntimePlugin {
  965   1044   
    pub fn new(_service_config: crate::config::Config) -> Self {
  966   1045   
        let config = {
  967   1046   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("PokemonService");
  968   1047   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
  969   1048   
            ::std::option::Option::Some(cfg.freeze())
  970   1049   
        };
  971   1050   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
  972   1051   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
  973   1052   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
  974   1053   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
  975   1054   
        Self { config, runtime_components }
  976   1055   
    }
  977   1056   
}
  978   1057   
  979   1058   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
  980   1059   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
  981   1060   
        self.config.clone()
  982   1061   
    }
  983   1062   
  984   1063   
    fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
  985   1064   
        ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
  986   1065   
    }
  987   1066   
  988   1067   
    fn runtime_components(
  989   1068   
        &self,
  990   1069   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  991   1070   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  992   1071   
        ::std::borrow::Cow::Borrowed(&self.runtime_components)
  993   1072   
    }
  994   1073   
}
  995   1074   
  996   1075   
/// Cross-operation shared-state singletons
  997   1076   
        1077  +
/* ConfigOverrideRuntimePluginGenerator.kt:42 */
  998   1078   
/// A plugin that enables configuration for a single operation invocation
  999   1079   
///
 1000   1080   
/// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
 1001   1081   
/// In the case of default values requested, they will be obtained from `client_config`.
 1002   1082   
#[derive(Debug)]
 1003   1083   
pub(crate) struct ConfigOverrideRuntimePlugin {
 1004   1084   
    pub(crate) config: ::aws_smithy_types::config_bag::FrozenLayer,
 1005   1085   
    pub(crate) components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1006   1086   
}
 1007   1087   
 1008   1088   
impl ConfigOverrideRuntimePlugin {
 1009   1089   
    #[allow(dead_code)] // unused when a service does not provide any operations
 1010   1090   
    pub(crate) fn new(
 1011   1091   
        config_override: Builder,
 1012   1092   
        initial_config: ::aws_smithy_types::config_bag::FrozenLayer,
 1013   1093   
        initial_components: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1014   1094   
    ) -> Self {
 1015   1095   
        let mut layer = config_override.config;
 1016   1096   
        let mut components = config_override.runtime_components;
 1017   1097   
        #[allow(unused_mut)]
 1018   1098   
        let mut resolver =
 1019   1099   
            ::aws_smithy_runtime::client::config_override::Resolver::overrid(initial_config, initial_components, &mut layer, &mut components);
 1020   1100   
 1021   1101   
        let _ = resolver;
 1022   1102   
        Self {
 1023   1103   
            config: ::aws_smithy_types::config_bag::Layer::from(layer)
 1024   1104   
                .with_name("pokemon_service_client::config::ConfigOverrideRuntimePlugin")
 1025   1105   
                .freeze(),
 1026   1106   
            components,
 1027   1107   
        }
 1028   1108   
    }
 1029   1109   
}
 1030   1110   
 1031   1111   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
 1032   1112   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
 1033   1113   
        Some(self.config.clone())
 1034   1114   
    }
 1035   1115   
 1036   1116   
    fn runtime_components(
 1037   1117   
        &self,
 1038   1118   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1039   1119   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
 1040   1120   
        ::std::borrow::Cow::Borrowed(&self.components)
 1041   1121   
    }
 1042   1122   
}
 1043   1123   
        1124  +
/* ClientRuntimeTypesReExportGenerator.kt:24 */
 1044   1125   
pub use ::aws_smithy_runtime::client::identity::IdentityCache;
 1045   1126   
pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
 1046   1127   
pub use ::aws_smithy_types::config_bag::ConfigBag;
 1047   1128   
        1129  +
/* ResiliencyConfigCustomization.kt:318 */
 1048   1130   
pub use ::aws_smithy_async::rt::sleep::Sleep;
 1049   1131   
        1132  +
/* FluentClientGenerator.kt:261 */
 1050   1133   
pub(crate) fn base_client_runtime_plugins(mut config: crate::Config) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
 1051   1134   
    let mut configured_plugins = ::std::vec::Vec::new();
 1052   1135   
    ::std::mem::swap(&mut config.runtime_plugins, &mut configured_plugins);
 1053   1136   
    #[cfg(feature = "behavior-version-latest")]
 1054   1137   
    {
 1055   1138   
        if config.behavior_version.is_none() {
 1056   1139   
            config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest());
 1057   1140   
        }
 1058   1141   
    }
 1059   1142   
 1060   1143   
    let default_retry_partition = "pokemonservice";
 1061   1144   
 1062   1145   
    let scope = "pokemon-service-client";
 1063   1146   
 1064   1147   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1065   1148   
                        // defaults
 1066   1149   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1067   1150   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1068   1151   
                                .with_retry_partition_name(default_retry_partition)
 1069   1152   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
 1070   1153   
                        ))
 1071   1154   
                        // user config
 1072   1155   
                        .with_client_plugin(
 1073   1156   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1074   1157   
                                .with_config(config.config.clone())
 1075   1158   
                                .with_runtime_components(config.runtime_components.clone())
 1076   1159   
                        )
 1077   1160   
                        // codegen config
 1078   1161   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1079   1162   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())
 1080   1163   
                        .with_client_plugin(
 1081   1164   
                            ::aws_smithy_runtime::client::metrics::MetricsRuntimePlugin::builder()
 1082   1165   
                                .with_scope(scope)
 1083   1166   
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1084   1167   
                                .build()
 1085   1168   
                                .expect("All required fields have been set")
 1086   1169   
                        );
 1087   1170   
 1088   1171   
    for plugin in configured_plugins {
 1089   1172   
        plugins = plugins.with_client_plugin(plugin);
 1090   1173   
    }
 1091   1174   
    plugins
 1092   1175   
}
 1093   1176   
        1177  +
/* ClientReExports.kt:17 */
 1094   1178   
pub use ::aws_smithy_types::config_bag::FrozenLayer;
 1095   1179   
        1180  +
/* ClientReExports.kt:17 */
 1096   1181   
pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
 1097   1182   
        1183  +
/* ClientReExports.kt:17 */
 1098   1184   
pub use ::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin;
 1099   1185   
        1186  +
/* ClientReExports.kt:17 */
 1100   1187   
pub use ::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion;
 1101   1188   
        1189  +
/* ClientReExports.kt:17 */
 1102   1190   
pub use ::aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig;
 1103   1191   
        1192  +
/* ClientReExports.kt:17 */
 1104   1193   
pub use ::aws_smithy_runtime_api::client::http::SharedHttpClient;
 1105   1194   
        1195  +
/* ClientReExports.kt:17 */
 1106   1196   
pub use ::aws_smithy_async::rt::sleep::SharedAsyncSleep;
 1107   1197   
        1198  +
/* ClientReExports.kt:17 */
 1108   1199   
pub use ::aws_smithy_runtime_api::client::identity::SharedIdentityCache;
 1109   1200   
        1201  +
/* ClientReExports.kt:17 */
 1110   1202   
pub use ::aws_smithy_runtime_api::client::interceptors::SharedInterceptor;
 1111   1203   
        1204  +
/* ClientReExports.kt:17 */
 1112   1205   
pub use ::aws_smithy_runtime_api::client::http::HttpClient;
 1113   1206   
        1207  +
/* ClientReExports.kt:17 */
 1114   1208   
pub use ::aws_smithy_runtime_api::shared::IntoShared;
 1115   1209   
        1210  +
/* ClientReExports.kt:17 */
 1116   1211   
pub use ::aws_smithy_async::rt::sleep::AsyncSleep;
 1117   1212   
        1213  +
/* ClientReExports.kt:17 */
 1118   1214   
pub use ::aws_smithy_runtime_api::client::identity::ResolveCachedIdentity;
 1119   1215   
        1216  +
/* ClientReExports.kt:17 */
 1120   1217   
pub use ::aws_smithy_runtime_api::client::interceptors::Intercept;
 1121   1218   
        1219  +
/* ClientReExports.kt:17 */
 1122   1220   
pub use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
 1123   1221   
        1222  +
/* ClientReExports.kt:17 */
 1124   1223   
pub use ::aws_smithy_types::config_bag::Layer;
 1125   1224   
 1126         -
/// Types needed to configure endpoint resolution.
        1225  +
/// /* ClientRustModule.kt:121 */Types needed to configure endpoint resolution.
 1127   1226   
pub mod endpoint;
 1128   1227   
 1129         -
/// HTTP request and response types.
        1228  +
/// /* ClientRustModule.kt:121 */HTTP request and response types.
 1130   1229   
pub mod http;
 1131   1230   
 1132         -
/// Types needed to implement [`Intercept`](crate::config::Intercept).
        1231  +
/// /* ClientRustModule.kt:121 */Types needed to implement [`Intercept`](crate::config::Intercept).
 1133   1232   
pub mod interceptors;
 1134   1233   
 1135         -
/// Retry configuration.
        1234  +
/// /* ClientRustModule.kt:121 */Retry configuration.
 1136   1235   
pub mod retry;
 1137   1236   
 1138         -
/// Timeout configuration.
        1237  +
/// /* ClientRustModule.kt:121 */Timeout configuration.
 1139   1238   
pub mod timeout;

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/config/endpoint.rs

@@ -1,1 +86,107 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ClientRuntimeTypesReExportGenerator.kt:38 */
    2      3   
pub use ::aws_smithy_runtime_api::client::endpoint::EndpointFuture;
    3      4   
pub use ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver;
    4      5   
pub use ::aws_smithy_types::endpoint::Endpoint;
    5      6   
           7  +
/* RustType.kt:516 */
    6      8   
#[cfg(test)]
    7         -
mod test {}
           9  +
/* EndpointsDecorator.kt:175 */
          10  +
mod test {
    8     11   
          12  +
    /* EndpointsDecorator.kt:175 */
          13  +
}
          14  +
          15  +
/* EndpointResolverGenerator.kt:416 */
    9     16   
/// Endpoint resolver trait specific to Pokémon Service
   10     17   
pub trait ResolveEndpoint: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug {
   11     18   
    /// Resolve an endpoint with the given parameters
   12     19   
    fn resolve_endpoint<'a>(&'a self, params: &'a crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a>;
   13     20   
   14     21   
    /// Convert this service-specific resolver into a `SharedEndpointResolver`
   15     22   
    ///
   16     23   
    /// The resulting resolver will downcast `EndpointResolverParams` into `crate::config::endpoint::Params`.
   17     24   
    fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver
   18     25   
    where
   19     26   
        Self: Sized + 'static,
   20     27   
    {
   21     28   
        ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver::new(DowncastParams(self))
   22     29   
    }
   23     30   
}
   24     31   
   25     32   
#[derive(Debug)]
   26     33   
struct DowncastParams<T>(T);
   27     34   
impl<T> ::aws_smithy_runtime_api::client::endpoint::ResolveEndpoint for DowncastParams<T>
   28     35   
where
   29     36   
    T: ResolveEndpoint,
   30     37   
{
   31     38   
    fn resolve_endpoint<'a>(
   32     39   
        &'a self,
   33     40   
        params: &'a ::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams,
   34     41   
    ) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a> {
   35     42   
        let ep = match params.get::<crate::config::endpoint::Params>() {
   36     43   
            Some(params) => self.0.resolve_endpoint(params),
   37     44   
            None => ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(Err("params of expected type was not present".into())),
   38     45   
        };
   39     46   
        ep
   40     47   
    }
   41     48   
}
   42     49   
          50  +
/* RustType.kt:516 */
   43     51   
#[non_exhaustive]
          52  +
/* RustType.kt:516 */
   44     53   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   45         -
/// Configuration parameters for resolving the correct endpoint
   46         -
pub struct Params {}
          54  +
/// /* EndpointParamsGenerator.kt:178 */Configuration parameters for resolving the correct endpoint
          55  +
/* EndpointParamsGenerator.kt:179 */
          56  +
pub struct Params {/* EndpointParamsGenerator.kt:179 */}
          57  +
/* EndpointParamsGenerator.kt:188 */
   47     58   
impl Params {
          59  +
    /* EndpointParamsGenerator.kt:189 */
   48     60   
    /// Create a builder for [`Params`]
   49     61   
    pub fn builder() -> crate::config::endpoint::ParamsBuilder {
   50     62   
        crate::config::endpoint::ParamsBuilder::default()
   51     63   
    }
          64  +
    /* EndpointParamsGenerator.kt:188 */
   52     65   
}
   53     66   
   54         -
/// Builder for [`Params`]
          67  +
/// /* EndpointParamsGenerator.kt:234 */Builder for [`Params`]
          68  +
/* RustType.kt:516 */
   55     69   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   56         -
pub struct ParamsBuilder {}
          70  +
/* EndpointParamsGenerator.kt:238 */
          71  +
pub struct ParamsBuilder {/* EndpointParamsGenerator.kt:238 */}
          72  +
/* EndpointParamsGenerator.kt:246 */
   57     73   
impl ParamsBuilder {
   58         -
    /// Consume this builder, creating [`Params`].
          74  +
    /// /* EndpointParamsGenerator.kt:247 */Consume this builder, creating [`Params`].
          75  +
    /* EndpointParamsGenerator.kt:248 */
   59     76   
    pub fn build(self) -> ::std::result::Result<crate::config::endpoint::Params, crate::config::endpoint::InvalidParams> {
          77  +
        /* EndpointParamsGenerator.kt:272 */
   60     78   
        Ok(
   61     79   
            #[allow(clippy::unnecessary_lazy_evaluations)]
   62     80   
            crate::config::endpoint::Params {},
   63     81   
        )
          82  +
        /* EndpointParamsGenerator.kt:248 */
   64     83   
    }
          84  +
    /* EndpointParamsGenerator.kt:246 */
   65     85   
}
   66     86   
          87  +
/* EndpointParamsGenerator.kt:139 */
   67     88   
/// An error that occurred during endpoint resolution
   68     89   
#[derive(Debug)]
   69     90   
pub struct InvalidParams {
   70     91   
    field: std::borrow::Cow<'static, str>,
   71     92   
}
   72     93   
   73     94   
impl InvalidParams {
   74     95   
    #[allow(dead_code)]
   75     96   
    fn missing(field: &'static str) -> Self {
   76     97   
        Self { field: field.into() }

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/config/http.rs

@@ -1,1 +3,4 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ClientRuntimeTypesReExportGenerator.kt:60 */
    2      3   
pub use ::aws_smithy_runtime_api::client::orchestrator::HttpRequest;
    3      4   
pub use ::aws_smithy_runtime_api::client::orchestrator::HttpResponse;

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/config/interceptors.rs

@@ -1,1 +11,12 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ClientRuntimeTypesReExportGenerator.kt:70 */
    2      3   
pub use ::aws_smithy_runtime_api::client::interceptors::context::AfterDeserializationInterceptorContextRef;
    3      4   
pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeDeserializationInterceptorContextMut;
    4      5   
pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeDeserializationInterceptorContextRef;
    5      6   
pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut;
    6      7   
pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef;
    7      8   
pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut;
    8      9   
pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextRef;
    9     10   
pub use ::aws_smithy_runtime_api::client::interceptors::context::FinalizerInterceptorContextMut;
   10     11   
pub use ::aws_smithy_runtime_api::client::interceptors::context::FinalizerInterceptorContextRef;
   11     12   
pub use ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext;

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/config/retry.rs

@@ -1,1 +7,9 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ClientRuntimeTypesReExportGenerator.kt:48 */
    2      3   
pub use ::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry;
    3      4   
pub use ::aws_smithy_runtime_api::client::retries::classifiers::RetryAction;
    4      5   
pub use ::aws_smithy_runtime_api::client::retries::ShouldAttempt;
    5      6   
    6         -
pub use ::aws_smithy_runtime::client::retries::RetryPartition;
           7  +
/* ResiliencyConfigCustomization.kt:324 */
           8  +
/* ResiliencyConfigCustomization.kt:329 */ pub use ::aws_smithy_runtime::client::retries::RetryPartition;
    7      9   
pub use ::aws_smithy_types::retry::{ReconnectMode, RetryConfig, RetryConfigBuilder, RetryMode};

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/config/timeout.rs

@@ -1,1 +2,3 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ResiliencyConfigCustomization.kt:335 */
    2      3   
pub use ::aws_smithy_types::timeout::{TimeoutConfig, TimeoutConfigBuilder};

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

@@ -1,1 +30,33 @@
    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   
          15  +
/* ClientEnumGenerator.kt:302 */
   13     16   
/// The given enum value failed to parse since it is not a known value.
   14     17   
#[derive(Debug)]
   15     18   
pub struct UnknownVariantError {
   16     19   
    value: ::std::string::String,
   17     20   
}
   18     21   
impl UnknownVariantError {
   19     22   
    pub(crate) fn new(value: impl ::std::convert::Into<::std::string::String>) -> Self {
   20     23   
        Self { value: value.into() }
   21     24   
    }
   22     25   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-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-client/rust-client-codegen/src/error_meta.rs

@@ -1,1 +286,465 @@
    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   
    ResourceNotFoundError(crate::types::error::ResourceNotFoundError),
   12         -
    /// Not authorized to access Pokémon storage.
          21  +
    /// /* ServiceErrorGenerator.kt:259 */Not authorized to access Pokémon storage.
          22  +
    /* ServiceErrorGenerator.kt:262 */
   13     23   
    StorageAccessNotAuthorized(crate::types::error::StorageAccessNotAuthorized),
          24  +
    /* ServiceErrorGenerator.kt:259 */
   14     25   
    #[allow(missing_docs)] // documentation missing in model
          26  +
    /* ServiceErrorGenerator.kt:262 */
   15     27   
    ThrottlingError(crate::types::error::ThrottlingError),
          28  +
    /* ServiceErrorGenerator.kt:259 */
   16     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
    /* ServiceErrorGenerator.kt:262 */
   17     31   
    UnsupportedRegionError(crate::types::error::UnsupportedRegionError),
   18         -
    /// 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.
          32  +
    /// /* 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.
          33  +
    /* ServiceErrorGenerator.kt:262 */
   19     34   
    ValidationError(crate::types::error::ValidationError),
   20         -
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
          35  +
    /// /* ServiceErrorGenerator.kt:264 */An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
          36  +
    /* ServiceErrorGenerator.kt:320 */
   21     37   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
   22     38   
    variable wildcard pattern and check `.code()`:
   23     39   
     \
   24     40   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
   25     41   
     \
   26     42   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
   27         -
    Unhandled(crate::error::sealed_unhandled::Unhandled),
          43  +
    /* ServiceErrorGenerator.kt:266 */
          44  +
    Unhandled(crate::error::sealed_unhandled::Unhandled), /* ServiceErrorGenerator.kt:257 */
   28     45   
}
          46  +
/* ServiceErrorGenerator.kt:131 */
   29     47   
impl ::std::fmt::Display for Error {
          48  +
    /* ServiceErrorGenerator.kt:132 */
   30     49   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          50  +
        /* ServiceErrorGenerator.kt:133 */
   31     51   
        match self {
   32         -
            Error::InvalidPokeballError(inner) => inner.fmt(f),
   33         -
            Error::MasterBallUnsuccessful(inner) => inner.fmt(f),
   34         -
            Error::ResourceNotFoundError(inner) => inner.fmt(f),
   35         -
            Error::StorageAccessNotAuthorized(inner) => inner.fmt(f),
   36         -
            Error::ThrottlingError(inner) => inner.fmt(f),
   37         -
            Error::UnsupportedRegionError(inner) => inner.fmt(f),
   38         -
            Error::ValidationError(inner) => inner.fmt(f),
          52  +
            /* ServiceErrorGenerator.kt:135 */ Error::InvalidPokeballError(inner) => inner.fmt(f),
          53  +
            /* ServiceErrorGenerator.kt:135 */ Error::MasterBallUnsuccessful(inner) => inner.fmt(f),
          54  +
            /* ServiceErrorGenerator.kt:135 */ Error::ResourceNotFoundError(inner) => inner.fmt(f),
          55  +
            /* ServiceErrorGenerator.kt:135 */ Error::StorageAccessNotAuthorized(inner) => inner.fmt(f),
          56  +
            /* ServiceErrorGenerator.kt:135 */ Error::ThrottlingError(inner) => inner.fmt(f),
          57  +
            /* ServiceErrorGenerator.kt:135 */ Error::UnsupportedRegionError(inner) => inner.fmt(f),
          58  +
            /* ServiceErrorGenerator.kt:135 */ Error::ValidationError(inner) => inner.fmt(f),
          59  +
            /* ServiceErrorGenerator.kt:137 */
   39     60   
            Error::Unhandled(_) => {
   40     61   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
   41     62   
                    write!(f, "unhandled error ({code})")
   42     63   
                } else {
   43     64   
                    f.write_str("unhandled error")
   44     65   
                }
          66  +
            } /* ServiceErrorGenerator.kt:133 */
   45     67   
        }
          68  +
        /* ServiceErrorGenerator.kt:132 */
   46     69   
    }
   47         -
    }
          70  +
    /* ServiceErrorGenerator.kt:131 */
   48     71   
}
          72  +
/* ServiceErrorGenerator.kt:154 */
   49     73   
impl From<::aws_smithy_types::error::operation::BuildError> for Error {
   50     74   
    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
   51     75   
        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
   52     76   
            source: value.into(),
   53     77   
            meta: ::std::default::Default::default(),
   54     78   
        })
   55     79   
    }
   56     80   
}
          81  +
/* ServiceErrorGenerator.kt:223 */
   57     82   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
   58     83   
    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
   59     84   
        match self {
   60     85   
            Self::InvalidPokeballError(inner) => inner.meta(),
   61     86   
            Self::MasterBallUnsuccessful(inner) => inner.meta(),
   62     87   
            Self::ResourceNotFoundError(inner) => inner.meta(),
   63     88   
            Self::StorageAccessNotAuthorized(inner) => inner.meta(),
   64     89   
            Self::ThrottlingError(inner) => inner.meta(),
   65     90   
            Self::UnsupportedRegionError(inner) => inner.meta(),
   66     91   
            Self::ValidationError(inner) => inner.meta(),
   67     92   
            Self::Unhandled(inner) => &inner.meta,
   68     93   
        }
   69     94   
    }
   70     95   
}
          96  +
/* ServiceErrorGenerator.kt:174 */
   71     97   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::capture_pokemon::CapturePokemonError, R>> for Error
   72     98   
where
   73     99   
    R: Send + Sync + std::fmt::Debug + 'static,
   74    100   
{
         101  +
    /* ServiceErrorGenerator.kt:179 */
   75    102   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::capture_pokemon::CapturePokemonError, R>) -> Self {
         103  +
        /* ServiceErrorGenerator.kt:184 */
   76    104   
        match err {
         105  +
            /* ServiceErrorGenerator.kt:185 */
   77    106   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         107  +
            /* ServiceErrorGenerator.kt:186 */
   78    108   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
   79    109   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
   80    110   
                source: err.into(),
   81    111   
            }),
         112  +
            /* ServiceErrorGenerator.kt:184 */
   82    113   
        }
         114  +
        /* ServiceErrorGenerator.kt:179 */
   83    115   
    }
         116  +
    /* ServiceErrorGenerator.kt:174 */
   84    117   
}
         118  +
/* ServiceErrorGenerator.kt:202 */
   85    119   
impl From<crate::operation::capture_pokemon::CapturePokemonError> for Error {
         120  +
    /* ServiceErrorGenerator.kt:203 */
   86    121   
    fn from(err: crate::operation::capture_pokemon::CapturePokemonError) -> Self {
         122  +
        /* ServiceErrorGenerator.kt:204 */
   87    123   
        match err {
         124  +
            /* ServiceErrorGenerator.kt:207 */
   88    125   
            crate::operation::capture_pokemon::CapturePokemonError::ValidationError(inner) => Error::ValidationError(inner),
         126  +
            /* ServiceErrorGenerator.kt:207 */
   89    127   
            crate::operation::capture_pokemon::CapturePokemonError::MasterBallUnsuccessful(inner) => Error::MasterBallUnsuccessful(inner),
         128  +
            /* ServiceErrorGenerator.kt:207 */
   90    129   
            crate::operation::capture_pokemon::CapturePokemonError::InvalidPokeballError(inner) => Error::InvalidPokeballError(inner),
         130  +
            /* ServiceErrorGenerator.kt:207 */
   91    131   
            crate::operation::capture_pokemon::CapturePokemonError::ThrottlingError(inner) => Error::ThrottlingError(inner),
         132  +
            /* ServiceErrorGenerator.kt:207 */
   92    133   
            crate::operation::capture_pokemon::CapturePokemonError::UnsupportedRegionError(inner) => Error::UnsupportedRegionError(inner),
         134  +
            /* ServiceErrorGenerator.kt:212 */
   93    135   
            crate::operation::capture_pokemon::CapturePokemonError::Unhandled(inner) => Error::Unhandled(inner),
         136  +
            /* ServiceErrorGenerator.kt:204 */
   94    137   
        }
         138  +
        /* ServiceErrorGenerator.kt:203 */
   95    139   
    }
         140  +
    /* ServiceErrorGenerator.kt:202 */
   96    141   
}
         142  +
/* ServiceErrorGenerator.kt:174 */
   97    143   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::check_health::CheckHealthError, R>> for Error
   98    144   
where
   99    145   
    R: Send + Sync + std::fmt::Debug + 'static,
  100    146   
{
         147  +
    /* ServiceErrorGenerator.kt:179 */
  101    148   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::check_health::CheckHealthError, R>) -> Self {
         149  +
        /* ServiceErrorGenerator.kt:184 */
  102    150   
        match err {
         151  +
            /* ServiceErrorGenerator.kt:185 */
  103    152   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         153  +
            /* ServiceErrorGenerator.kt:186 */
  104    154   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  105    155   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  106    156   
                source: err.into(),
  107    157   
            }),
         158  +
            /* ServiceErrorGenerator.kt:184 */
  108    159   
        }
         160  +
        /* ServiceErrorGenerator.kt:179 */
  109    161   
    }
         162  +
    /* ServiceErrorGenerator.kt:174 */
  110    163   
}
         164  +
/* ServiceErrorGenerator.kt:202 */
  111    165   
impl From<crate::operation::check_health::CheckHealthError> for Error {
         166  +
    /* ServiceErrorGenerator.kt:203 */
  112    167   
    fn from(err: crate::operation::check_health::CheckHealthError) -> Self {
         168  +
        /* ServiceErrorGenerator.kt:204 */
  113    169   
        match err {
         170  +
            /* ServiceErrorGenerator.kt:212 */
  114    171   
            crate::operation::check_health::CheckHealthError::Unhandled(inner) => Error::Unhandled(inner),
         172  +
            /* ServiceErrorGenerator.kt:204 */
  115    173   
        }
         174  +
        /* ServiceErrorGenerator.kt:203 */
  116    175   
    }
         176  +
    /* ServiceErrorGenerator.kt:202 */
  117    177   
}
         178  +
/* ServiceErrorGenerator.kt:174 */
  118    179   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::do_nothing::DoNothingError, R>> for Error
  119    180   
where
  120    181   
    R: Send + Sync + std::fmt::Debug + 'static,
  121    182   
{
         183  +
    /* ServiceErrorGenerator.kt:179 */
  122    184   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::do_nothing::DoNothingError, R>) -> Self {
         185  +
        /* ServiceErrorGenerator.kt:184 */
  123    186   
        match err {
         187  +
            /* ServiceErrorGenerator.kt:185 */
  124    188   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         189  +
            /* ServiceErrorGenerator.kt:186 */
  125    190   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  126    191   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  127    192   
                source: err.into(),
  128    193   
            }),
         194  +
            /* ServiceErrorGenerator.kt:184 */
  129    195   
        }
         196  +
        /* ServiceErrorGenerator.kt:179 */
  130    197   
    }
         198  +
    /* ServiceErrorGenerator.kt:174 */
  131    199   
}
         200  +
/* ServiceErrorGenerator.kt:202 */
  132    201   
impl From<crate::operation::do_nothing::DoNothingError> for Error {
         202  +
    /* ServiceErrorGenerator.kt:203 */
  133    203   
    fn from(err: crate::operation::do_nothing::DoNothingError) -> Self {
         204  +
        /* ServiceErrorGenerator.kt:204 */
  134    205   
        match err {
         206  +
            /* ServiceErrorGenerator.kt:212 */
  135    207   
            crate::operation::do_nothing::DoNothingError::Unhandled(inner) => Error::Unhandled(inner),
         208  +
            /* ServiceErrorGenerator.kt:204 */
  136    209   
        }
         210  +
        /* ServiceErrorGenerator.kt:203 */
  137    211   
    }
         212  +
    /* ServiceErrorGenerator.kt:202 */
  138    213   
}
         214  +
/* ServiceErrorGenerator.kt:174 */
  139    215   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_pokemon_species::GetPokemonSpeciesError, R>> for Error
  140    216   
where
  141    217   
    R: Send + Sync + std::fmt::Debug + 'static,
  142    218   
{
         219  +
    /* ServiceErrorGenerator.kt:179 */
  143    220   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_pokemon_species::GetPokemonSpeciesError, R>) -> Self {
         221  +
        /* ServiceErrorGenerator.kt:184 */
  144    222   
        match err {
         223  +
            /* ServiceErrorGenerator.kt:185 */
  145    224   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         225  +
            /* ServiceErrorGenerator.kt:186 */
  146    226   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  147    227   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  148    228   
                source: err.into(),
  149    229   
            }),
         230  +
            /* ServiceErrorGenerator.kt:184 */
  150    231   
        }
         232  +
        /* ServiceErrorGenerator.kt:179 */
  151    233   
    }
         234  +
    /* ServiceErrorGenerator.kt:174 */
  152    235   
}
         236  +
/* ServiceErrorGenerator.kt:202 */
  153    237   
impl From<crate::operation::get_pokemon_species::GetPokemonSpeciesError> for Error {
         238  +
    /* ServiceErrorGenerator.kt:203 */
  154    239   
    fn from(err: crate::operation::get_pokemon_species::GetPokemonSpeciesError) -> Self {
         240  +
        /* ServiceErrorGenerator.kt:204 */
  155    241   
        match err {
         242  +
            /* ServiceErrorGenerator.kt:207 */
  156    243   
            crate::operation::get_pokemon_species::GetPokemonSpeciesError::ValidationError(inner) => Error::ValidationError(inner),
         244  +
            /* ServiceErrorGenerator.kt:207 */
  157    245   
            crate::operation::get_pokemon_species::GetPokemonSpeciesError::ResourceNotFoundError(inner) => Error::ResourceNotFoundError(inner),
         246  +
            /* ServiceErrorGenerator.kt:212 */
  158    247   
            crate::operation::get_pokemon_species::GetPokemonSpeciesError::Unhandled(inner) => Error::Unhandled(inner),
         248  +
            /* ServiceErrorGenerator.kt:204 */
  159    249   
        }
         250  +
        /* ServiceErrorGenerator.kt:203 */
  160    251   
    }
         252  +
    /* ServiceErrorGenerator.kt:202 */
  161    253   
}
         254  +
/* ServiceErrorGenerator.kt:174 */
  162    255   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_server_statistics::GetServerStatisticsError, R>> for Error
  163    256   
where
  164    257   
    R: Send + Sync + std::fmt::Debug + 'static,
  165    258   
{
         259  +
    /* ServiceErrorGenerator.kt:179 */
  166    260   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_server_statistics::GetServerStatisticsError, R>) -> Self {
         261  +
        /* ServiceErrorGenerator.kt:184 */
  167    262   
        match err {
         263  +
            /* ServiceErrorGenerator.kt:185 */
  168    264   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         265  +
            /* ServiceErrorGenerator.kt:186 */
  169    266   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  170    267   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  171    268   
                source: err.into(),
  172    269   
            }),
         270  +
            /* ServiceErrorGenerator.kt:184 */
  173    271   
        }
         272  +
        /* ServiceErrorGenerator.kt:179 */
  174    273   
    }
         274  +
    /* ServiceErrorGenerator.kt:174 */
  175    275   
}
         276  +
/* ServiceErrorGenerator.kt:202 */
  176    277   
impl From<crate::operation::get_server_statistics::GetServerStatisticsError> for Error {
         278  +
    /* ServiceErrorGenerator.kt:203 */
  177    279   
    fn from(err: crate::operation::get_server_statistics::GetServerStatisticsError) -> Self {
         280  +
        /* ServiceErrorGenerator.kt:204 */
  178    281   
        match err {
         282  +
            /* ServiceErrorGenerator.kt:212 */
  179    283   
            crate::operation::get_server_statistics::GetServerStatisticsError::Unhandled(inner) => Error::Unhandled(inner),
         284  +
            /* ServiceErrorGenerator.kt:204 */
  180    285   
        }
         286  +
        /* ServiceErrorGenerator.kt:203 */
  181    287   
    }
         288  +
    /* ServiceErrorGenerator.kt:202 */
  182    289   
}
         290  +
/* ServiceErrorGenerator.kt:174 */
  183    291   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_storage::GetStorageError, R>> for Error
  184    292   
where
  185    293   
    R: Send + Sync + std::fmt::Debug + 'static,
  186    294   
{
         295  +
    /* ServiceErrorGenerator.kt:179 */
  187    296   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_storage::GetStorageError, R>) -> Self {
         297  +
        /* ServiceErrorGenerator.kt:184 */
  188    298   
        match err {
         299  +
            /* ServiceErrorGenerator.kt:185 */
  189    300   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         301  +
            /* ServiceErrorGenerator.kt:186 */
  190    302   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  191    303   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  192    304   
                source: err.into(),
  193    305   
            }),
         306  +
            /* ServiceErrorGenerator.kt:184 */
  194    307   
        }
         308  +
        /* ServiceErrorGenerator.kt:179 */
  195    309   
    }
         310  +
    /* ServiceErrorGenerator.kt:174 */
  196    311   
}
         312  +
/* ServiceErrorGenerator.kt:202 */
  197    313   
impl From<crate::operation::get_storage::GetStorageError> for Error {
         314  +
    /* ServiceErrorGenerator.kt:203 */
  198    315   
    fn from(err: crate::operation::get_storage::GetStorageError) -> Self {
         316  +
        /* ServiceErrorGenerator.kt:204 */
  199    317   
        match err {
         318  +
            /* ServiceErrorGenerator.kt:207 */
  200    319   
            crate::operation::get_storage::GetStorageError::ValidationError(inner) => Error::ValidationError(inner),
         320  +
            /* ServiceErrorGenerator.kt:207 */
  201    321   
            crate::operation::get_storage::GetStorageError::StorageAccessNotAuthorized(inner) => Error::StorageAccessNotAuthorized(inner),
         322  +
            /* ServiceErrorGenerator.kt:207 */
  202    323   
            crate::operation::get_storage::GetStorageError::ResourceNotFoundError(inner) => Error::ResourceNotFoundError(inner),
         324  +
            /* ServiceErrorGenerator.kt:212 */
  203    325   
            crate::operation::get_storage::GetStorageError::Unhandled(inner) => Error::Unhandled(inner),
         326  +
            /* ServiceErrorGenerator.kt:204 */
  204    327   
        }
         328  +
        /* ServiceErrorGenerator.kt:203 */
  205    329   
    }
         330  +
    /* ServiceErrorGenerator.kt:202 */
  206    331   
}
         332  +
/* ServiceErrorGenerator.kt:174 */
  207    333   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stream_pokemon_radio::StreamPokemonRadioError, R>> for Error
  208    334   
where
  209    335   
    R: Send + Sync + std::fmt::Debug + 'static,
  210    336   
{
         337  +
    /* ServiceErrorGenerator.kt:179 */
  211    338   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stream_pokemon_radio::StreamPokemonRadioError, R>) -> Self {
         339  +
        /* ServiceErrorGenerator.kt:184 */
  212    340   
        match err {
         341  +
            /* ServiceErrorGenerator.kt:185 */
  213    342   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         343  +
            /* ServiceErrorGenerator.kt:186 */
  214    344   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  215    345   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  216    346   
                source: err.into(),
  217    347   
            }),
         348  +
            /* ServiceErrorGenerator.kt:184 */
  218    349   
        }
         350  +
        /* ServiceErrorGenerator.kt:179 */
  219    351   
    }
         352  +
    /* ServiceErrorGenerator.kt:174 */
  220    353   
}
         354  +
/* ServiceErrorGenerator.kt:202 */
  221    355   
impl From<crate::operation::stream_pokemon_radio::StreamPokemonRadioError> for Error {
         356  +
    /* ServiceErrorGenerator.kt:203 */
  222    357   
    fn from(err: crate::operation::stream_pokemon_radio::StreamPokemonRadioError) -> Self {
         358  +
        /* ServiceErrorGenerator.kt:204 */
  223    359   
        match err {
         360  +
            /* ServiceErrorGenerator.kt:212 */
  224    361   
            crate::operation::stream_pokemon_radio::StreamPokemonRadioError::Unhandled(inner) => Error::Unhandled(inner),
         362  +
            /* ServiceErrorGenerator.kt:204 */
  225    363   
        }
         364  +
        /* ServiceErrorGenerator.kt:203 */
  226    365   
    }
         366  +
    /* ServiceErrorGenerator.kt:202 */
  227    367   
}
         368  +
/* ServiceErrorGenerator.kt:174 */
  228    369   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::AttemptCapturingPokemonEventError, R>> for Error
  229    370   
where
  230    371   
    R: Send + Sync + std::fmt::Debug + 'static,
  231    372   
{
         373  +
    /* ServiceErrorGenerator.kt:179 */
  232    374   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::AttemptCapturingPokemonEventError, R>) -> Self {
         375  +
        /* ServiceErrorGenerator.kt:184 */
  233    376   
        match err {
         377  +
            /* ServiceErrorGenerator.kt:185 */
  234    378   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         379  +
            /* ServiceErrorGenerator.kt:186 */
  235    380   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  236    381   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  237    382   
                source: err.into(),
  238    383   
            }),
         384  +
            /* ServiceErrorGenerator.kt:184 */
  239    385   
        }
         386  +
        /* ServiceErrorGenerator.kt:179 */
  240    387   
    }
         388  +
    /* ServiceErrorGenerator.kt:174 */
  241    389   
}
         390  +
/* ServiceErrorGenerator.kt:202 */
  242    391   
impl From<crate::types::error::AttemptCapturingPokemonEventError> for Error {
         392  +
    /* ServiceErrorGenerator.kt:203 */
  243    393   
    fn from(err: crate::types::error::AttemptCapturingPokemonEventError) -> Self {
         394  +
        /* ServiceErrorGenerator.kt:204 */
  244    395   
        match err {
         396  +
            /* ServiceErrorGenerator.kt:207 */
  245    397   
            crate::types::error::AttemptCapturingPokemonEventError::MasterBallUnsuccessful(inner) => Error::MasterBallUnsuccessful(inner),
         398  +
            /* ServiceErrorGenerator.kt:212 */
  246    399   
            crate::types::error::AttemptCapturingPokemonEventError::Unhandled(inner) => Error::Unhandled(inner),
         400  +
            /* ServiceErrorGenerator.kt:204 */
  247    401   
        }
         402  +
        /* ServiceErrorGenerator.kt:203 */
  248    403   
    }
         404  +
    /* ServiceErrorGenerator.kt:202 */
  249    405   
}
         406  +
/* ServiceErrorGenerator.kt:174 */
  250    407   
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::CapturePokemonEventsError, R>> for Error
  251    408   
where
  252    409   
    R: Send + Sync + std::fmt::Debug + 'static,
  253    410   
{
         411  +
    /* ServiceErrorGenerator.kt:179 */
  254    412   
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::CapturePokemonEventsError, R>) -> Self {
         413  +
        /* ServiceErrorGenerator.kt:184 */
  255    414   
        match err {
         415  +
            /* ServiceErrorGenerator.kt:185 */
  256    416   
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
         417  +
            /* ServiceErrorGenerator.kt:186 */
  257    418   
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
  258    419   
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
  259    420   
                source: err.into(),
  260    421   
            }),
         422  +
            /* ServiceErrorGenerator.kt:184 */
  261    423   
        }
         424  +
        /* ServiceErrorGenerator.kt:179 */
  262    425   
    }
         426  +
    /* ServiceErrorGenerator.kt:174 */
  263    427   
}
         428  +
/* ServiceErrorGenerator.kt:202 */
  264    429   
impl From<crate::types::error::CapturePokemonEventsError> for Error {
         430  +
    /* ServiceErrorGenerator.kt:203 */
  265    431   
    fn from(err: crate::types::error::CapturePokemonEventsError) -> Self {
         432  +
        /* ServiceErrorGenerator.kt:204 */
  266    433   
        match err {
         434  +
            /* ServiceErrorGenerator.kt:207 */
  267    435   
            crate::types::error::CapturePokemonEventsError::InvalidPokeballError(inner) => Error::InvalidPokeballError(inner),
         436  +
            /* ServiceErrorGenerator.kt:207 */
  268    437   
            crate::types::error::CapturePokemonEventsError::ThrottlingError(inner) => Error::ThrottlingError(inner),
         438  +
            /* ServiceErrorGenerator.kt:212 */
  269    439   
            crate::types::error::CapturePokemonEventsError::Unhandled(inner) => Error::Unhandled(inner),
         440  +
            /* ServiceErrorGenerator.kt:204 */
  270    441   
        }
         442  +
        /* ServiceErrorGenerator.kt:203 */
  271    443   
    }
         444  +
    /* ServiceErrorGenerator.kt:202 */
  272    445   
}
         446  +
/* ServiceErrorGenerator.kt:115 */
  273    447   
impl ::std::error::Error for Error {
         448  +
    /* ServiceErrorGenerator.kt:116 */
  274    449   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         450  +
        /* ServiceErrorGenerator.kt:117 */
  275    451   
        match self {
  276         -
            Error::InvalidPokeballError(inner) => inner.source(),
  277         -
            Error::MasterBallUnsuccessful(inner) => inner.source(),
  278         -
            Error::ResourceNotFoundError(inner) => inner.source(),
  279         -
            Error::StorageAccessNotAuthorized(inner) => inner.source(),
  280         -
            Error::ThrottlingError(inner) => inner.source(),
  281         -
            Error::UnsupportedRegionError(inner) => inner.source(),
  282         -
            Error::ValidationError(inner) => inner.source(),
  283         -
            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
  284         -
        }
  285         -
    }
         452  +
            /* ServiceErrorGenerator.kt:119 */ Error::InvalidPokeballError(inner) => inner.source(),
         453  +
            /* ServiceErrorGenerator.kt:119 */ Error::MasterBallUnsuccessful(inner) => inner.source(),
         454  +
            /* ServiceErrorGenerator.kt:119 */ Error::ResourceNotFoundError(inner) => inner.source(),
         455  +
            /* ServiceErrorGenerator.kt:119 */ Error::StorageAccessNotAuthorized(inner) => inner.source(),
         456  +
            /* ServiceErrorGenerator.kt:119 */ Error::ThrottlingError(inner) => inner.source(),
         457  +
            /* ServiceErrorGenerator.kt:119 */ Error::UnsupportedRegionError(inner) => inner.source(),
         458  +
            /* ServiceErrorGenerator.kt:119 */ Error::ValidationError(inner) => inner.source(),
         459  +
            /* ServiceErrorGenerator.kt:121 */
         460  +
            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source), /* ServiceErrorGenerator.kt:117 */
         461  +
        }
         462  +
        /* ServiceErrorGenerator.kt:116 */
         463  +
    }
         464  +
    /* ServiceErrorGenerator.kt:115 */
  286    465   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-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-client/rust-client-codegen/src/lib.rs

@@ -18,18 +136,148 @@
   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_client::Config::builder()
   72     75   
///     .endpoint_url("http://localhost:1234")
   73     76   
///     .build();
   74     77   
/// let client = pokemon_service_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         -
/// # Using the `Client`
          83  +
/// /* FluentClientDocs.kt:79 */# Using the `Client`
   81     84   
///
   82     85   
/// A client has a function for every operation that can be performed by the service.
   83     86   
/// For example, the [`CapturePokemon`](crate::operation::capture_pokemon) operation has
   84     87   
/// a [`Client::capture_pokemon`], function which returns a builder for that operation.
   85     88   
/// The fluent builder ultimately has a `send()` function that returns an async future that
   86     89   
/// returns a result, as illustrated below:
   87     90   
///
   88     91   
/// ```rust,ignore
   89     92   
/// let result = client.capture_pokemon()
   90     93   
///     .region("example")
   91     94   
///     .send()
   92     95   
///     .await;
   93     96   
/// ```
   94     97   
///
   95     98   
/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
   96     99   
/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
   97    100   
/// information.
   98    101   
pub mod client;
   99    102   
  100         -
/// Configuration for Pokémon Service.
         103  +
/// /* ClientRustModule.kt:121 */Configuration for Pokémon Service.
  101    104   
pub mod config;
  102    105   
  103         -
/// Common errors and error handling utilities.
         106  +
/// /* ClientRustModule.kt:121 */Common errors and error handling utilities.
  104    107   
pub mod error;
  105    108   
         109  +
/* RustModule.kt:172 */
  106    110   
mod error_meta;
  107    111   
  108         -
/// Information about this crate.
         112  +
/// /* ClientRustModule.kt:121 */Information about this crate.
  109    113   
pub mod meta;
  110    114   
  111         -
/// Primitives such as `Blob` or `DateTime` used by other types.
         115  +
/// /* ClientRustModule.kt:121 */Primitives such as `Blob` or `DateTime` used by other types.
  112    116   
pub mod primitives;
  113    117   
  114         -
/// Data structures used by operation inputs/outputs.
         118  +
/// /* ClientRustModule.kt:121 */Data structures used by operation inputs/outputs.
  115    119   
pub mod types;
  116    120   
         121  +
/* RustModule.kt:172 */
  117    122   
mod auth_plugin;
  118    123   
         124  +
/* RustModule.kt:172 */
  119    125   
mod event_receiver;
  120    126   
         127  +
/* RustModule.kt:172 */
  121    128   
mod event_stream_serde;
  122    129   
  123         -
/// All operations that this crate can perform.
         130  +
/// /* ClientRustModule.kt:121 */All operations that this crate can perform.
  124    131   
pub mod operation;
  125    132   
  126    133   
pub(crate) mod protocol_serde;
  127    134   
         135  +
/* RustModule.kt:172 */
  128    136   
mod sdk_feature_tracker;
  129    137   
         138  +
/* RustModule.kt:172 */
  130    139   
mod serialization_settings;
  131    140   
         141  +
/* RustModule.kt:172 */
  132    142   
mod serde_util;
  133    143   
         144  +
/* RustModule.kt:172 */
  134    145   
mod json_errors;
  135    146   
         147  +
/* FluentClientDecorator.kt:76 */
  136    148   
pub use client::Client;

tmp-codegen-diff/codegen-client-test/pokemon-service-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-client/rust-client-codegen/src/operation.rs

@@ -1,1 +22,22 @@
    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 `GetPokemonSpecies` operation.
          12  +
/// /* CodegenDelegator.kt:51 */Types for the `GetPokemonSpecies` operation.
   13     13   
pub mod get_pokemon_species;
   14     14   
   15         -
/// Types for the `GetServerStatistics` operation.
          15  +
/// /* CodegenDelegator.kt:51 */Types for the `GetServerStatistics` operation.
   16     16   
pub mod get_server_statistics;
   17     17   
   18         -
/// Types for the `GetStorage` operation.
          18  +
/// /* CodegenDelegator.kt:51 */Types for the `GetStorage` operation.
   19     19   
pub mod get_storage;
   20     20   
   21         -
/// Types for the `StreamPokemonRadio` operation.
          21  +
/// /* CodegenDelegator.kt:51 */Types for the `StreamPokemonRadio` operation.
   22     22   
pub mod stream_pokemon_radio;

tmp-codegen-diff/codegen-client-test/pokemon-service-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
@@ -198,211 +410,603 @@
  218    231   
                signer,
  219    232   
            )))
  220    233   
        });
  221    234   
        if let Some(content_length) = body.content_length() {
  222    235   
            let content_length = content_length.to_string();
  223    236   
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
  224    237   
        }
  225    238   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  226    239   
    }
  227    240   
}
         241  +
/* EndpointParamsInterceptorGenerator.kt:86 */
  228    242   
#[derive(Debug)]
  229    243   
struct CapturePokemonEndpointParamsInterceptor;
  230    244   
  231    245   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CapturePokemonEndpointParamsInterceptor {
  232    246   
    fn name(&self) -> &'static str {
  233    247   
        "CapturePokemonEndpointParamsInterceptor"
  234    248   
    }
  235    249   
  236    250   
    fn read_before_execution(
  237    251   
        &self,
  238    252   
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
  239    253   
            '_,
  240    254   
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
  241    255   
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
  242    256   
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
  243    257   
        >,
  244    258   
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  245    259   
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
  246    260   
        let _input = context
  247    261   
            .input()
  248    262   
            .downcast_ref::<CapturePokemonInput>()
  249    263   
            .ok_or("failed to downcast to CapturePokemonInput")?;
  250    264   
  251    265   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  252    266   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  253    267   
        })?;
  254    268   
        cfg.interceptor_state()
  255    269   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  256    270   
        ::std::result::Result::Ok(())
  257    271   
    }
  258    272   
}
  259    273   
  260    274   
// The get_* functions below are generated from JMESPath expressions in the
  261    275   
// operationContextParams trait. They target the operation's input shape.
  262    276   
         277  +
/* OperationErrorGenerator.kt:79 */
  263    278   
/// Error type for the `CapturePokemonError` operation.
         279  +
/* RustType.kt:516 */
  264    280   
#[non_exhaustive]
         281  +
/* RustType.kt:516 */
  265    282   
#[derive(::std::fmt::Debug)]
  266         -
pub enum CapturePokemonError {
  267         -
    /// 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.
         283  +
pub /* OperationErrorGenerator.kt:81 */ enum CapturePokemonError {
         284  +
    /// /* 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.
         285  +
    /* OperationErrorGenerator.kt:86 */
  268    286   
    ValidationError(crate::types::error::ValidationError),
         287  +
    /* OperationErrorGenerator.kt:83 */
  269    288   
    #[allow(missing_docs)] // documentation missing in model
         289  +
    /* OperationErrorGenerator.kt:86 */
  270    290   
    MasterBallUnsuccessful(crate::types::error::MasterBallUnsuccessful),
         291  +
    /* OperationErrorGenerator.kt:83 */
  271    292   
    #[allow(missing_docs)] // documentation missing in model
         293  +
    /* OperationErrorGenerator.kt:86 */
  272    294   
    InvalidPokeballError(crate::types::error::InvalidPokeballError),
         295  +
    /* OperationErrorGenerator.kt:83 */
  273    296   
    #[allow(missing_docs)] // documentation missing in model
         297  +
    /* OperationErrorGenerator.kt:86 */
  274    298   
    ThrottlingError(crate::types::error::ThrottlingError),
         299  +
    /* OperationErrorGenerator.kt:83 */
  275    300   
    #[allow(missing_docs)] // documentation missing in model
         301  +
    /* OperationErrorGenerator.kt:86 */
  276    302   
    UnsupportedRegionError(crate::types::error::UnsupportedRegionError),
         303  +
    /* OperationErrorGenerator.kt:88 */
  277    304   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  278    305   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  279    306   
    variable wildcard pattern and check `.code()`:
  280    307   
     \
  281    308   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  282    309   
     \
  283    310   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CapturePokemonError) for what information is available for the error.")]
  284    311   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         312  +
    /* OperationErrorGenerator.kt:81 */
  285    313   
}
         314  +
/* OperationErrorGenerator.kt:218 */
  286    315   
impl CapturePokemonError {
         316  +
    /* OperationErrorGenerator.kt:219 */
  287    317   
    /// Creates the `CapturePokemonError::Unhandled` variant from any error type.
  288    318   
    pub fn unhandled(
  289    319   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  290    320   
    ) -> Self {
  291    321   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  292    322   
            source: err.into(),
  293    323   
            meta: ::std::default::Default::default(),
  294    324   
        })
  295    325   
    }
  296    326   
  297    327   
    /// Creates the `CapturePokemonError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  298    328   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  299    329   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  300    330   
            source: err.clone().into(),
  301    331   
            meta: err,
  302    332   
        })
  303    333   
    }
  304         -
    ///
         334  +
    /// /* OperationErrorGenerator.kt:236 */
  305    335   
    /// Returns error metadata, which includes the error code, message,
  306    336   
    /// request ID, and potentially additional information.
  307    337   
    ///
         338  +
    /* OperationErrorGenerator.kt:242 */
  308    339   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         340  +
        /* OperationErrorGenerator.kt:243 */
  309    341   
        match self {
  310         -
            Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         342  +
            /* OperationErrorGenerator.kt:246 */ Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         343  +
            /* OperationErrorGenerator.kt:246 */
  311    344   
            Self::MasterBallUnsuccessful(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         345  +
            /* OperationErrorGenerator.kt:246 */
  312    346   
            Self::InvalidPokeballError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  313         -
            Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         347  +
            /* OperationErrorGenerator.kt:246 */ Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         348  +
            /* OperationErrorGenerator.kt:246 */
  314    349   
            Self::UnsupportedRegionError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  315         -
            Self::Unhandled(e) => &e.meta,
         350  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         351  +
            /* OperationErrorGenerator.kt:243 */
  316    352   
        }
         353  +
        /* OperationErrorGenerator.kt:242 */
  317    354   
    }
         355  +
    /* OperationErrorGenerator.kt:257 */
  318    356   
    /// Returns `true` if the error kind is `CapturePokemonError::ValidationError`.
         357  +
    /* OperationErrorGenerator.kt:258 */
  319    358   
    pub fn is_validation_error(&self) -> bool {
         359  +
        /* OperationErrorGenerator.kt:259 */
  320    360   
        matches!(self, Self::ValidationError(_))
         361  +
        /* OperationErrorGenerator.kt:258 */
  321    362   
    }
         363  +
    /* OperationErrorGenerator.kt:257 */
  322    364   
    /// Returns `true` if the error kind is `CapturePokemonError::MasterBallUnsuccessful`.
         365  +
    /* OperationErrorGenerator.kt:258 */
  323    366   
    pub fn is_master_ball_unsuccessful(&self) -> bool {
         367  +
        /* OperationErrorGenerator.kt:259 */
  324    368   
        matches!(self, Self::MasterBallUnsuccessful(_))
         369  +
        /* OperationErrorGenerator.kt:258 */
  325    370   
    }
         371  +
    /* OperationErrorGenerator.kt:257 */
  326    372   
    /// Returns `true` if the error kind is `CapturePokemonError::InvalidPokeballError`.
         373  +
    /* OperationErrorGenerator.kt:258 */
  327    374   
    pub fn is_invalid_pokeball_error(&self) -> bool {
         375  +
        /* OperationErrorGenerator.kt:259 */
  328    376   
        matches!(self, Self::InvalidPokeballError(_))
         377  +
        /* OperationErrorGenerator.kt:258 */
  329    378   
    }
         379  +
    /* OperationErrorGenerator.kt:257 */
  330    380   
    /// Returns `true` if the error kind is `CapturePokemonError::ThrottlingError`.
         381  +
    /* OperationErrorGenerator.kt:258 */
  331    382   
    pub fn is_throttling_error(&self) -> bool {
         383  +
        /* OperationErrorGenerator.kt:259 */
  332    384   
        matches!(self, Self::ThrottlingError(_))
         385  +
        /* OperationErrorGenerator.kt:258 */
  333    386   
    }
         387  +
    /* OperationErrorGenerator.kt:257 */
  334    388   
    /// Returns `true` if the error kind is `CapturePokemonError::UnsupportedRegionError`.
         389  +
    /* OperationErrorGenerator.kt:258 */
  335    390   
    pub fn is_unsupported_region_error(&self) -> bool {
         391  +
        /* OperationErrorGenerator.kt:259 */
  336    392   
        matches!(self, Self::UnsupportedRegionError(_))
         393  +
        /* OperationErrorGenerator.kt:258 */
  337    394   
    }
         395  +
    /* OperationErrorGenerator.kt:218 */
  338    396   
}
         397  +
/* OperationErrorGenerator.kt:269 */
  339    398   
impl ::std::error::Error for CapturePokemonError {
         399  +
    /* OperationErrorGenerator.kt:270 */
  340    400   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         401  +
        /* OperationErrorGenerator.kt:318 */
  341    402   
        match self {
  342         -
            Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
  343         -
            Self::MasterBallUnsuccessful(_inner) => ::std::option::Option::Some(_inner),
  344         -
            Self::InvalidPokeballError(_inner) => ::std::option::Option::Some(_inner),
  345         -
            Self::ThrottlingError(_inner) => ::std::option::Option::Some(_inner),
  346         -
            Self::UnsupportedRegionError(_inner) => ::std::option::Option::Some(_inner),
  347         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         403  +
            /* OperationErrorGenerator.kt:321 */
         404  +
            Self::ValidationError(_inner) =>
         405  +
            /* OperationErrorGenerator.kt:283 */
         406  +
            {
         407  +
                ::std::option::Option::Some(_inner)
         408  +
            }
         409  +
            ,
         410  +
            /* OperationErrorGenerator.kt:321 */
         411  +
            Self::MasterBallUnsuccessful(_inner) =>
         412  +
            /* OperationErrorGenerator.kt:283 */
         413  +
            {
         414  +
                ::std::option::Option::Some(_inner)
         415  +
            }
         416  +
            ,
         417  +
            /* OperationErrorGenerator.kt:321 */
         418  +
            Self::InvalidPokeballError(_inner) =>
         419  +
            /* OperationErrorGenerator.kt:283 */
         420  +
            {
         421  +
                ::std::option::Option::Some(_inner)
         422  +
            }
         423  +
            ,
         424  +
            /* OperationErrorGenerator.kt:321 */
         425  +
            Self::ThrottlingError(_inner) =>
         426  +
            /* OperationErrorGenerator.kt:283 */
         427  +
            {
         428  +
                ::std::option::Option::Some(_inner)
         429  +
            }
         430  +
            ,
         431  +
            /* OperationErrorGenerator.kt:321 */
         432  +
            Self::UnsupportedRegionError(_inner) =>
         433  +
            /* OperationErrorGenerator.kt:283 */
         434  +
            {
         435  +
                ::std::option::Option::Some(_inner)
         436  +
            }
         437  +
            ,
         438  +
            /* OperationErrorGenerator.kt:326 */
         439  +
            Self::Unhandled(_inner) => {
         440  +
                /* OperationErrorGenerator.kt:279 */
         441  +
                ::std::option::Option::Some(&*_inner.source)
         442  +
                /* OperationErrorGenerator.kt:326 */
         443  +
            } /* OperationErrorGenerator.kt:318 */
  348    444   
        }
         445  +
        /* OperationErrorGenerator.kt:270 */
  349    446   
    }
         447  +
    /* OperationErrorGenerator.kt:269 */
  350    448   
}
         449  +
/* OperationErrorGenerator.kt:133 */
  351    450   
impl ::std::fmt::Display for CapturePokemonError {
         451  +
    /* OperationErrorGenerator.kt:134 */
  352    452   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         453  +
        /* OperationErrorGenerator.kt:318 */
  353    454   
        match self {
  354         -
            Self::ValidationError(_inner) => _inner.fmt(f),
  355         -
            Self::MasterBallUnsuccessful(_inner) => _inner.fmt(f),
  356         -
            Self::InvalidPokeballError(_inner) => _inner.fmt(f),
  357         -
            Self::ThrottlingError(_inner) => _inner.fmt(f),
  358         -
            Self::UnsupportedRegionError(_inner) => _inner.fmt(f),
         455  +
            /* OperationErrorGenerator.kt:321 */
         456  +
            Self::ValidationError(_inner) =>
         457  +
            /* OperationErrorGenerator.kt:151 */
         458  +
            {
         459  +
                _inner.fmt(f)
         460  +
            }
         461  +
            ,
         462  +
            /* OperationErrorGenerator.kt:321 */
         463  +
            Self::MasterBallUnsuccessful(_inner) =>
         464  +
            /* OperationErrorGenerator.kt:151 */
         465  +
            {
         466  +
                _inner.fmt(f)
         467  +
            }
         468  +
            ,
         469  +
            /* OperationErrorGenerator.kt:321 */
         470  +
            Self::InvalidPokeballError(_inner) =>
         471  +
            /* OperationErrorGenerator.kt:151 */
         472  +
            {
         473  +
                _inner.fmt(f)
         474  +
            }
         475  +
            ,
         476  +
            /* OperationErrorGenerator.kt:321 */
         477  +
            Self::ThrottlingError(_inner) =>
         478  +
            /* OperationErrorGenerator.kt:151 */
         479  +
            {
         480  +
                _inner.fmt(f)
         481  +
            }
         482  +
            ,
         483  +
            /* OperationErrorGenerator.kt:321 */
         484  +
            Self::UnsupportedRegionError(_inner) =>
         485  +
            /* OperationErrorGenerator.kt:151 */
         486  +
            {
         487  +
                _inner.fmt(f)
         488  +
            }
         489  +
            ,
         490  +
            /* OperationErrorGenerator.kt:326 */
  359    491   
            Self::Unhandled(_inner) => {
         492  +
                /* OperationErrorGenerator.kt:139 */
  360    493   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  361    494   
                    write!(f, "unhandled error ({code})")
  362    495   
                } else {
  363    496   
                    f.write_str("unhandled error")
  364    497   
                }
         498  +
                /* OperationErrorGenerator.kt:326 */
         499  +
            } /* OperationErrorGenerator.kt:318 */
  365    500   
        }
         501  +
        /* OperationErrorGenerator.kt:134 */
  366    502   
    }
  367         -
    }
         503  +
    /* OperationErrorGenerator.kt:133 */
  368    504   
}
         505  +
/* OperationErrorGenerator.kt:182 */
  369    506   
impl ::aws_smithy_types::retry::ProvideErrorKind for CapturePokemonError {
         507  +
    /* OperationErrorGenerator.kt:186 */
  370    508   
    fn code(&self) -> ::std::option::Option<&str> {
         509  +
        /* OperationErrorGenerator.kt:187 */
  371    510   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         511  +
        /* OperationErrorGenerator.kt:186 */
  372    512   
    }
         513  +
    /* OperationErrorGenerator.kt:190 */
  373    514   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         515  +
        /* OperationErrorGenerator.kt:197 */
  374    516   
        ::std::option::Option::None
         517  +
        /* OperationErrorGenerator.kt:190 */
  375    518   
    }
         519  +
    /* OperationErrorGenerator.kt:182 */
  376    520   
}
         521  +
/* OperationErrorGenerator.kt:163 */
  377    522   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CapturePokemonError {
         523  +
    /* OperationErrorGenerator.kt:164 */
  378    524   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         525  +
        /* OperationErrorGenerator.kt:318 */
  379    526   
        match self {
  380         -
            Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  381         -
            Self::MasterBallUnsuccessful(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  382         -
            Self::InvalidPokeballError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  383         -
            Self::ThrottlingError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  384         -
            Self::UnsupportedRegionError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  385         -
            Self::Unhandled(_inner) => &_inner.meta,
         527  +
            /* OperationErrorGenerator.kt:321 */
         528  +
            Self::ValidationError(_inner) =>
         529  +
            /* OperationErrorGenerator.kt:169 */
         530  +
            {
         531  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         532  +
            }
         533  +
            ,
         534  +
            /* OperationErrorGenerator.kt:321 */
         535  +
            Self::MasterBallUnsuccessful(_inner) =>
         536  +
            /* OperationErrorGenerator.kt:169 */
         537  +
            {
         538  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         539  +
            }
         540  +
            ,
         541  +
            /* OperationErrorGenerator.kt:321 */
         542  +
            Self::InvalidPokeballError(_inner) =>
         543  +
            /* OperationErrorGenerator.kt:169 */
         544  +
            {
         545  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         546  +
            }
         547  +
            ,
         548  +
            /* OperationErrorGenerator.kt:321 */
         549  +
            Self::ThrottlingError(_inner) =>
         550  +
            /* OperationErrorGenerator.kt:169 */
         551  +
            {
         552  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         553  +
            }
         554  +
            ,
         555  +
            /* OperationErrorGenerator.kt:321 */
         556  +
            Self::UnsupportedRegionError(_inner) =>
         557  +
            /* OperationErrorGenerator.kt:169 */
         558  +
            {
         559  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         560  +
            }
         561  +
            ,
         562  +
            /* OperationErrorGenerator.kt:326 */
         563  +
            Self::Unhandled(_inner) => {
         564  +
                /* OperationErrorGenerator.kt:168 */
         565  +
                &_inner.meta
         566  +
                /* OperationErrorGenerator.kt:326 */
         567  +
            } /* OperationErrorGenerator.kt:318 */
  386    568   
        }
         569  +
        /* OperationErrorGenerator.kt:164 */
  387    570   
    }
         571  +
    /* OperationErrorGenerator.kt:163 */
  388    572   
}
         573  +
/* OperationErrorGenerator.kt:109 */
  389    574   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CapturePokemonError {
         575  +
    /* OperationErrorGenerator.kt:110 */
  390    576   
    fn create_unhandled_error(
  391    577   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  392    578   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  393    579   
    ) -> Self {
         580  +
        /* OperationErrorGenerator.kt:121 */
  394    581   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  395    582   
            source,
  396    583   
            meta: meta.unwrap_or_default(),
  397    584   
        })
         585  +
        /* OperationErrorGenerator.kt:110 */
  398    586   
    }
         587  +
    /* OperationErrorGenerator.kt:109 */
  399    588   
}
  400    589   
         590  +
/* CodegenDelegator.kt:255 */
  401    591   
pub use crate::operation::capture_pokemon::_capture_pokemon_output::CapturePokemonOutput;
  402    592   
         593  +
/* CodegenDelegator.kt:255 */
  403    594   
pub use crate::operation::capture_pokemon::_capture_pokemon_input::CapturePokemonInput;
  404    595   
         596  +
/* RustModule.kt:172 */
  405    597   
mod _capture_pokemon_input;
  406    598   
         599  +
/* RustModule.kt:172 */
  407    600   
mod _capture_pokemon_output;
  408    601   
  409         -
/// Builders
         602  +
/// /* CodegenDelegator.kt:51 */Builders
  410    603   
pub mod builders;