Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

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

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

@@ -1,1 +288,447 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Contains details for the backup.</p>
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */<p>Contains details for the backup.</p>
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct BackupSummary {
    7         -
    /// <p>Name of the table.</p>
           8  +
pub /* StructureGenerator.kt:201 */ struct BackupSummary {
           9  +
    /// /* StructureGenerator.kt:231 */<p>Name of the table.</p>
    8     10   
    pub table_name: ::std::option::Option<::std::string::String>,
    9         -
    /// <p>Unique identifier for the table.</p>
          11  +
    /// /* StructureGenerator.kt:231 */<p>Unique identifier for the table.</p>
   10     12   
    pub table_id: ::std::option::Option<::std::string::String>,
   11         -
    /// <p>ARN associated with the table.</p>
          13  +
    /// /* StructureGenerator.kt:231 */<p>ARN associated with the table.</p>
   12     14   
    pub table_arn: ::std::option::Option<::std::string::String>,
   13         -
    /// <p>ARN associated with the backup.</p>
          15  +
    /// /* StructureGenerator.kt:231 */<p>ARN associated with the backup.</p>
   14     16   
    pub backup_arn: ::std::option::Option<::std::string::String>,
   15         -
    /// <p>Name of the specified backup.</p>
          17  +
    /// /* StructureGenerator.kt:231 */<p>Name of the specified backup.</p>
   16     18   
    pub backup_name: ::std::option::Option<::std::string::String>,
   17         -
    /// <p>Time at which the backup was created.</p>
          19  +
    /// /* StructureGenerator.kt:231 */<p>Time at which the backup was created.</p>
   18     20   
    pub backup_creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
   19         -
    /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
          21  +
    /// /* StructureGenerator.kt:231 */<p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
   20     22   
    pub backup_expiry_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
   21         -
    /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
          23  +
    /// /* StructureGenerator.kt:231 */<p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
   22     24   
    pub backup_status: ::std::option::Option<crate::types::BackupStatus>,
   23         -
    /// <p>BackupType:</p>
          25  +
    /// /* StructureGenerator.kt:231 */<p>BackupType:</p>
   24     26   
    /// <ul>
   25     27   
    /// <li>
   26     28   
    /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
   27     29   
    /// <li>
   28     30   
    /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
   29     31   
    /// <li>
   30     32   
    /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from AWS Backup service.</p></li>
   31     33   
    /// </ul>
   32     34   
    pub backup_type: ::std::option::Option<crate::types::BackupType>,
   33         -
    /// <p>Size of the backup in bytes.</p>
          35  +
    /// /* StructureGenerator.kt:231 */<p>Size of the backup in bytes.</p>
   34     36   
    pub backup_size_bytes: ::std::option::Option<i64>,
          37  +
    /* StructureGenerator.kt:201 */
   35     38   
}
          39  +
/* StructureGenerator.kt:135 */
   36     40   
impl BackupSummary {
   37         -
    /// <p>Name of the table.</p>
          41  +
    /// /* StructureGenerator.kt:231 */<p>Name of the table.</p>
          42  +
    /* StructureGenerator.kt:166 */
   38     43   
    pub fn table_name(&self) -> ::std::option::Option<&str> {
          44  +
        /* StructureGenerator.kt:169 */
   39     45   
        self.table_name.as_deref()
          46  +
        /* StructureGenerator.kt:166 */
   40     47   
    }
   41         -
    /// <p>Unique identifier for the table.</p>
          48  +
    /// /* StructureGenerator.kt:231 */<p>Unique identifier for the table.</p>
          49  +
    /* StructureGenerator.kt:166 */
   42     50   
    pub fn table_id(&self) -> ::std::option::Option<&str> {
          51  +
        /* StructureGenerator.kt:169 */
   43     52   
        self.table_id.as_deref()
          53  +
        /* StructureGenerator.kt:166 */
   44     54   
    }
   45         -
    /// <p>ARN associated with the table.</p>
          55  +
    /// /* StructureGenerator.kt:231 */<p>ARN associated with the table.</p>
          56  +
    /* StructureGenerator.kt:166 */
   46     57   
    pub fn table_arn(&self) -> ::std::option::Option<&str> {
          58  +
        /* StructureGenerator.kt:169 */
   47     59   
        self.table_arn.as_deref()
          60  +
        /* StructureGenerator.kt:166 */
   48     61   
    }
   49         -
    /// <p>ARN associated with the backup.</p>
          62  +
    /// /* StructureGenerator.kt:231 */<p>ARN associated with the backup.</p>
          63  +
    /* StructureGenerator.kt:166 */
   50     64   
    pub fn backup_arn(&self) -> ::std::option::Option<&str> {
          65  +
        /* StructureGenerator.kt:169 */
   51     66   
        self.backup_arn.as_deref()
          67  +
        /* StructureGenerator.kt:166 */
   52     68   
    }
   53         -
    /// <p>Name of the specified backup.</p>
          69  +
    /// /* StructureGenerator.kt:231 */<p>Name of the specified backup.</p>
          70  +
    /* StructureGenerator.kt:166 */
   54     71   
    pub fn backup_name(&self) -> ::std::option::Option<&str> {
          72  +
        /* StructureGenerator.kt:169 */
   55     73   
        self.backup_name.as_deref()
          74  +
        /* StructureGenerator.kt:166 */
   56     75   
    }
   57         -
    /// <p>Time at which the backup was created.</p>
          76  +
    /// /* StructureGenerator.kt:231 */<p>Time at which the backup was created.</p>
          77  +
    /* StructureGenerator.kt:166 */
   58     78   
    pub fn backup_creation_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          79  +
        /* StructureGenerator.kt:170 */
   59     80   
        self.backup_creation_date_time.as_ref()
          81  +
        /* StructureGenerator.kt:166 */
   60     82   
    }
   61         -
    /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
          83  +
    /// /* StructureGenerator.kt:231 */<p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
          84  +
    /* StructureGenerator.kt:166 */
   62     85   
    pub fn backup_expiry_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          86  +
        /* StructureGenerator.kt:170 */
   63     87   
        self.backup_expiry_date_time.as_ref()
          88  +
        /* StructureGenerator.kt:166 */
   64     89   
    }
   65         -
    /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
          90  +
    /// /* StructureGenerator.kt:231 */<p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
          91  +
    /* StructureGenerator.kt:166 */
   66     92   
    pub fn backup_status(&self) -> ::std::option::Option<&crate::types::BackupStatus> {
          93  +
        /* StructureGenerator.kt:170 */
   67     94   
        self.backup_status.as_ref()
          95  +
        /* StructureGenerator.kt:166 */
   68     96   
    }
   69         -
    /// <p>BackupType:</p>
          97  +
    /// /* StructureGenerator.kt:231 */<p>BackupType:</p>
   70     98   
    /// <ul>
   71     99   
    /// <li>
   72    100   
    /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
   73    101   
    /// <li>
   74    102   
    /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
   75    103   
    /// <li>
   76    104   
    /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from AWS Backup service.</p></li>
   77    105   
    /// </ul>
         106  +
    /* StructureGenerator.kt:166 */
   78    107   
    pub fn backup_type(&self) -> ::std::option::Option<&crate::types::BackupType> {
         108  +
        /* StructureGenerator.kt:170 */
   79    109   
        self.backup_type.as_ref()
         110  +
        /* StructureGenerator.kt:166 */
   80    111   
    }
   81         -
    /// <p>Size of the backup in bytes.</p>
         112  +
    /// /* StructureGenerator.kt:231 */<p>Size of the backup in bytes.</p>
         113  +
    /* StructureGenerator.kt:166 */
   82    114   
    pub fn backup_size_bytes(&self) -> ::std::option::Option<i64> {
         115  +
        /* StructureGenerator.kt:168 */
   83    116   
        self.backup_size_bytes
         117  +
        /* StructureGenerator.kt:166 */
   84    118   
    }
         119  +
    /* StructureGenerator.kt:135 */
   85    120   
}
         121  +
