Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +32,55 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_validation_exception_field_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::ValidationExceptionField>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
   23         -
                    }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   24     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   25     40   
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
            "expected start array or null",
   30         -
        )),
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
                "expected start array or null",
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

@@ -1,1 +88,97 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ErrorCorrection.kt:126 */
    2      3   
pub(crate) fn validation_exception_correct_errors(
    3      4   
    mut builder: crate::types::error::builders::ValidationErrorBuilder,
    4      5   
) -> crate::types::error::builders::ValidationErrorBuilder {
    5      6   
    if builder.message.is_none() {
    6      7   
        builder.message = Some(Default::default())
    7      8   
    }
    8      9   
    builder
    9     10   
}
   10     11   
          12  +
/* ErrorCorrection.kt:126 */
   11     13   
pub(crate) fn invalid_pokeball_error_correct_errors(
   12     14   
    mut builder: crate::types::error::builders::InvalidPokeballErrorBuilder,
   13     15   
) -> crate::types::error::builders::InvalidPokeballErrorBuilder {
   14     16   
    if builder.pokeball.is_none() {
   15     17   
        builder.pokeball = Some(Default::default())
   16     18   
    }
   17     19   
    builder
   18     20   
}
   19     21   
          22  +
/* ErrorCorrection.kt:126 */
   20     23   
pub(crate) fn unsupported_region_error_correct_errors(
   21     24   
    mut builder: crate::types::error::builders::UnsupportedRegionErrorBuilder,
   22     25   
) -> crate::types::error::builders::UnsupportedRegionErrorBuilder {
   23     26   
    if builder.region.is_none() {
   24     27   
        builder.region = Some(Default::default())
   25     28   
    }
   26     29   
    builder
   27     30   
}
   28     31   
          32  +
/* ErrorCorrection.kt:126 */
   29     33   
pub(crate) fn resource_not_found_exception_correct_errors(
   30     34   
    mut builder: crate::types::error::builders::ResourceNotFoundErrorBuilder,
   31     35   
) -> crate::types::error::builders::ResourceNotFoundErrorBuilder {
   32     36   
    if builder.message.is_none() {
   33     37   
        builder.message = Some(Default::default())
   34     38   
    }
   35     39   
    builder
   36     40   
}
   37     41   
          42  +
/* ErrorCorrection.kt:126 */
   38     43   
pub(crate) fn get_pokemon_species_output_output_correct_errors(
   39     44   
    mut builder: crate::operation::get_pokemon_species::builders::GetPokemonSpeciesOutputBuilder,
   40     45   
) -> crate::operation::get_pokemon_species::builders::GetPokemonSpeciesOutputBuilder {
   41     46   
    if builder.name.is_none() {
   42     47   
        builder.name = Some(Default::default())
   43     48   
    }
   44     49   
    if builder.flavor_text_entries.is_none() {
   45     50   
        builder.flavor_text_entries = Some(Default::default())
   46     51   
    }
   47     52   
    builder
   48     53   
}
   49     54   
          55  +
/* ErrorCorrection.kt:126 */
   50     56   
pub(crate) fn get_server_statistics_output_output_correct_errors(
   51     57   
    mut builder: crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder,
   52     58   
) -> crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder {
   53     59   
    if builder.calls_count.is_none() {
   54     60   
        builder.calls_count = Some(Default::default())
   55     61   
    }
   56     62   
    builder
   57     63   
}
   58     64   
          65  +
/* ErrorCorrection.kt:126 */
   59     66   
pub(crate) fn get_storage_output_output_correct_errors(
   60     67   
    mut builder: crate::operation::get_storage::builders::GetStorageOutputBuilder,
   61     68   
) -> crate::operation::get_storage::builders::GetStorageOutputBuilder {
   62     69   
    if builder.collection.is_none() {
   63     70   
        builder.collection = Some(Default::default())
   64     71   
    }
   65     72   
    builder
   66     73   
}
   67     74   
          75  +
/* ErrorCorrection.kt:126 */
   68     76   
pub(crate) fn flavor_text_correct_errors(mut builder: crate::types::builders::FlavorTextBuilder) -> crate::types::builders::FlavorTextBuilder {
   69     77   
    if builder.flavor_text.is_none() {
   70     78   
        builder.flavor_text = Some(Default::default())
   71     79   
    }
   72     80   
    if builder.language.is_none() {
   73     81   
        builder.language = "no value was set".parse::<crate::types::Language>().ok()
   74     82   
    }
   75     83   
    builder
   76     84   
}
   77     85   
          86  +
/* ErrorCorrection.kt:126 */
   78     87   
