Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/operation/structs/_structs_input.rs

@@ -1,1 +151,276 @@
    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 StructsInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StructsInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub result: ::std::option::Option<crate::types::Result>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub option: ::std::option::Option<crate::types::Option>,
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[allow(missing_docs)] // documentation missing in model
   13     20   
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          21  +
    /* StructureGenerator.kt:231 */
   14     22   
    #[allow(missing_docs)] // documentation missing in model
   15     23   
    pub something_else: ::std::option::Option<crate::types::SomethingElse>,
          24  +
    /* StructureGenerator.kt:201 */
   16     25   
}
          26  +
/* StructureGenerator.kt:135 */
   17     27   
impl StructsInput {
          28  +
    /* StructureGenerator.kt:231 */
   18     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
                           /* StructureGenerator.kt:166 */
   19     31   
    pub fn result(&self) -> ::std::option::Option<&crate::types::Result> {
          32  +
        /* StructureGenerator.kt:170 */
   20     33   
        self.result.as_ref()
          34  +
        /* StructureGenerator.kt:166 */
   21     35   
    }
          36  +
    /* StructureGenerator.kt:231 */
   22     37   
    #[allow(missing_docs)] // documentation missing in model
   23         -
    ///
   24         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.result_list.is_none()`.
          38  +
    /// /* StructureGenerator.kt:162 */
          39  +
    /// /* 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 `.result_list.is_none()`.
          40  +
    /* StructureGenerator.kt:166 */
   25     41   
    pub fn result_list(&self) -> &[crate::types::Result] {
   26         -
        self.result_list.as_deref().unwrap_or_default()
          42  +
        /* StructureGenerator.kt:169 */
          43  +
        self.result_list
          44  +
            .as_deref()
          45  +
            /* StructureGenerator.kt:175 */
          46  +
            .unwrap_or_default()
          47  +
        /* StructureGenerator.kt:166 */
   27     48   
    }
          49  +
    /* StructureGenerator.kt:231 */
   28     50   
    #[allow(missing_docs)] // documentation missing in model
          51  +
                           /* StructureGenerator.kt:166 */
   29     52   
    pub fn option(&self) -> ::std::option::Option<&crate::types::Option> {
          53  +
        /* StructureGenerator.kt:170 */
   30     54   
        self.option.as_ref()
          55  +
        /* StructureGenerator.kt:166 */
   31     56   
    }
          57  +
    /* StructureGenerator.kt:231 */
   32     58   
    #[allow(missing_docs)] // documentation missing in model
   33         -
    ///
   34         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.option_list.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 `.option_list.is_none()`.
          61  +
    /* StructureGenerator.kt:166 */
   35     62   
    pub fn option_list(&self) -> &[crate::types::Result] {
   36         -
        self.option_list.as_deref().unwrap_or_default()
          63  +
        /* StructureGenerator.kt:169 */
          64  +
        self.option_list
          65  +
            .as_deref()
          66  +
            /* StructureGenerator.kt:175 */
          67  +
            .unwrap_or_default()
          68  +
        /* StructureGenerator.kt:166 */
   37     69   
    }
          70  +
    /* StructureGenerator.kt:231 */
   38     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* StructureGenerator.kt:166 */
   39     73   
    pub fn something_else(&self) -> ::std::option::Option<&crate::types::SomethingElse> {
          74  +
        /* StructureGenerator.kt:170 */
   40     75   
        self.something_else.as_ref()
          76  +
        /* StructureGenerator.kt:166 */
   41     77   
    }
          78  +
    /* StructureGenerator.kt:135 */
   42     79   
}
          80  +
/* ClientCodegenVisitor.kt:237 */
   43     81   
impl StructsInput {
   44         -
    /// Creates a new builder-style object to manufacture [`StructsInput`](crate::operation::structs::StructsInput).
          82  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StructsInput`](crate::operation::structs::StructsInput).
          83  +
    /* BuilderGenerator.kt:175 */
   45     84   
    pub fn builder() -> crate::operation::structs::builders::StructsInputBuilder {
          85  +
        /* BuilderGenerator.kt:176 */
   46     86   
        crate::operation::structs::builders::StructsInputBuilder::default()
          87  +
        /* BuilderGenerator.kt:175 */
   47     88   
    }
          89  +
    /* ClientCodegenVisitor.kt:237 */
   48     90   
}
   49     91   
   50         -
/// A builder for [`StructsInput`](crate::operation::structs::StructsInput).
          92  +
/// /* BuilderGenerator.kt:342 */A builder for [`StructsInput`](crate::operation::structs::StructsInput).
          93  +
/* RustType.kt:516 */
   51     94   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          95  +
/* RustType.kt:516 */
   52     96   
#[non_exhaustive]
          97  +
/* BuilderGenerator.kt:345 */
   53     98   
pub struct StructsInputBuilder {
   54         -
    pub(crate) result: ::std::option::Option<crate::types::Result>,
   55         -
    pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
   56         -
    pub(crate) option: ::std::option::Option<crate::types::Option>,
   57         -
    pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          99  +
    /* BuilderGenerator.kt:275 */ pub(crate) result: ::std::option::Option<crate::types::Result>,
         100  +
    /* BuilderGenerator.kt:275 */ pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
         101  +
    /* BuilderGenerator.kt:275 */ pub(crate) option: ::std::option::Option<crate::types::Option>,
         102  +
    /* BuilderGenerator.kt:275 */ pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
         103  +
    /* BuilderGenerator.kt:275 */
   58    104   
    pub(crate) something_else: ::std::option::Option<crate::types::SomethingElse>,
         105  +
    /* BuilderGenerator.kt:345 */
   59    106   
}
         107  +
/* BuilderGenerator.kt:355 */
   60    108   