/* ClientCodegenVisitor.kt:237 */
   86    122   
impl BackupSummary {
   87         -
    /// Creates a new builder-style object to manufacture [`BackupSummary`](crate::types::BackupSummary).
         123  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`BackupSummary`](crate::types::BackupSummary).
         124  +
    /* BuilderGenerator.kt:175 */
   88    125   
    pub fn builder() -> crate::types::builders::BackupSummaryBuilder {
         126  +
        /* BuilderGenerator.kt:176 */
   89    127   
        crate::types::builders::BackupSummaryBuilder::default()
         128  +
        /* BuilderGenerator.kt:175 */
   90    129   
    }
         130  +
    /* ClientCodegenVisitor.kt:237 */
   91    131   
}
   92    132   
   93         -
/// A builder for [`BackupSummary`](crate::types::BackupSummary).
         133  +
/// /* BuilderGenerator.kt:342 */A builder for [`BackupSummary`](crate::types::BackupSummary).
         134  +
/* RustType.kt:516 */
   94    135   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         136  +
/* RustType.kt:516 */
   95    137   
#[non_exhaustive]
         138  +
/* BuilderGenerator.kt:345 */
   96    139   
pub struct BackupSummaryBuilder {
   97         -
    pub(crate) table_name: ::std::option::Option<::std::string::String>,
   98         -
    pub(crate) table_id: ::std::option::Option<::std::string::String>,
   99         -
    pub(crate) table_arn: ::std::option::Option<::std::string::String>,
  100         -
    pub(crate) backup_arn: ::std::option::Option<::std::string::String>,
  101         -
    pub(crate) backup_name: ::std::option::Option<::std::string::String>,
  102         -
    pub(crate) backup_creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
  103         -
    pub(crate) backup_expiry_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
  104         -
    pub(crate) backup_status: ::std::option::Option<crate::types::BackupStatus>,
  105         -
    pub(crate) backup_type: ::std::option::Option<crate::types::BackupType>,
  106         -
    pub(crate) backup_size_bytes: ::std::option::Option<i64>,
         140  +
    /* BuilderGenerator.kt:275 */ pub(crate) table_name: ::std::option::Option<::std::string::String>,
         141  +
    /* BuilderGenerator.kt:275 */ pub(crate) table_id: ::std::option::Option<::std::string::String>,
         142  +
    /* BuilderGenerator.kt:275 */ pub(crate) table_arn: ::std::option::Option<::std::string::String>,
         143  +
    /* BuilderGenerator.kt:275 */ pub(crate) backup_arn: ::std::option::Option<::std::string::String>,
         144  +
    /* BuilderGenerator.kt:275 */ pub(crate) backup_name: ::std::option::Option<::std::string::String>,
         145  +
    /* BuilderGenerator.kt:275 */ pub(crate) backup_creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
         146  +
    /* BuilderGenerator.kt:275 */ pub(crate) backup_expiry_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
         147  +
    /* BuilderGenerator.kt:275 */ pub(crate) backup_status: ::std::option::Option<crate::types::BackupStatus>,
         148  +
    /* BuilderGenerator.kt:275 */ pub(crate) backup_type: ::std::option::Option<crate::types::BackupType>,
         149  +
    /* BuilderGenerator.kt:275 */ pub(crate) backup_size_bytes: ::std::option::Option<i64>,
         150  +
    /* BuilderGenerator.kt:345 */
  107    151   
}
         152  +
/* BuilderGenerator.kt:355 */
  108    153   
