Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +8,12 @@
    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::_capture_event::CaptureEventBuilder;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_capturing_event::CapturingEventBuilder;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_capturing_payload::CapturingPayloadBuilder;

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

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

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

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

@@ -1,1 +80,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 MasterBallUnsuccessful {
           8  +
pub /* StructureGenerator.kt:201 */ struct MasterBallUnsuccessful {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub message: ::std::option::Option<::std::string::String>,
    8         -
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          12  +
    /* ErrorGenerator.kt:53 */ pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          13  +
    /* StructureGenerator.kt:201 */
    9     14   
}
          15  +
/* ErrorImplGenerator.kt:99 */
   10     16   
impl MasterBallUnsuccessful {
          17  +
    /* ErrorImplGenerator.kt:128 */
   11     18   
    /// Returns the error message.
   12     19   
    pub fn message(&self) -> ::std::option::Option<&str> {
   13     20   
        self.message.as_deref()
   14     21   
    }
          22  +
    /* ErrorImplGenerator.kt:99 */
   15     23   
}
          24  +
/* ErrorImplGenerator.kt:153 */
   16     25   
impl ::std::fmt::Display for MasterBallUnsuccessful {
          26  +
    /* ErrorImplGenerator.kt:154 */
   17     27   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          28  +
        /* ErrorImplGenerator.kt:161 */
   18     29   
        ::std::write!(f, "MasterBallUnsuccessful")?;
          30  +
        /* ErrorImplGenerator.kt:166 */
   19     31   
        if let ::std::option::Option::Some(inner_1) = &self.message {
          32  +
            /* ErrorImplGenerator.kt:166 */
   20     33   
            {
          34  +
                /* ErrorImplGenerator.kt:167 */
   21     35   
                ::std::write!(f, ": {}", inner_1)?;
          36  +
                /* ErrorImplGenerator.kt:166 */
   22     37   
            }
          38  +
            /* ErrorImplGenerator.kt:166 */
   23     39   
        }
          40  +
        /* ErrorImplGenerator.kt:171 */
   24     41   
        Ok(())
          42  +
        /* ErrorImplGenerator.kt:154 */
   25     43   
    }
          44  +
    /* ErrorImplGenerator.kt:153 */
   26     45   
}
          46  +
/* ErrorImplGenerator.kt:175 */
   27     47   
impl ::std::error::Error for MasterBallUnsuccessful {}
          48  +
/* ErrorGenerator.kt:77 */
   28     49   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for MasterBallUnsuccessful {
          50  +
    /* ErrorGenerator.kt:78 */
   29     51   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   30     52   
        &self.meta
   31     53   
    }
          54  +
    /* ErrorGenerator.kt:77 */
   32     55   
}
          56  +
/* ErrorGenerator.kt:81 */
   33     57   
impl MasterBallUnsuccessful {
   34         -
    /// Creates a new builder-style object to manufacture [`MasterBallUnsuccessful`](crate::types::error::MasterBallUnsuccessful).
          58  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`MasterBallUnsuccessful`](crate::types::error::MasterBallUnsuccessful).
          59  +
    /* BuilderGenerator.kt:175 */
   35     60   
    pub fn builder() -> crate::types::error::builders::MasterBallUnsuccessfulBuilder {
          61  +
        /* BuilderGenerator.kt:176 */
   36     62   
        crate::types::error::builders::MasterBallUnsuccessfulBuilder::default()
          63  +
        /* BuilderGenerator.kt:175 */
   37     64   
    }
          65  +
    /* ErrorGenerator.kt:81 */
   38     66   
}
   39     67   
   40         -
/// A builder for [`MasterBallUnsuccessful`](crate::types::error::MasterBallUnsuccessful).
          68  +
/// /* BuilderGenerator.kt:342 */A builder for [`MasterBallUnsuccessful`](crate::types::error::MasterBallUnsuccessful).
          69  +
/* RustType.kt:516 */
   41     70   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          71  +
/* RustType.kt:516 */
   42     72   
#[non_exhaustive]
          73  +
/* BuilderGenerator.kt:345 */
   43     74   
pub struct MasterBallUnsuccessfulBuilder {
   44         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
   45         -
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          75  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          76  +
    /* ErrorGenerator.kt:97 */ meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          77  +
    /* BuilderGenerator.kt:345 */
   46     78   
}
          79  +
/* BuilderGenerator.kt:355 */
   47     80   