pub(crate) fn validation_exception_field_correct_errors(
   79     88   
    mut builder: crate::types::builders::ValidationExceptionFieldBuilder,
   80     89   
) -> crate::types::builders::ValidationExceptionFieldBuilder {
   81     90   
    if builder.path.is_none() {
   82     91   
        builder.path = Some(Default::default())
   83     92   
    }
   84     93   
    if builder.message.is_none() {
   85     94   
        builder.message = Some(Default::default())
   86     95   
    }
   87     96   
    builder

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

@@ -1,1 +38,54 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_validation_exception_field::ValidationExceptionField;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_flavor_text::FlavorText;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_language::Language;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_capture_pokemon_events::CapturePokemonEvents;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_capture_event::CaptureEvent;
   11     16   
          17  +
/* CodegenDelegator.kt:255 */
   12     18   
pub use crate::types::_attempt_capturing_pokemon_event::AttemptCapturingPokemonEvent;
   13     19   
          20  +
/* CodegenDelegator.kt:255 */
   14     21   
pub use crate::types::_capturing_event::CapturingEvent;
   15     22   
          23  +
/* CodegenDelegator.kt:255 */
   16     24   
pub use crate::types::_capturing_payload::CapturingPayload;
   17     25   
          26  +
/* RustModule.kt:172 */
   18     27   
mod _attempt_capturing_pokemon_event;
   19     28   
          29  +
/* RustModule.kt:172 */
   20     30   
mod _capture_event;
   21     31   
          32  +
/* RustModule.kt:172 */
   22     33   
mod _capture_pokemon_events;
   23     34   
          35  +
/* RustModule.kt:172 */
   24     36   
mod _capturing_event;
   25     37   
          38  +
/* RustModule.kt:172 */
   26     39   
mod _capturing_payload;
   27     40   
          41  +
/* RustModule.kt:172 */
   28     42   
mod _flavor_text;
   29     43   
          44  +
/* RustModule.kt:172 */
   30     45   
mod _language;
   31     46   
          47  +
/* RustModule.kt:172 */
   32     48   
mod _validation_exception_field;
   33     49   
   34         -
/// Builders
          50  +
/// /* CodegenDelegator.kt:51 */Builders
   35     51   
pub mod builders;
   36     52   
   37         -
/// Error types that Pokémon Service can respond with.
          53  +
/// /* ClientRustModule.kt:121 */Error types that Pokémon Service can respond with.
   38     54   
pub mod error;

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

@@ -1,1 +37,67 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* UnionGenerator.kt:67 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub enum AttemptCapturingPokemonEvent {
           8  +
pub /* UnionGenerator.kt:85 */ enum AttemptCapturingPokemonEvent {
           9  +
    /* UnionGenerator.kt:90 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
          11  +
    /* UnionGenerator.kt:190 */
    7     12   
    Event(crate::types::CapturingEvent),
    8         -
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          13  +
    /// /* UnionGenerator.kt:96 */The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          14  +
    /* UnionGenerator.kt:97 */
    9     15   
    /// An unknown enum variant
          16  +
    /* UnionGenerator.kt:98 */
   10     17   
    ///
          18  +
    /* UnionGenerator.kt:99 */
   11     19   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
          20  +
    /* UnionGenerator.kt:100 */
   12     21   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
          22  +
    /* UnionGenerator.kt:101 */
   13     23   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
          24  +
    /* UnionGenerator.kt:102 */
   14     25   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
          26  +
    /* RustType.kt:516 */
   15     27   
    #[non_exhaustive]
          28  +
    /* UnionGenerator.kt:105 */
   16     29   
    Unknown,
          30  +
    /* UnionGenerator.kt:85 */
   17     31   
}
          32  +
/* UnionGenerator.kt:111 */
   18     33   
impl AttemptCapturingPokemonEvent {
          34  +
    /* RustType.kt:516 */
   19     35   
    #[allow(irrefutable_let_patterns)]
          36  +
    /* UnionGenerator.kt:217 */
   20     37   
    /// Tries to convert the enum instance into [`Event`](crate::types::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::types::CapturingEvent).
          38  +
    /* UnionGenerator.kt:222 */
   21     39   
    /// Returns `Err(&Self)` if it can't be converted.
          40  +
    /* UnionGenerator.kt:223 */
   22     41   
    pub fn as_event(&self) -> ::std::result::Result<&crate::types::CapturingEvent, &Self> {
          42  +
        /* UnionGenerator.kt:227 */
   23     43   
        if let AttemptCapturingPokemonEvent::Event(val) = &self {
   24     44   
            ::std::result::Result::Ok(val)
   25     45   
        } else {
   26     46   
            ::std::result::Result::Err(self)
   27     47   
        }
          48  +
        /* UnionGenerator.kt:223 */
   28     49   
    }
          50  +
    /* UnionGenerator.kt:121 */
   29     51   
    /// Returns true if this is a [`Event`](crate::types::AttemptCapturingPokemonEvent::Event).
          52  +
    /* UnionGenerator.kt:122 */
   30     53   
    pub fn is_event(&self) -> bool {
          54  +
        /* UnionGenerator.kt:123 */
   31     55   
        self.as_event().is_ok()
          56  +
        /* UnionGenerator.kt:122 */
   32     57   
    }
          58  +
    /* UnionGenerator.kt:127 */
   33     59   
    /// Returns true if the enum instance is the `Unknown` variant.
          60  +
    /* UnionGenerator.kt:128 */
   34     61   
    pub fn is_unknown(&self) -> bool {
          62  +
        /* UnionGenerator.kt:129 */
   35     63   
        matches!(self, Self::Unknown)
          64  +
        /* UnionGenerator.kt:128 */
   36     65   
    }
          66  +
    /* UnionGenerator.kt:111 */
   37     67   
}

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

@@ -1,1 +115,210 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct CaptureEvent {
           8  +
pub /* StructureGenerator.kt:201 */ struct CaptureEvent {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub name: ::std::option::Option<::std::string::String>,
    8         -
    #[allow(missing_docs)] // documentation missing in model
          12  +
    /* StructureGenerator.kt:231 */ #[allow(missing_docs)] // documentation missing in model
    9     13   
    pub captured: ::std::option::Option<bool>,
   10         -
    #[allow(missing_docs)] // documentation missing in model
          14  +
    /* StructureGenerator.kt:231 */ #[allow(missing_docs)] // documentation missing in model
   11     15   
    pub shiny: ::std::option::Option<bool>,
          16  +
    /* StructureGenerator.kt:231 */
   12     17   
    #[allow(missing_docs)] // documentation missing in model
   13     18   
    pub pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
          19  +
    /* StructureGenerator.kt:201 */
   14     20   
}
          21  +
/* StructureGenerator.kt:135 */
   15     22   
impl CaptureEvent {
          23  +
    /* StructureGenerator.kt:231 */
   16     24   
    #[allow(missing_docs)] // documentation missing in model
          25  +
                           /* StructureGenerator.kt:166 */
   17     26   
    pub fn name(&self) -> ::std::option::Option<&str> {
          27  +
        /* StructureGenerator.kt:169 */
   18     28   
        self.name.as_deref()
          29  +
        /* StructureGenerator.kt:166 */
   19     30   
    }
          31  +
    /* StructureGenerator.kt:231 */
   20     32   
    #[allow(missing_docs)] // documentation missing in model
          33  +
                           /* StructureGenerator.kt:166 */
   21     34   
    pub fn captured(&self) -> ::std::option::Option<bool> {
          35  +
        /* StructureGenerator.kt:168 */
   22     36   
        self.captured
          37  +
        /* StructureGenerator.kt:166 */
   23     38   
    }
          39  +
    /* StructureGenerator.kt:231 */
   24     40   
    #[allow(missing_docs)] // documentation missing in model
          41  +
                           /* StructureGenerator.kt:166 */
   25     42   
    pub fn shiny(&self) -> ::std::option::Option<bool> {
          43  +
        /* StructureGenerator.kt:168 */
   26     44   
        self.shiny
          45  +
        /* StructureGenerator.kt:166 */
   27     46   
    }
          47  +
    /* StructureGenerator.kt:231 */
   28     48   
    #[allow(missing_docs)] // documentation missing in model
          49  +
                           /* StructureGenerator.kt:166 */
   29     50   
    pub fn pokedex_update(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
          51  +
        /* StructureGenerator.kt:170 */
   30     52   
        self.pokedex_update.as_ref()
          53  +
        /* StructureGenerator.kt:166 */
   31     54   
    }
          55  +
    /* StructureGenerator.kt:135 */
   32     56   
}
          57  +
/* ClientCodegenVisitor.kt:237 */
   33     58   
impl CaptureEvent {
   34         -
    /// Creates a new builder-style object to manufacture [`CaptureEvent`](crate::types::CaptureEvent).
          59  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CaptureEvent`](crate::types::CaptureEvent).
          60  +
    /* BuilderGenerator.kt:175 */
   35     61   
    pub fn builder() -> crate::types::builders::CaptureEventBuilder {
          62  +
        /* BuilderGenerator.kt:176 */
   36     63   
        crate::types::builders::CaptureEventBuilder::default()
          64  +
        /* BuilderGenerator.kt:175 */
   37     65   
    }
          66  +
    /* ClientCodegenVisitor.kt:237 */
   38     67   
}
   39     68   
   40         -
/// A builder for [`CaptureEvent`](crate::types::CaptureEvent).
          69  +
/// /* BuilderGenerator.kt:342 */A builder for [`CaptureEvent`](crate::types::CaptureEvent).
          70  +
/* RustType.kt:516 */
   41     71   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          72  +
/* RustType.kt:516 */
   42     73   
#[non_exhaustive]
          74  +
/* BuilderGenerator.kt:345 */
   43     75   
pub struct CaptureEventBuilder {
   44         -
    pub(crate) name: ::std::option::Option<::std::string::String>,
   45         -
    pub(crate) captured: ::std::option::Option<bool>,
   46         -
    pub(crate) shiny: ::std::option::Option<bool>,
          76  +
    /* BuilderGenerator.kt:275 */ pub(crate) name: ::std::option::Option<::std::string::String>,
          77  +
    /* BuilderGenerator.kt:275 */ pub(crate) captured: ::std::option::Option<bool>,
          78  +
    /* BuilderGenerator.kt:275 */ pub(crate) shiny: ::std::option::Option<bool>,
          79  +
    /* BuilderGenerator.kt:275 */
   47     80   
    pub(crate) pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
          81  +
    /* BuilderGenerator.kt:345 */
   48     82   
}
          83  +
/* BuilderGenerator.kt:355 */
   49     84   
impl CaptureEventBuilder {
          85  +
    /* BuilderGenerator.kt:286 */
   50     86   
    #[allow(missing_docs)] // documentation missing in model
          87  +
                           /* BuilderGenerator.kt:291 */
   51     88   
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          89  +
        /* BuilderGenerator.kt:292 */
   52     90   
        self.name = ::std::option::Option::Some(input.into());
          91  +
        /* BuilderGenerator.kt:293 */
   53     92   
        self
          93  +
        /* BuilderGenerator.kt:291 */
   54     94   
    }
          95  +
    /* BuilderGenerator.kt:312 */
   55     96   
    #[allow(missing_docs)] // documentation missing in model
          97  +
                           /* BuilderGenerator.kt:314 */
   56     98   
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          99  +
        /* BuilderGenerator.kt:315 */
   57    100   
        self.name = input;
   58    101   
        self
         102  +
        /* BuilderGenerator.kt:314 */
   59    103   
    }
         104  +
    /* BuilderGenerator.kt:334 */
   60    105   
    #[allow(missing_docs)] // documentation missing in model
         106  +
                           /* BuilderGenerator.kt:336 */
   61    107   
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         108  +
        /* BuilderGenerator.kt:337 */
   62    109   
        &self.name
         110  +
        /* BuilderGenerator.kt:336 */
   63    111   
    }
         112  +
    /* BuilderGenerator.kt:286 */
   64    113   
    #[allow(missing_docs)] // documentation missing in model
         114  +
                           /* BuilderGenerator.kt:291 */
   65    115   
    pub fn captured(mut self, input: bool) -> Self {
         116  +
        /* BuilderGenerator.kt:292 */
   66    117   
        self.captured = ::std::option::Option::Some(input);
         118  +
        /* BuilderGenerator.kt:293 */
   67    119   
        self
         120  +
        /* BuilderGenerator.kt:291 */
   68    121   
    }
         122  +
    /* BuilderGenerator.kt:312 */
   69    123   
    #[allow(missing_docs)] // documentation missing in model
         124  +
                           /* BuilderGenerator.kt:314 */
   70    125   
    pub fn set_captured(mut self, input: ::std::option::Option<bool>) -> Self {
         126  +
        /* BuilderGenerator.kt:315 */
   71    127   
        self.captured = input;
   72    128   
        self
         129  +
        /* BuilderGenerator.kt:314 */
   73    130   
    }
         131  +
    /* BuilderGenerator.kt:334 */
   74    132   
    #[allow(missing_docs)] // documentation missing in model
         133  +
                           /* BuilderGenerator.kt:336 */
   75    134   
    pub fn get_captured(&self) -> &::std::option::Option<bool> {
         135  +
        /* BuilderGenerator.kt:337 */
   76    136   
        &self.captured
         137  +
        /* BuilderGenerator.kt:336 */
   77    138   
    }
         139  +
    /* BuilderGenerator.kt:286 */
   78    140   
    #[allow(missing_docs)] // documentation missing in model
         141  +
                           /* BuilderGenerator.kt:291 */
   79    142   
    pub fn shiny(mut self, input: bool) -> Self {
         143  +
        /* BuilderGenerator.kt:292 */
   80    144   
        self.shiny = ::std::option::Option::Some(input);
         145  +
        /* BuilderGenerator.kt:293 */
   81    146   
        self
         147  +
        /* BuilderGenerator.kt:291 */
   82    148   
    }
         149  +
    /* BuilderGenerator.kt:312 */
   83    150   
    #[allow(missing_docs)] // documentation missing in model
         151  +
                           /* BuilderGenerator.kt:314 */
   84    152   
    pub fn set_shiny(mut self, input: ::std::option::Option<bool>) -> Self {
         153  +
        /* BuilderGenerator.kt:315 */
   85    154   
        self.shiny = input;
   86    155   
        self
         156  +
        /* BuilderGenerator.kt:314 */
   87    157   
    }
         158  +
    /* BuilderGenerator.kt:334 */
   88    159   
    #[allow(missing_docs)] // documentation missing in model
         160  +
                           /* BuilderGenerator.kt:336 */
   89    161   
    pub fn get_shiny(&self) -> &::std::option::Option<bool> {
         162  +
        /* BuilderGenerator.kt:337 */
   90    163   
        &self.shiny
         164  +
        /* BuilderGenerator.kt:336 */
   91    165   
    }
         166  +
    /* BuilderGenerator.kt:286 */
   92    167   
    #[allow(missing_docs)] // documentation missing in model
         168  +
                           /* BuilderGenerator.kt:291 */
   93    169   
    pub fn pokedex_update(mut self, input: ::aws_smithy_types::Blob) -> Self {
         170  +
        /* BuilderGenerator.kt:292 */
   94    171   
        self.pokedex_update = ::std::option::Option::Some(input);
         172  +
        /* BuilderGenerator.kt:293 */
   95    173   
        self
         174  +
        /* BuilderGenerator.kt:291 */
   96    175   
    }
         176  +
    /* BuilderGenerator.kt:312 */
   97    177   
    #[allow(missing_docs)] // documentation missing in model
         178  +
                           /* BuilderGenerator.kt:314 */
   98    179   
    pub fn set_pokedex_update(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
         180  +
        /* BuilderGenerator.kt:315 */
   99    181   
        self.pokedex_update = input;
  100    182   
        self
         183  +
        /* BuilderGenerator.kt:314 */
  101    184   
    }
         185  +
    /* BuilderGenerator.kt:334 */
  102    186   
    #[allow(missing_docs)] // documentation missing in model
         187  +
                           /* BuilderGenerator.kt:336 */
  103    188   
    pub fn get_pokedex_update(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
         189  +
        /* BuilderGenerator.kt:337 */
  104    190   
        &self.pokedex_update
         191  +
        /* BuilderGenerator.kt:336 */
  105    192   
    }
  106         -
    /// Consumes the builder and constructs a [`CaptureEvent`](crate::types::CaptureEvent).
         193  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CaptureEvent`](crate::types::CaptureEvent).
         194  +
    /* BuilderGenerator.kt:253 */
  107    195   
    pub fn build(self) -> crate::types::CaptureEvent {
         196  +
        /* BuilderGenerator.kt:477 */
  108    197   
        crate::types::CaptureEvent {
  109         -
            name: self.name,
         198  +
            /* BuilderGenerator.kt:481 */ name: self.name,
         199  +
            /* BuilderGenerator.kt:481 */
  110    200   
            captured: self.captured,
         201  +
            /* BuilderGenerator.kt:481 */
  111    202   
            shiny: self.shiny,
         203  +
            /* BuilderGenerator.kt:481 */
  112    204   
            pokedex_update: self.pokedex_update,
         205  +
            /* BuilderGenerator.kt:477 */
  113    206   
        }
         207  +
        /* BuilderGenerator.kt:253 */
  114    208   
    }
         209  +
    /* BuilderGenerator.kt:355 */
  115    210   
}

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

@@ -1,1 +37,67 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* UnionGenerator.kt:67 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub enum CapturePokemonEvents {
           8  +
pub /* UnionGenerator.kt:85 */ enum CapturePokemonEvents {
           9  +
    /* UnionGenerator.kt:90 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
          11  +
    /* UnionGenerator.kt:190 */
    7     12   
    Event(crate::types::CaptureEvent),
    8         -
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          13  +
    /// /* UnionGenerator.kt:96 */The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          14  +
    /* UnionGenerator.kt:97 */
    9     15   
    /// An unknown enum variant
          16  +
    /* UnionGenerator.kt:98 */
   10     17   
    ///
          18  +
    /* UnionGenerator.kt:99 */
   11     19   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
          20  +
    /* UnionGenerator.kt:100 */
   12     21   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
          22  +
    /* UnionGenerator.kt:101 */
   13     23   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
          24  +
    /* UnionGenerator.kt:102 */
   14     25   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
          26  +
    /* RustType.kt:516 */
   15     27   
    #[non_exhaustive]
          28  +
    /* UnionGenerator.kt:105 */
   16     29   
    Unknown,
          30  +
    /* UnionGenerator.kt:85 */
   17     31   
}
          32  +
/* UnionGenerator.kt:111 */
   18     33   
impl CapturePokemonEvents {
          34  +
    /* RustType.kt:516 */
   19     35   
    #[allow(irrefutable_let_patterns)]
          36  +
    /* UnionGenerator.kt:217 */
   20     37   
    /// Tries to convert the enum instance into [`Event`](crate::types::CapturePokemonEvents::Event), extracting the inner [`CaptureEvent`](crate::types::CaptureEvent).
          38  +
    /* UnionGenerator.kt:222 */
   21     39   
    /// Returns `Err(&Self)` if it can't be converted.
          40  +
    /* UnionGenerator.kt:223 */
   22     41   
    pub fn as_event(&self) -> ::std::result::Result<&crate::types::CaptureEvent, &Self> {
          42  +
        /* UnionGenerator.kt:227 */
   23     43   
        if let CapturePokemonEvents::Event(val) = &self {
   24     44   
            ::std::result::Result::Ok(val)
   25     45   
        } else {
   26     46   
            ::std::result::Result::Err(self)
   27     47   
        }
          48  +
        /* UnionGenerator.kt:223 */
   28     49   
    }
          50  +
    /* UnionGenerator.kt:121 */
   29     51   
    /// Returns true if this is a [`Event`](crate::types::CapturePokemonEvents::Event).
          52  +
    /* UnionGenerator.kt:122 */
   30     53   
    pub fn is_event(&self) -> bool {
          54  +
        /* UnionGenerator.kt:123 */
   31     55   
        self.as_event().is_ok()
          56  +
        /* UnionGenerator.kt:122 */
   32     57   
    }
          58  +
    /* UnionGenerator.kt:127 */
   33     59   
    /// Returns true if the enum instance is the `Unknown` variant.
          60  +
    /* UnionGenerator.kt:128 */
   34     61   
    pub fn is_unknown(&self) -> bool {
          62  +
        /* UnionGenerator.kt:129 */
   35     63   
        matches!(self, Self::Unknown)
          64  +
        /* UnionGenerator.kt:128 */
   36     65   
    }
          66  +
    /* UnionGenerator.kt:111 */
   37     67   
}

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

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct CapturingEvent {
           8  +
pub /* StructureGenerator.kt:201 */ struct CapturingEvent {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub payload: ::std::option::Option<crate::types::CapturingPayload>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl CapturingEvent {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn payload(&self) -> ::std::option::Option<&crate::types::CapturingPayload> {
          20  +
        /* StructureGenerator.kt:170 */
   12     21   
        self.payload.as_ref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl CapturingEvent {
   16         -
    /// Creates a new builder-style object to manufacture [`CapturingEvent`](crate::types::CapturingEvent).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CapturingEvent`](crate::types::CapturingEvent).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::CapturingEventBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::CapturingEventBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`CapturingEvent`](crate::types::CapturingEvent).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`CapturingEvent`](crate::types::CapturingEvent).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct CapturingEventBuilder {
   26         -
    pub(crate) payload: ::std::option::Option<crate::types::CapturingPayload>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) payload: ::std::option::Option<crate::types::CapturingPayload>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl CapturingEventBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn payload(mut self, input: crate::types::CapturingPayload) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.payload = ::std::option::Option::Some(input);
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_payload(mut self, input: ::std::option::Option<crate::types::CapturingPayload>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.payload = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_payload(&self) -> &::std::option::Option<crate::types::CapturingPayload> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.payload
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`CapturingEvent`](crate::types::CapturingEvent).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CapturingEvent`](crate::types::CapturingEvent).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::CapturingEvent {
   45         -
        crate::types::CapturingEvent { payload: self.payload }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::CapturingEvent {
          82  +
            /* BuilderGenerator.kt:481 */ payload: self.payload,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

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

@@ -1,1 +71,129 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct CapturingPayload {
           8  +
pub /* StructureGenerator.kt:201 */ struct CapturingPayload {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub name: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub pokeball: ::std::option::Option<::std::string::String>,
          15  +
    /* StructureGenerator.kt:201 */
   10     16   
}
          17  +
/* StructureGenerator.kt:135 */
   11     18   
impl CapturingPayload {
          19  +
    /* StructureGenerator.kt:231 */
   12     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   13     22   
    pub fn name(&self) -> ::std::option::Option<&str> {
          23  +
        /* StructureGenerator.kt:169 */
   14     24   
        self.name.as_deref()
          25  +
        /* StructureGenerator.kt:166 */
   15     26   
    }
          27  +
    /* StructureGenerator.kt:231 */
   16     28   
    #[allow(missing_docs)] // documentation missing in model
          29  +
                           /* StructureGenerator.kt:166 */
   17     30   
    pub fn pokeball(&self) -> ::std::option::Option<&str> {
          31  +
        /* StructureGenerator.kt:169 */
   18     32   
        self.pokeball.as_deref()
          33  +
        /* StructureGenerator.kt:166 */
   19     34   
    }
          35  +
    /* StructureGenerator.kt:135 */
   20     36   
}
          37  +
/* ClientCodegenVisitor.kt:237 */
   21     38   
impl CapturingPayload {
   22         -
    /// Creates a new builder-style object to manufacture [`CapturingPayload`](crate::types::CapturingPayload).
          39  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CapturingPayload`](crate::types::CapturingPayload).
          40  +
    /* BuilderGenerator.kt:175 */
   23     41   
    pub fn builder() -> crate::types::builders::CapturingPayloadBuilder {
          42  +
        /* BuilderGenerator.kt:176 */
   24     43   
        crate::types::builders::CapturingPayloadBuilder::default()
          44  +
        /* BuilderGenerator.kt:175 */
   25     45   
    }
          46  +
    /* ClientCodegenVisitor.kt:237 */
   26     47   
}
   27     48   
   28         -
/// A builder for [`CapturingPayload`](crate::types::CapturingPayload).
          49  +
/// /* BuilderGenerator.kt:342 */A builder for [`CapturingPayload`](crate::types::CapturingPayload).
          50  +
/* RustType.kt:516 */
   29     51   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          52  +
/* RustType.kt:516 */
   30     53   
#[non_exhaustive]
          54  +
/* BuilderGenerator.kt:345 */
   31     55   
pub struct CapturingPayloadBuilder {
   32         -
    pub(crate) name: ::std::option::Option<::std::string::String>,
   33         -
    pub(crate) pokeball: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:275 */ pub(crate) name: ::std::option::Option<::std::string::String>,
          57  +
    /* BuilderGenerator.kt:275 */ pub(crate) pokeball: ::std::option::Option<::std::string::String>,
          58  +
    /* BuilderGenerator.kt:345 */
   34     59   
}
          60  +
/* BuilderGenerator.kt:355 */
   35     61   
impl CapturingPayloadBuilder {
          62  +
    /* BuilderGenerator.kt:286 */
   36     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
                           /* BuilderGenerator.kt:291 */
   37     65   
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          66  +
        /* BuilderGenerator.kt:292 */
   38     67   
        self.name = ::std::option::Option::Some(input.into());
          68  +
        /* BuilderGenerator.kt:293 */
   39     69   
        self
          70  +
        /* BuilderGenerator.kt:291 */
   40     71   
    }
          72  +
    /* BuilderGenerator.kt:312 */
   41     73   
    #[allow(missing_docs)] // documentation missing in model
          74  +
                           /* BuilderGenerator.kt:314 */
   42     75   
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          76  +
        /* BuilderGenerator.kt:315 */
   43     77   
        self.name = input;
   44     78   
        self
          79  +
        /* BuilderGenerator.kt:314 */
   45     80   
    }
          81  +
    /* BuilderGenerator.kt:334 */
   46     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:336 */
   47     84   
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
          85  +
        /* BuilderGenerator.kt:337 */
   48     86   
        &self.name
          87  +
        /* BuilderGenerator.kt:336 */
   49     88   
    }
          89  +
    /* BuilderGenerator.kt:286 */
   50     90   
    #[allow(missing_docs)] // documentation missing in model
          91  +
                           /* BuilderGenerator.kt:291 */
   51     92   
    pub fn pokeball(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          93  +
        /* BuilderGenerator.kt:292 */
   52     94   
        self.pokeball = ::std::option::Option::Some(input.into());
          95  +
        /* BuilderGenerator.kt:293 */
   53     96   
        self
          97  +
        /* BuilderGenerator.kt:291 */
   54     98   
    }
          99  +
    /* BuilderGenerator.kt:312 */
   55    100   
    #[allow(missing_docs)] // documentation missing in model
         101  +
                           /* BuilderGenerator.kt:314 */
   56    102   
    pub fn set_pokeball(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         103  +
        /* BuilderGenerator.kt:315 */
   57    104   
        self.pokeball = input;
   58    105   
        self
         106  +
        /* BuilderGenerator.kt:314 */
   59    107   
    }
         108  +
    /* BuilderGenerator.kt:334 */
   60    109   
    #[allow(missing_docs)] // documentation missing in model
         110  +
                           /* BuilderGenerator.kt:336 */
   61    111   
    pub fn get_pokeball(&self) -> &::std::option::Option<::std::string::String> {
         112  +
        /* BuilderGenerator.kt:337 */
   62    113   
        &self.pokeball
         114  +
        /* BuilderGenerator.kt:336 */
   63    115   
    }
   64         -
    /// Consumes the builder and constructs a [`CapturingPayload`](crate::types::CapturingPayload).
         116  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CapturingPayload`](crate::types::CapturingPayload).
         117  +
    /* BuilderGenerator.kt:253 */
   65    118   
    pub fn build(self) -> crate::types::CapturingPayload {
         119  +
        /* BuilderGenerator.kt:477 */
   66    120   
        crate::types::CapturingPayload {
   67         -
            name: self.name,
         121  +
            /* BuilderGenerator.kt:481 */ name: self.name,
         122  +
            /* BuilderGenerator.kt:481 */
   68    123   
            pokeball: self.pokeball,
         124  +
            /* BuilderGenerator.kt:477 */
   69    125   
        }
         126  +
        /* BuilderGenerator.kt:253 */
   70    127   
    }
         128  +
    /* BuilderGenerator.kt:355 */
   71    129   
}

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

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

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

@@ -1,1 +120,143 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// When writing a match expression against `Language`, it is important to ensure
           2  +
/* ClientEnumGenerator.kt:234 */
           3  +
/// /* ClientEnumGenerator.kt:234 */When writing a match expression against `Language`, it is important to ensure
    4      4   
/// your code is forward-compatible. That is, if a match arm handles a case for a
    5      5   
/// feature that is supported by the service but has not been represented as an enum
    6      6   
/// variant in a current version of SDK, your code should continue to work when you
    7      7   
/// upgrade SDK to a future version in which the enum does include a variant for that
    8      8   
/// feature.
    9         -
///
   10         -
/// Here is an example of how you can make a match expression forward-compatible:
   11         -
///
   12         -
/// ```text
           9  +
/// /* ClientEnumGenerator.kt:244 */
          10  +
/// /* ClientEnumGenerator.kt:245 */Here is an example of how you can make a match expression forward-compatible:
          11  +
/// /* ClientEnumGenerator.kt:246 */
          12  +
/// /* ClientEnumGenerator.kt:247 */```text
          13  +
/* ClientEnumGenerator.kt:248 */
   13     14   
/// # let language = unimplemented!();
          15  +
/* ClientEnumGenerator.kt:249 */
   14     16   
/// match language {
          17  +
/* ClientEnumGenerator.kt:251 */
   15     18   
///     Language::English => { /* ... */ },
          19  +
/* ClientEnumGenerator.kt:251 */
   16     20   
///     Language::Spanish => { /* ... */ },
          21  +
/* ClientEnumGenerator.kt:251 */
   17     22   
///     Language::Italian => { /* ... */ },
          23  +
/* ClientEnumGenerator.kt:251 */
   18     24   
///     Language::Japanese => { /* ... */ },
          25  +
/* ClientEnumGenerator.kt:253 */
   19     26   
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          27  +
/* ClientEnumGenerator.kt:254 */
   20     28   
///     _ => { /* ... */ },
          29  +
/* ClientEnumGenerator.kt:255 */
   21     30   
/// }
   22         -
/// ```
   23         -
/// The above code demonstrates that when `language` represents
          31  +
/// /* ClientEnumGenerator.kt:256 */```
          32  +
/// /* ClientEnumGenerator.kt:257 */The above code demonstrates that when `language` represents
   24     33   
/// `NewFeature`, the execution path will lead to the second last match arm,
   25     34   
/// even though the enum does not contain a variant `Language::NewFeature`
   26     35   
/// in the current version of SDK. The reason is that the variable `other`,
   27     36   
/// created by the `@` operator, is bound to
   28     37   
/// `Language::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
   29     38   
/// and calling `as_str` on it yields `"NewFeature"`.
   30     39   
/// This match expression is forward-compatible when executed with a newer
   31     40   
/// version of SDK where the variant `Language::NewFeature` is defined.
   32     41   
/// Specifically, when `language` represents `NewFeature`,
   33     42   
/// the execution path will hit the second last match arm as before by virtue of
   34     43   
/// calling `as_str` on `Language::NewFeature` also yielding `"NewFeature"`.
   35         -
///
   36         -
/// Explicitly matching on the `Unknown` variant should
          44  +
/// /* ClientEnumGenerator.kt:273 */
          45  +
/// /* ClientEnumGenerator.kt:274 */Explicitly matching on the `Unknown` variant should
   37     46   
/// be avoided for two reasons:
   38     47   
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
   39     48   
/// - It might inadvertently shadow other intended match arms.
   40         -
///
   41         -
/// Supported languages for FlavorText entries.
          49  +
/// /* ClientEnumGenerator.kt:282 */
          50  +
/// /* EnumGenerator.kt:156 */Supported languages for FlavorText entries.
          51  +
/* RustType.kt:516 */
   42     52   
#[non_exhaustive]
          53  +
/* RustType.kt:516 */
   43     54   
#[derive(
   44     55   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
   45     56   
)]
   46         -
pub enum Language {
   47         -
    /// American English.
          57  +
pub /* EnumGenerator.kt:267 */ enum Language {
          58  +
    /// /* EnumGenerator.kt:156 */American English.
          59  +
    /* EnumGenerator.kt:143 */
   48     60   
    English,
   49         -
    /// Español.
          61  +
    /// /* EnumGenerator.kt:156 */Español.
          62  +
    /* EnumGenerator.kt:143 */
   50     63   
    Spanish,
   51         -
    /// Italiano.
          64  +
    /// /* EnumGenerator.kt:156 */Italiano.
          65  +
    /* EnumGenerator.kt:143 */
   52     66   
    Italian,
   53         -
    /// 日本語。
          67  +
    /// /* EnumGenerator.kt:156 */日本語。
          68  +
    /* EnumGenerator.kt:143 */
   54     69   
    Japanese,
   55         -
    /// `Unknown` contains new variants that have been added since this code was generated.
          70  +
    /// /* ClientEnumGenerator.kt:175 */`Unknown` contains new variants that have been added since this code was generated.
          71  +
    /* ClientEnumGenerator.kt:176 */
   56     72   
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
   57         -
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
          73  +
    /* ClientEnumGenerator.kt:179 */
          74  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), /* EnumGenerator.kt:267 */
   58     75   
}
          76  +
/* ClientEnumGenerator.kt:42 */
   59     77   
impl ::std::convert::From<&str> for Language {
   60     78   
    fn from(s: &str) -> Self {
   61     79   
        match s {
   62     80   
            "en" => Language::English,
   63     81   
            "es" => Language::Spanish,
   64     82   
            "it" => Language::Italian,
   65     83   
            "jp" => Language::Japanese,
   66     84   
            other => Language::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
   67     85   
        }
   68     86   
    }
   69     87   
}
          88  +
/* ClientEnumGenerator.kt:68 */
   70     89   
impl ::std::str::FromStr for Language {
   71     90   
    type Err = ::std::convert::Infallible;
   72     91   
   73     92   
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
   74     93   
        ::std::result::Result::Ok(Language::from(s))
   75     94   
    }
   76     95   
}
          96  +