impl BackupSummaryBuilder {
  109         -
    /// <p>Name of the table.</p>
         154  +
    /// /* BuilderGenerator.kt:286 */<p>Name of the table.</p>
         155  +
    /* BuilderGenerator.kt:291 */
  110    156   
    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         157  +
        /* BuilderGenerator.kt:292 */
  111    158   
        self.table_name = ::std::option::Option::Some(input.into());
         159  +
        /* BuilderGenerator.kt:293 */
  112    160   
        self
         161  +
        /* BuilderGenerator.kt:291 */
  113    162   
    }
  114         -
    /// <p>Name of the table.</p>
         163  +
    /// /* BuilderGenerator.kt:312 */<p>Name of the table.</p>
         164  +
    /* BuilderGenerator.kt:314 */
  115    165   
    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         166  +
        /* BuilderGenerator.kt:315 */
  116    167   
        self.table_name = input;
  117    168   
        self
         169  +
        /* BuilderGenerator.kt:314 */
  118    170   
    }
  119         -
    /// <p>Name of the table.</p>
         171  +
    /// /* BuilderGenerator.kt:334 */<p>Name of the table.</p>
         172  +
    /* BuilderGenerator.kt:336 */
  120    173   
    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
         174  +
        /* BuilderGenerator.kt:337 */
  121    175   
        &self.table_name
         176  +
        /* BuilderGenerator.kt:336 */
  122    177   
    }
  123         -
    /// <p>Unique identifier for the table.</p>
         178  +
    /// /* BuilderGenerator.kt:286 */<p>Unique identifier for the table.</p>
         179  +
    /* BuilderGenerator.kt:291 */
  124    180   
    pub fn table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         181  +
        /* BuilderGenerator.kt:292 */
  125    182   
        self.table_id = ::std::option::Option::Some(input.into());
         183  +
        /* BuilderGenerator.kt:293 */
  126    184   
        self
         185  +
        /* BuilderGenerator.kt:291 */
  127    186   
    }
  128         -
    /// <p>Unique identifier for the table.</p>
         187  +
    /// /* BuilderGenerator.kt:312 */<p>Unique identifier for the table.</p>
         188  +
    /* BuilderGenerator.kt:314 */
  129    189   
    pub fn set_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         190  +
        /* BuilderGenerator.kt:315 */
  130    191   
        self.table_id = input;
  131    192   
        self
         193  +
        /* BuilderGenerator.kt:314 */
  132    194   
    }
  133         -
    /// <p>Unique identifier for the table.</p>
         195  +
    /// /* BuilderGenerator.kt:334 */<p>Unique identifier for the table.</p>
         196  +
    /* BuilderGenerator.kt:336 */
  134    197   
    pub fn get_table_id(&self) -> &::std::option::Option<::std::string::String> {
         198  +
        /* BuilderGenerator.kt:337 */
  135    199   
        &self.table_id
         200  +
        /* BuilderGenerator.kt:336 */
  136    201   
    }
  137         -
    /// <p>ARN associated with the table.</p>
         202  +
    /// /* BuilderGenerator.kt:286 */<p>ARN associated with the table.</p>
         203  +
    /* BuilderGenerator.kt:291 */
  138    204   
    pub fn table_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         205  +
        /* BuilderGenerator.kt:292 */
  139    206   
        self.table_arn = ::std::option::Option::Some(input.into());
         207  +
        /* BuilderGenerator.kt:293 */
  140    208   
        self
         209  +
        /* BuilderGenerator.kt:291 */
  141    210   
    }
  142         -
    /// <p>ARN associated with the table.</p>
         211  +
    /// /* BuilderGenerator.kt:312 */<p>ARN associated with the table.</p>
         212  +
    /* BuilderGenerator.kt:314 */
  143    213   
    pub fn set_table_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         214  +
        /* BuilderGenerator.kt:315 */
  144    215   
        self.table_arn = input;
  145    216   
        self
         217  +
        /* BuilderGenerator.kt:314 */
  146    218   
    }
  147         -
    /// <p>ARN associated with the table.</p>
         219  +
    /// /* BuilderGenerator.kt:334 */<p>ARN associated with the table.</p>
         220  +
    /* BuilderGenerator.kt:336 */
  148    221   
    pub fn get_table_arn(&self) -> &::std::option::Option<::std::string::String> {
         222  +
        /* BuilderGenerator.kt:337 */
  149    223   
        &self.table_arn
         224  +
        /* BuilderGenerator.kt:336 */
  150    225   
    }
  151         -
    /// <p>ARN associated with the backup.</p>
         226  +
    /// /* BuilderGenerator.kt:286 */<p>ARN associated with the backup.</p>
         227  +
    /* BuilderGenerator.kt:291 */
  152    228   
    pub fn backup_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         229  +
        /* BuilderGenerator.kt:292 */
  153    230   
        self.backup_arn = ::std::option::Option::Some(input.into());
         231  +
        /* BuilderGenerator.kt:293 */
  154    232   
        self
         233  +
        /* BuilderGenerator.kt:291 */
  155    234   
    }
  156         -
    /// <p>ARN associated with the backup.</p>
         235  +
    /// /* BuilderGenerator.kt:312 */<p>ARN associated with the backup.</p>
         236  +
    /* BuilderGenerator.kt:314 */
  157    237   
    pub fn set_backup_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         238  +
        /* BuilderGenerator.kt:315 */
  158    239   
        self.backup_arn = input;
  159    240   
        self
         241  +
        /* BuilderGenerator.kt:314 */
  160    242   
    }
  161         -
    /// <p>ARN associated with the backup.</p>
         243  +
    /// /* BuilderGenerator.kt:334 */<p>ARN associated with the backup.</p>
         244  +
    /* BuilderGenerator.kt:336 */
  162    245   
    pub fn get_backup_arn(&self) -> &::std::option::Option<::std::string::String> {
         246  +
        /* BuilderGenerator.kt:337 */
  163    247   
        &self.backup_arn
         248  +
        /* BuilderGenerator.kt:336 */
  164    249   
    }
  165         -
    /// <p>Name of the specified backup.</p>
         250  +
    /// /* BuilderGenerator.kt:286 */<p>Name of the specified backup.</p>
         251  +
    /* BuilderGenerator.kt:291 */
  166    252   
    pub fn backup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         253  +
        /* BuilderGenerator.kt:292 */
  167    254   
        self.backup_name = ::std::option::Option::Some(input.into());
         255  +
        /* BuilderGenerator.kt:293 */
  168    256   
        self
         257  +
        /* BuilderGenerator.kt:291 */
  169    258   
    }
  170         -
    /// <p>Name of the specified backup.</p>
         259  +
    /// /* BuilderGenerator.kt:312 */<p>Name of the specified backup.</p>
         260  +
    /* BuilderGenerator.kt:314 */
  171    261   
    pub fn set_backup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         262  +
        /* BuilderGenerator.kt:315 */
  172    263   
        self.backup_name = input;
  173    264   
        self
         265  +
        /* BuilderGenerator.kt:314 */
  174    266   
    }
  175         -
    /// <p>Name of the specified backup.</p>
         267  +
    /// /* BuilderGenerator.kt:334 */<p>Name of the specified backup.</p>
         268  +
    /* BuilderGenerator.kt:336 */
  176    269   
    pub fn get_backup_name(&self) -> &::std::option::Option<::std::string::String> {
         270  +
        /* BuilderGenerator.kt:337 */
  177    271   
        &self.backup_name
         272  +
        /* BuilderGenerator.kt:336 */
  178    273   
    }
  179         -
    /// <p>Time at which the backup was created.</p>
         274  +
    /// /* BuilderGenerator.kt:286 */<p>Time at which the backup was created.</p>
         275  +
    /* BuilderGenerator.kt:291 */
  180    276   
    pub fn backup_creation_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         277  +
        /* BuilderGenerator.kt:292 */
  181    278   
        self.backup_creation_date_time = ::std::option::Option::Some(input);
         279  +
        /* BuilderGenerator.kt:293 */
  182    280   
        self
         281  +
        /* BuilderGenerator.kt:291 */
  183    282   
    }
  184         -
    /// <p>Time at which the backup was created.</p>
         283  +
    /// /* BuilderGenerator.kt:312 */<p>Time at which the backup was created.</p>
         284  +
    /* BuilderGenerator.kt:314 */
  185    285   
    pub fn set_backup_creation_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         286  +
        /* BuilderGenerator.kt:315 */
  186    287   
        self.backup_creation_date_time = input;
  187    288   
        self
         289  +
        /* BuilderGenerator.kt:314 */
  188    290   
    }
  189         -
    /// <p>Time at which the backup was created.</p>
         291  +
    /// /* BuilderGenerator.kt:334 */<p>Time at which the backup was created.</p>
         292  +
    /* BuilderGenerator.kt:336 */
  190    293   
    pub fn get_backup_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         294  +
        /* BuilderGenerator.kt:337 */
  191    295   
        &self.backup_creation_date_time
         296  +
        /* BuilderGenerator.kt:336 */
  192    297   
    }
  193         -
    /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
         298  +
    /// /* BuilderGenerator.kt:286 */<p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
         299  +
    /* BuilderGenerator.kt:291 */
  194    300   
    pub fn backup_expiry_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         301  +
        /* BuilderGenerator.kt:292 */
  195    302   
        self.backup_expiry_date_time = ::std::option::Option::Some(input);
         303  +
        /* BuilderGenerator.kt:293 */
  196    304   
        self
         305  +
        /* BuilderGenerator.kt:291 */
  197    306   
    }
  198         -
    /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
         307  +
    /// /* BuilderGenerator.kt:312 */<p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
         308  +
    /* BuilderGenerator.kt:314 */
  199    309   
    pub fn set_backup_expiry_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         310  +
        /* BuilderGenerator.kt:315 */
  200    311   
        self.backup_expiry_date_time = input;
  201    312   
        self
         313  +
        /* BuilderGenerator.kt:314 */
  202    314   
    }
  203         -
    /// <p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
         315  +
    /// /* BuilderGenerator.kt:334 */<p>Time at which the automatic on-demand backup created by DynamoDB will expire. This <code>SYSTEM</code> on-demand backup expires automatically 35 days after its creation.</p>
         316  +
    /* BuilderGenerator.kt:336 */
  204    317   
    pub fn get_backup_expiry_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         318  +
        /* BuilderGenerator.kt:337 */
  205    319   
        &self.backup_expiry_date_time
         320  +
        /* BuilderGenerator.kt:336 */
  206    321   
    }
  207         -
    /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
         322  +
    /// /* BuilderGenerator.kt:286 */<p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
         323  +
    /* BuilderGenerator.kt:291 */
  208    324   
    pub fn backup_status(mut self, input: crate::types::BackupStatus) -> Self {
         325  +
        /* BuilderGenerator.kt:292 */
  209    326   
        self.backup_status = ::std::option::Option::Some(input);
         327  +
        /* BuilderGenerator.kt:293 */
  210    328   
        self
         329  +
        /* BuilderGenerator.kt:291 */
  211    330   
    }
  212         -
    /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
         331  +
    /// /* BuilderGenerator.kt:312 */<p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
         332  +
    /* BuilderGenerator.kt:314 */
  213    333   
    pub fn set_backup_status(mut self, input: ::std::option::Option<crate::types::BackupStatus>) -> Self {
         334  +
        /* BuilderGenerator.kt:315 */
  214    335   
        self.backup_status = input;
  215    336   
        self
         337  +
        /* BuilderGenerator.kt:314 */
  216    338   
    }
  217         -
    /// <p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
         339  +
    /// /* BuilderGenerator.kt:334 */<p>Backup can be in one of the following states: CREATING, ACTIVE, DELETED.</p>
         340  +
    /* BuilderGenerator.kt:336 */
  218    341   
    pub fn get_backup_status(&self) -> &::std::option::Option<crate::types::BackupStatus> {
         342  +
        /* BuilderGenerator.kt:337 */
  219    343   
        &self.backup_status
         344  +
        /* BuilderGenerator.kt:336 */
  220    345   
    }
  221         -
    /// <p>BackupType:</p>
         346  +
    /// /* BuilderGenerator.kt:286 */<p>BackupType:</p>
  222    347   
    /// <ul>
  223    348   
    /// <li>
  224    349   
    /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
  225    350   
    /// <li>
  226    351   
    /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
  227    352   
    /// <li>
  228    353   
    /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from AWS Backup service.</p></li>
  229    354   
    /// </ul>
         355  +
    /* BuilderGenerator.kt:291 */
  230    356   
    pub fn backup_type(mut self, input: crate::types::BackupType) -> Self {
         357  +
        /* BuilderGenerator.kt:292 */
  231    358   
        self.backup_type = ::std::option::Option::Some(input);
         359  +
        /* BuilderGenerator.kt:293 */
  232    360   
        self
         361  +
        /* BuilderGenerator.kt:291 */
  233    362   
    }
  234         -
    /// <p>BackupType:</p>
         363  +
    /// /* BuilderGenerator.kt:312 */<p>BackupType:</p>
  235    364   
    /// <ul>
  236    365   
    /// <li>
  237    366   
    /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
  238    367   
    /// <li>
  239    368   
    /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
  240    369   
    /// <li>
  241    370   
    /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from AWS Backup service.</p></li>
  242    371   
    /// </ul>
         372  +
    /* BuilderGenerator.kt:314 */
  243    373   
    pub fn set_backup_type(mut self, input: ::std::option::Option<crate::types::BackupType>) -> Self {
         374  +
        /* BuilderGenerator.kt:315 */
  244    375   
        self.backup_type = input;
  245    376   
        self
         377  +
        /* BuilderGenerator.kt:314 */
  246    378   
    }
  247         -
    /// <p>BackupType:</p>
         379  +
    /// /* BuilderGenerator.kt:334 */<p>BackupType:</p>
  248    380   
    /// <ul>
  249    381   
    /// <li>
  250    382   
    /// <p><code>USER</code> - You create and manage these using the on-demand backup feature.</p></li>
  251    383   
    /// <li>
  252    384   
    /// <p><code>SYSTEM</code> - If you delete a table with point-in-time recovery enabled, a <code>SYSTEM</code> backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion.</p></li>
  253    385   
    /// <li>
  254    386   
    /// <p><code>AWS_BACKUP</code> - On-demand backup created by you from AWS Backup service.</p></li>
  255    387   
    /// </ul>
         388  +
    /* BuilderGenerator.kt:336 */
  256    389   
    pub fn get_backup_type(&self) -> &::std::option::Option<crate::types::BackupType> {
         390  +
        /* BuilderGenerator.kt:337 */
  257    391   
        &self.backup_type
         392  +
        /* BuilderGenerator.kt:336 */
  258    393   
    }
  259         -
    /// <p>Size of the backup in bytes.</p>
         394  +
    /// /* BuilderGenerator.kt:286 */<p>Size of the backup in bytes.</p>
         395  +
    /* BuilderGenerator.kt:291 */
  260    396   
    pub fn backup_size_bytes(mut self, input: i64) -> Self {
         397  +
        /* BuilderGenerator.kt:292 */
  261    398   
        self.backup_size_bytes = ::std::option::Option::Some(input);
         399  +
        /* BuilderGenerator.kt:293 */
  262    400   
        self
         401  +
        /* BuilderGenerator.kt:291 */
  263    402   
    }
  264         -
    /// <p>Size of the backup in bytes.</p>
         403  +
    /// /* BuilderGenerator.kt:312 */<p>Size of the backup in bytes.</p>
         404  +
    /* BuilderGenerator.kt:314 */
  265    405   
    pub fn set_backup_size_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
         406  +
        /* BuilderGenerator.kt:315 */
  266    407   
        self.backup_size_bytes = input;
  267    408   
        self
         409  +
        /* BuilderGenerator.kt:314 */
  268    410   
    }
  269         -
    /// <p>Size of the backup in bytes.</p>
         411  +
    /// /* BuilderGenerator.kt:334 */<p>Size of the backup in bytes.</p>
         412  +
    /* BuilderGenerator.kt:336 */
  270    413   
    pub fn get_backup_size_bytes(&self) -> &::std::option::Option<i64> {
         414  +
        /* BuilderGenerator.kt:337 */
  271    415   
        &self.backup_size_bytes
         416  +
        /* BuilderGenerator.kt:336 */
  272    417   
    }
  273         -
    /// Consumes the builder and constructs a [`BackupSummary`](crate::types::BackupSummary).
         418  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`BackupSummary`](crate::types::BackupSummary).
         419  +
    /* BuilderGenerator.kt:253 */
  274    420   
    pub fn build(self) -> crate::types::BackupSummary {
         421  +
        /* BuilderGenerator.kt:477 */
  275    422   
        crate::types::BackupSummary {
  276         -
            table_name: self.table_name,
         423  +
            /* BuilderGenerator.kt:481 */ table_name: self.table_name,
         424  +
            /* BuilderGenerator.kt:481 */
  277    425   
            table_id: self.table_id,
         426  +
            /* BuilderGenerator.kt:481 */
  278    427   
            table_arn: self.table_arn,
         428  +
            /* BuilderGenerator.kt:481 */
  279    429   
            backup_arn: self.backup_arn,
         430  +
            /* BuilderGenerator.kt:481 */
  280    431   
            backup_name: self.backup_name,
         432  +
            /* BuilderGenerator.kt:481 */
  281    433   
            backup_creation_date_time: self.backup_creation_date_time,
         434  +
            /* BuilderGenerator.kt:481 */
  282    435   
            backup_expiry_date_time: self.backup_expiry_date_time,
         436  +
            /* BuilderGenerator.kt:481 */
  283    437   
            backup_status: self.backup_status,
         438  +
            /* BuilderGenerator.kt:481 */
  284    439   
            backup_type: self.backup_type,
         440  +
            /* BuilderGenerator.kt:481 */
  285    441   
            backup_size_bytes: self.backup_size_bytes,
         442  +
            /* BuilderGenerator.kt:477 */
  286    443   
        }
         444  +
        /* BuilderGenerator.kt:253 */
  287    445   
    }
         446  +
    /* BuilderGenerator.kt:355 */
  288    447   
}

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

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

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

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

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

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

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

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

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