impl MasterBallUnsuccessfulBuilder {
          81  +
    /* BuilderGenerator.kt:286 */
   48     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:291 */
   49     84   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          85  +
        /* BuilderGenerator.kt:292 */
   50     86   
        self.message = ::std::option::Option::Some(input.into());
          87  +
        /* BuilderGenerator.kt:293 */
   51     88   
        self
          89  +
        /* BuilderGenerator.kt:291 */
   52     90   
    }
          91  +
    /* BuilderGenerator.kt:312 */
   53     92   
    #[allow(missing_docs)] // documentation missing in model
          93  +
                           /* BuilderGenerator.kt:314 */
   54     94   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          95  +
        /* BuilderGenerator.kt:315 */
   55     96   
        self.message = input;
   56     97   
        self
          98  +
        /* BuilderGenerator.kt:314 */
   57     99   
    }
         100  +
    /* BuilderGenerator.kt:334 */
   58    101   
    #[allow(missing_docs)] // documentation missing in model
         102  +
                           /* BuilderGenerator.kt:336 */
   59    103   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         104  +
        /* BuilderGenerator.kt:337 */
   60    105   
        &self.message
         106  +
        /* BuilderGenerator.kt:336 */
   61    107   
    }
         108  +
    /* ErrorGenerator.kt:101 */
   62    109   
    /// Sets error metadata
   63    110   
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   64    111   
        self.meta = Some(meta);
   65    112   
        self
   66    113   
    }
   67    114   
   68    115   
    /// Sets error metadata
   69    116   
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
   70    117   
        self.meta = meta;
   71    118   
        self
   72    119   
    }
   73         -
    /// Consumes the builder and constructs a [`MasterBallUnsuccessful`](crate::types::error::MasterBallUnsuccessful).
         120  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`MasterBallUnsuccessful`](crate::types::error::MasterBallUnsuccessful).
         121  +
    /* BuilderGenerator.kt:253 */
   74    122   
    pub fn build(self) -> crate::types::error::MasterBallUnsuccessful {
         123  +
        /* BuilderGenerator.kt:477 */
   75    124   
        crate::types::error::MasterBallUnsuccessful {
   76         -
            message: self.message,
         125  +
            /* BuilderGenerator.kt:481 */ message: self.message,
         126  +
            /* ErrorGenerator.kt:120 */
   77    127   
            meta: self.meta.unwrap_or_default(),
         128  +
            /* BuilderGenerator.kt:477 */
   78    129   
        }
         130  +
        /* BuilderGenerator.kt:253 */
   79    131   
    }
         132  +
    /* BuilderGenerator.kt:355 */
   80    133   
}

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

@@ -1,1 +80,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 ThrottlingError {
           8  +
pub /* StructureGenerator.kt:201 */ struct ThrottlingError {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub message: ::std::option::Option<::std::string::String>,
    8         -
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          12  +
    /* ErrorGenerator.kt:53 */ pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          13  +
    /* StructureGenerator.kt:201 */
    9     14   
}
          15  +
/* ErrorImplGenerator.kt:99 */
   10     16   
impl ThrottlingError {
          17  +
    /* ErrorImplGenerator.kt:128 */
   11     18   
    /// Returns the error message.
   12     19   
    pub fn message(&self) -> ::std::option::Option<&str> {
   13     20   
        self.message.as_deref()
   14     21   
    }
          22  +
    /* ErrorImplGenerator.kt:99 */
   15     23   
}
          24  +
/* ErrorImplGenerator.kt:153 */
   16     25   
impl ::std::fmt::Display for ThrottlingError {
          26  +
    /* ErrorImplGenerator.kt:154 */
   17     27   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          28  +
        /* ErrorImplGenerator.kt:161 */
   18     29   
        ::std::write!(f, "ThrottlingError")?;
          30  +
        /* ErrorImplGenerator.kt:166 */
   19     31   
        if let ::std::option::Option::Some(inner_1) = &self.message {
          32  +
            /* ErrorImplGenerator.kt:166 */
   20     33   
            {
          34  +
                /* ErrorImplGenerator.kt:167 */
   21     35   
                ::std::write!(f, ": {}", inner_1)?;
          36  +
                /* ErrorImplGenerator.kt:166 */
   22     37   
            }
          38  +
            /* ErrorImplGenerator.kt:166 */
   23     39   
        }
          40  +
        /* ErrorImplGenerator.kt:171 */
   24     41   
        Ok(())
          42  +
        /* ErrorImplGenerator.kt:154 */
   25     43   
    }
          44  +
    /* ErrorImplGenerator.kt:153 */
   26     45   
}
          46  +
