Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

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

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

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

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

@@ -1,1 +12,18 @@
    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::_greeting_struct::GreetingStructBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_complex_nested_error_data::ComplexNestedErrorDataBuilder;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_kitchen_sink::KitchenSinkBuilder;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_struct_with_json_name::StructWithJsonNameBuilder;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_simple_struct::SimpleStructBuilder;
   11     16   
          17  +
/* CodegenDelegator.kt:255 */
   12     18   
pub use crate::types::_empty_struct::EmptyStructBuilder;

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

@@ -1,1 +23,33 @@
    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  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::error::_error_without_members::ErrorWithoutMembers;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::error::_error_with_members::ErrorWithMembers;
   11     16   
          17  +
/* RustModule.kt:172 */
   12     18   
mod _complex_error;
   13     19   
          20  +
/* RustModule.kt:172 */
   14     21   
mod _error_with_members;
   15     22   
          23  +
/* RustModule.kt:172 */
   16     24   
mod _error_without_members;
   17     25   
          26  +
/* RustModule.kt:172 */
   18     27   
mod _foo_error;
   19     28   
          29  +
/* RustModule.kt:172 */
   20     30   
mod _invalid_greeting;
   21     31   
   22         -
/// Builders
          32  +
/// /* CodegenDelegator.kt:51 */Builders
   23     33   
pub mod builders;

tmp-codegen-diff/codegen-client-test/json_rpc11/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_rpc11/rust-client-codegen/src/types/error/_error_with_members.rs

@@ -1,1 +226,393 @@
    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 ErrorWithMembers {
           8  +
pub /* StructureGenerator.kt:201 */ struct ErrorWithMembers {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub code: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub complex_data: ::std::option::Option<crate::types::KitchenSink>,
   10         -
    #[allow(missing_docs)] // documentation missing in model
          15  +
    /* StructureGenerator.kt:231 */ #[allow(missing_docs)] // documentation missing in model
   11     16   
    pub integer_field: ::std::option::Option<i32>,
          17  +
    /* StructureGenerator.kt:231 */
   12     18   
    #[allow(missing_docs)] // documentation missing in model
   13     19   
    pub list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          20  +
    /* StructureGenerator.kt:231 */
   14     21   
    #[allow(missing_docs)] // documentation missing in model
   15     22   
    pub map_field: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
          23  +
    /* StructureGenerator.kt:231 */
   16     24   
    #[allow(missing_docs)] // documentation missing in model
   17     25   
    pub message: ::std::option::Option<::std::string::String>,
   18         -
    /// abc
          26  +
    /// /* StructureGenerator.kt:231 */abc
   19     27   
    pub string_field: ::std::option::Option<::std::string::String>,
   20         -
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          28  +
    /* ErrorGenerator.kt:53 */ pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          29  +
    /* StructureGenerator.kt:201 */
   21     30   
}
          31  +
/* StructureGenerator.kt:135 */
   22     32   
impl ErrorWithMembers {
          33  +
    /* StructureGenerator.kt:231 */
   23     34   
    #[allow(missing_docs)] // documentation missing in model
          35  +
                           /* StructureGenerator.kt:166 */
   24     36   
    pub fn code(&self) -> ::std::option::Option<&str> {
          37  +
        /* StructureGenerator.kt:169 */
   25     38   
        self.code.as_deref()
          39  +
        /* StructureGenerator.kt:166 */
   26     40   
    }
          41  +
    /* StructureGenerator.kt:231 */
   27     42   
    #[allow(missing_docs)] // documentation missing in model
          43  +
                           /* StructureGenerator.kt:166 */
   28     44   
    pub fn complex_data(&self) -> ::std::option::Option<&crate::types::KitchenSink> {
          45  +
        /* StructureGenerator.kt:170 */
   29     46   
        self.complex_data.as_ref()
          47  +
        /* StructureGenerator.kt:166 */
   30     48   
    }
          49  +
    /* StructureGenerator.kt:231 */
   31     50   
    #[allow(missing_docs)] // documentation missing in model
          51  +
                           /* StructureGenerator.kt:166 */
   32     52   
    pub fn integer_field(&self) -> ::std::option::Option<i32> {
          53  +
        /* StructureGenerator.kt:168 */
   33     54   
        self.integer_field
          55  +
        /* StructureGenerator.kt:166 */
   34     56   
    }
          57  +
    /* StructureGenerator.kt:231 */
   35     58   
    #[allow(missing_docs)] // documentation missing in model
   36         -
    ///
   37         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.list_field.is_none()`.
          59  +
    /// /* StructureGenerator.kt:162 */
          60  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.list_field.is_none()`.
          61  +
    /* StructureGenerator.kt:166 */
   38     62   
    pub fn list_field(&self) -> &[::std::string::String] {
   39         -
        self.list_field.as_deref().unwrap_or_default()
   40         -
    }
          63  +
        /* StructureGenerator.kt:169 */
          64  +
        self.list_field
          65  +
            .as_deref()
          66  +
            /* StructureGenerator.kt:175 */
          67  +
            .unwrap_or_default()
          68  +
        /* StructureGenerator.kt:166 */
          69  +
    }
          70  +
    /* StructureGenerator.kt:231 */
   41     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* StructureGenerator.kt:166 */
   42     73   
    pub fn map_field(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
          74  +
        /* StructureGenerator.kt:170 */
   43     75   
        self.map_field.as_ref()
          76  +
        /* StructureGenerator.kt:166 */
   44     77   
    }
   45         -
    /// abc
          78  +
    /// /* StructureGenerator.kt:231 */abc
          79  +
    /* StructureGenerator.kt:166 */
   46     80   
    pub fn string_field(&self) -> ::std::option::Option<&str> {
          81  +
        /* StructureGenerator.kt:169 */
   47     82   
        self.string_field.as_deref()
          83  +
        /* StructureGenerator.kt:166 */
   48     84   
    }
          85  +
    /* StructureGenerator.kt:135 */
   49     86   
}
          87  +