@@ -1,1 +111,176 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>A PartiQL batch statement request.</p>
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */<p>A PartiQL batch statement request.</p>
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct BatchStatementRequest {
    7         -
    /// <p>A valid PartiQL statement.</p>
           8  +
pub /* StructureGenerator.kt:201 */ struct BatchStatementRequest {
           9  +
    /// /* StructureGenerator.kt:231 */<p>A valid PartiQL statement.</p>
    8     10   
    pub statement: ::std::string::String,
    9         -
    /// <p>The parameters associated with a PartiQL statement in the batch request.</p>
          11  +
    /// /* StructureGenerator.kt:231 */<p>The parameters associated with a PartiQL statement in the batch request.</p>
   10     12   
    pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::AttributeValue>>,
   11         -
    /// <p>The read consistency of the PartiQL batch request.</p>
          13  +
    /// /* StructureGenerator.kt:231 */<p>The read consistency of the PartiQL batch request.</p>
   12     14   
    pub consistent_read: ::std::option::Option<bool>,
          15  +
    /* StructureGenerator.kt:201 */
   13     16   
}
          17  +
/* StructureGenerator.kt:135 */
   14     18   
impl BatchStatementRequest {
   15         -
    /// <p>A valid PartiQL statement.</p>
          19  +
    /// /* StructureGenerator.kt:231 */<p>A valid PartiQL statement.</p>
          20  +
    /* StructureGenerator.kt:166 */
   16     21   
    pub fn statement(&self) -> &str {
          22  +
        /* StructureGenerator.kt:171 */
   17     23   
        use std::ops::Deref;
   18     24   
        self.statement.deref()
          25  +
        /* StructureGenerator.kt:166 */
   19     26   
    }
   20         -
    /// <p>The parameters associated with a PartiQL statement in the batch request.</p>
   21         -
    ///
   22         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.parameters.is_none()`.
          27  +
    /// /* StructureGenerator.kt:231 */<p>The parameters associated with a PartiQL statement in the batch request.</p>
          28  +
    /// /* StructureGenerator.kt:162 */
          29  +
    /// /* 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 `.parameters.is_none()`.
          30  +
    /* StructureGenerator.kt:166 */
   23     31   
    pub fn parameters(&self) -> &[crate::types::AttributeValue] {
   24         -
        self.parameters.as_deref().unwrap_or_default()
          32  +
        /* StructureGenerator.kt:169 */
          33  +
        self.parameters
          34  +
            .as_deref()
          35  +
            /* StructureGenerator.kt:175 */
          36  +
            .unwrap_or_default()
          37  +
        /* StructureGenerator.kt:166 */
   25     38   
    }
   26         -
    /// <p>The read consistency of the PartiQL batch request.</p>
          39  +
    /// /* StructureGenerator.kt:231 */<p>The read consistency of the PartiQL batch request.</p>
          40  +
    /* StructureGenerator.kt:166 */
   27     41   
    pub fn consistent_read(&self) -> ::std::option::Option<bool> {
          42  +
        /* StructureGenerator.kt:168 */
   28     43   
        self.consistent_read
          44  +
        /* StructureGenerator.kt:166 */
   29     45   
    }
          46  +
    /* StructureGenerator.kt:135 */
   30     47   
}
          48  +
/* ClientCodegenVisitor.kt:237 */
   31     49   
impl BatchStatementRequest {
   32         -
    /// Creates a new builder-style object to manufacture [`BatchStatementRequest`](crate::types::BatchStatementRequest).
          50  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`BatchStatementRequest`](crate::types::BatchStatementRequest).
          51  +
    /* BuilderGenerator.kt:175 */
   33     52   
    pub fn builder() -> crate::types::builders::BatchStatementRequestBuilder {
          53  +
        /* BuilderGenerator.kt:176 */
   34     54   
        crate::types::builders::BatchStatementRequestBuilder::default()
          55  +
        /* BuilderGenerator.kt:175 */
   35     56   
    }
          57  +
    /* ClientCodegenVisitor.kt:237 */
   36     58   
}
   37     59   
   38         -
/// A builder for [`BatchStatementRequest`](crate::types::BatchStatementRequest).
          60  +
/// /* BuilderGenerator.kt:342 */A builder for [`BatchStatementRequest`](crate::types::BatchStatementRequest).
          61  +
/* RustType.kt:516 */
   39     62   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          63  +
/* RustType.kt:516 */
   40     64   
#[non_exhaustive]
          65  +
/* BuilderGenerator.kt:345 */
   41     66   
pub struct BatchStatementRequestBuilder {
   42         -
    pub(crate) statement: ::std::option::Option<::std::string::String>,
   43         -
    pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::AttributeValue>>,
   44         -
    pub(crate) consistent_read: ::std::option::Option<bool>,
          67  +
    /* BuilderGenerator.kt:275 */ pub(crate) statement: ::std::option::Option<::std::string::String>,
          68  +
    /* BuilderGenerator.kt:275 */ pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::AttributeValue>>,
          69  +
    /* BuilderGenerator.kt:275 */ pub(crate) consistent_read: ::std::option::Option<bool>,
          70  +
    /* BuilderGenerator.kt:345 */
   45     71   
}
          72  +
/* BuilderGenerator.kt:355 */
   46     73   
impl BatchStatementRequestBuilder {
   47         -
    /// <p>A valid PartiQL statement.</p>
   48         -
    /// This field is required.
          74  +
    /// /* BuilderGenerator.kt:286 */<p>A valid PartiQL statement.</p>
          75  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          76  +
    /* BuilderGenerator.kt:291 */
   49     77   
    pub fn statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          78  +
        /* BuilderGenerator.kt:292 */
   50     79   
        self.statement = ::std::option::Option::Some(input.into());
          80  +
        /* BuilderGenerator.kt:293 */
   51     81   
        self
          82  +
        /* BuilderGenerator.kt:291 */
   52     83   
    }
   53         -
    /// <p>A valid PartiQL statement.</p>
          84  +
    /// /* BuilderGenerator.kt:312 */<p>A valid PartiQL statement.</p>
          85  +
    /* BuilderGenerator.kt:314 */
   54     86   
    pub fn set_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          87  +
        /* BuilderGenerator.kt:315 */
   55     88   
        self.statement = input;
   56     89   
        self
          90  +
        /* BuilderGenerator.kt:314 */
   57     91   
    }
   58         -
    /// <p>A valid PartiQL statement.</p>
          92  +
    /// /* BuilderGenerator.kt:334 */<p>A valid PartiQL statement.</p>
          93  +
    /* BuilderGenerator.kt:336 */
   59     94   
    pub fn get_statement(&self) -> &::std::option::Option<::std::string::String> {
          95  +
        /* BuilderGenerator.kt:337 */
   60     96   
        &self.statement
          97  +
        /* BuilderGenerator.kt:336 */
   61     98   
    }
   62         -
    /// Appends an item to `parameters`.
          99  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `parameters`.
         100  +
    /* BuilderGenerator.kt:411 */
   63    101   
    ///
   64         -
    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
         102  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_parameters`](Self::set_parameters).
         103  +
    /* BuilderGenerator.kt:413 */
   65    104   
    ///
   66         -
    /// <p>The parameters associated with a PartiQL statement in the batch request.</p>
         105  +
    /// /* BuilderGenerator.kt:414 */<p>The parameters associated with a PartiQL statement in the batch request.</p>
         106  +
    /* BuilderGenerator.kt:418 */
   67    107   
    pub fn parameters(mut self, input: crate::types::AttributeValue) -> Self {
         108  +
        /* BuilderGenerator.kt:419 */
   68    109   
        let mut v = self.parameters.unwrap_or_default();
   69    110   
        v.push(input);
   70    111   
        self.parameters = ::std::option::Option::Some(v);
   71    112   
        self
         113  +
        /* BuilderGenerator.kt:418 */
   72    114   
    }
   73         -
    /// <p>The parameters associated with a PartiQL statement in the batch request.</p>
         115  +
    /// /* BuilderGenerator.kt:312 */<p>The parameters associated with a PartiQL statement in the batch request.</p>
         116  +
    /* BuilderGenerator.kt:314 */
   74    117   
    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttributeValue>>) -> Self {
         118  +
        /* BuilderGenerator.kt:315 */
   75    119   
        self.parameters = input;
   76    120   
        self
         121  +
        /* BuilderGenerator.kt:314 */
   77    122   
    }
   78         -
    /// <p>The parameters associated with a PartiQL statement in the batch request.</p>
         123  +
    /// /* BuilderGenerator.kt:334 */<p>The parameters associated with a PartiQL statement in the batch request.</p>
         124  +
    /* BuilderGenerator.kt:336 */
   79    125   
    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttributeValue>> {
         126  +
        /* BuilderGenerator.kt:337 */
   80    127   
        &self.parameters
         128  +
        /* BuilderGenerator.kt:336 */
   81    129   
    }
   82         -
    /// <p>The read consistency of the PartiQL batch request.</p>
         130  +
    /// /* BuilderGenerator.kt:286 */<p>The read consistency of the PartiQL batch request.</p>
         131  +
    /* BuilderGenerator.kt:291 */
   83    132   
    pub fn consistent_read(mut self, input: bool) -> Self {
         133  +
        /* BuilderGenerator.kt:292 */
   84    134   
        self.consistent_read = ::std::option::Option::Some(input);
         135  +
        /* BuilderGenerator.kt:293 */
   85    136   
        self
         137  +
        /* BuilderGenerator.kt:291 */
   86    138   
    }
   87         -
    /// <p>The read consistency of the PartiQL batch request.</p>
         139  +
    /// /* BuilderGenerator.kt:312 */<p>The read consistency of the PartiQL batch request.</p>
         140  +
    /* BuilderGenerator.kt:314 */
   88    141   
    pub fn set_consistent_read(mut self, input: ::std::option::Option<bool>) -> Self {
         142  +
        /* BuilderGenerator.kt:315 */
   89    143   
        self.consistent_read = input;
   90    144   
        self
         145  +
        /* BuilderGenerator.kt:314 */
   91    146   
    }
   92         -
    /// <p>The read consistency of the PartiQL batch request.</p>
         147  +
    /// /* BuilderGenerator.kt:334 */<p>The read consistency of the PartiQL batch request.</p>
         148  +
    /* BuilderGenerator.kt:336 */
   93    149   
    pub fn get_consistent_read(&self) -> &::std::option::Option<bool> {
         150  +
        /* BuilderGenerator.kt:337 */
   94    151   
        &self.consistent_read
         152  +
        /* BuilderGenerator.kt:336 */
   95    153   
    }
   96         -
    /// Consumes the builder and constructs a [`BatchStatementRequest`](crate::types::BatchStatementRequest).
   97         -
    /// This method will fail if any of the following fields are not set:
   98         -
    /// - [`statement`](crate::types::builders::BatchStatementRequestBuilder::statement)
         154  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`BatchStatementRequest`](crate::types::BatchStatementRequest).
         155  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         156  +
    /// /* BuilderGenerator.kt:246 */- [`statement`](crate::types::builders::BatchStatementRequestBuilder::statement)
         157  +
    /* BuilderGenerator.kt:253 */
   99    158   
    pub fn build(self) -> ::std::result::Result<crate::types::BatchStatementRequest, ::aws_smithy_types::error::operation::BuildError> {
  100         -
        ::std::result::Result::Ok(crate::types::BatchStatementRequest {
  101         -
            statement: self.statement.ok_or_else(|| {
  102         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  103         -
                    "statement",
  104         -
                    "statement was not specified but it is required when building BatchStatementRequest",
  105         -
                )
  106         -
            })?,
  107         -
            parameters: self.parameters,
  108         -
            consistent_read: self.consistent_read,
  109         -
        })
         159  +
        /* BuilderGenerator.kt:254 */
         160  +
        ::std::result::Result::Ok(
         161  +
            /* BuilderGenerator.kt:477 */crate::types::BatchStatementRequest {
         162  +
                /* BuilderGenerator.kt:481 */statement: self.statement
         163  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         164  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("statement", "statement was not specified but it is required when building BatchStatementRequest")
         165  +
                    /* BuilderGenerator.kt:494 */)?
         166  +
                ,
         167  +
                /* BuilderGenerator.kt:481 */parameters: self.parameters
         168  +
                ,
         169  +
                /* BuilderGenerator.kt:481 */consistent_read: self.consistent_read
         170  +
                ,
         171  +
            /* BuilderGenerator.kt:477 */}
         172  +
        /* BuilderGenerator.kt:254 */)
         173  +
        /* BuilderGenerator.kt:253 */
  110    174   
    }
         175  +
    /* BuilderGenerator.kt:355 */
  111    176   
}

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