/* ErrorImplGenerator.kt:175 */
   27     47   
impl ::std::error::Error for ThrottlingError {}
          48  +
/* ErrorGenerator.kt:77 */
   28     49   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ThrottlingError {
          50  +
    /* ErrorGenerator.kt:78 */
   29     51   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   30     52   
        &self.meta
   31     53   
    }
          54  +
    /* ErrorGenerator.kt:77 */
   32     55   
}
          56  +
/* ErrorGenerator.kt:81 */
   33     57   
impl ThrottlingError {
   34         -
    /// Creates a new builder-style object to manufacture [`ThrottlingError`](crate::types::error::ThrottlingError).
          58  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ThrottlingError`](crate::types::error::ThrottlingError).
          59  +
    /* BuilderGenerator.kt:175 */
   35     60   
    pub fn builder() -> crate::types::error::builders::ThrottlingErrorBuilder {
          61  +
        /* BuilderGenerator.kt:176 */
   36     62   
        crate::types::error::builders::ThrottlingErrorBuilder::default()
          63  +
        /* BuilderGenerator.kt:175 */
   37     64   
    }
          65  +
    /* ErrorGenerator.kt:81 */
   38     66   
}
   39     67   
   40         -
/// A builder for [`ThrottlingError`](crate::types::error::ThrottlingError).
          68  +
/// /* BuilderGenerator.kt:342 */A builder for [`ThrottlingError`](crate::types::error::ThrottlingError).
          69  +
/* RustType.kt:516 */
   41     70   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          71  +
/* RustType.kt:516 */
   42     72   
#[non_exhaustive]
          73  +
/* BuilderGenerator.kt:345 */
   43     74   
pub struct ThrottlingErrorBuilder {
   44         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
   45         -
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          75  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          76  +
    /* ErrorGenerator.kt:97 */ meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          77  +
    /* BuilderGenerator.kt:345 */
   46     78   
}
          79  +
/* BuilderGenerator.kt:355 */
   47     80   
impl ThrottlingErrorBuilder {
          81  +
    /* BuilderGenerator.kt:286 */
   48     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:291 */
   49     84   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          85  +
        /* BuilderGenerator.kt:292 */
   50     86   
        self.message = ::std::option::Option::Some(input.into());
          87  +
        /* BuilderGenerator.kt:293 */
   51     88   
        self
          89  +
        /* BuilderGenerator.kt:291 */
   52     90   
    }
          91  +
    /* BuilderGenerator.kt:312 */
   53     92   
    #[allow(missing_docs)] // documentation missing in model
          93  +
                           /* BuilderGenerator.kt:314 */
   54     94   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          95  +
        /* BuilderGenerator.kt:315 */
   55     96   
        self.message = input;
   56     97   
        self
          98  +
        /* BuilderGenerator.kt:314 */
   57     99   
    }
         100  +
    /* BuilderGenerator.kt:334 */
   58    101   
    #[allow(missing_docs)] // documentation missing in model
         102  +
                           /* BuilderGenerator.kt:336 */
   59    103   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         104  +
        /* BuilderGenerator.kt:337 */
   60    105   
        &self.message
         106  +
        /* BuilderGenerator.kt:336 */
   61    107   
    }
         108  +
    /* ErrorGenerator.kt:101 */
   62    109   
    /// Sets error metadata
   63    110   
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   64    111   
        self.meta = Some(meta);
   65    112   
        self
   66    113   
    }
   67    114   
   68    115   
    /// Sets error metadata
   69    116   
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
   70    117   
        self.meta = meta;
   71    118   
        self
   72    119   
    }
   73         -
    /// Consumes the builder and constructs a [`ThrottlingError`](crate::types::error::ThrottlingError).
         120  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ThrottlingError`](crate::types::error::ThrottlingError).
         121  +
    /* BuilderGenerator.kt:253 */
   74    122   
    pub fn build(self) -> crate::types::error::ThrottlingError {
         123  +
        /* BuilderGenerator.kt:477 */
   75    124   
        crate::types::error::ThrottlingError {
   76         -
            message: self.message,
         125  +
            /* BuilderGenerator.kt:481 */ message: self.message,
         126  +
            /* ErrorGenerator.kt:120 */
   77    127   
            meta: self.meta.unwrap_or_default(),
         128  +
            /* BuilderGenerator.kt:477 */
   78    129   
        }
         130  +
        /* BuilderGenerator.kt:253 */
   79    131   
    }
         132  +
    /* BuilderGenerator.kt:355 */
   80    133   
}