/* EnumGenerator.kt:274 */
   77     97   
impl Language {
   78     98   
    /// Returns the `&str` value of the enum member.
   79     99   
    pub fn as_str(&self) -> &str {
   80    100   
        match self {
   81    101   
            Language::English => "en",
   82    102   
            Language::Spanish => "es",
   83    103   
            Language::Italian => "it",
   84    104   
            Language::Japanese => "jp",
   85    105   
            Language::Unknown(value) => value.as_str(),
   86    106   
        }
   87    107   
    }
   88    108   
    /// Returns all the `&str` representations of the enum members.
   89    109   
    pub const fn values() -> &'static [&'static str] {
   90    110   
        &["en", "es", "it", "jp"]
   91    111   
    }
   92    112   
}
         113  +
/* EnumGenerator.kt:223 */
   93    114   
impl ::std::convert::AsRef<str> for Language {
   94    115   
    fn as_ref(&self) -> &str {
   95    116   
        self.as_str()
   96    117   
    }
   97    118   
}
         119  +
/* ClientEnumGenerator.kt:117 */
   98    120   
impl Language {
   99    121   
    /// Parses the enum value while disallowing unknown variants.
  100    122   
    ///
  101    123   
    /// Unknown variants will result in an error.
  102    124   
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
  103    125   
        match Self::from(value) {
  104    126   
            #[allow(deprecated)]
  105    127   
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
  106    128   
            known => Ok(known),
  107    129   
        }
  108    130   
    }
  109    131   
}
         132  +