@@ -1,1 +103,166 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>A PartiQL batch statement response..</p>
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */<p>A PartiQL batch statement response..</p>
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct BatchStatementResponse {
    7         -
    /// <p>The error associated with a failed PartiQL batch statement.</p>
           8  +
pub /* StructureGenerator.kt:201 */ struct BatchStatementResponse {
           9  +
    /// /* StructureGenerator.kt:231 */<p>The error associated with a failed PartiQL batch statement.</p>
    8     10   
    pub error: ::std::option::Option<crate::types::BatchStatementError>,
    9         -
    /// <p>The table name associated with a failed PartiQL batch statement.</p>
          11  +
    /// /* StructureGenerator.kt:231 */<p>The table name associated with a failed PartiQL batch statement.</p>
   10     12   
    pub table_name: ::std::option::Option<::std::string::String>,
   11         -
    /// <p>A DynamoDB item associated with a BatchStatementResponse</p>
          13  +
    /// /* StructureGenerator.kt:231 */<p>A DynamoDB item associated with a BatchStatementResponse</p>
   12     14   
    pub item: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
          15  +
    /* StructureGenerator.kt:201 */
   13     16   
}
          17  +
/* StructureGenerator.kt:135 */
   14     18   
impl BatchStatementResponse {
   15         -
    /// <p>The error associated with a failed PartiQL batch statement.</p>
          19  +
    /// /* StructureGenerator.kt:231 */<p>The error associated with a failed PartiQL batch statement.</p>
          20  +
    /* StructureGenerator.kt:166 */
   16     21   
    pub fn error(&self) -> ::std::option::Option<&crate::types::BatchStatementError> {
          22  +
        /* StructureGenerator.kt:170 */
   17     23   
        self.error.as_ref()
          24  +
        /* StructureGenerator.kt:166 */
   18     25   
    }
   19         -
    /// <p>The table name associated with a failed PartiQL batch statement.</p>
          26  +
    /// /* StructureGenerator.kt:231 */<p>The table name associated with a failed PartiQL batch statement.</p>
          27  +
    /* StructureGenerator.kt:166 */
   20     28   
    pub fn table_name(&self) -> ::std::option::Option<&str> {
          29  +
        /* StructureGenerator.kt:169 */
   21     30   
        self.table_name.as_deref()
          31  +
        /* StructureGenerator.kt:166 */
   22     32   
    }
   23         -
    /// <p>A DynamoDB item associated with a BatchStatementResponse</p>
          33  +
    /// /* StructureGenerator.kt:231 */<p>A DynamoDB item associated with a BatchStatementResponse</p>
          34  +
    /* StructureGenerator.kt:166 */
   24     35   
    pub fn item(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
          36  +
        /* StructureGenerator.kt:170 */
   25     37   
        self.item.as_ref()
          38  +
        /* StructureGenerator.kt:166 */
   26     39   
    }
          40  +
    /* StructureGenerator.kt:135 */
   27     41   
}
          42  +
/* ClientCodegenVisitor.kt:237 */
   28     43   
impl BatchStatementResponse {
   29         -
    /// Creates a new builder-style object to manufacture [`BatchStatementResponse`](crate::types::BatchStatementResponse).
          44  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`BatchStatementResponse`](crate::types::BatchStatementResponse).
          45  +
    /* BuilderGenerator.kt:175 */
   30     46   
    pub fn builder() -> crate::types::builders::BatchStatementResponseBuilder {
          47  +
        /* BuilderGenerator.kt:176 */
   31     48   
        crate::types::builders::BatchStatementResponseBuilder::default()
          49  +
        /* BuilderGenerator.kt:175 */
   32     50   
    }
          51  +
    /* ClientCodegenVisitor.kt:237 */
   33     52   
}
   34     53   
   35         -