impl StructsInputBuilder {
         109  +
    /* BuilderGenerator.kt:286 */
   61    110   
    #[allow(missing_docs)] // documentation missing in model
         111  +
                           /* BuilderGenerator.kt:291 */
   62    112   
    pub fn result(mut self, input: crate::types::Result) -> Self {
         113  +
        /* BuilderGenerator.kt:292 */
   63    114   
        self.result = ::std::option::Option::Some(input);
         115  +
        /* BuilderGenerator.kt:293 */
   64    116   
        self
         117  +
        /* BuilderGenerator.kt:291 */
   65    118   
    }
         119  +
    /* BuilderGenerator.kt:312 */
   66    120   
    #[allow(missing_docs)] // documentation missing in model
         121  +
                           /* BuilderGenerator.kt:314 */
   67    122   
    pub fn set_result(mut self, input: ::std::option::Option<crate::types::Result>) -> Self {
         123  +
        /* BuilderGenerator.kt:315 */
   68    124   
        self.result = input;
   69    125   
        self
         126  +
        /* BuilderGenerator.kt:314 */
   70    127   
    }
         128  +
    /* BuilderGenerator.kt:334 */
   71    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* BuilderGenerator.kt:336 */
   72    131   
    pub fn get_result(&self) -> &::std::option::Option<crate::types::Result> {
         132  +
        /* BuilderGenerator.kt:337 */
   73    133   
        &self.result
         134  +
        /* BuilderGenerator.kt:336 */
   74    135   
    }
   75         -
    /// Appends an item to `result_list`.
         136  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `result_list`.
         137  +
    /* BuilderGenerator.kt:411 */
   76    138   
    ///
   77         -
    /// To override the contents of this collection use [`set_result_list`](Self::set_result_list).
         139  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_result_list`](Self::set_result_list).
         140  +
    /* BuilderGenerator.kt:413 */
   78    141   
    ///
         142  +
    /* BuilderGenerator.kt:418 */
   79    143   
    pub fn result_list(mut self, input: crate::types::Result) -> Self {
         144  +
        /* BuilderGenerator.kt:419 */
   80    145   
        let mut v = self.result_list.unwrap_or_default();
   81    146   
        v.push(input);
   82    147   
        self.result_list = ::std::option::Option::Some(v);
   83    148   
        self
         149  +
        /* BuilderGenerator.kt:418 */
   84    150   
    }
         151  +
    /* BuilderGenerator.kt:312 */
   85    152   
    #[allow(missing_docs)] // documentation missing in model
         153  +
                           /* BuilderGenerator.kt:314 */
   86    154   
    pub fn set_result_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
         155  +
        /* BuilderGenerator.kt:315 */
   87    156   
        self.result_list = input;
   88    157   
        self
         158  +
        /* BuilderGenerator.kt:314 */
   89    159   
    }
         160  +
    /* BuilderGenerator.kt:334 */
   90    161   
    #[allow(missing_docs)] // documentation missing in model
         162  +
                           /* BuilderGenerator.kt:336 */
   91    163   
    pub fn get_result_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
         164  +
        /* BuilderGenerator.kt:337 */
   92    165   
        &self.result_list
         166  +
        /* BuilderGenerator.kt:336 */
   93    167   
    }
         168  +
    /* BuilderGenerator.kt:286 */
   94    169   
    #[allow(missing_docs)] // documentation missing in model
         170  +
                           /* BuilderGenerator.kt:291 */
   95    171   
    pub fn option(mut self, input: crate::types::Option) -> Self {
         172  +
        /* BuilderGenerator.kt:292 */
   96    173   
        self.option = ::std::option::Option::Some(input);
         174  +
        /* BuilderGenerator.kt:293 */
   97    175   
        self
         176  +
        /* BuilderGenerator.kt:291 */
   98    177   
    }
         178  +
    /* BuilderGenerator.kt:312 */
   99    179   
    #[allow(missing_docs)] // documentation missing in model
         180  +
                           /* BuilderGenerator.kt:314 */
  100    181   
    pub fn set_option(mut self, input: ::std::option::Option<crate::types::Option>) -> Self {
         182  +
        /* BuilderGenerator.kt:315 */
  101    183   
        self.option = input;
  102    184   
        self
         185  +
        /* BuilderGenerator.kt:314 */
  103    186   
    }
         187  +
    /* BuilderGenerator.kt:334 */
  104    188   
    #[allow(missing_docs)] // documentation missing in model
         189  +
                           /* BuilderGenerator.kt:336 */
  105    190   
    pub fn get_option(&self) -> &::std::option::Option<crate::types::Option> {
         191  +
        /* BuilderGenerator.kt:337 */
  106    192   
        &self.option
         193  +
        /* BuilderGenerator.kt:336 */
  107    194   
    }
  108         -
    /// Appends an item to `option_list`.
         195  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `option_list`.
         196  +
    /* BuilderGenerator.kt:411 */
  109    197   
    ///
  110         -
    /// To override the contents of this collection use [`set_option_list`](Self::set_option_list).
         198  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_option_list`](Self::set_option_list).
         199  +
    /* BuilderGenerator.kt:413 */
  111    200   
    ///
         201  +
    /* BuilderGenerator.kt:418 */
  112    202   
    pub fn option_list(mut self, input: crate::types::Result) -> Self {
         203  +
        /* BuilderGenerator.kt:419 */
  113    204   
        let mut v = self.option_list.unwrap_or_default();
  114    205   
        v.push(input);
  115    206   
        self.option_list = ::std::option::Option::Some(v);
  116    207   
        self
         208  +
        /* BuilderGenerator.kt:418 */
  117    209   
    }
         210  +
    /* BuilderGenerator.kt:312 */
  118    211   
    #[allow(missing_docs)] // documentation missing in model
         212  +
                           /* BuilderGenerator.kt:314 */
  119    213   
    pub fn set_option_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
         214  +
        /* BuilderGenerator.kt:315 */
  120    215   
        self.option_list = input;
  121    216   
        self
         217  +
        /* BuilderGenerator.kt:314 */
  122    218   
    }
         219  +
    /* BuilderGenerator.kt:334 */
  123    220   
    #[allow(missing_docs)] // documentation missing in model
         221  +
                           /* BuilderGenerator.kt:336 */
  124    222   
    pub fn get_option_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
         223  +
        /* BuilderGenerator.kt:337 */
  125    224   
        &self.option_list
         225  +
        /* BuilderGenerator.kt:336 */
  126    226   
    }
         227  +
    /* BuilderGenerator.kt:286 */
  127    228   
    #[allow(missing_docs)] // documentation missing in model
         229  +
                           /* BuilderGenerator.kt:291 */
  128    230   
    pub fn something_else(mut self, input: crate::types::SomethingElse) -> Self {
         231  +
        /* BuilderGenerator.kt:292 */
  129    232   
        self.something_else = ::std::option::Option::Some(input);
         233  +
        /* BuilderGenerator.kt:293 */
  130    234   
        self
         235  +
        /* BuilderGenerator.kt:291 */
  131    236   
    }
         237  +
    /* BuilderGenerator.kt:312 */
  132    238   
    #[allow(missing_docs)] // documentation missing in model
         239  +
                           /* BuilderGenerator.kt:314 */
  133    240   
    pub fn set_something_else(mut self, input: ::std::option::Option<crate::types::SomethingElse>) -> Self {
         241  +
        /* BuilderGenerator.kt:315 */
  134    242   
        self.something_else = input;
  135    243   
        self
         244  +
        /* BuilderGenerator.kt:314 */
  136    245   
    }
         246  +
    /* BuilderGenerator.kt:334 */
  137    247   
    #[allow(missing_docs)] // documentation missing in model
         248  +
                           /* BuilderGenerator.kt:336 */
  138    249   
    pub fn get_something_else(&self) -> &::std::option::Option<crate::types::SomethingElse> {
         250  +
        /* BuilderGenerator.kt:337 */
  139    251   
        &self.something_else
         252  +
        /* BuilderGenerator.kt:336 */
  140    253   
    }
  141         -
    /// Consumes the builder and constructs a [`StructsInput`](crate::operation::structs::StructsInput).
         254  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StructsInput`](crate::operation::structs::StructsInput).
         255  +
    /* BuilderGenerator.kt:253 */
  142    256   
    pub fn build(self) -> ::std::result::Result<crate::operation::structs::StructsInput, ::aws_smithy_types::error::operation::BuildError> {
  143         -
        ::std::result::Result::Ok(crate::operation::structs::StructsInput {
  144         -
            result: self.result,
         257  +
        /* BuilderGenerator.kt:254 */
         258  +
        ::std::result::Result::Ok(
         259  +
            /* BuilderGenerator.kt:477 */
         260  +
            crate::operation::structs::StructsInput {
         261  +
                /* BuilderGenerator.kt:481 */ result: self.result,
         262  +
                /* BuilderGenerator.kt:481 */
  145    263   
                result_list: self.result_list,
         264  +
                /* BuilderGenerator.kt:481 */
  146    265   
                option: self.option,
         266  +
                /* BuilderGenerator.kt:481 */
  147    267   
                option_list: self.option_list,
         268  +
                /* BuilderGenerator.kt:481 */
  148    269   
                something_else: self.something_else,
  149         -
        })
         270  +
                /* BuilderGenerator.kt:477 */
         271  +
            }, /* BuilderGenerator.kt:254 */
         272  +
        )
         273  +
        /* BuilderGenerator.kt:253 */
  150    274   
    }
         275  +
    /* BuilderGenerator.kt:355 */
  151    276   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/operation/structs/_structs_output.rs

@@ -1,1 +151,273 @@
    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 StructsOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StructsOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub result: ::std::option::Option<crate::types::Result>,
          12  +
    /* StructureGenerator.kt:231 */
    8     13   
    #[allow(missing_docs)] // documentation missing in model
    9     14   
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          15  +
    /* StructureGenerator.kt:231 */
   10     16   
    #[allow(missing_docs)] // documentation missing in model
   11     17   
    pub option: ::std::option::Option<crate::types::Option>,
          18  +
    /* StructureGenerator.kt:231 */
   12     19   
    #[allow(missing_docs)] // documentation missing in model
   13     20   
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          21  +
    /* StructureGenerator.kt:231 */
   14     22   
    #[allow(missing_docs)] // documentation missing in model
   15     23   
    pub something_else: ::std::option::Option<crate::types::SomethingElse>,
          24  +
    /* StructureGenerator.kt:201 */
   16     25   
}
          26  +
/* StructureGenerator.kt:135 */
   17     27   
impl StructsOutput {
          28  +
    /* StructureGenerator.kt:231 */
   18     29   
    #[allow(missing_docs)] // documentation missing in model
          30  +
                           /* StructureGenerator.kt:166 */
   19     31   
    pub fn result(&self) -> ::std::option::Option<&crate::types::Result> {
          32  +
        /* StructureGenerator.kt:170 */
   20     33   
        self.result.as_ref()
          34  +
        /* StructureGenerator.kt:166 */
   21     35   
    }
          36  +
    /* StructureGenerator.kt:231 */
   22     37   
    #[allow(missing_docs)] // documentation missing in model
   23         -
    ///
   24         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.result_list.is_none()`.
          38  +
    /// /* StructureGenerator.kt:162 */
          39  +
    /// /* 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 `.result_list.is_none()`.
          40  +
    /* StructureGenerator.kt:166 */
   25     41   
    pub fn result_list(&self) -> &[crate::types::Result] {
   26         -
        self.result_list.as_deref().unwrap_or_default()
          42  +
        /* StructureGenerator.kt:169 */
          43  +
        self.result_list
          44  +
            .as_deref()
          45  +
            /* StructureGenerator.kt:175 */
          46  +
            .unwrap_or_default()
          47  +
        /* StructureGenerator.kt:166 */
   27     48   
    }
          49  +
    /* StructureGenerator.kt:231 */
   28     50   
    #[allow(missing_docs)] // documentation missing in model
          51  +
                           /* StructureGenerator.kt:166 */
   29     52   
    pub fn option(&self) -> ::std::option::Option<&crate::types::Option> {
          53  +
        /* StructureGenerator.kt:170 */
   30     54   
        self.option.as_ref()
          55  +
        /* StructureGenerator.kt:166 */
   31     56   
    }
          57  +
    /* StructureGenerator.kt:231 */
   32     58   
    #[allow(missing_docs)] // documentation missing in model
   33         -
    ///
   34         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.option_list.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 `.option_list.is_none()`.
          61  +
    /* StructureGenerator.kt:166 */
   35     62   
    pub fn option_list(&self) -> &[crate::types::Result] {
   36         -
        self.option_list.as_deref().unwrap_or_default()
          63  +
        /* StructureGenerator.kt:169 */
          64  +
        self.option_list
          65  +
            .as_deref()
          66  +
            /* StructureGenerator.kt:175 */
          67  +
            .unwrap_or_default()
          68  +
        /* StructureGenerator.kt:166 */
   37     69   
    }
          70  +
    /* StructureGenerator.kt:231 */
   38     71   
    #[allow(missing_docs)] // documentation missing in model
          72  +
                           /* StructureGenerator.kt:166 */
   39     73   
    pub fn something_else(&self) -> ::std::option::Option<&crate::types::SomethingElse> {
          74  +
        /* StructureGenerator.kt:170 */
   40     75   
        self.something_else.as_ref()
          76  +
        /* StructureGenerator.kt:166 */
   41     77   
    }
          78  +
    /* StructureGenerator.kt:135 */
   42     79   
}
          80  +
/* ClientCodegenVisitor.kt:237 */
   43     81   