/* ErrorImplGenerator.kt:99 */
   50     88   
impl ErrorWithMembers {
          89  +
    /* ErrorImplGenerator.kt:128 */
   51     90   
    /// Returns the error message.
   52     91   
    pub fn message(&self) -> ::std::option::Option<&str> {
   53     92   
        self.message.as_deref()
   54     93   
    }
          94  +
    /* ErrorImplGenerator.kt:99 */
   55     95   
}
          96  +
/* ErrorImplGenerator.kt:153 */
   56     97   
impl ::std::fmt::Display for ErrorWithMembers {
          98  +
    /* ErrorImplGenerator.kt:154 */
   57     99   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         100  +
        /* ErrorImplGenerator.kt:161 */
   58    101   
        ::std::write!(f, "ErrorWithMembers")?;
         102  +
        /* ErrorImplGenerator.kt:166 */
   59    103   
        if let ::std::option::Option::Some(inner_1) = &self.message {
         104  +
            /* ErrorImplGenerator.kt:166 */
   60    105   
            {
         106  +
                /* ErrorImplGenerator.kt:167 */
   61    107   
                ::std::write!(f, ": {}", inner_1)?;
         108  +
                /* ErrorImplGenerator.kt:166 */
   62    109   
            }
         110  +
            /* ErrorImplGenerator.kt:166 */
   63    111   
        }
         112  +
        /* ErrorImplGenerator.kt:171 */
   64    113   
        Ok(())
         114  +
        /* ErrorImplGenerator.kt:154 */
   65    115   
    }
         116  +
    /* ErrorImplGenerator.kt:153 */
   66    117   
}
         118  +
/* ErrorImplGenerator.kt:175 */
   67    119   
impl ::std::error::Error for ErrorWithMembers {}
         120  +
/* ErrorGenerator.kt:77 */
   68    121   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ErrorWithMembers {
         122  +
    /* ErrorGenerator.kt:78 */
   69    123   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   70    124   
        &self.meta
   71    125   
    }
         126  +
    /* ErrorGenerator.kt:77 */
   72    127   
}
         128  +
/* ErrorGenerator.kt:81 */
   73    129   
