Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_foo_enum.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_greeting_struct.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 GreetingStruct {
           8  +
pub /* StructureGenerator.kt:201 */ struct GreetingStruct {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub hi: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl GreetingStruct {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn hi(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.hi.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl GreetingStruct {
   16         -
    /// Creates a new builder-style object to manufacture [`GreetingStruct`](crate::types::GreetingStruct).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`GreetingStruct`](crate::types::GreetingStruct).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::GreetingStructBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::GreetingStructBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`GreetingStruct`](crate::types::GreetingStruct).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`GreetingStruct`](crate::types::GreetingStruct).
          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 GreetingStructBuilder {
   26         -
    pub(crate) hi: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) hi: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl GreetingStructBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn hi(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.hi = ::std::option::Option::Some(input.into());
          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_hi(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.hi = 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_hi(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.hi
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`GreetingStruct`](crate::types::GreetingStruct).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`GreetingStruct`](crate::types::GreetingStruct).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::GreetingStruct {
   45         -
        crate::types::GreetingStruct { hi: self.hi }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::GreetingStruct {
          82  +
            /* BuilderGenerator.kt:481 */ hi: self.hi,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_my_union.rs

@@ -1,1 +172,297 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// A union with a representative set of types for members.
           2  +
/* UnionGenerator.kt:67 */
           3  +
/// /* UnionGenerator.kt:67 */A union with a representative set of types for members.
           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 enum MyUnion {
           8  +
pub /* UnionGenerator.kt:85 */ enum MyUnion {
           9  +
    /* UnionGenerator.kt:90 */
    7     10   
    #[allow(missing_docs)] // documentation missing in model
          11  +
    /* UnionGenerator.kt:190 */
    8     12   
    BlobValue(::aws_smithy_types::Blob),
          13  +
    /* UnionGenerator.kt:90 */
    9     14   
    #[allow(missing_docs)] // documentation missing in model
          15  +
    /* UnionGenerator.kt:190 */
   10     16   
    BooleanValue(bool),
          17  +
    /* UnionGenerator.kt:90 */
   11     18   
    #[allow(missing_docs)] // documentation missing in model
          19  +
    /* UnionGenerator.kt:190 */
   12     20   
    EnumValue(crate::types::FooEnum),
   13         -
    #[allow(missing_docs)] // documentation missing in model
          21  +
    /* UnionGenerator.kt:90 */ #[allow(missing_docs)] // documentation missing in model
          22  +
    /* UnionGenerator.kt:190 */
   14     23   
    IntEnumValue(i32),
          24  +
    /* UnionGenerator.kt:90 */
   15     25   
    #[allow(missing_docs)] // documentation missing in model
          26  +
    /* UnionGenerator.kt:190 */
   16     27   
    ListValue(::std::vec::Vec<::std::string::String>),
          28  +
    /* UnionGenerator.kt:90 */
   17     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
    /* UnionGenerator.kt:190 */
   18     31   
    MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
   19         -
    #[allow(missing_docs)] // documentation missing in model
          32  +
    /* UnionGenerator.kt:90 */ #[allow(missing_docs)] // documentation missing in model
          33  +
    /* UnionGenerator.kt:190 */
   20     34   
    NumberValue(i32),
          35  +
    /* UnionGenerator.kt:90 */
   21     36   
    #[allow(missing_docs)] // documentation missing in model
          37  +
    /* UnionGenerator.kt:190 */
   22     38   
    StringValue(::std::string::String),
          39  +
    /* UnionGenerator.kt:90 */
   23     40   
    #[allow(missing_docs)] // documentation missing in model
          41  +
    /* UnionGenerator.kt:190 */
   24     42   
    StructureValue(crate::types::GreetingStruct),
          43  +
    /* UnionGenerator.kt:90 */
   25     44   
    #[allow(missing_docs)] // documentation missing in model
          45  +
    /* UnionGenerator.kt:190 */
   26     46   
    TimestampValue(::aws_smithy_types::DateTime),
   27         -
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          47  +
    /// /* UnionGenerator.kt:96 */The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          48  +
    /* UnionGenerator.kt:97 */
   28     49   
    /// An unknown enum variant
          50  +
    /* UnionGenerator.kt:98 */
   29     51   
    ///
          52  +
    /* UnionGenerator.kt:99 */
   30     53   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
          54  +
    /* UnionGenerator.kt:100 */
   31     55   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
          56  +
    /* UnionGenerator.kt:101 */
   32     57   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
          58  +
    /* UnionGenerator.kt:102 */
   33     59   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
          60  +
    /* RustType.kt:516 */
   34     61   
    #[non_exhaustive]
          62  +
    /* UnionGenerator.kt:105 */
   35     63   
    Unknown,
          64  +
    /* UnionGenerator.kt:85 */
   36     65   
}
          66  +
/* UnionGenerator.kt:111 */
   37     67   
impl MyUnion {
          68  +
    /* UnionGenerator.kt:217 */
   38     69   
    /// Tries to convert the enum instance into [`BlobValue`](crate::types::MyUnion::BlobValue), extracting the inner [`Blob`](::aws_smithy_types::Blob).
          70  +
    /* UnionGenerator.kt:222 */
   39     71   
    /// Returns `Err(&Self)` if it can't be converted.
          72  +
    /* UnionGenerator.kt:223 */
   40     73   
    pub fn as_blob_value(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
          74  +
        /* UnionGenerator.kt:227 */
   41     75   
        if let MyUnion::BlobValue(val) = &self {
   42     76   
            ::std::result::Result::Ok(val)
   43     77   
        } else {
   44     78   
            ::std::result::Result::Err(self)
   45     79   
        }
          80  +
        /* UnionGenerator.kt:223 */
   46     81   
    }
          82  +
    /* UnionGenerator.kt:121 */
   47     83   
    /// Returns true if this is a [`BlobValue`](crate::types::MyUnion::BlobValue).
          84  +
    /* UnionGenerator.kt:122 */
   48     85   
    pub fn is_blob_value(&self) -> bool {
          86  +
        /* UnionGenerator.kt:123 */
   49     87   
        self.as_blob_value().is_ok()
          88  +
        /* UnionGenerator.kt:122 */
   50     89   
    }
          90  +
    /* UnionGenerator.kt:217 */
   51     91   
    /// Tries to convert the enum instance into [`BooleanValue`](crate::types::MyUnion::BooleanValue), extracting the inner [`bool`](bool).
          92  +
    /* UnionGenerator.kt:222 */
   52     93   
    /// Returns `Err(&Self)` if it can't be converted.
          94  +
    /* UnionGenerator.kt:223 */
   53     95   
    pub fn as_boolean_value(&self) -> ::std::result::Result<&bool, &Self> {
          96  +
        /* UnionGenerator.kt:227 */
   54     97   
        if let MyUnion::BooleanValue(val) = &self {
   55     98   
            ::std::result::Result::Ok(val)
   56     99   
        } else {
   57    100   
            ::std::result::Result::Err(self)
   58    101   
        }
         102  +
        /* UnionGenerator.kt:223 */
   59    103   
    }
         104  +
    /* UnionGenerator.kt:121 */
   60    105   
    /// Returns true if this is a [`BooleanValue`](crate::types::MyUnion::BooleanValue).
         106  +
    /* UnionGenerator.kt:122 */
   61    107   
    pub fn is_boolean_value(&self) -> bool {
         108  +
        /* UnionGenerator.kt:123 */
   62    109   
        self.as_boolean_value().is_ok()
         110  +
        /* UnionGenerator.kt:122 */
   63    111   
    }
         112  +
    /* UnionGenerator.kt:217 */
   64    113   
    /// Tries to convert the enum instance into [`EnumValue`](crate::types::MyUnion::EnumValue), extracting the inner [`FooEnum`](crate::types::FooEnum).
         114  +
    /* UnionGenerator.kt:222 */
   65    115   
    /// Returns `Err(&Self)` if it can't be converted.
         116  +
    /* UnionGenerator.kt:223 */
   66    117   
    pub fn as_enum_value(&self) -> ::std::result::Result<&crate::types::FooEnum, &Self> {
         118  +
        /* UnionGenerator.kt:227 */
   67    119   
        if let MyUnion::EnumValue(val) = &self {
   68    120   
            ::std::result::Result::Ok(val)
   69    121   
        } else {
   70    122   
            ::std::result::Result::Err(self)
   71    123   
        }
         124  +
        /* UnionGenerator.kt:223 */
   72    125   
    }
         126  +
    /* UnionGenerator.kt:121 */
   73    127   
    /// Returns true if this is a [`EnumValue`](crate::types::MyUnion::EnumValue).
         128  +
    /* UnionGenerator.kt:122 */
   74    129   
    pub fn is_enum_value(&self) -> bool {
         130  +
        /* UnionGenerator.kt:123 */
   75    131   
        self.as_enum_value().is_ok()
         132  +
        /* UnionGenerator.kt:122 */
   76    133   
    }
         134  +
    /* UnionGenerator.kt:217 */
   77    135   
    /// Tries to convert the enum instance into [`IntEnumValue`](crate::types::MyUnion::IntEnumValue), extracting the inner [`i32`](i32).
         136  +
    /* UnionGenerator.kt:222 */
   78    137   
    /// Returns `Err(&Self)` if it can't be converted.
         138  +
    /* UnionGenerator.kt:223 */
   79    139   
    pub fn as_int_enum_value(&self) -> ::std::result::Result<&i32, &Self> {
         140  +
        /* UnionGenerator.kt:227 */
   80    141   
        if let MyUnion::IntEnumValue(val) = &self {
   81    142   
            ::std::result::Result::Ok(val)
   82    143   
        } else {
   83    144   
            ::std::result::Result::Err(self)
   84    145   
        }
         146  +
        /* UnionGenerator.kt:223 */
   85    147   
    }
         148  +
    /* UnionGenerator.kt:121 */
   86    149   
    /// Returns true if this is a [`IntEnumValue`](crate::types::MyUnion::IntEnumValue).
         150  +
    /* UnionGenerator.kt:122 */
   87    151   
    pub fn is_int_enum_value(&self) -> bool {
         152  +
        /* UnionGenerator.kt:123 */
   88    153   
        self.as_int_enum_value().is_ok()
         154  +
        /* UnionGenerator.kt:122 */
   89    155   
    }
         156  +
    /* UnionGenerator.kt:217 */
   90    157   
    /// Tries to convert the enum instance into [`ListValue`](crate::types::MyUnion::ListValue), extracting the inner [`Vec`](::std::vec::Vec).
         158  +
    /* UnionGenerator.kt:222 */
   91    159   
    /// Returns `Err(&Self)` if it can't be converted.
         160  +
    /* UnionGenerator.kt:223 */
   92    161   
    pub fn as_list_value(&self) -> ::std::result::Result<&::std::vec::Vec<::std::string::String>, &Self> {
         162  +
        /* UnionGenerator.kt:227 */
   93    163   
        if let MyUnion::ListValue(val) = &self {
   94    164   
            ::std::result::Result::Ok(val)
   95    165   
        } else {
   96    166   
            ::std::result::Result::Err(self)
   97    167   
        }
         168  +
        /* UnionGenerator.kt:223 */
   98    169   
    }
         170  +
    /* UnionGenerator.kt:121 */
   99    171   
    /// Returns true if this is a [`ListValue`](crate::types::MyUnion::ListValue).
         172  +
    /* UnionGenerator.kt:122 */
  100    173   
    pub fn is_list_value(&self) -> bool {
         174  +
        /* UnionGenerator.kt:123 */
  101    175   
        self.as_list_value().is_ok()
         176  +
        /* UnionGenerator.kt:122 */
  102    177   
    }
         178  +
    /* UnionGenerator.kt:217 */
  103    179   
    /// Tries to convert the enum instance into [`MapValue`](crate::types::MyUnion::MapValue), extracting the inner [`HashMap`](::std::collections::HashMap).
         180  +
    /* UnionGenerator.kt:222 */
  104    181   
    /// Returns `Err(&Self)` if it can't be converted.
         182  +
    /* UnionGenerator.kt:223 */
  105    183   
    pub fn as_map_value(&self) -> ::std::result::Result<&::std::collections::HashMap<::std::string::String, ::std::string::String>, &Self> {
         184  +
        /* UnionGenerator.kt:227 */
  106    185   
        if let MyUnion::MapValue(val) = &self {
  107    186   
            ::std::result::Result::Ok(val)
  108    187   
        } else {
  109    188   
            ::std::result::Result::Err(self)
  110    189   
        }
         190  +
        /* UnionGenerator.kt:223 */
  111    191   
    }
         192  +
    /* UnionGenerator.kt:121 */
  112    193   
    /// Returns true if this is a [`MapValue`](crate::types::MyUnion::MapValue).
         194  +
    /* UnionGenerator.kt:122 */
  113    195   
    pub fn is_map_value(&self) -> bool {
         196  +
        /* UnionGenerator.kt:123 */
  114    197   
        self.as_map_value().is_ok()
         198  +
        /* UnionGenerator.kt:122 */
  115    199   
    }
         200  +
    /* UnionGenerator.kt:217 */
  116    201   
    /// Tries to convert the enum instance into [`NumberValue`](crate::types::MyUnion::NumberValue), extracting the inner [`i32`](i32).
         202  +
    /* UnionGenerator.kt:222 */
  117    203   
    /// Returns `Err(&Self)` if it can't be converted.
         204  +
    /* UnionGenerator.kt:223 */
  118    205   
    pub fn as_number_value(&self) -> ::std::result::Result<&i32, &Self> {
         206  +
        /* UnionGenerator.kt:227 */
  119    207   
        if let MyUnion::NumberValue(val) = &self {
  120    208   
            ::std::result::Result::Ok(val)
  121    209   
        } else {
  122    210   
            ::std::result::Result::Err(self)
  123    211   
        }
         212  +
        /* UnionGenerator.kt:223 */
  124    213   
    }
         214  +
    /* UnionGenerator.kt:121 */
  125    215   
    /// Returns true if this is a [`NumberValue`](crate::types::MyUnion::NumberValue).
         216  +
    /* UnionGenerator.kt:122 */
  126    217   
    pub fn is_number_value(&self) -> bool {
         218  +
        /* UnionGenerator.kt:123 */
  127    219   
        self.as_number_value().is_ok()
         220  +
        /* UnionGenerator.kt:122 */
  128    221   
    }
         222  +
    /* UnionGenerator.kt:217 */
  129    223   
    /// Tries to convert the enum instance into [`StringValue`](crate::types::MyUnion::StringValue), extracting the inner [`String`](::std::string::String).
         224  +
    /* UnionGenerator.kt:222 */
  130    225   
    /// Returns `Err(&Self)` if it can't be converted.
         226  +
    /* UnionGenerator.kt:223 */
  131    227   
    pub fn as_string_value(&self) -> ::std::result::Result<&::std::string::String, &Self> {
         228  +
        /* UnionGenerator.kt:227 */
  132    229   
        if let MyUnion::StringValue(val) = &self {
  133    230   
            ::std::result::Result::Ok(val)
  134    231   
        } else {
  135    232   
            ::std::result::Result::Err(self)
  136    233   
        }
         234  +
        /* UnionGenerator.kt:223 */
  137    235   
    }
         236  +
    /* UnionGenerator.kt:121 */
  138    237   
    /// Returns true if this is a [`StringValue`](crate::types::MyUnion::StringValue).
         238  +
    /* UnionGenerator.kt:122 */
  139    239   
    pub fn is_string_value(&self) -> bool {
         240  +
        /* UnionGenerator.kt:123 */
  140    241   
        self.as_string_value().is_ok()
         242  +
        /* UnionGenerator.kt:122 */
  141    243   
    }
         244  +
    /* UnionGenerator.kt:217 */
  142    245   
    /// Tries to convert the enum instance into [`StructureValue`](crate::types::MyUnion::StructureValue), extracting the inner [`GreetingStruct`](crate::types::GreetingStruct).
         246  +
    /* UnionGenerator.kt:222 */
  143    247   
    /// Returns `Err(&Self)` if it can't be converted.
         248  +
    /* UnionGenerator.kt:223 */
  144    249   
    pub fn as_structure_value(&self) -> ::std::result::Result<&crate::types::GreetingStruct, &Self> {
         250  +
        /* UnionGenerator.kt:227 */
  145    251   
        if let MyUnion::StructureValue(val) = &self {
  146    252   
            ::std::result::Result::Ok(val)
  147    253   
        } else {
  148    254   
            ::std::result::Result::Err(self)
  149    255   
        }
         256  +
        /* UnionGenerator.kt:223 */
  150    257   
    }
         258  +
    /* UnionGenerator.kt:121 */
  151    259   
    /// Returns true if this is a [`StructureValue`](crate::types::MyUnion::StructureValue).
         260  +
    /* UnionGenerator.kt:122 */
  152    261   
    pub fn is_structure_value(&self) -> bool {
         262  +
        /* UnionGenerator.kt:123 */
  153    263   
        self.as_structure_value().is_ok()
         264  +
        /* UnionGenerator.kt:122 */
  154    265   
    }
         266  +
    /* UnionGenerator.kt:217 */
  155    267   
    /// Tries to convert the enum instance into [`TimestampValue`](crate::types::MyUnion::TimestampValue), extracting the inner [`DateTime`](::aws_smithy_types::DateTime).
         268  +
    /* UnionGenerator.kt:222 */
  156    269   
    /// Returns `Err(&Self)` if it can't be converted.
         270  +
    /* UnionGenerator.kt:223 */
  157    271   
    pub fn as_timestamp_value(&self) -> ::std::result::Result<&::aws_smithy_types::DateTime, &Self> {
         272  +
        /* UnionGenerator.kt:227 */
  158    273   
        if let MyUnion::TimestampValue(val) = &self {
  159    274   
            ::std::result::Result::Ok(val)
  160    275   
        } else {
  161    276   
            ::std::result::Result::Err(self)
  162    277   
        }
         278  +
        /* UnionGenerator.kt:223 */
  163    279   
    }
         280  +
    /* UnionGenerator.kt:121 */
  164    281   
    /// Returns true if this is a [`TimestampValue`](crate::types::MyUnion::TimestampValue).
         282  +
    /* UnionGenerator.kt:122 */
  165    283   
    pub fn is_timestamp_value(&self) -> bool {
         284  +
        /* UnionGenerator.kt:123 */
  166    285   
        self.as_timestamp_value().is_ok()
         286  +
        /* UnionGenerator.kt:122 */
  167    287   
    }
         288  +
    /* UnionGenerator.kt:127 */
  168    289   
    /// Returns true if the enum instance is the `Unknown` variant.
         290  +
    /* UnionGenerator.kt:128 */
  169    291   
    pub fn is_unknown(&self) -> bool {
         292  +
        /* UnionGenerator.kt:129 */
  170    293   
        matches!(self, Self::Unknown)
         294  +
        /* UnionGenerator.kt:128 */
  171    295   
    }
         296  +
    /* UnionGenerator.kt:111 */
  172    297   
}

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_test_enum.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/_top_level.rs

@@ -1,1 +112,191 @@
    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 TopLevel {
    6         -
    #[allow(missing_docs)] // documentation missing in model
           8  +
pub /* StructureGenerator.kt:201 */ struct TopLevel {
           9  +
    /* StructureGenerator.kt:231 */ #[allow(missing_docs)] // documentation missing in model
    7     10   
    pub dialog: crate::types::Dialog,
          11  +
    /* StructureGenerator.kt:231 */
    8     12   
    #[allow(missing_docs)] // documentation missing in model
    9     13   
    pub dialog_list: ::std::vec::Vec<crate::types::Dialog>,
          14  +
    /* StructureGenerator.kt:231 */
   10     15   
    #[allow(missing_docs)] // documentation missing in model
   11     16   
    pub dialog_map: ::std::collections::HashMap<::std::string::String, crate::types::Dialog>,
          17  +
    /* StructureGenerator.kt:201 */
   12     18   
}
          19  +
/* StructureGenerator.kt:135 */
   13     20   
impl TopLevel {
          21  +
    /* StructureGenerator.kt:231 */
   14     22   
    #[allow(missing_docs)] // documentation missing in model
          23  +
                           /* StructureGenerator.kt:166 */
   15     24   
    pub fn dialog(&self) -> &crate::types::Dialog {
          25  +
        /* StructureGenerator.kt:172 */
   16     26   
        &self.dialog
          27  +
        /* StructureGenerator.kt:166 */
   17     28   
    }
          29  +
    /* StructureGenerator.kt:231 */
   18     30   
    #[allow(missing_docs)] // documentation missing in model
          31  +
                           /* StructureGenerator.kt:166 */
   19     32   
    pub fn dialog_list(&self) -> &[crate::types::Dialog] {
          33  +
        /* StructureGenerator.kt:171 */
   20     34   
        use std::ops::Deref;
   21     35   
        self.dialog_list.deref()
          36  +
        /* StructureGenerator.kt:166 */
   22     37   
    }
          38  +
    /* StructureGenerator.kt:231 */
   23     39   
    #[allow(missing_docs)] // documentation missing in model
          40  +
                           /* StructureGenerator.kt:166 */
   24     41   
    pub fn dialog_map(&self) -> &::std::collections::HashMap<::std::string::String, crate::types::Dialog> {
          42  +
        /* StructureGenerator.kt:172 */
   25     43   
        &self.dialog_map
          44  +
        /* StructureGenerator.kt:166 */
   26     45   
    }
          46  +
    /* StructureGenerator.kt:135 */
   27     47   
}
          48  +
/* ClientCodegenVisitor.kt:237 */
   28     49   
impl TopLevel {
   29         -
    /// Creates a new builder-style object to manufacture [`TopLevel`](crate::types::TopLevel).
          50  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`TopLevel`](crate::types::TopLevel).
          51  +
    /* BuilderGenerator.kt:175 */
   30     52   
    pub fn builder() -> crate::types::builders::TopLevelBuilder {
          53  +
        /* BuilderGenerator.kt:176 */
   31     54   
        crate::types::builders::TopLevelBuilder::default()
          55  +
        /* BuilderGenerator.kt:175 */
   32     56   
    }
          57  +
    /* ClientCodegenVisitor.kt:237 */
   33     58   
}
   34     59   
   35         -
/// A builder for [`TopLevel`](crate::types::TopLevel).
          60  +
/// /* BuilderGenerator.kt:342 */A builder for [`TopLevel`](crate::types::TopLevel).
          61  +
/* RustType.kt:516 */
   36     62   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          63  +
/* RustType.kt:516 */
   37     64   
#[non_exhaustive]
          65  +
/* BuilderGenerator.kt:345 */
   38     66   
pub struct TopLevelBuilder {
   39         -
    pub(crate) dialog: ::std::option::Option<crate::types::Dialog>,
   40         -
    pub(crate) dialog_list: ::std::option::Option<::std::vec::Vec<crate::types::Dialog>>,
          67  +
    /* BuilderGenerator.kt:275 */ pub(crate) dialog: ::std::option::Option<crate::types::Dialog>,
          68  +
    /* BuilderGenerator.kt:275 */ pub(crate) dialog_list: ::std::option::Option<::std::vec::Vec<crate::types::Dialog>>,
          69  +
    /* BuilderGenerator.kt:275 */
   41     70   
    pub(crate) dialog_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Dialog>>,
          71  +
    /* BuilderGenerator.kt:345 */
   42     72   
}
          73  +
/* BuilderGenerator.kt:355 */
   43     74   
impl TopLevelBuilder {
          75  +
    /* BuilderGenerator.kt:286 */
   44     76   
    #[allow(missing_docs)] // documentation missing in model
   45         -
    /// This field is required.
          77  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          78  +
    /* BuilderGenerator.kt:291 */
   46     79   
    pub fn dialog(mut self, input: crate::types::Dialog) -> Self {
          80  +
        /* BuilderGenerator.kt:292 */
   47     81   
        self.dialog = ::std::option::Option::Some(input);
          82  +
        /* BuilderGenerator.kt:293 */
   48     83   
        self
          84  +
        /* BuilderGenerator.kt:291 */
   49     85   
    }
          86  +
    /* BuilderGenerator.kt:312 */
   50     87   
    #[allow(missing_docs)] // documentation missing in model
          88  +
                           /* BuilderGenerator.kt:314 */
   51     89   
    pub fn set_dialog(mut self, input: ::std::option::Option<crate::types::Dialog>) -> Self {
          90  +
        /* BuilderGenerator.kt:315 */
   52     91   
        self.dialog = input;
   53     92   
        self
          93  +
        /* BuilderGenerator.kt:314 */
   54     94   
    }
          95  +
    /* BuilderGenerator.kt:334 */
   55     96   
    #[allow(missing_docs)] // documentation missing in model
          97  +
                           /* BuilderGenerator.kt:336 */
   56     98   
    pub fn get_dialog(&self) -> &::std::option::Option<crate::types::Dialog> {
          99  +
        /* BuilderGenerator.kt:337 */
   57    100   
        &self.dialog
         101  +
        /* BuilderGenerator.kt:336 */
   58    102   
    }
   59         -
    /// Appends an item to `dialog_list`.
         103  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `dialog_list`.
         104  +
    /* BuilderGenerator.kt:411 */
   60    105   
    ///
   61         -
    /// To override the contents of this collection use [`set_dialog_list`](Self::set_dialog_list).
         106  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_dialog_list`](Self::set_dialog_list).
         107  +
    /* BuilderGenerator.kt:413 */
   62    108   
    ///
         109  +
    /* BuilderGenerator.kt:418 */
   63    110   
    pub fn dialog_list(mut self, input: crate::types::Dialog) -> Self {
         111  +
        /* BuilderGenerator.kt:419 */
   64    112   
        let mut v = self.dialog_list.unwrap_or_default();
   65    113   
        v.push(input);
   66    114   
        self.dialog_list = ::std::option::Option::Some(v);
   67    115   
        self
         116  +
        /* BuilderGenerator.kt:418 */
   68    117   
    }
         118  +
    /* BuilderGenerator.kt:312 */
   69    119   
    #[allow(missing_docs)] // documentation missing in model
         120  +
                           /* BuilderGenerator.kt:314 */
   70    121   
    pub fn set_dialog_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Dialog>>) -> Self {
         122  +
        /* BuilderGenerator.kt:315 */
   71    123   
        self.dialog_list = input;
   72    124   
        self
         125  +
        /* BuilderGenerator.kt:314 */
   73    126   
    }
         127  +
    /* BuilderGenerator.kt:334 */
   74    128   
    #[allow(missing_docs)] // documentation missing in model
         129  +
                           /* BuilderGenerator.kt:336 */
   75    130   
    pub fn get_dialog_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Dialog>> {
         131  +
        /* BuilderGenerator.kt:337 */
   76    132   
        &self.dialog_list
         133  +
        /* BuilderGenerator.kt:336 */
   77    134   
    }
   78         -
    /// Adds a key-value pair to `dialog_map`.
         135  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `dialog_map`.
         136  +
    /* BuilderGenerator.kt:437 */
   79    137   
    ///
   80         -
    /// To override the contents of this collection use [`set_dialog_map`](Self::set_dialog_map).
         138  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_dialog_map`](Self::set_dialog_map).
         139  +
    /* BuilderGenerator.kt:439 */
   81    140   
    ///
         141  +
    /* BuilderGenerator.kt:445 */
   82    142   
    pub fn dialog_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Dialog) -> Self {
         143  +
        /* BuilderGenerator.kt:448 */
   83    144   
        let mut hash_map = self.dialog_map.unwrap_or_default();
   84    145   
        hash_map.insert(k.into(), v);
   85    146   
        self.dialog_map = ::std::option::Option::Some(hash_map);
   86    147   
        self
         148  +
        /* BuilderGenerator.kt:445 */
   87    149   
    }
         150  +
    /* BuilderGenerator.kt:312 */
   88    151   
    #[allow(missing_docs)] // documentation missing in model
         152  +
                           /* BuilderGenerator.kt:314 */
   89    153   
    pub fn set_dialog_map(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Dialog>>) -> Self {
         154  +
        /* BuilderGenerator.kt:315 */
   90    155   
        self.dialog_map = input;
   91    156   
        self
         157  +
        /* BuilderGenerator.kt:314 */
   92    158   
    }
         159  +
    /* BuilderGenerator.kt:334 */
   93    160   
    #[allow(missing_docs)] // documentation missing in model
         161  +
                           /* BuilderGenerator.kt:336 */
   94    162   
    pub fn get_dialog_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Dialog>> {
         163  +
        /* BuilderGenerator.kt:337 */
   95    164   
        &self.dialog_map
         165  +
        /* BuilderGenerator.kt:336 */
   96    166   
    }
   97         -
    /// Consumes the builder and constructs a [`TopLevel`](crate::types::TopLevel).
   98         -
    /// This method will fail if any of the following fields are not set:
   99         -
    /// - [`dialog`](crate::types::builders::TopLevelBuilder::dialog)
         167  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`TopLevel`](crate::types::TopLevel).
         168  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         169  +
    /// /* BuilderGenerator.kt:246 */- [`dialog`](crate::types::builders::TopLevelBuilder::dialog)
         170  +
    /* BuilderGenerator.kt:253 */
  100    171   
    pub fn build(self) -> ::std::result::Result<crate::types::TopLevel, ::aws_smithy_types::error::operation::BuildError> {
  101         -
        ::std::result::Result::Ok(crate::types::TopLevel {
  102         -
            dialog: self.dialog.ok_or_else(|| {
  103         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  104         -
                    "dialog",
  105         -
                    "dialog was not specified but it is required when building TopLevel",
  106         -
                )
  107         -
            })?,
  108         -
            dialog_list: self.dialog_list.unwrap_or_default(),
  109         -
            dialog_map: self.dialog_map.unwrap_or_default(),
  110         -
        })
         172  +
        /* BuilderGenerator.kt:254 */
         173  +
        ::std::result::Result::Ok(
         174  +
            /* BuilderGenerator.kt:477 */crate::types::TopLevel {
         175  +
                /* BuilderGenerator.kt:481 */dialog: self.dialog
         176  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         177  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("dialog", "dialog was not specified but it is required when building TopLevel")
         178  +
                    /* BuilderGenerator.kt:494 */)?
         179  +
                ,
         180  +
                /* BuilderGenerator.kt:481 */dialog_list: self.dialog_list
         181  +
                    /* BuilderGenerator.kt:487 */.unwrap_or_default()
         182  +
                ,
         183  +
                /* BuilderGenerator.kt:481 */dialog_map: self.dialog_map
         184  +
                    /* BuilderGenerator.kt:487 */.unwrap_or_default()
         185  +
                ,
         186  +
            /* BuilderGenerator.kt:477 */}
         187  +
        /* BuilderGenerator.kt:254 */)
         188  +
        /* BuilderGenerator.kt:253 */
  111    189   
    }
         190  +
    /* BuilderGenerator.kt:355 */
  112    191   
}

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

@@ -1,1 +14,21 @@
    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::_dialog::DialogBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_farewell::FarewellBuilder;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_top_level::TopLevelBuilder;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_client_optional_defaults::ClientOptionalDefaultsBuilder;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_defaults::DefaultsBuilder;
   11     16   
          17  +
/* CodegenDelegator.kt:255 */
   12     18   
pub use crate::types::_greeting_struct::GreetingStructBuilder;
   13     19   
          20  +
/* CodegenDelegator.kt:255 */
   14     21   
pub use crate::types::_complex_nested_error_data::ComplexNestedErrorDataBuilder;

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

@@ -1,1 +15,21 @@
    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::_foo_error::FooError;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::error::_complex_error::ComplexError;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::error::_invalid_greeting::InvalidGreeting;
    7     10   
          11  +
/* RustModule.kt:172 */
    8     12   
mod _complex_error;
    9     13   
          14  +
/* RustModule.kt:172 */
   10     15   
mod _foo_error;
   11     16   
          17  +
/* RustModule.kt:172 */
   12     18   
mod _invalid_greeting;
   13     19   
   14         -
/// Builders
          20  +
/// /* CodegenDelegator.kt:51 */Builders
   15     21   
pub mod builders;

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/error/_complex_error.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/error/_foo_error.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/error/_invalid_greeting.rs

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

tmp-codegen-diff/codegen-client-test/json_rpc10/rust-client-codegen/src/types/error/builders.rs

@@ -1,1 +6,9 @@
    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::_foo_error::FooErrorBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::error::_complex_error::ComplexErrorBuilder;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::error::_invalid_greeting::InvalidGreetingBuilder;

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/client.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* FluentClientGenerator.kt:105 */
    2      3   
#[derive(Debug)]
    3      4   
pub(crate) struct Handle {
    4      5   
    pub(crate) conf: crate::Config,
    5      6   
    #[allow(dead_code)] // unused when a service does not provide any operations
    6      7   
    pub(crate) runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
    7      8   
}
    8      9   
    9     10   
///
   10     11   
/// An ergonomic client for Sample Json 1.1 Protocol Service.
   11     12   
///
@@ -77,78 +166,184 @@
   97     98   
    fn validate_config(handle: &Handle) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
   98     99   
        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
   99    100   
        handle
  100    101   
            .runtime_plugins
  101    102   
            .apply_client_configuration(&mut cfg)?
  102    103   
            .validate_base_client_config(&cfg)?;
  103    104   
        Ok(())
  104    105   
    }
  105    106   
}
  106    107   
         108  +
/* RustModule.kt:172 */
  107    109   
mod content_type_parameters;
  108    110   
  109         -
/// Operation customization and supporting types.
         111  +
/// /* ClientRustModule.kt:161 */Operation customization and supporting types.
  110    112   
///
  111         -
/// The underlying HTTP requests made during an operation can be customized
         113  +
/// /* ClientRustModule.kt:170 */The underlying HTTP requests made during an operation can be customized
  112    114   
/// by calling the `customize()` method on the builder returned from a client
  113    115   
/// operation call. For example, this can be used to add an additional HTTP header:
  114    116   
///
  115    117   
/// ```ignore
  116    118   
/// # async fn wrapper() -> ::std::result::Result<(), json_rpc11::Error> {
  117    119   
/// # let client: json_rpc11::Client = unimplemented!();
  118    120   
/// use ::http::header::{HeaderName, HeaderValue};
  119    121   
///
  120    122   
/// let result = client.content_type_parameters()
  121    123   
///     .customize()
  122    124   
///     .mutate_request(|req| {
  123    125   
///         // Add `x-example-header` with value
  124    126   
///         req.headers_mut()
  125    127   
///             .insert(
  126    128   
///                 HeaderName::from_static("x-example-header"),
  127    129   
///                 HeaderValue::from_static("1"),
  128    130   
///             );
  129    131   
///     })
  130    132   
///     .send()
  131    133   
///     .await;
  132    134   
/// # }
  133    135   
/// ```
  134    136   
pub mod customize;
  135    137   
         138  +
/* RustModule.kt:172 */
  136    139   
mod datetime_offsets;
  137    140   
         141  +
/* RustModule.kt:172 */
  138    142   
mod empty_operation;
  139    143   
         144  +
/* RustModule.kt:172 */
  140    145   
mod endpoint_operation;
  141    146   
         147  +
/* RustModule.kt:172 */
  142    148   
mod endpoint_with_host_label_operation;
  143    149   
         150  +
/* RustModule.kt:172 */
  144    151   
mod fractional_seconds;
  145    152   
         153  +
/* RustModule.kt:172 */
  146    154   
mod greeting_with_errors;
  147    155   
         156  +
/* RustModule.kt:172 */
  148    157   
mod host_with_path_operation;
  149    158   
         159  +
/* RustModule.kt:172 */
  150    160   
mod json_enums;
  151    161   
         162  +
/* RustModule.kt:172 */
  152    163   
mod json_unions;
  153    164   
         165  +
/* RustModule.kt:172 */
  154    166   
mod kitchen_sink_operation;
  155    167   
         168  +
/* RustModule.kt:172 */
  156    169   
mod null_operation;
  157    170   
         171  +
/* RustModule.kt:172 */
  158    172   
mod operation_with_optional_input_output;
  159    173   
         174  +
/* RustModule.kt:172 */
  160    175   
mod put_and_get_inline_documents;
  161    176   
         177  +
/* RustModule.kt:172 */
  162    178   
mod put_with_content_encoding;
  163    179   
         180  +
/* RustModule.kt:172 */
  164    181   
mod simple_scalar_properties;
  165    182   
         183  +
/* RustModule.kt:172 */
  166    184   
mod sparse_nulls_operation;

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/client/content_type_parameters.rs

@@ -1,1 +12,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* FluentClientGenerator.kt:187 */
    2      3   
impl super::Client {
           4  +
    /* FluentClientGenerator.kt:221 */
    3      5   
    /// Constructs a fluent builder for the [`ContentTypeParameters`](crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder) operation.
    4      6   
    ///
    5      7   
    /// - The fluent builder is configurable:
    6      8   
    ///   - [`value(i32)`](crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder::value) / [`set_value(Option<i32>)`](crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder::set_value):<br>required: **false**<br>(undocumented)<br>
    7      9   
    /// - On success, responds with [`ContentTypeParametersOutput`](crate::operation::content_type_parameters::ContentTypeParametersOutput)
    8     10   
    /// - On failure, responds with [`SdkError<ContentTypeParametersError>`](crate::operation::content_type_parameters::ContentTypeParametersError)
          11  +
    /* FluentClientGenerator.kt:234 */
    9     12   
    pub fn content_type_parameters(&self) -> crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder {
   10     13   
        crate::operation::content_type_parameters::builders::ContentTypeParametersFluentBuilder::new(self.handle.clone())
   11     14   
    }
          15  +
    /* FluentClientGenerator.kt:187 */
   12     16   
}

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/client/customize.rs

@@ -1,1 +32,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* CustomizableOperationGenerator.kt:72 */
    3      4   
/// `CustomizableOperation` allows for configuring a single operation invocation before it is sent.
    4      5   
pub struct CustomizableOperation<T, E, B> {
    5      6   
    customizable_send: B,
    6      7   
    config_override: ::std::option::Option<crate::config::Builder>,
    7      8   
    interceptors: Vec<::aws_smithy_runtime_api::client::interceptors::SharedInterceptor>,
    8      9   
    runtime_plugins: Vec<::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin>,
    9     10   
    _output: ::std::marker::PhantomData<T>,
   10     11   
    _error: ::std::marker::PhantomData<E>,
   11     12   
}
   12     13   

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/client/customize/internal.rs

@@ -1,1 +12,13 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CustomizableOperationGenerator.kt:204 */
    2      3   
pub type BoxFuture<T> = ::std::pin::Pin<::std::boxed::Box<dyn ::std::future::Future<Output = T> + ::std::marker::Send>>;
    3      4   
    4      5   
pub type SendResult<T, E> =
    5      6   
    ::std::result::Result<T, ::aws_smithy_runtime_api::client::result::SdkError<E, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>>;
    6      7   
    7      8   
pub trait CustomizableSend<T, E>: ::std::marker::Send + ::std::marker::Sync {
    8      9   
    // Takes an owned `self` as the implementation will internally call methods that take `self`.
    9     10   
    // If it took `&self`, that would make this trait object safe, but some implementing types do not
   10     11   
    // derive `Clone`, unable to yield `self` from `&self`.
   11     12   
    fn send(self, config_override: crate::config::Builder) -> BoxFuture<SendResult<T, E>>;

tmp-codegen-diff/codegen-client-test/json_rpc11/rust-client-codegen/src/client/datetime_offsets.rs

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