impl StructsOutput {
   44         -
    /// Creates a new builder-style object to manufacture [`StructsOutput`](crate::operation::structs::StructsOutput).
          82  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StructsOutput`](crate::operation::structs::StructsOutput).
          83  +
    /* BuilderGenerator.kt:175 */
   45     84   
    pub fn builder() -> crate::operation::structs::builders::StructsOutputBuilder {
          85  +
        /* BuilderGenerator.kt:176 */
   46     86   
        crate::operation::structs::builders::StructsOutputBuilder::default()
          87  +
        /* BuilderGenerator.kt:175 */
   47     88   
    }
          89  +
    /* ClientCodegenVisitor.kt:237 */
   48     90   
}
   49     91   
   50         -
/// A builder for [`StructsOutput`](crate::operation::structs::StructsOutput).
          92  +
/// /* BuilderGenerator.kt:342 */A builder for [`StructsOutput`](crate::operation::structs::StructsOutput).
          93  +
/* RustType.kt:516 */
   51     94   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          95  +
/* RustType.kt:516 */
   52     96   
#[non_exhaustive]
          97  +
/* BuilderGenerator.kt:345 */
   53     98   
pub struct StructsOutputBuilder {
   54         -
    pub(crate) result: ::std::option::Option<crate::types::Result>,
   55         -
    pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
   56         -
    pub(crate) option: ::std::option::Option<crate::types::Option>,
   57         -
    pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
          99  +
    /* BuilderGenerator.kt:275 */ pub(crate) result: ::std::option::Option<crate::types::Result>,
         100  +
    /* BuilderGenerator.kt:275 */ pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
         101  +
    /* BuilderGenerator.kt:275 */ pub(crate) option: ::std::option::Option<crate::types::Option>,
         102  +
    /* BuilderGenerator.kt:275 */ pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
         103  +
    /* BuilderGenerator.kt:275 */
   58    104   
    pub(crate) something_else: ::std::option::Option<crate::types::SomethingElse>,
         105  +
    /* BuilderGenerator.kt:345 */
   59    106   
}
         107  +
/* BuilderGenerator.kt:355 */
   60    108   
impl StructsOutputBuilder {
         109  +
    /* BuilderGenerator.kt:286 */
   61    110   
    #[allow(missing_docs)] // documentation missing in model
         111  +
                           /* BuilderGenerator.kt:291 */
   62    112   
    pub fn result(mut self, input: crate::types::Result) -> Self {
         113  +
        /* BuilderGenerator.kt:292 */
   63    114   
        self.result = ::std::option::Option::Some(input);
         115  +
        /* BuilderGenerator.kt:293 */
   64    116   
        self
         117  +
        /* BuilderGenerator.kt:291 */
   65    118   
    }
         119  +
    /* BuilderGenerator.kt:312 */
   66    120   
    #[allow(missing_docs)] // documentation missing in model
         121  +
                           /* BuilderGenerator.kt:314 */
   67    122   
    pub fn set_result(mut self, input: ::std::option::Option<crate::types::Result>) -> Self {
         123  +
        /* BuilderGenerator.kt:315 */
   68    124   
        self.result = input;
   69    125   
        self
         126  +
        /* BuilderGenerator.kt:314 */
   70    127   
    }
         128  +
    /* BuilderGenerator.kt:334 */
   71    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* BuilderGenerator.kt:336 */
   72    131   
    pub fn get_result(&self) -> &::std::option::Option<crate::types::Result> {
         132  +
        /* BuilderGenerator.kt:337 */
   73    133   
        &self.result
         134  +
        /* BuilderGenerator.kt:336 */
   74    135   
    }
   75         -
    /// Appends an item to `result_list`.
         136  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `result_list`.
         137  +
    /* BuilderGenerator.kt:411 */
   76    138   
    ///
   77         -
    /// To override the contents of this collection use [`set_result_list`](Self::set_result_list).
         139  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_result_list`](Self::set_result_list).
         140  +
    /* BuilderGenerator.kt:413 */
   78    141   
    ///
         142  +
    /* BuilderGenerator.kt:418 */
   79    143   
    pub fn result_list(mut self, input: crate::types::Result) -> Self {
         144  +
        /* BuilderGenerator.kt:419 */
   80    145   
        let mut v = self.result_list.unwrap_or_default();
   81    146   
        v.push(input);
   82    147   
        self.result_list = ::std::option::Option::Some(v);
   83    148   
        self
         149  +
        /* BuilderGenerator.kt:418 */
   84    150   
    }
         151  +
    /* BuilderGenerator.kt:312 */
   85    152   
    #[allow(missing_docs)] // documentation missing in model
         153  +
                           /* BuilderGenerator.kt:314 */
   86    154   
    pub fn set_result_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
         155  +
        /* BuilderGenerator.kt:315 */
   87    156   
        self.result_list = input;
   88    157   
        self
         158  +
        /* BuilderGenerator.kt:314 */
   89    159   
    }
         160  +
    /* BuilderGenerator.kt:334 */
   90    161   
    #[allow(missing_docs)] // documentation missing in model
         162  +
                           /* BuilderGenerator.kt:336 */
   91    163   
    pub fn get_result_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
         164  +
        /* BuilderGenerator.kt:337 */
   92    165   
        &self.result_list
         166  +
        /* BuilderGenerator.kt:336 */
   93    167   
    }
         168  +
    /* BuilderGenerator.kt:286 */
   94    169   
    #[allow(missing_docs)] // documentation missing in model
         170  +
                           /* BuilderGenerator.kt:291 */
   95    171   
    pub fn option(mut self, input: crate::types::Option) -> Self {
         172  +
        /* BuilderGenerator.kt:292 */
   96    173   
        self.option = ::std::option::Option::Some(input);
         174  +
        /* BuilderGenerator.kt:293 */
   97    175   
        self
         176  +
        /* BuilderGenerator.kt:291 */
   98    177   
    }
         178  +
    /* BuilderGenerator.kt:312 */
   99    179   
    #[allow(missing_docs)] // documentation missing in model
         180  +
                           /* BuilderGenerator.kt:314 */
  100    181   
    pub fn set_option(mut self, input: ::std::option::Option<crate::types::Option>) -> Self {
         182  +
        /* BuilderGenerator.kt:315 */
  101    183   
        self.option = input;
  102    184   
        self
         185  +
        /* BuilderGenerator.kt:314 */
  103    186   
    }
         187  +
    /* BuilderGenerator.kt:334 */
  104    188   
    #[allow(missing_docs)] // documentation missing in model
         189  +
                           /* BuilderGenerator.kt:336 */
  105    190   
    pub fn get_option(&self) -> &::std::option::Option<crate::types::Option> {
         191  +
        /* BuilderGenerator.kt:337 */
  106    192   
        &self.option
         193  +
        /* BuilderGenerator.kt:336 */
  107    194   
    }
  108         -
    /// Appends an item to `option_list`.
         195  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `option_list`.
         196  +
    /* BuilderGenerator.kt:411 */
  109    197   
    ///
  110         -
    /// To override the contents of this collection use [`set_option_list`](Self::set_option_list).
         198  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_option_list`](Self::set_option_list).
         199  +
    /* BuilderGenerator.kt:413 */
  111    200   
    ///
         201  +
    /* BuilderGenerator.kt:418 */
  112    202   
    pub fn option_list(mut self, input: crate::types::Result) -> Self {
         203  +
        /* BuilderGenerator.kt:419 */
  113    204   
        let mut v = self.option_list.unwrap_or_default();
  114    205   
        v.push(input);
  115    206   
        self.option_list = ::std::option::Option::Some(v);
  116    207   
        self
         208  +
        /* BuilderGenerator.kt:418 */
  117    209   
    }
         210  +
    /* BuilderGenerator.kt:312 */
  118    211   
    #[allow(missing_docs)] // documentation missing in model
         212  +
                           /* BuilderGenerator.kt:314 */
  119    213   
    pub fn set_option_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
         214  +
        /* BuilderGenerator.kt:315 */
  120    215   
        self.option_list = input;
  121    216   
        self
         217  +
        /* BuilderGenerator.kt:314 */
  122    218   
    }
         219  +
    /* BuilderGenerator.kt:334 */
  123    220   
    #[allow(missing_docs)] // documentation missing in model
         221  +
                           /* BuilderGenerator.kt:336 */
  124    222   
    pub fn get_option_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
         223  +
        /* BuilderGenerator.kt:337 */
  125    224   
        &self.option_list
         225  +
        /* BuilderGenerator.kt:336 */
  126    226   
    }
         227  +
    /* BuilderGenerator.kt:286 */
  127    228   
    #[allow(missing_docs)] // documentation missing in model
         229  +
                           /* BuilderGenerator.kt:291 */
  128    230   
    pub fn something_else(mut self, input: crate::types::SomethingElse) -> Self {
         231  +
        /* BuilderGenerator.kt:292 */
  129    232   
        self.something_else = ::std::option::Option::Some(input);
         233  +
        /* BuilderGenerator.kt:293 */
  130    234   
        self
         235  +
        /* BuilderGenerator.kt:291 */
  131    236   
    }
         237  +
    /* BuilderGenerator.kt:312 */
  132    238   
    #[allow(missing_docs)] // documentation missing in model
         239  +
                           /* BuilderGenerator.kt:314 */
  133    240   
    pub fn set_something_else(mut self, input: ::std::option::Option<crate::types::SomethingElse>) -> Self {
         241  +
        /* BuilderGenerator.kt:315 */
  134    242   
        self.something_else = input;
  135    243   
        self
         244  +
        /* BuilderGenerator.kt:314 */
  136    245   
    }
         246  +
    /* BuilderGenerator.kt:334 */
  137    247   
    #[allow(missing_docs)] // documentation missing in model
         248  +
                           /* BuilderGenerator.kt:336 */
  138    249   
    pub fn get_something_else(&self) -> &::std::option::Option<crate::types::SomethingElse> {
         250  +
        /* BuilderGenerator.kt:337 */
  139    251   
        &self.something_else
         252  +
        /* BuilderGenerator.kt:336 */
  140    253   
    }
  141         -
    /// Consumes the builder and constructs a [`StructsOutput`](crate::operation::structs::StructsOutput).
         254  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StructsOutput`](crate::operation::structs::StructsOutput).
         255  +
    /* BuilderGenerator.kt:253 */
  142    256   
    pub fn build(self) -> crate::operation::structs::StructsOutput {
         257  +
        /* BuilderGenerator.kt:477 */
  143    258   
        crate::operation::structs::StructsOutput {
  144         -
            result: self.result,
         259  +
            /* BuilderGenerator.kt:481 */ result: self.result,
         260  +
            /* BuilderGenerator.kt:481 */
  145    261   
            result_list: self.result_list,
         262  +
            /* BuilderGenerator.kt:481 */
  146    263   
            option: self.option,
         264  +
            /* BuilderGenerator.kt:481 */
  147    265   
            option_list: self.option_list,
         266  +
            /* BuilderGenerator.kt:481 */
  148    267   
            something_else: self.something_else,
         268  +
            /* BuilderGenerator.kt:477 */
  149    269   
        }
         270  +
        /* BuilderGenerator.kt:253 */
  150    271   
    }
         272  +
    /* BuilderGenerator.kt:355 */
  151    273   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/operation/structs/builders.rs