impl ErrorWithMembers {
   74         -
    /// Creates a new builder-style object to manufacture [`ErrorWithMembers`](crate::types::error::ErrorWithMembers).
         130  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ErrorWithMembers`](crate::types::error::ErrorWithMembers).
         131  +
    /* BuilderGenerator.kt:175 */
   75    132   
    pub fn builder() -> crate::types::error::builders::ErrorWithMembersBuilder {
         133  +
        /* BuilderGenerator.kt:176 */
   76    134   
        crate::types::error::builders::ErrorWithMembersBuilder::default()
         135  +
        /* BuilderGenerator.kt:175 */
   77    136   
    }
         137  +
    /* ErrorGenerator.kt:81 */
   78    138   
}
   79    139   
   80         -
/// A builder for [`ErrorWithMembers`](crate::types::error::ErrorWithMembers).
         140  +
/// /* BuilderGenerator.kt:342 */A builder for [`ErrorWithMembers`](crate::types::error::ErrorWithMembers).
         141  +
/* RustType.kt:516 */
   81    142   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         143  +
/* RustType.kt:516 */
   82    144   
#[non_exhaustive]
         145  +
/* BuilderGenerator.kt:345 */
   83    146   
pub struct ErrorWithMembersBuilder {
   84         -
    pub(crate) code: ::std::option::Option<::std::string::String>,
   85         -
    pub(crate) complex_data: ::std::option::Option<crate::types::KitchenSink>,
   86         -
    pub(crate) integer_field: ::std::option::Option<i32>,
   87         -
    pub(crate) list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         147  +
    /* BuilderGenerator.kt:275 */ pub(crate) code: ::std::option::Option<::std::string::String>,
         148  +
    /* BuilderGenerator.kt:275 */ pub(crate) complex_data: ::std::option::Option<crate::types::KitchenSink>,
         149  +
    /* BuilderGenerator.kt:275 */ pub(crate) integer_field: ::std::option::Option<i32>,
         150  +
    /* BuilderGenerator.kt:275 */ pub(crate) list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         151  +
    /* BuilderGenerator.kt:275 */
   88    152   
    pub(crate) map_field: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
   89         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
   90         -
    pub(crate) string_field: ::std::option::Option<::std::string::String>,
   91         -
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         153  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
         154  +
    /* BuilderGenerator.kt:275 */ pub(crate) string_field: ::std::option::Option<::std::string::String>,
         155  +
    /* ErrorGenerator.kt:97 */ meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         156  +
    /* BuilderGenerator.kt:345 */
   92    157   
}
         158  +
/* BuilderGenerator.kt:355 */
   93    159   
impl ErrorWithMembersBuilder {
         160  +
    /* BuilderGenerator.kt:286 */
   94    161   
    #[allow(missing_docs)] // documentation missing in model
         162  +
                           /* BuilderGenerator.kt:291 */
   95    163   
    pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         164  +
        /* BuilderGenerator.kt:292 */
   96    165   
        self.code = ::std::option::Option::Some(input.into());
         166  +
        /* BuilderGenerator.kt:293 */
   97    167   
        self
         168  +
        /* BuilderGenerator.kt:291 */
   98    169   
    }
         170  +
    /* BuilderGenerator.kt:312 */
   99    171   
    #[allow(missing_docs)] // documentation missing in model
         172  +
                           /* BuilderGenerator.kt:314 */
  100    173   
    pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         174  +
        /* BuilderGenerator.kt:315 */
  101    175   
        self.code = input;
  102    176   
        self
         177  +
        /* BuilderGenerator.kt:314 */
  103    178   
    }
         179  +
    /* BuilderGenerator.kt:334 */
  104    180   
    #[allow(missing_docs)] // documentation missing in model
         181  +
                           /* BuilderGenerator.kt:336 */
  105    182   
    pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
         183  +
        /* BuilderGenerator.kt:337 */
  106    184   
        &self.code
         185  +
        /* BuilderGenerator.kt:336 */
  107    186   
    }
         187  +
    /* BuilderGenerator.kt:286 */
  108    188   
    #[allow(missing_docs)] // documentation missing in model
         189  +
                           /* BuilderGenerator.kt:291 */
  109    190   
    pub fn complex_data(mut self, input: crate::types::KitchenSink) -> Self {
         191  +
        /* BuilderGenerator.kt:292 */
  110    192   
        self.complex_data = ::std::option::Option::Some(input);
         193  +
        /* BuilderGenerator.kt:293 */
  111    194   
        self
         195  +
        /* BuilderGenerator.kt:291 */
  112    196   
    }
         197  +
    /* BuilderGenerator.kt:312 */
  113    198   
    #[allow(missing_docs)] // documentation missing in model
         199  +
                           /* BuilderGenerator.kt:314 */
  114    200   
    pub fn set_complex_data(mut self, input: ::std::option::Option<crate::types::KitchenSink>) -> Self {
         201  +
        /* BuilderGenerator.kt:315 */
  115    202   
        self.complex_data = input;
  116    203   
        self
         204  +
        /* BuilderGenerator.kt:314 */
  117    205   
    }
         206  +
    /* BuilderGenerator.kt:334 */
  118    207   
    #[allow(missing_docs)] // documentation missing in model
         208  +
                           /* BuilderGenerator.kt:336 */
  119    209   
    pub fn get_complex_data(&self) -> &::std::option::Option<crate::types::KitchenSink> {
         210  +
        /* BuilderGenerator.kt:337 */
  120    211   
        &self.complex_data
         212  +
        /* BuilderGenerator.kt:336 */
  121    213   
    }
         214  +
    /* BuilderGenerator.kt:286 */
  122    215   
    #[allow(missing_docs)] // documentation missing in model
         216  +
                           /* BuilderGenerator.kt:291 */
  123    217   
    pub fn integer_field(mut self, input: i32) -> Self {
         218  +
        /* BuilderGenerator.kt:292 */
  124    219   
        self.integer_field = ::std::option::Option::Some(input);
         220  +
        /* BuilderGenerator.kt:293 */
  125    221   
        self
         222  +
        /* BuilderGenerator.kt:291 */
  126    223   
    }
         224  +
    /* BuilderGenerator.kt:312 */
  127    225   
    #[allow(missing_docs)] // documentation missing in model
         226  +
                           /* BuilderGenerator.kt:314 */
  128    227   
    pub fn set_integer_field(mut self, input: ::std::option::Option<i32>) -> Self {
         228  +
        /* BuilderGenerator.kt:315 */
  129    229   
        self.integer_field = input;
  130    230   
        self
         231  +
        /* BuilderGenerator.kt:314 */
  131    232   
    }
         233  +
    /* BuilderGenerator.kt:334 */
  132    234   
    #[allow(missing_docs)] // documentation missing in model
         235  +
                           /* BuilderGenerator.kt:336 */
  133    236   
    pub fn get_integer_field(&self) -> &::std::option::Option<i32> {
         237  +
        /* BuilderGenerator.kt:337 */
  134    238   
        &self.integer_field
         239  +
        /* BuilderGenerator.kt:336 */
  135    240   
    }
  136         -
    /// Appends an item to `list_field`.
         241  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `list_field`.
         242  +
    /* BuilderGenerator.kt:411 */
  137    243   
    ///
  138         -
    /// To override the contents of this collection use [`set_list_field`](Self::set_list_field).
         244  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_list_field`](Self::set_list_field).
         245  +
    /* BuilderGenerator.kt:413 */
  139    246   
    ///
         247  +
    /* BuilderGenerator.kt:418 */
  140    248   
    pub fn list_field(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         249  +
        /* BuilderGenerator.kt:419 */
  141    250   
        let mut v = self.list_field.unwrap_or_default();
  142    251   
        v.push(input.into());
  143    252   
        self.list_field = ::std::option::Option::Some(v);
  144    253   
        self
         254  +
        /* BuilderGenerator.kt:418 */
  145    255   
    }
         256  +
    /* BuilderGenerator.kt:312 */
  146    257   
    #[allow(missing_docs)] // documentation missing in model
         258  +
                           /* BuilderGenerator.kt:314 */
  147    259   
    pub fn set_list_field(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         260  +
        /* BuilderGenerator.kt:315 */
  148    261   
        self.list_field = input;
  149    262   
        self
         263  +
        /* BuilderGenerator.kt:314 */
  150    264   
    }
         265  +
    /* BuilderGenerator.kt:334 */
  151    266   
    #[allow(missing_docs)] // documentation missing in model
         267  +
                           /* BuilderGenerator.kt:336 */
  152    268   
    pub fn get_list_field(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         269  +
        /* BuilderGenerator.kt:337 */
  153    270   
        &self.list_field
         271  +
        /* BuilderGenerator.kt:336 */
  154    272   
    }
  155         -
    /// Adds a key-value pair to `map_field`.
         273  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `map_field`.
         274  +
    /* BuilderGenerator.kt:437 */
  156    275   
    ///
  157         -
    /// To override the contents of this collection use [`set_map_field`](Self::set_map_field).
         276  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_map_field`](Self::set_map_field).
         277  +
    /* BuilderGenerator.kt:439 */
  158    278   
    ///
         279  +
    /* BuilderGenerator.kt:445 */
  159    280   
    pub fn map_field(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
         281  +
        /* BuilderGenerator.kt:448 */
  160    282   
        let mut hash_map = self.map_field.unwrap_or_default();
  161    283   
        hash_map.insert(k.into(), v.into());
  162    284   
        self.map_field = ::std::option::Option::Some(hash_map);
  163    285   
        self
         286  +
        /* BuilderGenerator.kt:445 */
  164    287   
    }
         288  +
    /* BuilderGenerator.kt:312 */
  165    289   
    #[allow(missing_docs)] // documentation missing in model
         290  +
                           /* BuilderGenerator.kt:314 */
  166    291   
    pub fn set_map_field(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
         292  +
        /* BuilderGenerator.kt:315 */
  167    293   
        self.map_field = input;
  168    294   
        self
         295  +
        /* BuilderGenerator.kt:314 */
  169    296   
    }
         297  +
    /* BuilderGenerator.kt:334 */
  170    298   
    #[allow(missing_docs)] // documentation missing in model
         299  +
                           /* BuilderGenerator.kt:336 */
  171    300   
    pub fn get_map_field(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
         301  +
        /* BuilderGenerator.kt:337 */
  172    302   
        &self.map_field
         303  +
        /* BuilderGenerator.kt:336 */
  173    304   
    }
         305  +
    /* BuilderGenerator.kt:286 */
  174    306   
    #[allow(missing_docs)] // documentation missing in model
         307  +
                           /* BuilderGenerator.kt:291 */
  175    308   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         309  +
        /* BuilderGenerator.kt:292 */
  176    310   
        self.message = ::std::option::Option::Some(input.into());
         311  +
        /* BuilderGenerator.kt:293 */
  177    312   
        self
         313  +
        /* BuilderGenerator.kt:291 */
  178    314   
    }
         315  +
    /* BuilderGenerator.kt:312 */
  179    316   
    #[allow(missing_docs)] // documentation missing in model
         317  +
                           /* BuilderGenerator.kt:314 */
  180    318   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         319  +
        /* BuilderGenerator.kt:315 */
  181    320   
        self.message = input;
  182    321   
        self
         322  +
        /* BuilderGenerator.kt:314 */
  183    323   
    }
         324  +
    /* BuilderGenerator.kt:334 */
  184    325   
    #[allow(missing_docs)] // documentation missing in model
         326  +
                           /* BuilderGenerator.kt:336 */
  185    327   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         328  +
        /* BuilderGenerator.kt:337 */
  186    329   
        &self.message
         330  +
        /* BuilderGenerator.kt:336 */
  187    331   
    }
  188         -
    /// abc
         332  +
    /// /* BuilderGenerator.kt:286 */abc
         333  +
    /* BuilderGenerator.kt:291 */
  189    334   
    pub fn string_field(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         335  +
        /* BuilderGenerator.kt:292 */
  190    336   
        self.string_field = ::std::option::Option::Some(input.into());
         337  +
        /* BuilderGenerator.kt:293 */
  191    338   
        self
         339  +
        /* BuilderGenerator.kt:291 */
  192    340   
    }
  193         -
    /// abc
         341  +
    /// /* BuilderGenerator.kt:312 */abc
         342  +
    /* BuilderGenerator.kt:314 */
  194    343   
    pub fn set_string_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         344  +
        /* BuilderGenerator.kt:315 */
  195    345   
        self.string_field = input;
  196    346   
        self
         347  +
        /* BuilderGenerator.kt:314 */
  197    348   
    }
  198         -
    /// abc
         349  +
    /// /* BuilderGenerator.kt:334 */abc
         350  +
    /* BuilderGenerator.kt:336 */
  199    351   
    pub fn get_string_field(&self) -> &::std::option::Option<::std::string::String> {
         352  +
        /* BuilderGenerator.kt:337 */
  200    353   
        &self.string_field
         354  +
        /* BuilderGenerator.kt:336 */
  201    355   
    }
         356  +
    /* ErrorGenerator.kt:101 */
  202    357   
    /// Sets error metadata
  203    358   
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  204    359   
        self.meta = Some(meta);
  205    360   
        self
  206    361   
    }
  207    362   
  208    363   
    /// Sets error metadata
  209    364   
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
  210    365   
        self.meta = meta;
  211    366   
        self
  212    367   
    }
  213         -
    /// Consumes the builder and constructs a [`ErrorWithMembers`](crate::types::error::ErrorWithMembers).
         368  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ErrorWithMembers`](crate::types::error::ErrorWithMembers).
         369  +
    /* BuilderGenerator.kt:253 */
  214    370   
    pub fn build(self) -> crate::types::error::ErrorWithMembers {
         371  +
        /* BuilderGenerator.kt:477 */
  215    372   
        crate::types::error::ErrorWithMembers {
  216         -
            code: self.code,
         373  +
            /* BuilderGenerator.kt:481 */ code: self.code,
         374  +
            /* BuilderGenerator.kt:481 */
  217    375   
            complex_data: self.complex_data,
         376  +
            /* BuilderGenerator.kt:481 */
  218    377   
            integer_field: self.integer_field,
         378  +
            /* BuilderGenerator.kt:481 */
  219    379   
            list_field: self.list_field,
         380  +
            /* BuilderGenerator.kt:481 */
  220    381   
            map_field: self.map_field,
         382  +
            /* BuilderGenerator.kt:481 */
  221    383   
            message: self.message,
         384  +
            /* BuilderGenerator.kt:481 */
  222    385   
            string_field: self.string_field,
         386  +
            /* ErrorGenerator.kt:120 */
  223    387   
            meta: self.meta.unwrap_or_default(),
         388  +
            /* BuilderGenerator.kt:477 */
  224    389   
        }
         390  +
        /* BuilderGenerator.kt:253 */
  225    391   
    }
         392  +
    /* BuilderGenerator.kt:355 */
  226    393   
}

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

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