/* ClientEnumGenerator.kt:136 */
  110    133   
impl ::std::fmt::Display for Language {
  111    134   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  112    135   
        match self {
  113    136   
            Language::English => write!(f, "en"),
  114    137   
            Language::Spanish => write!(f, "es"),
  115    138   
            Language::Italian => write!(f, "it"),
  116    139   
            Language::Japanese => write!(f, "jp"),
  117    140   
            Language::Unknown(value) => write!(f, "{}", value),
  118    141   
        }
  119    142   
    }

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

@@ -1,1 +89,134 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Describes one specific validation failure for an input member.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */Describes one specific validation failure for an input member.
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct ValidationExceptionField {
    7         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
           8  +
pub /* StructureGenerator.kt:201 */ struct ValidationExceptionField {
           9  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
    8     10   
    pub path: ::std::string::String,
    9         -
    /// A detailed description of the validation failure.
          11  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
   10     12   
    pub message: ::std::string::String,
          13  +
    /* StructureGenerator.kt:201 */
   11     14   
}
          15  +
/* StructureGenerator.kt:135 */
   12     16   
impl ValidationExceptionField {
   13         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          17  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          18  +
    /* StructureGenerator.kt:166 */
   14     19   
    pub fn path(&self) -> &str {
          20  +
        /* StructureGenerator.kt:171 */
   15     21   
        use std::ops::Deref;
   16     22   
        self.path.deref()
          23  +
        /* StructureGenerator.kt:166 */
   17     24   
    }
   18         -
    /// A detailed description of the validation failure.
          25  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
          26  +
    /* StructureGenerator.kt:166 */
   19     27   
    pub fn message(&self) -> &str {
          28  +
        /* StructureGenerator.kt:171 */
   20     29   
        use std::ops::Deref;
   21     30   
        self.message.deref()
          31  +
        /* StructureGenerator.kt:166 */
   22     32   
    }
          33  +
    /* StructureGenerator.kt:135 */
   23     34   
}
          35  +
/* ClientCodegenVisitor.kt:237 */
   24     36   
impl ValidationExceptionField {
   25         -
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          37  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          38  +
    /* BuilderGenerator.kt:175 */
   26     39   
    pub fn builder() -> crate::types::builders::ValidationExceptionFieldBuilder {
          40  +
        /* BuilderGenerator.kt:176 */
   27     41   
        crate::types::builders::ValidationExceptionFieldBuilder::default()
          42  +
        /* BuilderGenerator.kt:175 */
   28     43   
    }
          44  +
    /* ClientCodegenVisitor.kt:237 */
   29     45   
}
   30     46   
   31         -
/// A builder for [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          47  +
/// /* BuilderGenerator.kt:342 */A builder for [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          48  +
/* RustType.kt:516 */
   32     49   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          50  +
/* RustType.kt:516 */
   33     51   
#[non_exhaustive]
          52  +
/* BuilderGenerator.kt:345 */
   34     53   
pub struct ValidationExceptionFieldBuilder {
   35         -
    pub(crate) path: ::std::option::Option<::std::string::String>,
   36         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
          54  +
    /* BuilderGenerator.kt:275 */ pub(crate) path: ::std::option::Option<::std::string::String>,
          55  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:345 */
   37     57   
}
          58  +
/* BuilderGenerator.kt:355 */
   38     59   
impl ValidationExceptionFieldBuilder {
   39         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   40         -
    /// This field is required.
          60  +
    /// /* BuilderGenerator.kt:286 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          61  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          62  +
    /* BuilderGenerator.kt:291 */
   41     63   
    pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:292 */
   42     65   
        self.path = ::std::option::Option::Some(input.into());
          66  +
        /* BuilderGenerator.kt:293 */
   43     67   
        self
          68  +
        /* BuilderGenerator.kt:291 */
   44     69   
    }
   45         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          70  +
    /// /* BuilderGenerator.kt:312 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          71  +
    /* BuilderGenerator.kt:314 */
   46     72   
    pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          73  +
        /* BuilderGenerator.kt:315 */
   47     74   
        self.path = input;
   48     75   
        self
          76  +
        /* BuilderGenerator.kt:314 */
   49     77   
    }
   50         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          78  +
    /// /* BuilderGenerator.kt:334 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          79  +
    /* BuilderGenerator.kt:336 */
   51     80   
    pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
          81  +
        /* BuilderGenerator.kt:337 */
   52     82   
        &self.path
          83  +
        /* BuilderGenerator.kt:336 */
   53     84   
    }
   54         -
    /// A detailed description of the validation failure.
   55         -
    /// This field is required.
          85  +
    /// /* BuilderGenerator.kt:286 */A detailed description of the validation failure.
          86  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          87  +
    /* BuilderGenerator.kt:291 */
   56     88   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          89  +
        /* BuilderGenerator.kt:292 */
   57     90   
        self.message = ::std::option::Option::Some(input.into());
          91  +
        /* BuilderGenerator.kt:293 */
   58     92   
        self
          93  +
        /* BuilderGenerator.kt:291 */
   59     94   
    }
   60         -
    /// A detailed description of the validation failure.
          95  +
    /// /* BuilderGenerator.kt:312 */A detailed description of the validation failure.
          96  +
    /* BuilderGenerator.kt:314 */
   61     97   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          98  +
        /* BuilderGenerator.kt:315 */
   62     99   
        self.message = input;
   63    100   
        self
         101  +
        /* BuilderGenerator.kt:314 */
   64    102   
    }
   65         -
    /// A detailed description of the validation failure.
         103  +
    /// /* BuilderGenerator.kt:334 */A detailed description of the validation failure.
         104  +
    /* BuilderGenerator.kt:336 */
   66    105   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         106  +
        /* BuilderGenerator.kt:337 */
   67    107   
        &self.message
         108  +
        /* BuilderGenerator.kt:336 */
   68    109   
    }
   69         -
    /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::types::ValidationExceptionField).
   70         -
    /// This method will fail if any of the following fields are not set:
   71         -
    /// - [`path`](crate::types::builders::ValidationExceptionFieldBuilder::path)
   72         -
    /// - [`message`](crate::types::builders::ValidationExceptionFieldBuilder::message)
         110  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::types::ValidationExceptionField).
         111  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         112  +
    /// /* BuilderGenerator.kt:246 */- [`path`](crate::types::builders::ValidationExceptionFieldBuilder::path)
         113  +
    /// /* BuilderGenerator.kt:246 */- [`message`](crate::types::builders::ValidationExceptionFieldBuilder::message)
         114  +
    /* BuilderGenerator.kt:253 */
   73    115   
    pub fn build(self) -> ::std::result::Result<crate::types::ValidationExceptionField, ::aws_smithy_types::error::operation::BuildError> {
   74         -
        ::std::result::Result::Ok(crate::types::ValidationExceptionField {
   75         -
            path: self.path.ok_or_else(|| {
   76         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   77         -
                    "path",
   78         -
                    "path was not specified but it is required when building ValidationExceptionField",
   79         -
                )
   80         -
            })?,
   81         -
            message: self.message.ok_or_else(|| {
   82         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   83         -
                    "message",
   84         -
                    "message was not specified but it is required when building ValidationExceptionField",
   85         -
                )
   86         -
            })?,
   87         -
        })
         116  +
        /* BuilderGenerator.kt:254 */
         117  +
        ::std::result::Result::Ok(
         118  +
            /* BuilderGenerator.kt:477 */crate::types::ValidationExceptionField {
         119  +
                /* BuilderGenerator.kt:481 */path: self.path
         120  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         121  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("path", "path was not specified but it is required when building ValidationExceptionField")
         122  +
                    /* BuilderGenerator.kt:494 */)?
         123  +
                ,
         124  +
                /* BuilderGenerator.kt:481 */message: self.message
         125  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         126  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("message", "message was not specified but it is required when building ValidationExceptionField")
         127  +
                    /* BuilderGenerator.kt:494 */)?
         128  +
                ,
         129  +
            /* BuilderGenerator.kt:477 */}
         130  +
        /* BuilderGenerator.kt:254 */)
         131  +
        /* BuilderGenerator.kt:253 */
   88    132   
    }
         133  +
    /* BuilderGenerator.kt:355 */
   89    134   
}

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