/// A builder for [`BatchStatementResponse`](crate::types::BatchStatementResponse).
          54  +
/// /* BuilderGenerator.kt:342 */A builder for [`BatchStatementResponse`](crate::types::BatchStatementResponse).
          55  +
/* RustType.kt:516 */
   36     56   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          57  +
/* RustType.kt:516 */
   37     58   
#[non_exhaustive]
          59  +
/* BuilderGenerator.kt:345 */
   38     60   
pub struct BatchStatementResponseBuilder {
   39         -
    pub(crate) error: ::std::option::Option<crate::types::BatchStatementError>,
   40         -
    pub(crate) table_name: ::std::option::Option<::std::string::String>,
          61  +
    /* BuilderGenerator.kt:275 */ pub(crate) error: ::std::option::Option<crate::types::BatchStatementError>,
          62  +
    /* BuilderGenerator.kt:275 */ pub(crate) table_name: ::std::option::Option<::std::string::String>,
          63  +
    /* BuilderGenerator.kt:275 */
   41     64   
    pub(crate) item: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
          65  +
    /* BuilderGenerator.kt:345 */
   42     66   
}
          67  +
/* BuilderGenerator.kt:355 */
   43     68   
impl BatchStatementResponseBuilder {
   44         -
    /// <p>The error associated with a failed PartiQL batch statement.</p>
          69  +
    /// /* BuilderGenerator.kt:286 */<p>The error associated with a failed PartiQL batch statement.</p>
          70  +
    /* BuilderGenerator.kt:291 */
   45     71   
    pub fn error(mut self, input: crate::types::BatchStatementError) -> Self {
          72  +
        /* BuilderGenerator.kt:292 */
   46     73   
        self.error = ::std::option::Option::Some(input);
          74  +
        /* BuilderGenerator.kt:293 */
   47     75   
        self
          76  +
        /* BuilderGenerator.kt:291 */
   48     77   
    }
   49         -
    /// <p>The error associated with a failed PartiQL batch statement.</p>
          78  +
    /// /* BuilderGenerator.kt:312 */<p>The error associated with a failed PartiQL batch statement.</p>
          79  +
    /* BuilderGenerator.kt:314 */
   50     80   
    pub fn set_error(mut self, input: ::std::option::Option<crate::types::BatchStatementError>) -> Self {
          81  +
        /* BuilderGenerator.kt:315 */
   51     82   
        self.error = input;
   52     83   
        self
          84  +
        /* BuilderGenerator.kt:314 */
   53     85   
    }
   54         -
    /// <p>The error associated with a failed PartiQL batch statement.</p>
          86  +
    /// /* BuilderGenerator.kt:334 */<p>The error associated with a failed PartiQL batch statement.</p>
          87  +
    /* BuilderGenerator.kt:336 */
   55     88   
    pub fn get_error(&self) -> &::std::option::Option<crate::types::BatchStatementError> {
          89  +
        /* BuilderGenerator.kt:337 */
   56     90   
        &self.error
          91  +
        /* BuilderGenerator.kt:336 */
   57     92   
    }
   58         -
    /// <p>The table name associated with a failed PartiQL batch statement.</p>
          93  +
    /// /* BuilderGenerator.kt:286 */<p>The table name associated with a failed PartiQL batch statement.</p>
          94  +
    /* BuilderGenerator.kt:291 */
   59     95   
    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          96  +
        /* BuilderGenerator.kt:292 */
   60     97   
        self.table_name = ::std::option::Option::Some(input.into());
          98  +
        /* BuilderGenerator.kt:293 */
   61     99   
        self
         100  +
        /* BuilderGenerator.kt:291 */
   62    101   
    }
   63         -
    /// <p>The table name associated with a failed PartiQL batch statement.</p>
         102  +
    /// /* BuilderGenerator.kt:312 */<p>The table name associated with a failed PartiQL batch statement.</p>
         103  +
    /* BuilderGenerator.kt:314 */
   64    104   
    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         105  +
        /* BuilderGenerator.kt:315 */
   65    106   
        self.table_name = input;
   66    107   
        self
         108  +
        /* BuilderGenerator.kt:314 */
   67    109   
    }
   68         -
    /// <p>The table name associated with a failed PartiQL batch statement.</p>
         110  +
    /// /* BuilderGenerator.kt:334 */<p>The table name associated with a failed PartiQL batch statement.</p>
         111  +
    /* BuilderGenerator.kt:336 */
   69    112   
    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
         113  +
        /* BuilderGenerator.kt:337 */
   70    114   
        &self.table_name
         115  +
        /* BuilderGenerator.kt:336 */
   71    116   
    }
   72         -
    /// Adds a key-value pair to `item`.
         117  +
    /// /* BuilderGenerator.kt:436 */Adds a key-value pair to `item`.
         118  +
    /* BuilderGenerator.kt:437 */
   73    119   
    ///
   74         -
    /// To override the contents of this collection use [`set_item`](Self::set_item).
         120  +
    /// /* BuilderGenerator.kt:438 */To override the contents of this collection use [`set_item`](Self::set_item).
         121  +
    /* BuilderGenerator.kt:439 */
   75    122   
    ///
   76         -
    /// <p>A DynamoDB item associated with a BatchStatementResponse</p>
         123  +
    /// /* BuilderGenerator.kt:440 */<p>A DynamoDB item associated with a BatchStatementResponse</p>
         124  +
    /* BuilderGenerator.kt:445 */
   77    125   
    pub fn item(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
         126  +
        /* BuilderGenerator.kt:448 */
   78    127   
        let mut hash_map = self.item.unwrap_or_default();
   79    128   
        hash_map.insert(k.into(), v);
   80    129   
        self.item = ::std::option::Option::Some(hash_map);
   81    130   
        self
         131  +
        /* BuilderGenerator.kt:445 */
   82    132   
    }
   83         -
    /// <p>A DynamoDB item associated with a BatchStatementResponse</p>
         133  +
    /// /* BuilderGenerator.kt:312 */<p>A DynamoDB item associated with a BatchStatementResponse</p>
         134  +
    /* BuilderGenerator.kt:314 */
   84    135   
    pub fn set_item(
   85    136   
        mut self,
   86    137   
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
   87    138   
    ) -> Self {
         139  +
        /* BuilderGenerator.kt:315 */
   88    140   
        self.item = input;
   89    141   
        self
         142  +
        /* BuilderGenerator.kt:314 */
   90    143   
    }
   91         -
    /// <p>A DynamoDB item associated with a BatchStatementResponse</p>
         144  +
    /// /* BuilderGenerator.kt:334 */<p>A DynamoDB item associated with a BatchStatementResponse</p>
         145  +
    /* BuilderGenerator.kt:336 */
   92    146   
    pub fn get_item(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
         147  +
        /* BuilderGenerator.kt:337 */
   93    148   
        &self.item
         149  +
        /* BuilderGenerator.kt:336 */
   94    150   
    }
   95         -
    /// Consumes the builder and constructs a [`BatchStatementResponse`](crate::types::BatchStatementResponse).
         151  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`BatchStatementResponse`](crate::types::BatchStatementResponse).
         152  +
    /* BuilderGenerator.kt:253 */
   96    153   
    pub fn build(self) -> crate::types::BatchStatementResponse {
         154  +
        /* BuilderGenerator.kt:477 */
   97    155   
        crate::types::BatchStatementResponse {
   98         -
            error: self.error,
         156  +
            /* BuilderGenerator.kt:481 */ error: self.error,
         157  +
            /* BuilderGenerator.kt:481 */
   99    158   
            table_name: self.table_name,
         159  +
            /* BuilderGenerator.kt:481 */
  100    160   
            item: self.item,
         161  +
            /* BuilderGenerator.kt:477 */
  101    162   
        }
         163  +
        /* BuilderGenerator.kt:253 */
  102    164   
    }
         165  +
    /* BuilderGenerator.kt:355 */
  103    166   
}

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

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

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