@@ -1,1 +181,223 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::structs::_structs_output::StructsOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::structs::_structs_input::StructsInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::structs::builders::StructsInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::structs::StructsOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::structs::StructsError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.structs();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `Structs`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `Structs`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct StructsFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::structs::builders::StructsInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl crate::client::customize::internal::CustomizableSend<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError>
   32     38   
    for StructsFluentBuilder
   33     39   
{
   34     40   
    fn send(
   35     41   
        self,
   36     42   
        config_override: crate::config::Builder,
   37     43   
    ) -> crate::client::customize::internal::BoxFuture<
   38     44   
        crate::client::customize::internal::SendResult<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError>,
   39     45   
    > {
   40     46   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   41     47   
    }
   42     48   
}
          49  +
/* FluentBuilderGenerator.kt:282 */
   43     50   
impl StructsFluentBuilder {
          51  +
    /* FluentBuilderGenerator.kt:288 */
   44     52   
    /// Creates a new `StructsFluentBuilder`.
   45     53   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   46     54   
        Self {
   47     55   
            handle,
   48     56   
            inner: ::std::default::Default::default(),
   49     57   
            config_override: ::std::option::Option::None,
   50     58   
        }
   51     59   
    }
          60  +
    /* FluentBuilderGenerator.kt:301 */
   52     61   
    /// Access the Structs as a reference.
   53     62   
    pub fn as_input(&self) -> &crate::operation::structs::builders::StructsInputBuilder {
   54     63   
        &self.inner
   55     64   
    }
          65  +
    /* FluentBuilderGenerator.kt:145 */
   56     66   
    /// Sends the request and returns the response.
   57     67   
    ///
   58     68   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   59     69   
    /// can be matched against.
   60     70   
    ///
   61     71   
    /// By default, any retryable failures will be retried twice. Retry behavior
   62     72   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   63     73   
    /// set when configuring the client.
   64     74   
    pub async fn send(
   65     75   
        self,
   66     76   
    ) -> ::std::result::Result<
   67     77   
        crate::operation::structs::StructsOutput,
   68     78   
        ::aws_smithy_runtime_api::client::result::SdkError<
   69     79   
            crate::operation::structs::StructsError,
   70     80   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   71     81   
        >,
   72     82   
    > {
   73     83   
        let input = self
   74     84   
            .inner
   75     85   
            .build()
   76     86   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   77     87   
        let runtime_plugins = crate::operation::structs::Structs::operation_runtime_plugins(
   78     88   
            self.handle.runtime_plugins.clone(),
   79     89   
            &self.handle.conf,
   80     90   
            self.config_override,
   81     91   
        );
   82     92   
        crate::operation::structs::Structs::orchestrate(&runtime_plugins, input).await
   83     93   
    }
   84     94   
   85     95   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   86     96   
    pub fn customize(
   87     97   
        self,
   88     98   
    ) -> crate::client::customize::CustomizableOperation<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError, Self>
   89     99   
    {
   90    100   
        crate::client::customize::CustomizableOperation::new(self)
   91    101   
    }
         102  +
    /* FluentBuilderGenerator.kt:315 */
   92    103   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
   93    104   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
   94    105   
        self
   95    106   
    }
   96    107   
   97    108   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
   98    109   
        self.config_override = config_override;
   99    110   
        self
  100    111   
    }
         112  +
    /* FluentBuilderGenerator.kt:498 */
  101    113   
    #[allow(missing_docs)] // documentation missing in model
         114  +
                           /* FluentBuilderGenerator.kt:500 */
  102    115   
    pub fn result(mut self, input: crate::types::Result) -> Self {
  103    116   
        self.inner = self.inner.result(input);
  104    117   
        self
  105    118   
    }
         119  +
    /* FluentBuilderGenerator.kt:498 */
  106    120   
    #[allow(missing_docs)] // documentation missing in model
         121  +
                           /* FluentBuilderGenerator.kt:500 */
  107    122   
    pub fn set_result(mut self, input: ::std::option::Option<crate::types::Result>) -> Self {
  108    123   
        self.inner = self.inner.set_result(input);
  109    124   
        self
  110    125   
    }
         126  +
    /* FluentBuilderGenerator.kt:518 */
  111    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* FluentBuilderGenerator.kt:520 */
  112    129   
    pub fn get_result(&self) -> &::std::option::Option<crate::types::Result> {
  113    130   
        self.inner.get_result()
  114    131   
    }
  115         -
    ///
         132  +
    /// /* FluentBuilderGenerator.kt:436 */
  116    133   
    /// Appends an item to `resultList`.
  117    134   
    ///
  118    135   
    /// To override the contents of this collection use [`set_result_list`](Self::set_result_list).
  119    136   
    ///
         137  +
    /* FluentBuilderGenerator.kt:443 */
  120    138   
    #[allow(missing_docs)] // documentation missing in model
         139  +
                           /* FluentBuilderGenerator.kt:446 */
  121    140   
    pub fn result_list(mut self, input: crate::types::Result) -> Self {
  122    141   
        self.inner = self.inner.result_list(input);
  123    142   
        self
  124    143   
    }
         144  +
    /* FluentBuilderGenerator.kt:498 */
  125    145   
    #[allow(missing_docs)] // documentation missing in model
         146  +
                           /* FluentBuilderGenerator.kt:500 */
  126    147   
    pub fn set_result_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
  127    148   
        self.inner = self.inner.set_result_list(input);
  128    149   
        self
  129    150   
    }
         151  +
    /* FluentBuilderGenerator.kt:518 */
  130    152   
    #[allow(missing_docs)] // documentation missing in model
         153  +
                           /* FluentBuilderGenerator.kt:520 */
  131    154   
    pub fn get_result_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
  132    155   
        self.inner.get_result_list()
  133    156   
    }
         157  +
    /* FluentBuilderGenerator.kt:498 */
  134    158   
    #[allow(missing_docs)] // documentation missing in model
         159  +
                           /* FluentBuilderGenerator.kt:500 */
  135    160   
    pub fn option(mut self, input: crate::types::Option) -> Self {
  136    161   
        self.inner = self.inner.option(input);
  137    162   
        self
  138    163   
    }
         164  +
    /* FluentBuilderGenerator.kt:498 */
  139    165   
    #[allow(missing_docs)] // documentation missing in model
         166  +
                           /* FluentBuilderGenerator.kt:500 */
  140    167   
    pub fn set_option(mut self, input: ::std::option::Option<crate::types::Option>) -> Self {
  141    168   
        self.inner = self.inner.set_option(input);
  142    169   
        self
  143    170   
    }
         171  +
    /* FluentBuilderGenerator.kt:518 */
  144    172   
    #[allow(missing_docs)] // documentation missing in model
         173  +
                           /* FluentBuilderGenerator.kt:520 */
  145    174   
    pub fn get_option(&self) -> &::std::option::Option<crate::types::Option> {
  146    175   
        self.inner.get_option()
  147    176   
    }
  148         -
    ///
         177  +
    /// /* FluentBuilderGenerator.kt:436 */
  149    178   
    /// Appends an item to `optionList`.
  150    179   
    ///
  151    180   
    /// To override the contents of this collection use [`set_option_list`](Self::set_option_list).
  152    181   
    ///
         182  +
    /* FluentBuilderGenerator.kt:443 */
  153    183   
    #[allow(missing_docs)] // documentation missing in model
         184  +
                           /* FluentBuilderGenerator.kt:446 */
  154    185   
    pub fn option_list(mut self, input: crate::types::Result) -> Self {
  155    186   
        self.inner = self.inner.option_list(input);
  156    187   
        self
  157    188   
    }
         189  +
    /* FluentBuilderGenerator.kt:498 */
  158    190   
    #[allow(missing_docs)] // documentation missing in model
         191  +
                           /* FluentBuilderGenerator.kt:500 */
  159    192   
    pub fn set_option_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
  160    193   
        self.inner = self.inner.set_option_list(input);
  161    194   
        self
  162    195   
    }
         196  +
    /* FluentBuilderGenerator.kt:518 */
  163    197   
    #[allow(missing_docs)] // documentation missing in model
         198  +
                           /* FluentBuilderGenerator.kt:520 */
  164    199   
    pub fn get_option_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
  165    200   
        self.inner.get_option_list()
  166    201   
    }
         202  +
    /* FluentBuilderGenerator.kt:498 */
  167    203   
    #[allow(missing_docs)] // documentation missing in model
         204  +
                           /* FluentBuilderGenerator.kt:500 */
  168    205   
    pub fn something_else(mut self, input: crate::types::SomethingElse) -> Self {
  169    206   
        self.inner = self.inner.something_else(input);
  170    207   
        self
  171    208   
    }
         209  +
    /* FluentBuilderGenerator.kt:498 */
  172    210   
    #[allow(missing_docs)] // documentation missing in model
         211  +
                           /* FluentBuilderGenerator.kt:500 */
  173    212   
    pub fn set_something_else(mut self, input: ::std::option::Option<crate::types::SomethingElse>) -> Self {
  174    213   
        self.inner = self.inner.set_something_else(input);
  175    214   
        self
  176    215   
    }
         216  +
    /* FluentBuilderGenerator.kt:518 */
  177    217   
    #[allow(missing_docs)] // documentation missing in model
         218  +
                           /* FluentBuilderGenerator.kt:520 */
  178    219   
    pub fn get_something_else(&self) -> &::std::option::Option<crate::types::SomethingElse> {
  179    220   
        self.inner.get_something_else()
  180    221   
    }
         222  +
    /* FluentBuilderGenerator.kt:282 */
  181    223   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/primitives.rs