@@ -1,1 +10,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_validation_exception_field::ValidationExceptionFieldBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_flavor_text::FlavorTextBuilder;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_capture_event::CaptureEventBuilder;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_capturing_event::CapturingEventBuilder;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_capturing_payload::CapturingPayloadBuilder;

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

@@ -1,1 +237,431 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundError;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::error::_storage_access_not_authorized::StorageAccessNotAuthorized;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::error::_validation_exception::ValidationError;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::error::_unsupported_region_error::UnsupportedRegionError;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::error::_throttling_error::ThrottlingError;
   11     16   
          17  +
/* CodegenDelegator.kt:255 */
   12     18   
pub use crate::types::error::_invalid_pokeball_error::InvalidPokeballError;
   13     19   
          20  +
/* CodegenDelegator.kt:255 */
   14     21   
pub use crate::types::error::_master_ball_unsuccessful::MasterBallUnsuccessful;
   15     22   
          23  +
/* OperationErrorGenerator.kt:79 */
   16     24   
/// Error type for the `CapturePokemonEventsError` operation.
          25  +
/* RustType.kt:516 */
   17     26   
#[non_exhaustive]
          27  +
/* RustType.kt:516 */
   18     28   
#[derive(::std::fmt::Debug)]
   19         -
pub enum CapturePokemonEventsError {
          29  +
pub /* OperationErrorGenerator.kt:81 */ enum CapturePokemonEventsError {
          30  +
    /* OperationErrorGenerator.kt:83 */
   20     31   
    #[allow(missing_docs)] // documentation missing in model
          32  +
    /* OperationErrorGenerator.kt:86 */
   21     33   
    InvalidPokeballError(crate::types::error::InvalidPokeballError),
          34  +
    /* OperationErrorGenerator.kt:83 */
   22     35   
    #[allow(missing_docs)] // documentation missing in model
          36  +
    /* OperationErrorGenerator.kt:86 */
   23     37   
    ThrottlingError(crate::types::error::ThrottlingError),
          38  +
    /* OperationErrorGenerator.kt:88 */
   24     39   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
   25     40   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
   26     41   
    variable wildcard pattern and check `.code()`:
   27     42   
     \
   28     43   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
   29     44   
     \
   30     45   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CapturePokemonEventsError) for what information is available for the error.")]
   31     46   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
          47  +
    /* OperationErrorGenerator.kt:81 */
   32     48   
}
          49  +