tmp-codegen-diff/codegen-client-test/json_rpc11/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_rpc11/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_rpc11/rust-client-codegen/src/types/error/builders.rs

@@ -1,1 +10,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::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;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::error::_error_without_members::ErrorWithoutMembersBuilder;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::error::_error_with_members::ErrorWithMembersBuilder;

tmp-codegen-diff/codegen-client-test/misc/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 MiscService.
   11     12   
///
@@ -59,60 +126,133 @@
   79     80   
    fn validate_config(handle: &Handle) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
   80     81   
        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
   81     82   
        handle
   82     83   
            .runtime_plugins
   83     84   
            .apply_client_configuration(&mut cfg)?
   84     85   
            .validate_base_client_config(&cfg)?;
   85     86   
        Ok(())
   86     87   
    }
   87     88   
}
   88     89   
   89         -
/// Operation customization and supporting types.
          90  +
/// /* ClientRustModule.kt:161 */Operation customization and supporting types.
   90     91   
///
   91         -
/// The underlying HTTP requests made during an operation can be customized
          92  +
/// /* ClientRustModule.kt:170 */The underlying HTTP requests made during an operation can be customized
   92     93   
/// by calling the `customize()` method on the builder returned from a client
   93     94   
/// operation call. For example, this can be used to add an additional HTTP header:
   94     95   