@@ -1,1 +7,8 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
    3      4   
pub use ::aws_smithy_types::Blob;
    4         -
pub use ::aws_smithy_types::DateTime;
           5  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;
    5      6   
    6         -
/// Event stream related primitives such as `Message` or `Header`.
           7  +
/// /* ClientRustModule.kt:121 */Event stream related primitives such as `Message` or `Header`.
    7      8   
pub mod event_stream;

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde.rs

@@ -1,1 +48,51 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ResponseDeserializerGenerator.kt:170 */
    2      3   
pub(crate) fn type_erase_result<O, E>(
    3      4   
    result: ::std::result::Result<O, E>,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6      7   
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7      8   
>
    8      9   
where
    9     10   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     11   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     12   
{
   12     13   
    result
   13     14   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     15   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     16   
        .map_err(::std::convert::Into::into)
   16     17   
}
   17     18   
          19  +
/* AwsJson.kt:203 */
   18     20   
pub fn parse_http_error_metadata(
   19     21   
    _response_status: u16,
   20     22   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21     23   
    response_body: &[u8],
   22     24   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23     25   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24     26   
}
   25     27   
   26     28   
pub(crate) mod shape_structs;
   27     29   
          30  +
/* JsonParserGenerator.kt:227 */
   28     31   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   29     32   
    if data.is_empty() {
   30     33   
        b"{}"
   31     34   
    } else {
   32     35   
        data
   33     36   
    }
   34     37   
}
   35     38   
   36     39   
pub(crate) mod shape_structs_input;
   37     40   

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_option.rs

@@ -1,1 +50,84 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_option<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::Option>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::OptionBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
   17     26   
                            "value" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_value(
          29  +
                                    /* JsonParserGenerator.kt:354 */
   19     30   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   22     36   
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
   23     38   
                            }
   24         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
                    },
          39  +
                            /* JsonParserGenerator.kt:290 */
          40  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          41  +
                        }
          42  +
                        /* JsonParserGenerator.kt:686 */
          43  +
                    }
          44  +
                    /* JsonParserGenerator.kt:695 */
   26     45   
                    other => {
   27     46   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28     47   
                            "expected object key or end object, found: {:?}",
   29     48   
                            other
   30     49   
                        )))
          50  +
                    } /* JsonParserGenerator.kt:685 */
   31     51   
                }
          52  +
                /* JsonParserGenerator.kt:684 */
   32     53   
            }
   33         -
            }
          54  +
            /* JsonParserGenerator.kt:540 */
   34     55   
            Ok(Some(builder.build()))
          56  +
            /* JsonParserGenerator.kt:713 */
   35     57   
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     62   
                "expected start object or null",
   38         -
        )),
          63  +
            ))
          64  +
            /* JsonParserGenerator.kt:722 */
          65  +
        } /* JsonParserGenerator.kt:712 */
   39     66   
    }
          67  +
    /* JsonParserGenerator.kt:516 */
   40     68   
}
   41     69   
          70  +
/* JsonSerializerGenerator.kt:358 */
   42     71   
pub fn ser_option(
   43     72   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44     73   
    input: &crate::types::Option,
   45     74   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          75  +
    /* JsonSerializerGenerator.kt:382 */
   46     76   
    if let Some(var_1) = &input.value {
          77  +
        /* JsonSerializerGenerator.kt:423 */
   47     78   
        object.key("value").string(var_1.as_str());
          79  +
        /* JsonSerializerGenerator.kt:382 */
   48     80   
    }
          81  +
    /* JsonSerializerGenerator.kt:372 */
   49     82   
    Ok(())
          83  +
    /* JsonSerializerGenerator.kt:358 */
   50     84   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_option_list.rs

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

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_result.rs

@@ -1,1 +50,84 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_result<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::Result>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::ResultBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
   17     26   
                            "value" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_value(
          29  +
                                    /* JsonParserGenerator.kt:354 */
   19     30   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   22     36   
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
   23     38   
                            }
   24         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
                    },
          39  +
                            /* JsonParserGenerator.kt:290 */
          40  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          41  +
                        }
          42  +
                        /* JsonParserGenerator.kt:686 */
          43  +
                    }
          44  +
                    /* JsonParserGenerator.kt:695 */
   26     45   
                    other => {
   27     46   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28     47   
                            "expected object key or end object, found: {:?}",
   29     48   
                            other
   30     49   
                        )))
          50  +
                    } /* JsonParserGenerator.kt:685 */
   31     51   
                }
          52  +
                /* JsonParserGenerator.kt:684 */
   32     53   
            }
   33         -
            }
          54  +
            /* JsonParserGenerator.kt:540 */
   34     55   
            Ok(Some(builder.build()))
          56  +
            /* JsonParserGenerator.kt:713 */
   35     57   
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     62   
                "expected start object or null",
   38         -
        )),
          63  +
            ))
          64  +
            /* JsonParserGenerator.kt:722 */
          65  +
        } /* JsonParserGenerator.kt:712 */
   39     66   
    }
          67  +
    /* JsonParserGenerator.kt:516 */
   40     68   
}
   41     69   
          70  +
/* JsonSerializerGenerator.kt:358 */
   42     71   
pub fn ser_result(
   43     72   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44     73   
    input: &crate::types::Result,
   45     74   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          75  +
    /* JsonSerializerGenerator.kt:382 */
   46     76   
    if let Some(var_1) = &input.value {
          77  +
        /* JsonSerializerGenerator.kt:423 */
   47     78   
        object.key("value").string(var_1.as_str());
          79  +
        /* JsonSerializerGenerator.kt:382 */
   48     80   
    }
          81  +
    /* JsonSerializerGenerator.kt:372 */
   49     82   
    Ok(())
          83  +
    /* JsonSerializerGenerator.kt:358 */
   50     84   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_result_list.rs

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

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_some_union.rs

@@ -1,1 +90,150 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_some_union<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::SomeUnion>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:565 */
    8     10   
    let mut variant = None;
          11  +
    /* JsonParserGenerator.kt:567 */
    9     12   
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
          13  +
        /* JsonParserGenerator.kt:568 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
          14  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          15  +
            /* JsonParserGenerator.kt:684 */
          16  +
            loop {
          17  +
                /* JsonParserGenerator.kt:685 */
   12     18   
                match tokens.next().transpose()? {
   13         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          19  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   14     20   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          21  +
                        /* JsonParserGenerator.kt:576 */
   15     22   
                        if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
   16     23   
                            tokens.peek()
   17     24   
                        {
   18     25   
                            let _ = tokens.next().expect("peek returned a token")?;
   19     26   
                            continue;
   20     27   
                        }
          28  +
                        /* JsonParserGenerator.kt:585 */
   21     29   
                        let key = key.to_unescaped()?;
   22     30   
                        if key == "__type" {
   23     31   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   24     32   
                            continue;
   25     33   
                        }
   26     34   
                        if variant.is_some() {
   27     35   
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28     36   
                                "encountered mixed variants in union",
   29     37   
                            ));
   30     38   
                        }
          39  +
                        /* JsonParserGenerator.kt:598 */
   31     40   
                        variant = match key.as_ref() {
   32         -
                        "Result" => Some(crate::types::SomeUnion::Result(
   33         -
                            crate::protocol_serde::shape_result::de_result(tokens)?.ok_or_else(|| {
          41  +
                            /* JsonParserGenerator.kt:601 */
          42  +
                            "Result" => {
          43  +
                                /* JsonParserGenerator.kt:611 */
          44  +
                                Some(crate::types::SomeUnion::Result(
          45  +
                                    /* JsonParserGenerator.kt:544 */
          46  +
                                    crate::protocol_serde::shape_result::de_result(tokens)?
          47  +
                                        /* JsonParserGenerator.kt:670 */
          48  +
                                        .ok_or_else(|| {
   34     49   
                                            ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Result' cannot be null")
   35         -
                            })?,
   36         -
                        )),
   37         -
                        "Option" => Some(crate::types::SomeUnion::Option(
   38         -
                            crate::protocol_serde::shape_option::de_option(tokens)?.ok_or_else(|| {
          50  +
                                        })?, /* JsonParserGenerator.kt:611 */
          51  +
                                ))
          52  +
                                /* JsonParserGenerator.kt:601 */
          53  +
                            }
          54  +
                            /* JsonParserGenerator.kt:601 */
          55  +
                            "Option" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
          57  +
                                Some(crate::types::SomeUnion::Option(
          58  +
                                    /* JsonParserGenerator.kt:544 */
          59  +
                                    crate::protocol_serde::shape_option::de_option(tokens)?
          60  +
                                        /* JsonParserGenerator.kt:670 */
          61  +
                                        .ok_or_else(|| {
   39     62   
                                            ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Option' cannot be null")
   40         -
                            })?,
   41         -
                        )),
          63  +
                                        })?, /* JsonParserGenerator.kt:611 */
          64  +
                                ))
          65  +
                                /* JsonParserGenerator.kt:601 */
          66  +
                            }
          67  +
                            /* JsonParserGenerator.kt:621 */
   42     68   
                            _ => {
   43     69   
                                ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   44     70   
                                Some(crate::types::SomeUnion::Unknown)
   45         -
                        }
          71  +
                            } /* JsonParserGenerator.kt:598 */
   46     72   
                        };
          73  +
                        /* JsonParserGenerator.kt:686 */
   47     74   
                    }
          75  +
                    /* JsonParserGenerator.kt:695 */
   48     76   
                    other => {
   49     77   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   50     78   
                            "expected object key or end object, found: {:?}",
   51     79   
                            other
   52     80   
                        )))
          81  +
                    } /* JsonParserGenerator.kt:685 */
          82  +
                }
          83  +
                /* JsonParserGenerator.kt:684 */
   53     84   
            }
          85  +
            /* JsonParserGenerator.kt:568 */
   54     86   
        }
   55         -
        },
          87  +
        /* JsonParserGenerator.kt:642 */
   56     88   
        _ => {
   57     89   
            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   58     90   
                "expected start object or null",
   59     91   
            ))
          92  +
        } /* JsonParserGenerator.kt:567 */
   60     93   
    }
   61         -
    }
          94  +
    /* JsonParserGenerator.kt:649 */
   62     95   
    if variant.is_none() {
   63     96   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   64     97   
            "Union did not contain a valid variant.",
   65     98   
        ));
   66     99   
    }
         100  +
    /* JsonParserGenerator.kt:657 */
   67    101   
    Ok(variant)
         102  +
    /* JsonParserGenerator.kt:551 */
   68    103   
}
   69    104   
         105  +