/* OperationErrorGenerator.kt:218 */
   33     50   
impl CapturePokemonEventsError {
          51  +
    /* OperationErrorGenerator.kt:219 */
   34     52   
    /// Creates the `CapturePokemonEventsError::Unhandled` variant from any error type.
   35     53   
    pub fn unhandled(
   36     54   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
   37     55   
    ) -> Self {
   38     56   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
   39     57   
            source: err.into(),
   40     58   
            meta: ::std::default::Default::default(),
   41     59   
        })
   42     60   
    }
   43     61   
   44     62   
    /// Creates the `CapturePokemonEventsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
   45     63   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   46     64   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
   47     65   
            source: err.clone().into(),
   48     66   
            meta: err,
   49     67   
        })
   50     68   
    }
   51         -
    ///
          69  +
    /// /* OperationErrorGenerator.kt:236 */
   52     70   
    /// Returns error metadata, which includes the error code, message,
   53     71   
    /// request ID, and potentially additional information.
   54     72   
    ///
          73  +
    /* OperationErrorGenerator.kt:242 */
   55     74   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
          75  +
        /* OperationErrorGenerator.kt:243 */
   56     76   
        match self {
          77  +
            /* OperationErrorGenerator.kt:246 */
   57     78   
            Self::InvalidPokeballError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   58         -
            Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   59         -
            Self::Unhandled(e) => &e.meta,
          79  +
            /* OperationErrorGenerator.kt:246 */ Self::ThrottlingError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
          80  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
          81  +
            /* OperationErrorGenerator.kt:243 */
   60     82   
        }
          83  +
        /* OperationErrorGenerator.kt:242 */
   61     84   
    }
          85  +
    /* OperationErrorGenerator.kt:257 */
   62     86   
    /// Returns `true` if the error kind is `CapturePokemonEventsError::InvalidPokeballError`.
          87  +
    /* OperationErrorGenerator.kt:258 */
   63     88   
    pub fn is_invalid_pokeball_error(&self) -> bool {
          89  +
        /* OperationErrorGenerator.kt:259 */
   64     90   
        matches!(self, Self::InvalidPokeballError(_))
          91  +
        /* OperationErrorGenerator.kt:258 */
   65     92   
    }
          93  +
    /* OperationErrorGenerator.kt:257 */
   66     94   
    /// Returns `true` if the error kind is `CapturePokemonEventsError::ThrottlingError`.
          95  +
    /* OperationErrorGenerator.kt:258 */
   67     96   
    pub fn is_throttling_error(&self) -> bool {
          97  +
        /* OperationErrorGenerator.kt:259 */
   68     98   
        matches!(self, Self::ThrottlingError(_))
          99  +
        /* OperationErrorGenerator.kt:258 */
   69    100   
    }
         101  +
    /* OperationErrorGenerator.kt:218 */
   70    102   
}
         103  +
/* OperationErrorGenerator.kt:269 */
   71    104   
impl ::std::error::Error for CapturePokemonEventsError {
         105  +
    /* OperationErrorGenerator.kt:270 */
   72    106   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         107  +
        /* OperationErrorGenerator.kt:318 */
   73    108   
        match self {
   74         -
            Self::InvalidPokeballError(_inner) => ::std::option::Option::Some(_inner),
   75         -
            Self::ThrottlingError(_inner) => ::std::option::Option::Some(_inner),
   76         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         109  +
            /* OperationErrorGenerator.kt:321 */
         110  +
            Self::InvalidPokeballError(_inner) =>
         111  +
            /* OperationErrorGenerator.kt:283 */
         112  +
            {
         113  +
                ::std::option::Option::Some(_inner)
         114  +
            }
         115  +
            ,
         116  +
            /* OperationErrorGenerator.kt:321 */
         117  +
            Self::ThrottlingError(_inner) =>
         118  +
            /* OperationErrorGenerator.kt:283 */
         119  +
            {
         120  +
                ::std::option::Option::Some(_inner)
         121  +
            }
         122  +
            ,
         123  +
            /* OperationErrorGenerator.kt:326 */
         124  +
            Self::Unhandled(_inner) => {
         125  +
                /* OperationErrorGenerator.kt:279 */
         126  +
                ::std::option::Option::Some(&*_inner.source)
         127  +
                /* OperationErrorGenerator.kt:326 */
         128  +
            } /* OperationErrorGenerator.kt:318 */
   77    129   
        }
         130  +
        /* OperationErrorGenerator.kt:270 */
   78    131   
    }
         132  +
    /* OperationErrorGenerator.kt:269 */
   79    133   
}
         134  +
/* OperationErrorGenerator.kt:133 */
   80    135   
impl ::std::fmt::Display for CapturePokemonEventsError {
         136  +
    /* OperationErrorGenerator.kt:134 */
   81    137   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         138  +
        /* OperationErrorGenerator.kt:318 */
   82    139   
        match self {
   83         -
            Self::InvalidPokeballError(_inner) => _inner.fmt(f),
   84         -
            Self::ThrottlingError(_inner) => _inner.fmt(f),
         140  +
            /* OperationErrorGenerator.kt:321 */
         141  +
            Self::InvalidPokeballError(_inner) =>
         142  +
            /* OperationErrorGenerator.kt:151 */
         143  +
            {
         144  +
                _inner.fmt(f)
         145  +
            }
         146  +
            ,
         147  +
            /* OperationErrorGenerator.kt:321 */
         148  +
            Self::ThrottlingError(_inner) =>
         149  +
            /* OperationErrorGenerator.kt:151 */
         150  +
            {
         151  +
                _inner.fmt(f)
         152  +
            }
         153  +
            ,
         154  +
            /* OperationErrorGenerator.kt:326 */
   85    155   
            Self::Unhandled(_inner) => {
         156  +
                /* OperationErrorGenerator.kt:139 */
   86    157   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
   87    158   
                    write!(f, "unhandled error ({code})")
   88    159   
                } else {
   89    160   
                    f.write_str("unhandled error")
   90    161   
                }
   91         -
            }
         162  +
                /* OperationErrorGenerator.kt:326 */
         163  +
            } /* OperationErrorGenerator.kt:318 */
   92    164   
        }
         165  +
        /* OperationErrorGenerator.kt:134 */
   93    166   
    }
         167  +
    /* OperationErrorGenerator.kt:133 */
   94    168   
}
         169  +
/* OperationErrorGenerator.kt:182 */
   95    170   
impl ::aws_smithy_types::retry::ProvideErrorKind for CapturePokemonEventsError {
         171  +
    /* OperationErrorGenerator.kt:186 */
   96    172   
    fn code(&self) -> ::std::option::Option<&str> {
         173  +
        /* OperationErrorGenerator.kt:187 */
   97    174   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         175  +
        /* OperationErrorGenerator.kt:186 */
   98    176   
    }
         177  +
    /* OperationErrorGenerator.kt:190 */
   99    178   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         179  +
        /* OperationErrorGenerator.kt:197 */
  100    180   
        ::std::option::Option::None
         181  +
        /* OperationErrorGenerator.kt:190 */
  101    182   
    }
         183  +
    /* OperationErrorGenerator.kt:182 */
  102    184   
}
         185  +
/* OperationErrorGenerator.kt:163 */
  103    186   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CapturePokemonEventsError {
         187  +
    /* OperationErrorGenerator.kt:164 */
  104    188   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         189  +
        /* OperationErrorGenerator.kt:318 */
  105    190   
        match self {
  106         -
            Self::InvalidPokeballError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  107         -
            Self::ThrottlingError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  108         -
            Self::Unhandled(_inner) => &_inner.meta,
         191  +
            /* OperationErrorGenerator.kt:321 */
         192  +
            Self::InvalidPokeballError(_inner) =>
         193  +
            /* OperationErrorGenerator.kt:169 */
         194  +
            {
         195  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         196  +
            }
         197  +
            ,
         198  +
            /* OperationErrorGenerator.kt:321 */
         199  +
            Self::ThrottlingError(_inner) =>
         200  +
            /* OperationErrorGenerator.kt:169 */
         201  +
            {
         202  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         203  +
            }
         204  +
            ,
         205  +
            /* OperationErrorGenerator.kt:326 */
         206  +
            Self::Unhandled(_inner) => {
         207  +
                /* OperationErrorGenerator.kt:168 */
         208  +
                &_inner.meta
         209  +
                /* OperationErrorGenerator.kt:326 */
         210  +
            } /* OperationErrorGenerator.kt:318 */
  109    211   
        }
         212  +
        /* OperationErrorGenerator.kt:164 */
  110    213   
    }
         214  +
    /* OperationErrorGenerator.kt:163 */
  111    215   
}
         216  +
/* OperationErrorGenerator.kt:109 */
  112    217   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CapturePokemonEventsError {
         218  +
    /* OperationErrorGenerator.kt:110 */
  113    219   
    fn create_unhandled_error(
  114    220   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  115    221   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  116    222   
    ) -> Self {
         223  +
        /* OperationErrorGenerator.kt:121 */
  117    224   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  118    225   
            source,
  119    226   
            meta: meta.unwrap_or_default(),
  120    227   
        })
         228  +
        /* OperationErrorGenerator.kt:110 */
  121    229   
    }
         230  +
    /* OperationErrorGenerator.kt:109 */
  122    231   
}
  123    232   
         233  +
/* OperationErrorGenerator.kt:79 */
  124    234   