@@ -1,1 +102,150 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Contains the details for the read/write capacity mode.</p>
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */<p>Contains the details for the read/write capacity mode.</p>
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct BillingModeSummary {
    7         -
    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
           8  +
pub /* StructureGenerator.kt:201 */ struct BillingModeSummary {
           9  +
    /// /* StructureGenerator.kt:231 */<p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
    8     10   
    /// <ul>
    9     11   
    /// <li>
   10     12   
    /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
   11     13   
    /// <li>
   12     14   
    /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
   13     15   
    /// </ul>
   14     16   
    pub billing_mode: ::std::option::Option<crate::types::BillingMode>,
   15         -
    /// <p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
          17  +
    /// /* StructureGenerator.kt:231 */<p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
   16     18   
    pub last_update_to_pay_per_request_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
          19  +
    /* StructureGenerator.kt:201 */
   17     20   
}
          21  +
/* StructureGenerator.kt:135 */
   18     22   
impl BillingModeSummary {
   19         -
    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
          23  +
    /// /* StructureGenerator.kt:231 */<p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
   20     24   
    /// <ul>
   21     25   
    /// <li>
   22     26   
    /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
   23     27   
    /// <li>
   24     28   
    /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
   25     29   
    /// </ul>
          30  +
    /* StructureGenerator.kt:166 */
   26     31   
    pub fn billing_mode(&self) -> ::std::option::Option<&crate::types::BillingMode> {
          32  +
        /* StructureGenerator.kt:170 */
   27     33   
        self.billing_mode.as_ref()
          34  +
        /* StructureGenerator.kt:166 */
   28     35   
    }
   29         -
    /// <p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
          36  +
    /// /* StructureGenerator.kt:231 */<p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
          37  +
    /* StructureGenerator.kt:166 */
   30     38   
    pub fn last_update_to_pay_per_request_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
          39  +
        /* StructureGenerator.kt:170 */
   31     40   
        self.last_update_to_pay_per_request_date_time.as_ref()
          41  +
        /* StructureGenerator.kt:166 */
   32     42   
    }
          43  +
    /* StructureGenerator.kt:135 */
   33     44   
}
          45  +