/* JsonSerializerGenerator.kt:547 */
   70    106   
pub fn ser_some_union(
   71    107   
    object_14: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   72    108   
    input: &crate::types::SomeUnion,
   73    109   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         110  +
    /* JsonSerializerGenerator.kt:556 */
   74    111   
    match input {
         112  +
        /* JsonSerializerGenerator.kt:564 */
   75    113   
        crate::types::SomeUnion::Result(inner) => {
         114  +
            /* SerializerUtil.kt:42 */
         115  +
            {
         116  +
                /* JsonSerializerGenerator.kt:495 */
   76    117   
                #[allow(unused_mut)]
         118  +
                /* JsonSerializerGenerator.kt:496 */
   77    119   
                let mut object_1 = object_14.key("Result").start_object();
         120  +
                /* JsonSerializerGenerator.kt:375 */
   78    121   
                crate::protocol_serde::shape_result::ser_result(&mut object_1, inner)?;
         122  +
                /* JsonSerializerGenerator.kt:515 */
   79    123   
                object_1.finish();
         124  +
                /* SerializerUtil.kt:42 */
         125  +
            }
         126  +
            /* JsonSerializerGenerator.kt:564 */
   80    127   
        }
         128  +
        /* JsonSerializerGenerator.kt:564 */
   81    129   
        crate::types::SomeUnion::Option(inner) => {
         130  +
            /* SerializerUtil.kt:42 */
         131  +
            {
         132  +
                /* JsonSerializerGenerator.kt:495 */
   82    133   
                #[allow(unused_mut)]
         134  +
                /* JsonSerializerGenerator.kt:496 */
   83    135   
                let mut object_2 = object_14.key("Option").start_object();
         136  +
                /* JsonSerializerGenerator.kt:375 */
   84    137   
                crate::protocol_serde::shape_option::ser_option(&mut object_2, inner)?;
         138  +
                /* JsonSerializerGenerator.kt:515 */
   85    139   
                object_2.finish();
         140  +
                /* SerializerUtil.kt:42 */
         141  +
            }
         142  +
            /* JsonSerializerGenerator.kt:564 */
   86    143   
        }
   87         -
        crate::types::SomeUnion::Unknown => return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant("SomeUnion")),
         144  +
        /* JsonSerializerGenerator.kt:569 */
         145  +
        crate::types::SomeUnion::Unknown => return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant("SomeUnion")), /* JsonSerializerGenerator.kt:556 */
   88    146   
    }
         147  +
    /* JsonSerializerGenerator.kt:576 */
   89    148   
    Ok(())
         149  +
    /* JsonSerializerGenerator.kt:547 */
   90    150   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_something_else.rs

@@ -1,1 +97,193 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_something_else<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::SomethingElse>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::SomethingElseBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
   17     26   
                            "result" => {
   18         -
                            builder = builder.set_result(crate::protocol_serde::shape_result::de_result(tokens)?);
   19         -
                        }
          27  +
                                /* JsonParserGenerator.kt:265 */
          28  +
                                builder = builder.set_result(
          29  +
                                    /* JsonParserGenerator.kt:544 */
          30  +
                                    crate::protocol_serde::shape_result::de_result(tokens)?, /* JsonParserGenerator.kt:265 */
          31  +
                                );
          32  +
                                /* JsonParserGenerator.kt:262 */
          33  +
                            }
          34  +
                            /* JsonParserGenerator.kt:262 */
   20     35   
                            "resultList" => {
   21         -
                            builder = builder.set_result_list(crate::protocol_serde::shape_result_list::de_result_list(tokens)?);
   22         -
                        }
          36  +
                                /* JsonParserGenerator.kt:265 */
          37  +
                                builder = builder.set_result_list(
          38  +
                                    /* JsonParserGenerator.kt:451 */
          39  +
                                    crate::protocol_serde::shape_result_list::de_result_list(tokens)?, /* JsonParserGenerator.kt:265 */
          40  +
                                );
          41  +
                                /* JsonParserGenerator.kt:262 */
          42  +
                            }
          43  +
                            /* JsonParserGenerator.kt:262 */
   23     44   
                            "option" => {
   24         -
                            builder = builder.set_option(crate::protocol_serde::shape_option::de_option(tokens)?);
   25         -
                        }
          45  +
                                /* JsonParserGenerator.kt:265 */
          46  +
                                builder = builder.set_option(
          47  +
                                    /* JsonParserGenerator.kt:544 */
          48  +
                                    crate::protocol_serde::shape_option::de_option(tokens)?, /* JsonParserGenerator.kt:265 */
          49  +
                                );
          50  +
                                /* JsonParserGenerator.kt:262 */
          51  +
                            }
          52  +
                            /* JsonParserGenerator.kt:262 */
   26     53   
                            "optionList" => {
   27         -
                            builder = builder.set_option_list(crate::protocol_serde::shape_option_list::de_option_list(tokens)?);
   28         -
                        }
          54  +
                                /* JsonParserGenerator.kt:265 */
          55  +
                                builder = builder.set_option_list(
          56  +
                                    /* JsonParserGenerator.kt:451 */
          57  +
                                    crate::protocol_serde::shape_option_list::de_option_list(tokens)?, /* JsonParserGenerator.kt:265 */
          58  +
                                );
          59  +
                                /* JsonParserGenerator.kt:262 */
          60  +
                            }
          61  +
                            /* JsonParserGenerator.kt:262 */
   29     62   
                            "someUnion" => {
   30         -
                            builder = builder.set_some_union(crate::protocol_serde::shape_some_union::de_some_union(tokens)?);
          63  +
                                /* JsonParserGenerator.kt:265 */
          64  +
                                builder = builder.set_some_union(
          65  +
                                    /* JsonParserGenerator.kt:660 */
          66  +
                                    crate::protocol_serde::shape_some_union::de_some_union(tokens)?, /* JsonParserGenerator.kt:265 */
          67  +
                                );
          68  +
                                /* JsonParserGenerator.kt:262 */
   31     69   
                            }
   32         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   33         -
                    },
          70  +
                            /* JsonParserGenerator.kt:290 */
          71  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          72  +
                        }
          73  +
                        /* JsonParserGenerator.kt:686 */
          74  +
                    }
          75  +
                    /* JsonParserGenerator.kt:695 */
   34     76   
                    other => {
   35     77   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   36     78   
                            "expected object key or end object, found: {:?}",
   37     79   
                            other
   38     80   
                        )))
          81  +
                    } /* JsonParserGenerator.kt:685 */
   39     82   
                }
          83  +
                /* JsonParserGenerator.kt:684 */
   40     84   
            }
   41         -
            }
          85  +
            /* JsonParserGenerator.kt:540 */
   42     86   
            Ok(Some(builder.build()))
          87  +
            /* JsonParserGenerator.kt:713 */
   43     88   
        }
   44         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          89  +
        /* JsonParserGenerator.kt:722 */
          90  +
        _ => {
          91  +
            /* JsonParserGenerator.kt:723 */
          92  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45     93   
                "expected start object or null",
   46         -
        )),
          94  +
            ))
          95  +
            /* JsonParserGenerator.kt:722 */
          96  +
        } /* JsonParserGenerator.kt:712 */
   47     97   
    }
          98  +
    /* JsonParserGenerator.kt:516 */
   48     99   
}
   49    100   
         101  +
/* JsonSerializerGenerator.kt:358 */
   50    102   