/// Error type for the `AttemptCapturingPokemonEventError` operation.
         235  +
/* RustType.kt:516 */
  125    236   
#[non_exhaustive]
         237  +
/* RustType.kt:516 */
  126    238   
#[derive(::std::fmt::Debug)]
  127         -
pub enum AttemptCapturingPokemonEventError {
         239  +
pub /* OperationErrorGenerator.kt:81 */ enum AttemptCapturingPokemonEventError {
         240  +
    /* OperationErrorGenerator.kt:83 */
  128    241   
    #[allow(missing_docs)] // documentation missing in model
         242  +
    /* OperationErrorGenerator.kt:86 */
  129    243   
    MasterBallUnsuccessful(crate::types::error::MasterBallUnsuccessful),
         244  +
    /* OperationErrorGenerator.kt:88 */
  130    245   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  131    246   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  132    247   
    variable wildcard pattern and check `.code()`:
  133    248   
     \
  134    249   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  135    250   
     \
  136    251   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-AttemptCapturingPokemonEventError) for what information is available for the error.")]
  137    252   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         253  +
    /* OperationErrorGenerator.kt:81 */
  138    254   
}
         255  +
/* OperationErrorGenerator.kt:218 */
  139    256   
impl AttemptCapturingPokemonEventError {
         257  +
    /* OperationErrorGenerator.kt:219 */
  140    258   
    /// Creates the `AttemptCapturingPokemonEventError::Unhandled` variant from any error type.
  141    259   
    pub fn unhandled(
  142    260   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  143    261   
    ) -> Self {
  144    262   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  145    263   
            source: err.into(),
  146    264   
            meta: ::std::default::Default::default(),
  147    265   
        })
  148    266   
    }
  149    267   
  150    268   
    /// Creates the `AttemptCapturingPokemonEventError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  151    269   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  152    270   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  153    271   
            source: err.clone().into(),
  154    272   
            meta: err,
  155    273   
        })
  156    274   
    }
  157         -
    ///
         275  +
    /// /* OperationErrorGenerator.kt:236 */
  158    276   
    /// Returns error metadata, which includes the error code, message,
  159    277   
    /// request ID, and potentially additional information.
  160    278   
    ///
         279  +
    /* OperationErrorGenerator.kt:242 */
  161    280   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         281  +
        /* OperationErrorGenerator.kt:243 */
  162    282   
        match self {
         283  +
            /* OperationErrorGenerator.kt:246 */
  163    284   
            Self::MasterBallUnsuccessful(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  164         -
            Self::Unhandled(e) => &e.meta,
         285  +
            /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
         286  +
            /* OperationErrorGenerator.kt:243 */
  165    287   
        }
         288  +
        /* OperationErrorGenerator.kt:242 */
  166    289   
    }
         290  +
    /* OperationErrorGenerator.kt:257 */
  167    291   
    /// Returns `true` if the error kind is `AttemptCapturingPokemonEventError::MasterBallUnsuccessful`.
         292  +
    /* OperationErrorGenerator.kt:258 */
  168    293   
    pub fn is_master_ball_unsuccessful(&self) -> bool {
         294  +
        /* OperationErrorGenerator.kt:259 */
  169    295   
        matches!(self, Self::MasterBallUnsuccessful(_))
         296  +
        /* OperationErrorGenerator.kt:258 */
  170    297   
    }
         298  +
    /* OperationErrorGenerator.kt:218 */
  171    299   
}
         300  +
/* OperationErrorGenerator.kt:269 */
  172    301   
impl ::std::error::Error for AttemptCapturingPokemonEventError {
         302  +
    /* OperationErrorGenerator.kt:270 */
  173    303   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         304  +
        /* OperationErrorGenerator.kt:318 */
  174    305   
        match self {
  175         -
            Self::MasterBallUnsuccessful(_inner) => ::std::option::Option::Some(_inner),
  176         -
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         306  +
            /* OperationErrorGenerator.kt:321 */
         307  +
            Self::MasterBallUnsuccessful(_inner) =>
         308  +
            /* OperationErrorGenerator.kt:283 */
         309  +
            {
         310  +
                ::std::option::Option::Some(_inner)
         311  +
            }
         312  +
            ,
         313  +
            /* OperationErrorGenerator.kt:326 */
         314  +
            Self::Unhandled(_inner) => {
         315  +
                /* OperationErrorGenerator.kt:279 */
         316  +
                ::std::option::Option::Some(&*_inner.source)
         317  +
                /* OperationErrorGenerator.kt:326 */
         318  +
            } /* OperationErrorGenerator.kt:318 */
  177    319   
        }
         320  +
        /* OperationErrorGenerator.kt:270 */
  178    321   
    }
         322  +
    /* OperationErrorGenerator.kt:269 */
  179    323   
}
         324  +
/* OperationErrorGenerator.kt:133 */
  180    325   
impl ::std::fmt::Display for AttemptCapturingPokemonEventError {
         326  +
    /* OperationErrorGenerator.kt:134 */
  181    327   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         328  +
        /* OperationErrorGenerator.kt:318 */
  182    329   
        match self {
  183         -
            Self::MasterBallUnsuccessful(_inner) => _inner.fmt(f),
         330  +
            /* OperationErrorGenerator.kt:321 */
         331  +
            Self::MasterBallUnsuccessful(_inner) =>
         332  +
            /* OperationErrorGenerator.kt:151 */
         333  +
            {
         334  +
                _inner.fmt(f)
         335  +
            }
         336  +
            ,
         337  +
            /* OperationErrorGenerator.kt:326 */
  184    338   
            Self::Unhandled(_inner) => {
         339  +
                /* OperationErrorGenerator.kt:139 */
  185    340   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  186    341   
                    write!(f, "unhandled error ({code})")
  187    342   
                } else {
  188    343   
                    f.write_str("unhandled error")
  189    344   
                }
  190         -
            }
         345  +
                /* OperationErrorGenerator.kt:326 */
         346  +
            } /* OperationErrorGenerator.kt:318 */
  191    347   
        }
         348  +
        /* OperationErrorGenerator.kt:134 */
  192    349   
    }
         350  +
    /* OperationErrorGenerator.kt:133 */
  193    351   
}
         352  +
/* OperationErrorGenerator.kt:182 */
  194    353   
impl ::aws_smithy_types::retry::ProvideErrorKind for AttemptCapturingPokemonEventError {
         354  +
    /* OperationErrorGenerator.kt:186 */
  195    355   
    fn code(&self) -> ::std::option::Option<&str> {
         356  +
        /* OperationErrorGenerator.kt:187 */
  196    357   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         358  +
        /* OperationErrorGenerator.kt:186 */
  197    359   
    }
         360  +
    /* OperationErrorGenerator.kt:190 */
  198    361   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         362  +
        /* OperationErrorGenerator.kt:197 */
  199    363   
        ::std::option::Option::None
         364  +
        /* OperationErrorGenerator.kt:190 */
  200    365   
    }
         366  +
    /* OperationErrorGenerator.kt:182 */
  201    367   
}
         368  +
/* OperationErrorGenerator.kt:163 */
  202    369   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AttemptCapturingPokemonEventError {
         370  +
    /* OperationErrorGenerator.kt:164 */
  203    371   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         372  +
        /* OperationErrorGenerator.kt:318 */
  204    373   
        match self {
  205         -
            Self::MasterBallUnsuccessful(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  206         -
            Self::Unhandled(_inner) => &_inner.meta,
         374  +
            /* OperationErrorGenerator.kt:321 */
         375  +
            Self::MasterBallUnsuccessful(_inner) =>
         376  +
            /* OperationErrorGenerator.kt:169 */
         377  +
            {
         378  +
                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
         379  +
            }
         380  +
            ,
         381  +
            /* OperationErrorGenerator.kt:326 */
         382  +
            Self::Unhandled(_inner) => {
         383  +
                /* OperationErrorGenerator.kt:168 */
         384  +
                &_inner.meta
         385  +
                /* OperationErrorGenerator.kt:326 */
         386  +
            } /* OperationErrorGenerator.kt:318 */
  207    387   
        }
         388  +
        /* OperationErrorGenerator.kt:164 */
  208    389   
    }
         390  +
    /* OperationErrorGenerator.kt:163 */
  209    391   
}
         392  +
/* OperationErrorGenerator.kt:109 */
  210    393   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for AttemptCapturingPokemonEventError {
         394  +
    /* OperationErrorGenerator.kt:110 */
  211    395   
    fn create_unhandled_error(
  212    396   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  213    397   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  214    398   
    ) -> Self {
         399  +
        /* OperationErrorGenerator.kt:121 */
  215    400   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  216    401   
            source,
  217    402   
            meta: meta.unwrap_or_default(),
  218    403   
        })
         404  +
        /* OperationErrorGenerator.kt:110 */
  219    405   
    }
         406  +
    /* OperationErrorGenerator.kt:109 */
  220    407   
}
  221    408   
         409  +
/* RustModule.kt:172 */
  222    410   
mod _invalid_pokeball_error;
  223    411   
         412  +
/* RustModule.kt:172 */
  224    413   
mod _master_ball_unsuccessful;
  225    414   
         415  +
/* RustModule.kt:172 */
  226    416   
mod _resource_not_found_exception;
  227    417   
         418  +
/* RustModule.kt:172 */
  228    419   
mod _storage_access_not_authorized;
  229    420   
         421  +
/* RustModule.kt:172 */
  230    422   
mod _throttling_error;
  231    423   
         424  +
/* RustModule.kt:172 */
  232    425   
mod _unsupported_region_error;
  233    426   
         427  +
/* RustModule.kt:172 */
  234    428   
mod _validation_exception;
  235    429   
  236         -
/// Builders
         430  +
/// /* CodegenDelegator.kt:51 */Builders
  237    431   
pub mod builders;

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