///
   95     96   
/// ```ignore
   96     97   
/// # async fn wrapper() -> ::std::result::Result<(), misc::Error> {
   97     98   
/// # let client: misc::Client = unimplemented!();
   98     99   
/// use ::http::header::{HeaderName, HeaderValue};
   99    100   
///
  100    101   
/// let result = client.required_header_collection_operation()
  101    102   
///     .customize()
  102    103   
///     .mutate_request(|req| {
  103    104   
///         // Add `x-example-header` with value
  104    105   
///         req.headers_mut()
  105    106   
///             .insert(
  106    107   
///                 HeaderName::from_static("x-example-header"),
  107    108   
///                 HeaderValue::from_static("1"),
  108    109   
///             );
  109    110   
///     })
  110    111   
///     .send()
  111    112   
///     .await;
  112    113   
/// # }
  113    114   
/// ```
  114    115   
pub mod customize;
  115    116   
         117  +
/* RustModule.kt:172 */
  116    118   
mod required_header_collection_operation;
  117    119   
         120  +
/* RustModule.kt:172 */
  118    121   
mod required_inner_shape_operation;
  119    122   
         123  +
/* RustModule.kt:172 */
  120    124   
mod response_code_default_operation;
  121    125   
         126  +
/* RustModule.kt:172 */
  122    127   