pub fn ser_something_else(
   51    103   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   52    104   
    input: &crate::types::SomethingElse,
   53    105   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         106  +
    /* JsonSerializerGenerator.kt:382 */
   54    107   
    if let Some(var_1) = &input.result {
         108  +
        /* JsonSerializerGenerator.kt:495 */
   55    109   
        #[allow(unused_mut)]
         110  +
        /* JsonSerializerGenerator.kt:496 */
   56    111   
        let mut object_2 = object.key("result").start_object();
         112  +
        /* JsonSerializerGenerator.kt:375 */
   57    113   
        crate::protocol_serde::shape_result::ser_result(&mut object_2, var_1)?;
         114  +
        /* JsonSerializerGenerator.kt:515 */
   58    115   
        object_2.finish();
         116  +
        /* JsonSerializerGenerator.kt:382 */
   59    117   
    }
         118  +
    /* JsonSerializerGenerator.kt:382 */
   60    119   
    if let Some(var_3) = &input.result_list {
         120  +
        /* JsonSerializerGenerator.kt:484 */
   61    121   
        let mut array_4 = object.key("resultList").start_array();
         122  +
        /* JsonSerializerGenerator.kt:524 */
   62    123   
        for item_5 in var_3 {
         124  +
            /* SerializerUtil.kt:42 */
   63    125   
            {
         126  +
                /* JsonSerializerGenerator.kt:495 */
   64    127   
                #[allow(unused_mut)]
         128  +
                /* JsonSerializerGenerator.kt:496 */
   65    129   
                let mut object_6 = array_4.value().start_object();
         130  +
                /* JsonSerializerGenerator.kt:375 */
   66    131   
                crate::protocol_serde::shape_result::ser_result(&mut object_6, item_5)?;
         132  +
                /* JsonSerializerGenerator.kt:515 */
   67    133   
                object_6.finish();
         134  +
                /* SerializerUtil.kt:42 */
   68    135   
            }
         136  +
            /* JsonSerializerGenerator.kt:524 */
   69    137   
        }
         138  +
        /* JsonSerializerGenerator.kt:486 */
   70    139   
        array_4.finish();
         140  +
        /* JsonSerializerGenerator.kt:382 */
   71    141   
    }
         142  +
    /* JsonSerializerGenerator.kt:382 */
   72    143   
    if let Some(var_7) = &input.option {
         144  +
        /* JsonSerializerGenerator.kt:495 */
   73    145   
        #[allow(unused_mut)]
         146  +
        /* JsonSerializerGenerator.kt:496 */
   74    147   
        let mut object_8 = object.key("option").start_object();
         148  +
        /* JsonSerializerGenerator.kt:375 */
   75    149   
        crate::protocol_serde::shape_option::ser_option(&mut object_8, var_7)?;
         150  +
        /* JsonSerializerGenerator.kt:515 */
   76    151   
        object_8.finish();
         152  +
        /* JsonSerializerGenerator.kt:382 */
   77    153   
    }
         154  +
    /* JsonSerializerGenerator.kt:382 */
   78    155   
    if let Some(var_9) = &input.option_list {
         156  +
        /* JsonSerializerGenerator.kt:484 */
   79    157   
        let mut array_10 = object.key("optionList").start_array();
         158  +
        /* JsonSerializerGenerator.kt:524 */
   80    159   
        for item_11 in var_9 {
         160  +
            /* SerializerUtil.kt:42 */
   81    161   
            {
         162  +
                /* JsonSerializerGenerator.kt:495 */
   82    163   
                #[allow(unused_mut)]
         164  +
                /* JsonSerializerGenerator.kt:496 */
   83    165   
                let mut object_12 = array_10.value().start_object();
         166  +
                /* JsonSerializerGenerator.kt:375 */
   84    167   
                crate::protocol_serde::shape_result::ser_result(&mut object_12, item_11)?;
         168  +
                /* JsonSerializerGenerator.kt:515 */
   85    169   
                object_12.finish();
         170  +
                /* SerializerUtil.kt:42 */
   86    171   
            }
         172  +
            /* JsonSerializerGenerator.kt:524 */
   87    173   
        }
         174  +
        /* JsonSerializerGenerator.kt:486 */
   88    175   
        array_10.finish();
         176  +
        /* JsonSerializerGenerator.kt:382 */
   89    177   
    }
         178  +
    /* JsonSerializerGenerator.kt:382 */
   90    179   
    if let Some(var_13) = &input.some_union {
         180  +
        /* JsonSerializerGenerator.kt:495 */
   91    181   
        #[allow(unused_mut)]
         182  +
        /* JsonSerializerGenerator.kt:496 */
   92    183   
        let mut object_14 = object.key("someUnion").start_object();
         184  +
        /* JsonSerializerGenerator.kt:579 */
   93    185   
        crate::protocol_serde::shape_some_union::ser_some_union(&mut object_14, var_13)?;
         186  +
        /* JsonSerializerGenerator.kt:515 */
   94    187   
        object_14.finish();
         188  +
        /* JsonSerializerGenerator.kt:382 */
   95    189   
    }
         190  +
    /* JsonSerializerGenerator.kt:372 */
   96    191   
    Ok(())
         192  +
    /* JsonSerializerGenerator.kt:358 */
   97    193   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_structs.rs

@@ -1,1 +82,151 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_structs_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::structs::StructsError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::structs::StructsError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_structs_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::structs::StructsOutput, crate::operation::structs::StructsError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::structs::builders::StructsOutputBuilder::default();
          36  +
        /* ProtocolParserGenerator.kt:247 */
   24     37   
        output =
   25     38   
            crate::protocol_serde::shape_structs::de_structs(_response_body, output).map_err(crate::operation::structs::StructsError::unhandled)?;
          39  +
        /* ClientBuilderInstantiator.kt:56 */
   26     40   
        output.build()
          41  +
        /* ProtocolParserGenerator.kt:77 */
   27     42   
    })
          43  +
    /* ProtocolParserGenerator.kt:71 */
   28     44   
}
   29     45   
          46  +
/* JsonSerializerGenerator.kt:287 */
   30     47   
pub fn ser_structs_input(
   31     48   
    input: &crate::operation::structs::StructsInput,
   32     49   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          50  +
    /* JsonSerializerGenerator.kt:291 */
   33     51   
    let mut out = String::new();
          52  +
    /* JsonSerializerGenerator.kt:292 */
   34     53   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          54  +
    /* JsonSerializerGenerator.kt:375 */
   35     55   
    crate::protocol_serde::shape_structs_input::ser_structs_input_input(&mut object, input)?;
          56  +
    /* JsonSerializerGenerator.kt:295 */
   36     57   
    object.finish();
          58  +
    /* JsonSerializerGenerator.kt:296 */
   37     59   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          60  +
    /* JsonSerializerGenerator.kt:287 */
   38     61   
}
   39     62   
          63  +
/* JsonParserGenerator.kt:148 */
   40     64   
pub(crate) fn de_structs(
   41     65   
    value: &[u8],
   42     66   
    mut builder: crate::operation::structs::builders::StructsOutputBuilder,
   43     67   
) -> ::std::result::Result<crate::operation::structs::builders::StructsOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
          68  +
    /* JsonParserGenerator.kt:153 */
   44     69   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   45     70   
    let tokens = &mut tokens_owned;
   46     71   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          72  +
    /* JsonParserGenerator.kt:684 */
   47     73   
    loop {
          74  +
        /* JsonParserGenerator.kt:685 */
   48     75   
        match tokens.next().transpose()? {
   49         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   50         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          76  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          77  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          78  +
                /* JsonParserGenerator.kt:260 */
          79  +
                match key.to_unescaped()?.as_ref() {
          80  +
                    /* JsonParserGenerator.kt:262 */
   51     81   
                    "result" => {
   52         -
                    builder = builder.set_result(crate::protocol_serde::shape_result::de_result(tokens)?);
          82  +
                        /* JsonParserGenerator.kt:265 */
          83  +
                        builder = builder.set_result(
          84  +
                            /* JsonParserGenerator.kt:544 */
          85  +
                            crate::protocol_serde::shape_result::de_result(tokens)?, /* JsonParserGenerator.kt:265 */
          86  +
                        );
          87  +
                        /* JsonParserGenerator.kt:262 */
   53     88   
                    }
          89  +
                    /* JsonParserGenerator.kt:262 */
   54     90   
                    "resultList" => {
   55         -
                    builder = builder.set_result_list(crate::protocol_serde::shape_result_list::de_result_list(tokens)?);
          91  +
                        /* JsonParserGenerator.kt:265 */
          92  +
                        builder = builder.set_result_list(
          93  +
                            /* JsonParserGenerator.kt:451 */
          94  +
                            crate::protocol_serde::shape_result_list::de_result_list(tokens)?, /* JsonParserGenerator.kt:265 */
          95  +
                        );
          96  +
                        /* JsonParserGenerator.kt:262 */
   56     97   
                    }
          98  +
                    /* JsonParserGenerator.kt:262 */
   57     99   
                    "option" => {
   58         -
                    builder = builder.set_option(crate::protocol_serde::shape_option::de_option(tokens)?);
         100  +
                        /* JsonParserGenerator.kt:265 */
         101  +
                        builder = builder.set_option(
         102  +
                            /* JsonParserGenerator.kt:544 */
         103  +
                            crate::protocol_serde::shape_option::de_option(tokens)?, /* JsonParserGenerator.kt:265 */
         104  +
                        );
         105  +
                        /* JsonParserGenerator.kt:262 */
   59    106   
                    }
         107  +
                    /* JsonParserGenerator.kt:262 */
   60    108   
                    "optionList" => {
   61         -
                    builder = builder.set_option_list(crate::protocol_serde::shape_option_list::de_option_list(tokens)?);
         109  +
                        /* JsonParserGenerator.kt:265 */
         110  +
                        builder = builder.set_option_list(
         111  +
                            /* JsonParserGenerator.kt:451 */
         112  +
                            crate::protocol_serde::shape_option_list::de_option_list(tokens)?, /* JsonParserGenerator.kt:265 */
         113  +
                        );
         114  +
                        /* JsonParserGenerator.kt:262 */
   62    115   
                    }
         116  +
                    /* JsonParserGenerator.kt:262 */
   63    117   
                    "somethingElse" => {
   64         -
                    builder = builder.set_something_else(crate::protocol_serde::shape_something_else::de_something_else(tokens)?);
         118  +
                        /* JsonParserGenerator.kt:265 */
         119  +
                        builder = builder.set_something_else(
         120  +
                            /* JsonParserGenerator.kt:544 */
         121  +
                            crate::protocol_serde::shape_something_else::de_something_else(tokens)?, /* JsonParserGenerator.kt:265 */
         122  +
                        );
         123  +
                        /* JsonParserGenerator.kt:262 */
   65    124   
                    }
   66         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   67         -
            },
         125  +
                    /* JsonParserGenerator.kt:290 */
         126  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
         127  +
                }
         128  +
                /* JsonParserGenerator.kt:686 */
         129  +
            }
         130  +
            /* JsonParserGenerator.kt:695 */
   68    131   
            other => {
   69    132   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   70    133   
                    "expected object key or end object, found: {:?}",
   71    134   
                    other
   72    135   
                )))
         136  +
            } /* JsonParserGenerator.kt:685 */
   73    137   
        }
         138  +
        /* JsonParserGenerator.kt:684 */
   74    139   
    }
   75         -
    }
         140  +
    /* JsonParserGenerator.kt:250 */
   76    141   
    if tokens.next().is_some() {
         142  +
        /* JsonParserGenerator.kt:251 */
   77    143   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   78    144   
            "found more JSON tokens after completing parsing",
   79    145   
        ));
         146  +
        /* JsonParserGenerator.kt:250 */
   80    147   
    }
         148  +
    /* JsonParserGenerator.kt:163 */
   81    149   
    Ok(builder)
         150  +
    /* JsonParserGenerator.kt:148 */
   82    151   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/protocol_serde/shape_structs_input.rs