@@ -1,1 +113,185 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct InvalidPokeballError {
    6         -
    #[allow(missing_docs)] // documentation missing in model
           8  +
pub /* StructureGenerator.kt:201 */ struct InvalidPokeballError {
           9  +
    /* StructureGenerator.kt:231 */ #[allow(missing_docs)] // documentation missing in model
    7     10   
    pub pokeball: ::std::string::String,
          11  +
    /* StructureGenerator.kt:231 */
    8     12   
    #[allow(missing_docs)] // documentation missing in model
    9     13   
    pub message: ::std::option::Option<::std::string::String>,
   10         -
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          14  +
    /* ErrorGenerator.kt:53 */ pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          15  +
    /* StructureGenerator.kt:201 */
   11     16   
}
          17  +
/* StructureGenerator.kt:135 */
   12     18   
impl InvalidPokeballError {
          19  +
    /* StructureGenerator.kt:231 */
   13     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   14     22   
    pub fn pokeball(&self) -> &str {
          23  +
        /* StructureGenerator.kt:171 */
   15     24   
        use std::ops::Deref;
   16     25   
        self.pokeball.deref()
          26  +
        /* StructureGenerator.kt:166 */
   17     27   
    }
          28  +
    /* StructureGenerator.kt:135 */
   18     29   
}
          30  +
/* ErrorImplGenerator.kt:99 */
   19     31   
impl InvalidPokeballError {
          32  +
    /* ErrorImplGenerator.kt:128 */
   20     33   
    /// Returns the error message.
   21     34   
    pub fn message(&self) -> ::std::option::Option<&str> {
   22     35   
        self.message.as_deref()
   23     36   
    }
          37  +
    /* ErrorImplGenerator.kt:99 */
   24     38   
}
          39  +
/* ErrorImplGenerator.kt:153 */
   25     40   
impl ::std::fmt::Display for InvalidPokeballError {
          41  +
    /* ErrorImplGenerator.kt:154 */
   26     42   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          43  +
        /* ErrorImplGenerator.kt:161 */
   27     44   
        ::std::write!(f, "InvalidPokeballError")?;
          45  +
        /* ErrorImplGenerator.kt:166 */
   28     46   
        if let ::std::option::Option::Some(inner_1) = &self.message {
          47  +
            /* ErrorImplGenerator.kt:166 */
   29     48   
            {
          49  +
                /* ErrorImplGenerator.kt:167 */
   30     50   
                ::std::write!(f, ": {}", inner_1)?;
          51  +
                /* ErrorImplGenerator.kt:166 */
   31     52   
            }
          53  +
            /* ErrorImplGenerator.kt:166 */
   32     54   
        }
          55  +
        /* ErrorImplGenerator.kt:171 */
   33     56   
        Ok(())
          57  +
        /* ErrorImplGenerator.kt:154 */
   34     58   
    }
          59  +
    /* ErrorImplGenerator.kt:153 */
   35     60   
}
          61  +
/* ErrorImplGenerator.kt:175 */
   36     62   
impl ::std::error::Error for InvalidPokeballError {}
          63  +
/* ErrorGenerator.kt:77 */
   37     64   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvalidPokeballError {
          65  +
    /* ErrorGenerator.kt:78 */
   38     66   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   39     67   
        &self.meta
   40     68   
    }
          69  +
    /* ErrorGenerator.kt:77 */
   41     70   
}
          71  +
/* ErrorGenerator.kt:81 */
   42     72   
impl InvalidPokeballError {
   43         -
    /// Creates a new builder-style object to manufacture [`InvalidPokeballError`](crate::types::error::InvalidPokeballError).
          73  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`InvalidPokeballError`](crate::types::error::InvalidPokeballError).
          74  +
    /* BuilderGenerator.kt:175 */
   44     75   
    pub fn builder() -> crate::types::error::builders::InvalidPokeballErrorBuilder {
          76  +
        /* BuilderGenerator.kt:176 */
   45     77   
        crate::types::error::builders::InvalidPokeballErrorBuilder::default()
          78  +
        /* BuilderGenerator.kt:175 */
   46     79   
    }
          80  +
    /* ErrorGenerator.kt:81 */
   47     81   
}
   48     82   
   49         -
/// A builder for [`InvalidPokeballError`](crate::types::error::InvalidPokeballError).
          83  +
/// /* BuilderGenerator.kt:342 */A builder for [`InvalidPokeballError`](crate::types::error::InvalidPokeballError).
          84  +
/* RustType.kt:516 */
   50     85   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          86  +
/* RustType.kt:516 */
   51     87   
#[non_exhaustive]
          88  +
/* BuilderGenerator.kt:345 */
   52     89   
pub struct InvalidPokeballErrorBuilder {
   53         -
    pub(crate) pokeball: ::std::option::Option<::std::string::String>,
   54         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
   55         -
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          90  +
    /* BuilderGenerator.kt:275 */ pub(crate) pokeball: ::std::option::Option<::std::string::String>,
          91  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          92  +
    /* ErrorGenerator.kt:97 */ meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          93  +
    /* BuilderGenerator.kt:345 */
   56     94   
}
          95  +
/* BuilderGenerator.kt:355 */
   57     96   
impl InvalidPokeballErrorBuilder {
          97  +
    /* BuilderGenerator.kt:286 */
   58     98   
    #[allow(missing_docs)] // documentation missing in model
   59         -
    /// This field is required.
          99  +
    /// /* BuilderGenerator.kt:288 */This field is required.
         100  +
    /* BuilderGenerator.kt:291 */
   60    101   
    pub fn pokeball(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         102  +
        /* BuilderGenerator.kt:292 */
   61    103   
        self.pokeball = ::std::option::Option::Some(input.into());
         104  +
        /* BuilderGenerator.kt:293 */
   62    105   
        self
         106  +
        /* BuilderGenerator.kt:291 */
   63    107   
    }
         108  +
    /* BuilderGenerator.kt:312 */
   64    109   
    #[allow(missing_docs)] // documentation missing in model
         110  +
                           /* BuilderGenerator.kt:314 */
   65    111   
    pub fn set_pokeball(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         112  +
        /* BuilderGenerator.kt:315 */
   66    113   
        self.pokeball = input;
   67    114   
        self
         115  +
        /* BuilderGenerator.kt:314 */
   68    116   
    }
         117  +
    /* BuilderGenerator.kt:334 */
   69    118   
    #[allow(missing_docs)] // documentation missing in model
         119  +
                           /* BuilderGenerator.kt:336 */
   70    120   
    pub fn get_pokeball(&self) -> &::std::option::Option<::std::string::String> {
         121  +
        /* BuilderGenerator.kt:337 */
   71    122   
        &self.pokeball
         123  +
        /* BuilderGenerator.kt:336 */
   72    124   
    }
         125  +
    /* BuilderGenerator.kt:286 */
   73    126   
    #[allow(missing_docs)] // documentation missing in model
         127  +
                           /* BuilderGenerator.kt:291 */
   74    128   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         129  +
        /* BuilderGenerator.kt:292 */
   75    130   
        self.message = ::std::option::Option::Some(input.into());
         131  +
        /* BuilderGenerator.kt:293 */
   76    132   
        self
         133  +
        /* BuilderGenerator.kt:291 */
   77    134   
    }
         135  +
    /* BuilderGenerator.kt:312 */
   78    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* BuilderGenerator.kt:314 */
   79    138   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         139  +
        /* BuilderGenerator.kt:315 */
   80    140   
        self.message = input;
   81    141   
        self
         142  +
        /* BuilderGenerator.kt:314 */
   82    143   
    }
         144  +
    /* BuilderGenerator.kt:334 */
   83    145   
    #[allow(missing_docs)] // documentation missing in model
         146  +
                           /* BuilderGenerator.kt:336 */
   84    147   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         148  +
        /* BuilderGenerator.kt:337 */
   85    149   
        &self.message
         150  +
        /* BuilderGenerator.kt:336 */
   86    151   
    }
         152  +
    /* ErrorGenerator.kt:101 */
   87    153   
    /// Sets error metadata
   88    154   
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   89    155   
        self.meta = Some(meta);
   90    156   
        self
   91    157   
    }
   92    158   
   93    159   
    /// Sets error metadata
   94    160   
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
   95    161   
        self.meta = meta;
   96    162   
        self
   97    163   
    }
   98         -
    /// Consumes the builder and constructs a [`InvalidPokeballError`](crate::types::error::InvalidPokeballError).
   99         -
    /// This method will fail if any of the following fields are not set:
  100         -
    /// - [`pokeball`](crate::types::error::builders::InvalidPokeballErrorBuilder::pokeball)
         164  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`InvalidPokeballError`](crate::types::error::InvalidPokeballError).
         165  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         166  +
    /// /* BuilderGenerator.kt:246 */- [`pokeball`](crate::types::error::builders::InvalidPokeballErrorBuilder::pokeball)
         167  +
    /* BuilderGenerator.kt:253 */
  101    168   
    pub fn build(self) -> ::std::result::Result<crate::types::error::InvalidPokeballError, ::aws_smithy_types::error::operation::BuildError> {
  102         -
        ::std::result::Result::Ok(crate::types::error::InvalidPokeballError {
  103         -
            pokeball: self.pokeball.ok_or_else(|| {
  104         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  105         -
                    "pokeball",
  106         -
                    "pokeball was not specified but it is required when building InvalidPokeballError",
  107         -
                )
  108         -
            })?,
  109         -
            message: self.message,
  110         -
            meta: self.meta.unwrap_or_default(),
  111         -
        })
         169  +
        /* BuilderGenerator.kt:254 */
         170  +
        ::std::result::Result::Ok(
         171  +
            /* BuilderGenerator.kt:477 */crate::types::error::InvalidPokeballError {
         172  +
                /* BuilderGenerator.kt:481 */pokeball: self.pokeball
         173  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         174  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("pokeball", "pokeball was not specified but it is required when building InvalidPokeballError")
         175  +
                    /* BuilderGenerator.kt:494 */)?
         176  +
                ,
         177  +
                /* BuilderGenerator.kt:481 */message: self.message
         178  +
                ,
         179  +
                /* ErrorGenerator.kt:120 */meta: self.meta.unwrap_or_default(),
         180  +
            /* BuilderGenerator.kt:477 */}
         181  +
        /* BuilderGenerator.kt:254 */)
         182  +
        /* BuilderGenerator.kt:253 */
  112    183   
    }
         184  +
    /* BuilderGenerator.kt:355 */
  113    185   
}