/* ClientCodegenVisitor.kt:237 */
   34     46   
impl BillingModeSummary {
   35         -
    /// Creates a new builder-style object to manufacture [`BillingModeSummary`](crate::types::BillingModeSummary).
          47  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`BillingModeSummary`](crate::types::BillingModeSummary).
          48  +
    /* BuilderGenerator.kt:175 */
   36     49   
    pub fn builder() -> crate::types::builders::BillingModeSummaryBuilder {
          50  +
        /* BuilderGenerator.kt:176 */
   37     51   
        crate::types::builders::BillingModeSummaryBuilder::default()
          52  +
        /* BuilderGenerator.kt:175 */
   38     53   
    }
          54  +
    /* ClientCodegenVisitor.kt:237 */
   39     55   
}
   40     56   
   41         -
/// A builder for [`BillingModeSummary`](crate::types::BillingModeSummary).
          57  +
/// /* BuilderGenerator.kt:342 */A builder for [`BillingModeSummary`](crate::types::BillingModeSummary).
          58  +
/* RustType.kt:516 */
   42     59   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          60  +
/* RustType.kt:516 */
   43     61   
#[non_exhaustive]
          62  +
/* BuilderGenerator.kt:345 */
   44     63   
pub struct BillingModeSummaryBuilder {
   45         -
    pub(crate) billing_mode: ::std::option::Option<crate::types::BillingMode>,
          64  +
    /* BuilderGenerator.kt:275 */ pub(crate) billing_mode: ::std::option::Option<crate::types::BillingMode>,
          65  +
    /* BuilderGenerator.kt:275 */
   46     66   
    pub(crate) last_update_to_pay_per_request_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
          67  +
    /* BuilderGenerator.kt:345 */
   47     68   
}
          69  +
/* BuilderGenerator.kt:355 */
   48     70   
impl BillingModeSummaryBuilder {
   49         -
    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
          71  +
    /// /* BuilderGenerator.kt:286 */<p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
   50     72   
    /// <ul>
   51     73   
    /// <li>
   52     74   
    /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
   53     75   
    /// <li>
   54     76   
    /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
   55     77   
    /// </ul>
          78  +
    /* BuilderGenerator.kt:291 */
   56     79   
    pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
          80  +
        /* BuilderGenerator.kt:292 */
   57     81   
        self.billing_mode = ::std::option::Option::Some(input);
          82  +
        /* BuilderGenerator.kt:293 */
   58     83   
        self
          84  +
        /* BuilderGenerator.kt:291 */
   59     85   
    }
   60         -
    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
          86  +
    /// /* BuilderGenerator.kt:312 */<p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
   61     87   
    /// <ul>
   62     88   
    /// <li>
   63     89   
    /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
   64     90   
    /// <li>
   65     91   
    /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
   66     92   
    /// </ul>
          93  +
    /* BuilderGenerator.kt:314 */
   67     94   
    pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
          95  +
        /* BuilderGenerator.kt:315 */
   68     96   
        self.billing_mode = input;
   69     97   
        self
          98  +
        /* BuilderGenerator.kt:314 */
   70     99   
    }
   71         -
    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
         100  +
    /// /* BuilderGenerator.kt:334 */<p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
   72    101   
    /// <ul>
   73    102   
    /// <li>
   74    103   
    /// <p><code>PROVISIONED</code> - Sets the read/write capacity mode to <code>PROVISIONED</code>. We recommend using <code>PROVISIONED</code> for predictable workloads.</p></li>
   75    104   
    /// <li>
   76    105   
    /// <p><code>PAY_PER_REQUEST</code> - Sets the read/write capacity mode to <code>PAY_PER_REQUEST</code>. We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads.</p></li>
   77    106   
    /// </ul>
         107  +
    /* BuilderGenerator.kt:336 */
   78    108   
    pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
         109  +
        /* BuilderGenerator.kt:337 */
   79    110   
        &self.billing_mode
         111  +
        /* BuilderGenerator.kt:336 */
   80    112   
    }
   81         -
    /// <p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
         113  +
    /// /* BuilderGenerator.kt:286 */<p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
         114  +
    /* BuilderGenerator.kt:291 */
   82    115   
    pub fn last_update_to_pay_per_request_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         116  +
        /* BuilderGenerator.kt:292 */
   83    117   
        self.last_update_to_pay_per_request_date_time = ::std::option::Option::Some(input);
         118  +
        /* BuilderGenerator.kt:293 */
   84    119   
        self
         120  +
        /* BuilderGenerator.kt:291 */
   85    121   
    }
   86         -
    /// <p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
         122  +
    /// /* BuilderGenerator.kt:312 */<p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
         123  +
    /* BuilderGenerator.kt:314 */
   87    124   
    pub fn set_last_update_to_pay_per_request_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         125  +
        /* BuilderGenerator.kt:315 */
   88    126   
        self.last_update_to_pay_per_request_date_time = input;
   89    127   
        self
         128  +
        /* BuilderGenerator.kt:314 */
   90    129   
    }
   91         -
    /// <p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
         130  +
    /// /* BuilderGenerator.kt:334 */<p>Represents the time when <code>PAY_PER_REQUEST</code> was last set as the read/write capacity mode.</p>
         131  +
    /* BuilderGenerator.kt:336 */
   92    132   
    pub fn get_last_update_to_pay_per_request_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         133  +
        /* BuilderGenerator.kt:337 */
   93    134   
        &self.last_update_to_pay_per_request_date_time
         135  +
        /* BuilderGenerator.kt:336 */
   94    136   
    }
   95         -
    /// Consumes the builder and constructs a [`BillingModeSummary`](crate::types::BillingModeSummary).
         137  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`BillingModeSummary`](crate::types::BillingModeSummary).
         138  +
    /* BuilderGenerator.kt:253 */
   96    139   
    pub fn build(self) -> crate::types::BillingModeSummary {
         140  +
        /* BuilderGenerator.kt:477 */
   97    141   
        crate::types::BillingModeSummary {
   98         -
            billing_mode: self.billing_mode,
         142  +
            /* BuilderGenerator.kt:481 */ billing_mode: self.billing_mode,
         143  +
            /* BuilderGenerator.kt:481 */
   99    144   
            last_update_to_pay_per_request_date_time: self.last_update_to_pay_per_request_date_time,
         145  +
            /* BuilderGenerator.kt:477 */
  100    146   
        }
         147  +
        /* BuilderGenerator.kt:253 */
  101    148   
    }
         149  +
    /* BuilderGenerator.kt:355 */
  102    150   
}