tmp-codegen-diff/codegen-client-test/pokemon-service-awsjson-client/rust-client-codegen/src/types/error/_unsupported_region_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 UnsupportedRegionError {
    6         -
    #[allow(missing_docs)] // documentation missing in model
           8  +
pub /* StructureGenerator.kt:201 */ struct UnsupportedRegionError {
           9  +
    /* StructureGenerator.kt:231 */ #[allow(missing_docs)] // documentation missing in model
    7     10   
    pub region: ::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 UnsupportedRegionError {
          19  +
    /* StructureGenerator.kt:231 */
   13     20   
    #[allow(missing_docs)] // documentation missing in model
          21  +
                           /* StructureGenerator.kt:166 */
   14     22   
    pub fn region(&self) -> &str {
          23  +
        /* StructureGenerator.kt:171 */
   15     24   
        use std::ops::Deref;
   16     25   
        self.region.deref()
          26  +
        /* StructureGenerator.kt:166 */
   17     27   
    }
          28  +
    /* StructureGenerator.kt:135 */
   18     29   
}
          30  +
/* ErrorImplGenerator.kt:99 */
   19     31   
impl UnsupportedRegionError {
          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 UnsupportedRegionError {
          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, "UnsupportedRegionError")?;
          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 UnsupportedRegionError {}
          63  +
/* ErrorGenerator.kt:77 */
   37     64   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UnsupportedRegionError {
          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 UnsupportedRegionError {
   43         -
    /// Creates a new builder-style object to manufacture [`UnsupportedRegionError`](crate::types::error::UnsupportedRegionError).
          73  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`UnsupportedRegionError`](crate::types::error::UnsupportedRegionError).
          74  +
    /* BuilderGenerator.kt:175 */
   44     75   
    pub fn builder() -> crate::types::error::builders::UnsupportedRegionErrorBuilder {
          76  +
        /* BuilderGenerator.kt:176 */
   45     77   
        crate::types::error::builders::UnsupportedRegionErrorBuilder::default()
          78  +
        /* BuilderGenerator.kt:175 */
   46     79   
    }
          80  +
    /* ErrorGenerator.kt:81 */
   47     81   
}
   48     82   
   49         -
/// A builder for [`UnsupportedRegionError`](crate::types::error::UnsupportedRegionError).
          83  +
/// /* BuilderGenerator.kt:342 */A builder for [`UnsupportedRegionError`](crate::types::error::UnsupportedRegionError).
          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 UnsupportedRegionErrorBuilder {
   53         -
    pub(crate) region: ::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) region: ::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 UnsupportedRegionErrorBuilder {
          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 region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         102  +
        /* BuilderGenerator.kt:292 */
   61    103   
        self.region = ::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_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         112  +
        /* BuilderGenerator.kt:315 */
   66    113   
        self.region = 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_region(&self) -> &::std::option::Option<::std::string::String> {
         121  +
        /* BuilderGenerator.kt:337 */
   71    122   
        &self.region
         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 [`UnsupportedRegionError`](crate::types::error::UnsupportedRegionError).
   99         -
    /// This method will fail if any of the following fields are not set:
  100         -
    /// - [`region`](crate::types::error::builders::UnsupportedRegionErrorBuilder::region)
         164  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`UnsupportedRegionError`](crate::types::error::UnsupportedRegionError).
         165  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         166  +
    /// /* BuilderGenerator.kt:246 */- [`region`](crate::types::error::builders::UnsupportedRegionErrorBuilder::region)
         167  +
    /* BuilderGenerator.kt:253 */
  101    168   
    pub fn build(self) -> ::std::result::Result<crate::types::error::UnsupportedRegionError, ::aws_smithy_types::error::operation::BuildError> {
  102         -
        ::std::result::Result::Ok(crate::types::error::UnsupportedRegionError {
  103         -
            region: self.region.ok_or_else(|| {
  104         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  105         -
                    "region",
  106         -
                    "region was not specified but it is required when building UnsupportedRegionError",
  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::UnsupportedRegionError {
         172  +
                /* BuilderGenerator.kt:481 */region: self.region
         173  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         174  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("region", "region was not specified but it is required when building UnsupportedRegionError")
         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   
}

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

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