@@ -1,1 +49,94 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_structs_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::structs::StructsInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.result {
           9  +
        /* JsonSerializerGenerator.kt:495 */
    7     10   
        #[allow(unused_mut)]
          11  +
        /* JsonSerializerGenerator.kt:496 */
    8     12   
        let mut object_2 = object.key("result").start_object();
          13  +
        /* JsonSerializerGenerator.kt:375 */
    9     14   
        crate::protocol_serde::shape_result::ser_result(&mut object_2, var_1)?;
          15  +
        /* JsonSerializerGenerator.kt:515 */
   10     16   
        object_2.finish();
          17  +
        /* JsonSerializerGenerator.kt:382 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:382 */
   12     20   
    if let Some(var_3) = &input.result_list {
          21  +
        /* JsonSerializerGenerator.kt:484 */
   13     22   
        let mut array_4 = object.key("resultList").start_array();
          23  +
        /* JsonSerializerGenerator.kt:524 */
   14     24   
        for item_5 in var_3 {
          25  +
            /* SerializerUtil.kt:42 */
   15     26   
            {
          27  +
                /* JsonSerializerGenerator.kt:495 */
   16     28   
                #[allow(unused_mut)]
          29  +
                /* JsonSerializerGenerator.kt:496 */
   17     30   
                let mut object_6 = array_4.value().start_object();
          31  +
                /* JsonSerializerGenerator.kt:375 */
   18     32   
                crate::protocol_serde::shape_result::ser_result(&mut object_6, item_5)?;
          33  +
                /* JsonSerializerGenerator.kt:515 */
   19     34   
                object_6.finish();
          35  +
                /* SerializerUtil.kt:42 */
   20     36   
            }
          37  +
            /* JsonSerializerGenerator.kt:524 */
   21     38   
        }
          39  +
        /* JsonSerializerGenerator.kt:486 */
   22     40   
        array_4.finish();
          41  +
        /* JsonSerializerGenerator.kt:382 */
   23     42   
    }
          43  +
    /* JsonSerializerGenerator.kt:382 */
   24     44   
    if let Some(var_7) = &input.option {
          45  +
        /* JsonSerializerGenerator.kt:495 */
   25     46   
        #[allow(unused_mut)]
          47  +
        /* JsonSerializerGenerator.kt:496 */
   26     48   
        let mut object_8 = object.key("option").start_object();
          49  +
        /* JsonSerializerGenerator.kt:375 */
   27     50   
        crate::protocol_serde::shape_option::ser_option(&mut object_8, var_7)?;
          51  +
        /* JsonSerializerGenerator.kt:515 */
   28     52   
        object_8.finish();
          53  +
        /* JsonSerializerGenerator.kt:382 */
   29     54   
    }
          55  +
    /* JsonSerializerGenerator.kt:382 */
   30     56   
    if let Some(var_9) = &input.option_list {
          57  +
        /* JsonSerializerGenerator.kt:484 */
   31     58   
        let mut array_10 = object.key("optionList").start_array();
          59  +
        /* JsonSerializerGenerator.kt:524 */
   32     60   
        for item_11 in var_9 {
          61  +
            /* SerializerUtil.kt:42 */
   33     62   
            {
          63  +
                /* JsonSerializerGenerator.kt:495 */
   34     64   
                #[allow(unused_mut)]
          65  +
                /* JsonSerializerGenerator.kt:496 */
   35     66   
                let mut object_12 = array_10.value().start_object();
          67  +
                /* JsonSerializerGenerator.kt:375 */
   36     68   
                crate::protocol_serde::shape_result::ser_result(&mut object_12, item_11)?;
          69  +
                /* JsonSerializerGenerator.kt:515 */
   37     70   
                object_12.finish();
          71  +
                /* SerializerUtil.kt:42 */
   38     72   
            }
          73  +
            /* JsonSerializerGenerator.kt:524 */
   39     74   
        }
          75  +
        /* JsonSerializerGenerator.kt:486 */
   40     76   
        array_10.finish();
          77  +
        /* JsonSerializerGenerator.kt:382 */
   41     78   
    }
          79  +
    /* JsonSerializerGenerator.kt:382 */
   42     80   
    if let Some(var_13) = &input.something_else {
          81  +
        /* JsonSerializerGenerator.kt:495 */
   43     82   
        #[allow(unused_mut)]
          83  +
        /* JsonSerializerGenerator.kt:496 */
   44     84   
        let mut object_14 = object.key("somethingElse").start_object();
          85  +
        /* JsonSerializerGenerator.kt:375 */
   45     86   
        crate::protocol_serde::shape_something_else::ser_something_else(&mut object_14, var_13)?;
          87  +
        /* JsonSerializerGenerator.kt:515 */
   46     88   
        object_14.finish();
          89  +
        /* JsonSerializerGenerator.kt:382 */
   47     90   
    }
          91  +
    /* JsonSerializerGenerator.kt:372 */
   48     92   
    Ok(())
          93  +
    /* JsonSerializerGenerator.kt:358 */
   49     94   
}

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

@@ -1,1 +19,27 @@
    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::_something_else::SomethingElse;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_some_union::SomeUnion;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_option::Option;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_result::Result;
    9     13   
          14  +
/* RustModule.kt:172 */
   10     15   
mod _option;
   11     16   
          17  +
/* RustModule.kt:172 */
   12     18   
mod _result;
   13     19   
          20  +
/* RustModule.kt:172 */
   14     21   
mod _some_union;
   15     22   
          23  +
/* RustModule.kt:172 */
   16     24   
mod _something_else;
   17     25   
   18         -
/// Builders
          26  +
/// /* CodegenDelegator.kt:51 */Builders
   19     27   
pub mod builders;

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/types/_option.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 Option {
           8  +
pub /* StructureGenerator.kt:201 */ struct Option {
           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 Option {
          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 Option {
   16         -
    /// Creates a new builder-style object to manufacture [`Option`](crate::types::Option).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`Option`](crate::types::Option).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::OptionBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::OptionBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`Option`](crate::types::Option).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`Option`](crate::types::Option).
          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 OptionBuilder {
   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 OptionBuilder {
          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 [`Option`](crate::types::Option).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`Option`](crate::types::Option).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::Option {
   45         -
        crate::types::Option { value: self.value }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::Option {
          82  +
            /* BuilderGenerator.kt:481 */ value: self.value,
          83  +
            /* BuilderGenerator.kt:477 */
   46     84   
        }
          85  +
        /* BuilderGenerator.kt:253 */
          86  +
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/naming_test_structs/rust-client-codegen/src/types/_result.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 Result {
           8  +
pub /* StructureGenerator.kt:201 */ struct Result {
           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 Result {
          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 Result {
   16         -
    /// Creates a new builder-style object to manufacture [`Result`](crate::types::Result).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`Result`](crate::types::Result).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::ResultBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::ResultBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`Result`](crate::types::Result).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`Result`](crate::types::Result).
          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 ResultBuilder {
   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 ResultBuilder {
          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 [`Result`](crate::types::Result).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`Result`](crate::types::Result).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::Result {
   45         -
        crate::types::Result { value: self.value }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::Result {
          82  +
            /* BuilderGenerator.kt:481 */ value: self.value,
          83  +
            /* BuilderGenerator.kt:477 */
   46     84   
        }
          85  +
        /* BuilderGenerator.kt:253 */
          86  +
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}