mod response_code_http_fallback_operation;
  123    128   
         129  +
/* RustModule.kt:172 */
  124    130   
mod response_code_required_operation;
  125    131   
         132  +
/* RustModule.kt:172 */
  126    133   
mod type_complexity_operation;

tmp-codegen-diff/codegen-client-test/misc/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/misc/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/misc/rust-client-codegen/src/client/required_header_collection_operation.rs

@@ -1,1 +17,21 @@
    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 [`RequiredHeaderCollectionOperation`](crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationFluentBuilder) operation.
    4      6   
    ///
    5      7   
    /// - The fluent builder is configurable:
    6      8   
    ///   - [`required_header_list(impl Into<String>)`](crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationFluentBuilder::required_header_list) / [`set_required_header_list(Option<Vec::<String>>)`](crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationFluentBuilder::set_required_header_list):<br>required: **true**<br>(undocumented)<br>
    7      9   
    ///   - [`required_header_set(impl Into<String>)`](crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationFluentBuilder::required_header_set) / [`set_required_header_set(Option<Vec::<String>>)`](crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationFluentBuilder::set_required_header_set):<br>required: **true**<br>(undocumented)<br>
    8     10   
    /// - On success, responds with [`RequiredHeaderCollectionOperationOutput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput) with field(s):
    9     11   
    ///   - [`required_header_list(Vec::<String>)`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput::required_header_list): (undocumented)
   10     12   
    ///   - [`required_header_set(Vec::<String>)`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput::required_header_set): (undocumented)
   11     13   
    /// - On failure, responds with [`SdkError<RequiredHeaderCollectionOperationError>`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError)
          14  +
    /* FluentClientGenerator.kt:234 */
   12     15   
    pub fn required_header_collection_operation(
   13     16   
        &self,
   14     17   
    ) -> crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationFluentBuilder {
   15     18   
        crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationFluentBuilder::new(self.handle.clone())
   16     19   
    }
          20  +
    /* FluentClientGenerator.kt:187 */
   17     21   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/client/required_inner_shape_operation.rs

@@ -1,1 +15,19 @@
    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 [`RequiredInnerShapeOperation`](crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationFluentBuilder) operation.
    4      6   
    ///
    5      7   
    /// - The fluent builder is configurable:
    6      8   
    ///   - [`inner(InnerShape)`](crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationFluentBuilder::inner) / [`set_inner(Option<InnerShape>)`](crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationFluentBuilder::set_inner):<br>required: **false**<br>(undocumented)<br>
    7      9   
    /// - On success, responds with [`RequiredInnerShapeOperationOutput`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput) with field(s):
    8     10   
    ///   - [`inner(Option<InnerShape>)`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput::inner): (undocumented)
    9     11   
    /// - On failure, responds with [`SdkError<RequiredInnerShapeOperationError>`](crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError)
          12  +
    /* FluentClientGenerator.kt:234 */
   10     13   
    pub fn required_inner_shape_operation(
   11     14   
        &self,
   12     15   
    ) -> crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationFluentBuilder {
   13     16   
        crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationFluentBuilder::new(self.handle.clone())
   14     17   
    }
          18  +
    /* FluentClientGenerator.kt:187 */
   15     19   
}