Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

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

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

@@ -1,1 +43,73 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:148 */
    2      3   
pub(crate) fn de_validation_exception_json_err(
    3      4   
    value: &[u8],
    4      5   
    mut builder: crate::types::error::builders::ValidationErrorBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::ValidationErrorBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
           7  +
    /* JsonParserGenerator.kt:153 */
    6      8   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
    7      9   
    let tokens = &mut tokens_owned;
    8     10   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          11  +
    /* JsonParserGenerator.kt:684 */
    9     12   
    loop {
          13  +
        /* JsonParserGenerator.kt:685 */
   10     14   
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          15  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          16  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          17  +
                /* JsonParserGenerator.kt:260 */
          18  +
                match key.to_unescaped()?.as_ref() {
          19  +
                    /* JsonParserGenerator.kt:262 */
   13     20   
                    "Message" => {
          21  +
                        /* JsonParserGenerator.kt:265 */
   14     22   
                        builder = builder.set_message(
          23  +
                            /* JsonParserGenerator.kt:354 */
   15     24   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
          25  +
                                .map(|s|
          26  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          27  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          29  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
   18     30   
                        );
          31  +
                        /* JsonParserGenerator.kt:262 */
   19     32   
                    }
          33  +
                    /* JsonParserGenerator.kt:262 */
   20     34   
                    "Reason" => {
          35  +
                        /* JsonParserGenerator.kt:265 */
   21     36   
                        builder = builder.set_reason(
          37  +
                            /* JsonParserGenerator.kt:354 */
   22     38   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   23         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::ValidationExceptionReason::from(u.as_ref())))
   24         -
                            .transpose()?,
          39  +
                                .map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:345 */crate::types::ValidationExceptionReason::from(u.as_ref())
          42  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          43  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
   25     44   
                        );
          45  +
                        /* JsonParserGenerator.kt:262 */
   26     46   
                    }
   27         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   28         -
            },
          47  +
                    /* JsonParserGenerator.kt:290 */
          48  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          49  +
                }
          50  +
                /* JsonParserGenerator.kt:686 */
          51  +
            }
          52  +
            /* JsonParserGenerator.kt:695 */
   29     53   
            other => {
   30     54   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   31     55   
                    "expected object key or end object, found: {:?}",
   32     56   
                    other
   33     57   
                )))
          58  +
            } /* JsonParserGenerator.kt:685 */
   34     59   
        }
          60  +
        /* JsonParserGenerator.kt:684 */
   35     61   
    }
   36         -
    }
          62  +
    /* JsonParserGenerator.kt:250 */
   37     63   
    if tokens.next().is_some() {
          64  +
        /* JsonParserGenerator.kt:251 */
   38     65   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39     66   
            "found more JSON tokens after completing parsing",
   40     67   
        ));
          68  +
        /* JsonParserGenerator.kt:250 */
   41     69   
    }
          70  +
    /* JsonParserGenerator.kt:163 */
   42     71   
    Ok(builder)
          72  +
    /* JsonParserGenerator.kt:148 */
   43     73   
}

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/serde_util.rs

@@ -1,1 +9,10 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ErrorCorrection.kt:126 */
    2      3   
pub(crate) fn access_denied_exception_correct_errors(
    3      4   
    mut builder: crate::types::error::builders::AccessDeniedErrorBuilder,
    4      5   
) -> crate::types::error::builders::AccessDeniedErrorBuilder {
    5      6   
    if builder.reason.is_none() {
    6      7   
        builder.reason = "no value was set".parse::<crate::types::AccessDeniedExceptionReason>().ok()
    7      8   
    }
    8      9   
    builder
    9     10   
}

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

@@ -1,1 +50,72 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_validation_exception_reason::ValidationExceptionReason;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_service_quota_exceeded_exception_reason::ServiceQuotaExceededExceptionReason;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_resource_not_found_exception_reason::ResourceNotFoundExceptionReason;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_request_throttled_exception_reason::RequestThrottledExceptionReason;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_access_denied_exception_reason::AccessDeniedExceptionReason;
   11     16   
          17  +
/* CodegenDelegator.kt:255 */
   12     18   
pub use crate::types::_status::Status;
   13     19   
          20  +
/* CodegenDelegator.kt:255 */
   14     21   
pub use crate::types::_tag::Tag;
   15     22   
          23  +
/* CodegenDelegator.kt:255 */
   16     24   
pub use crate::types::_checksum_algorithm::ChecksumAlgorithm;
   17     25   
          26  +
/* CodegenDelegator.kt:255 */
   18     27   
pub use crate::types::_block::Block;
   19     28   
          29  +
/* CodegenDelegator.kt:255 */
   20     30   
pub use crate::types::_changed_block::ChangedBlock;
   21     31   
          32  +
/* CodegenDelegator.kt:255 */
   22     33   
pub use crate::types::_checksum_aggregation_method::ChecksumAggregationMethod;
   23     34   
          35  +
/* RustModule.kt:172 */
   24     36   
mod _access_denied_exception_reason;
   25     37   
          38  +
/* RustModule.kt:172 */
   26     39   
mod _block;
   27     40   
          41  +
/* RustModule.kt:172 */
   28     42   
mod _changed_block;
   29     43   
          44  +
/* RustModule.kt:172 */
   30     45   
mod _checksum_aggregation_method;
   31     46   
          47  +
/* RustModule.kt:172 */
   32     48   
mod _checksum_algorithm;
   33     49   
          50  +
/* RustModule.kt:172 */
   34     51   
mod _request_throttled_exception_reason;
   35     52   
          53  +
/* RustModule.kt:172 */
   36     54   
mod _resource_not_found_exception_reason;
   37     55   
          56  +
/* RustModule.kt:172 */
   38     57   
mod _service_quota_exceeded_exception_reason;
   39     58   
          59  +
/* RustModule.kt:172 */
   40     60   
mod _status;
   41     61   
          62  +
/* RustModule.kt:172 */
   42     63   
mod _tag;
   43     64   
          65  +
/* RustModule.kt:172 */
   44     66   
mod _validation_exception_reason;
   45     67   
   46         -
/// Builders
          68  +
/// /* CodegenDelegator.kt:51 */Builders
   47     69   
pub mod builders;
   48     70   
   49         -
/// Error types that Amazon Elastic Block Store can respond with.
          71  +
/// /* ClientRustModule.kt:121 */Error types that Amazon Elastic Block Store can respond with.
   50     72   
pub mod error;

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

@@ -1,1 +108,130 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// When writing a match expression against `AccessDeniedExceptionReason`, it is important to ensure
           2  +
/* ClientEnumGenerator.kt:234 */
           3  +
/// /* ClientEnumGenerator.kt:234 */When writing a match expression against `AccessDeniedExceptionReason`, 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 accessdeniedexceptionreason = unimplemented!();
          15  +
/* ClientEnumGenerator.kt:249 */
   14     16   
/// match accessdeniedexceptionreason {
          17  +
/* ClientEnumGenerator.kt:251 */
   15     18   
///     AccessDeniedExceptionReason::DependencyAccessDenied => { /* ... */ },
          19  +
/* ClientEnumGenerator.kt:251 */
   16     20   
///     AccessDeniedExceptionReason::UnauthorizedAccount => { /* ... */ },
          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 `accessdeniedexceptionreason` represents
          27  +
/// /* ClientEnumGenerator.kt:256 */```
          28  +
/// /* ClientEnumGenerator.kt:257 */The above code demonstrates that when `accessdeniedexceptionreason` 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 `AccessDeniedExceptionReason::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   
/// `AccessDeniedExceptionReason::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 `AccessDeniedExceptionReason::NewFeature` is defined.
   30     37   
/// Specifically, when `accessdeniedexceptionreason` 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 `AccessDeniedExceptionReason::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 AccessDeniedExceptionReason {
          54  +
pub /* EnumGenerator.kt:267 */ enum AccessDeniedExceptionReason {
          55  +
    /* EnumGenerator.kt:154 */
   45     56   
    #[allow(missing_docs)] // documentation missing in model
          57  +
    /* EnumGenerator.kt:143 */
   46     58   
    DependencyAccessDenied,
          59  +
    /* EnumGenerator.kt:154 */
   47     60   
    #[allow(missing_docs)] // documentation missing in model
          61  +
    /* EnumGenerator.kt:143 */
   48     62   
    UnauthorizedAccount,
   49         -
    /// `Unknown` contains new variants that have been added since this code was generated.
          63  +
    /// /* ClientEnumGenerator.kt:175 */`Unknown` contains new variants that have been added since this code was generated.
          64  +
    /* ClientEnumGenerator.kt:176 */
   50     65   
    #[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),
          66  +
    /* ClientEnumGenerator.kt:179 */
          67  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), /* EnumGenerator.kt:267 */
   52     68   
}
          69  +
/* ClientEnumGenerator.kt:42 */
   53     70   
impl ::std::convert::From<&str> for AccessDeniedExceptionReason {
   54     71   
    fn from(s: &str) -> Self {
   55     72   
        match s {
   56     73   
            "DEPENDENCY_ACCESS_DENIED" => AccessDeniedExceptionReason::DependencyAccessDenied,
   57     74   
            "UNAUTHORIZED_ACCOUNT" => AccessDeniedExceptionReason::UnauthorizedAccount,
   58     75   
            other => AccessDeniedExceptionReason::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
   59     76   
        }
   60     77   
    }
   61     78   
}
          79  +
/* ClientEnumGenerator.kt:68 */
   62     80   
impl ::std::str::FromStr for AccessDeniedExceptionReason {
   63     81   
    type Err = ::std::convert::Infallible;
   64     82   
   65     83   
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
   66     84   
        ::std::result::Result::Ok(AccessDeniedExceptionReason::from(s))
   67     85   
    }
   68     86   
}
          87  +
/* EnumGenerator.kt:274 */
   69     88   
impl AccessDeniedExceptionReason {
   70     89   
    /// Returns the `&str` value of the enum member.
   71     90   
    pub fn as_str(&self) -> &str {
   72     91   
        match self {
   73     92   
            AccessDeniedExceptionReason::DependencyAccessDenied => "DEPENDENCY_ACCESS_DENIED",
   74     93   
            AccessDeniedExceptionReason::UnauthorizedAccount => "UNAUTHORIZED_ACCOUNT",
   75     94   
            AccessDeniedExceptionReason::Unknown(value) => value.as_str(),
   76     95   
        }
   77     96   
    }
   78     97   
    /// Returns all the `&str` representations of the enum members.
   79     98   
    pub const fn values() -> &'static [&'static str] {
   80     99   
        &["DEPENDENCY_ACCESS_DENIED", "UNAUTHORIZED_ACCOUNT"]
   81    100   
    }
   82    101   
}
         102  +
/* EnumGenerator.kt:223 */
   83    103   
impl ::std::convert::AsRef<str> for AccessDeniedExceptionReason {
   84    104   
    fn as_ref(&self) -> &str {
   85    105   
        self.as_str()
   86    106   
    }
   87    107   
}
         108  +
/* ClientEnumGenerator.kt:117 */
   88    109   
impl AccessDeniedExceptionReason {
   89    110   
    /// Parses the enum value while disallowing unknown variants.
   90    111   
    ///
   91    112   
    /// Unknown variants will result in an error.
   92    113   
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
   93    114   
        match Self::from(value) {
   94    115   
            #[allow(deprecated)]
   95    116   
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
   96    117   
            known => Ok(known),
   97    118   
        }
   98    119   
    }
   99    120   
}
         121  +
/* ClientEnumGenerator.kt:136 */
  100    122   
impl ::std::fmt::Display for AccessDeniedExceptionReason {
  101    123   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  102    124   
        match self {
  103    125   
            AccessDeniedExceptionReason::DependencyAccessDenied => write!(f, "DEPENDENCY_ACCESS_DENIED"),
  104    126   
            AccessDeniedExceptionReason::UnauthorizedAccount => write!(f, "UNAUTHORIZED_ACCOUNT"),
  105    127   
            AccessDeniedExceptionReason::Unknown(value) => write!(f, "{}", value),
  106    128   
        }
  107    129   
    }
  108    130   
}

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

@@ -1,1 +72,119 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>A block of data in an Amazon Elastic Block Store snapshot.</p>
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */<p>A block of data in an Amazon Elastic Block Store snapshot.</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 Block {
    7         -
    /// <p>The block token for the block index.</p>
           8  +
pub /* StructureGenerator.kt:201 */ struct Block {
           9  +
    /// /* StructureGenerator.kt:231 */<p>The block token for the block index.</p>
    8     10   
    pub block_token: ::std::option::Option<::std::string::String>,
    9         -
    /// <p>The block index.</p>
          11  +
    /// /* StructureGenerator.kt:231 */<p>The block index.</p>
   10     12   
    pub block_index: ::std::option::Option<i32>,
          13  +
    /* StructureGenerator.kt:201 */
   11     14   
}
          15  +
/* StructureGenerator.kt:135 */
   12     16   
impl Block {
   13         -
    /// <p>The block token for the block index.</p>
          17  +
    /// /* StructureGenerator.kt:231 */<p>The block token for the block index.</p>
          18  +
    /* StructureGenerator.kt:166 */
   14     19   
    pub fn block_token(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   15     21   
        self.block_token.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   16     23   
    }
   17         -
    /// <p>The block index.</p>
          24  +
    /// /* StructureGenerator.kt:231 */<p>The block index.</p>
          25  +
    /* StructureGenerator.kt:166 */
   18     26   
    pub fn block_index(&self) -> ::std::option::Option<i32> {
          27  +
        /* StructureGenerator.kt:168 */
   19     28   
        self.block_index
          29  +
        /* StructureGenerator.kt:166 */
   20     30   
    }
          31  +
    /* StructureGenerator.kt:135 */
   21     32   
}
          33  +
/* ClientCodegenVisitor.kt:237 */
   22     34   
impl Block {
   23         -
    /// Creates a new builder-style object to manufacture [`Block`](crate::types::Block).
          35  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`Block`](crate::types::Block).
          36  +
    /* BuilderGenerator.kt:175 */
   24     37   
    pub fn builder() -> crate::types::builders::BlockBuilder {
          38  +
        /* BuilderGenerator.kt:176 */
   25     39   
        crate::types::builders::BlockBuilder::default()
          40  +
        /* BuilderGenerator.kt:175 */
   26     41   
    }
          42  +
    /* ClientCodegenVisitor.kt:237 */
   27     43   
}
   28     44   
   29         -
/// A builder for [`Block`](crate::types::Block).
          45  +
/// /* BuilderGenerator.kt:342 */A builder for [`Block`](crate::types::Block).
          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 BlockBuilder {
   33         -
    pub(crate) block_token: ::std::option::Option<::std::string::String>,
   34         -
    pub(crate) block_index: ::std::option::Option<i32>,
          52  +
    /* BuilderGenerator.kt:275 */ pub(crate) block_token: ::std::option::Option<::std::string::String>,
          53  +
    /* BuilderGenerator.kt:275 */ pub(crate) block_index: ::std::option::Option<i32>,
          54  +
    /* BuilderGenerator.kt:345 */
   35     55   
}
          56  +
/* BuilderGenerator.kt:355 */
   36     57   
impl BlockBuilder {
   37         -
    /// <p>The block token for the block index.</p>
          58  +
    /// /* BuilderGenerator.kt:286 */<p>The block token for the block index.</p>
          59  +
    /* BuilderGenerator.kt:291 */
   38     60   
    pub fn block_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          61  +
        /* BuilderGenerator.kt:292 */
   39     62   
        self.block_token = ::std::option::Option::Some(input.into());
          63  +
        /* BuilderGenerator.kt:293 */
   40     64   
        self
          65  +
        /* BuilderGenerator.kt:291 */
   41     66   
    }
   42         -
    /// <p>The block token for the block index.</p>
          67  +
    /// /* BuilderGenerator.kt:312 */<p>The block token for the block index.</p>
          68  +
    /* BuilderGenerator.kt:314 */
   43     69   
    pub fn set_block_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          70  +
        /* BuilderGenerator.kt:315 */
   44     71   
        self.block_token = input;
   45     72   
        self
          73  +
        /* BuilderGenerator.kt:314 */
   46     74   
    }
   47         -
    /// <p>The block token for the block index.</p>
          75  +
    /// /* BuilderGenerator.kt:334 */<p>The block token for the block index.</p>
          76  +
    /* BuilderGenerator.kt:336 */
   48     77   
    pub fn get_block_token(&self) -> &::std::option::Option<::std::string::String> {
          78  +
        /* BuilderGenerator.kt:337 */
   49     79   
        &self.block_token
          80  +
        /* BuilderGenerator.kt:336 */
   50     81   
    }
   51         -
    /// <p>The block index.</p>
          82  +
    /// /* BuilderGenerator.kt:286 */<p>The block index.</p>
          83  +
    /* BuilderGenerator.kt:291 */
   52     84   
    pub fn block_index(mut self, input: i32) -> Self {
          85  +
        /* BuilderGenerator.kt:292 */
   53     86   
        self.block_index = ::std::option::Option::Some(input);
          87  +
        /* BuilderGenerator.kt:293 */
   54     88   
        self
          89  +
        /* BuilderGenerator.kt:291 */
   55     90   
    }
   56         -
    /// <p>The block index.</p>
          91  +
    /// /* BuilderGenerator.kt:312 */<p>The block index.</p>
          92  +
    /* BuilderGenerator.kt:314 */
   57     93   
    pub fn set_block_index(mut self, input: ::std::option::Option<i32>) -> Self {
          94  +
        /* BuilderGenerator.kt:315 */
   58     95   
        self.block_index = input;
   59     96   
        self
          97  +
        /* BuilderGenerator.kt:314 */
   60     98   
    }
   61         -
    /// <p>The block index.</p>
          99  +
    /// /* BuilderGenerator.kt:334 */<p>The block index.</p>
         100  +
    /* BuilderGenerator.kt:336 */
   62    101   
    pub fn get_block_index(&self) -> &::std::option::Option<i32> {
         102  +
        /* BuilderGenerator.kt:337 */
   63    103   
        &self.block_index
         104  +
        /* BuilderGenerator.kt:336 */
   64    105   
    }
   65         -
    /// Consumes the builder and constructs a [`Block`](crate::types::Block).
         106  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`Block`](crate::types::Block).
         107  +
    /* BuilderGenerator.kt:253 */
   66    108   
    pub fn build(self) -> crate::types::Block {
         109  +
        /* BuilderGenerator.kt:477 */
   67    110   
        crate::types::Block {
   68         -
            block_token: self.block_token,
         111  +
            /* BuilderGenerator.kt:481 */ block_token: self.block_token,
         112  +
            /* BuilderGenerator.kt:481 */
   69    113   
            block_index: self.block_index,
         114  +
            /* BuilderGenerator.kt:477 */
   70    115   
        }
         116  +
        /* BuilderGenerator.kt:253 */
   71    117   
    }
         118  +
    /* BuilderGenerator.kt:355 */
   72    119   
}

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

@@ -1,1 +112,192 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>A block of data in an Amazon Elastic Block Store snapshot that is different from another snapshot of the same volume/snapshot lineage.</p>
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */<p>A block of data in an Amazon Elastic Block Store snapshot that is different from another snapshot of the same volume/snapshot lineage.</p>
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
    6         -
pub struct ChangedBlock {
    7         -
    /// <p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
           8  +
pub /* StructureGenerator.kt:201 */ struct ChangedBlock {
           9  +
    /// /* StructureGenerator.kt:231 */<p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
    8     10   
    pub first_block_token: ::std::option::Option<::std::string::String>,
    9         -
    /// <p>The block index.</p>
          11  +
    /// /* StructureGenerator.kt:231 */<p>The block index.</p>
   10     12   
    pub block_index: ::std::option::Option<i32>,
   11         -
    /// <p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
          13  +
    /// /* StructureGenerator.kt:231 */<p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
   12     14   
    pub second_block_token: ::std::option::Option<::std::string::String>,
          15  +
    /* StructureGenerator.kt:201 */
   13     16   
}
          17  +
/* StructureGenerator.kt:135 */
   14     18   
impl ChangedBlock {
   15         -
    /// <p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
          19  +
    /// /* StructureGenerator.kt:231 */<p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
          20  +
    /* StructureGenerator.kt:166 */
   16     21   
    pub fn first_block_token(&self) -> ::std::option::Option<&str> {
          22  +
        /* StructureGenerator.kt:169 */
   17     23   
        self.first_block_token.as_deref()
          24  +
        /* StructureGenerator.kt:166 */
   18     25   
    }
   19         -
    /// <p>The block index.</p>
          26  +
    /// /* StructureGenerator.kt:231 */<p>The block index.</p>
          27  +
    /* StructureGenerator.kt:166 */
   20     28   
    pub fn block_index(&self) -> ::std::option::Option<i32> {
          29  +
        /* StructureGenerator.kt:168 */
   21     30   
        self.block_index
          31  +
        /* StructureGenerator.kt:166 */
   22     32   
    }
   23         -
    /// <p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
          33  +
    /// /* StructureGenerator.kt:231 */<p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
          34  +
    /* StructureGenerator.kt:166 */
   24     35   
    pub fn second_block_token(&self) -> ::std::option::Option<&str> {
          36  +
        /* StructureGenerator.kt:169 */
   25     37   
        self.second_block_token.as_deref()
          38  +
        /* StructureGenerator.kt:166 */
   26     39   
    }
          40  +
    /* StructureGenerator.kt:135 */
   27     41   
}
          42  +
/* StructureGenerator.kt:101 */
   28     43   
impl ::std::fmt::Debug for ChangedBlock {
          44  +
    /* StructureGenerator.kt:105 */
   29     45   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          46  +
        /* StructureGenerator.kt:106 */
   30     47   
        let mut formatter = f.debug_struct("ChangedBlock");
          48  +
        /* StructureGenerator.kt:121 */
   31     49   
        formatter.field("first_block_token", &"*** Sensitive Data Redacted ***");
          50  +
        /* StructureGenerator.kt:121 */
   32     51   
        formatter.field("block_index", &"*** Sensitive Data Redacted ***");
          52  +
        /* StructureGenerator.kt:121 */
   33     53   
        formatter.field("second_block_token", &"*** Sensitive Data Redacted ***");
          54  +
        /* StructureGenerator.kt:126 */
   34     55   
        formatter.finish()
          56  +
        /* StructureGenerator.kt:105 */
   35     57   
    }
          58  +
    /* StructureGenerator.kt:101 */
   36     59   
}
          60  +
/* ClientCodegenVisitor.kt:237 */
   37     61   
impl ChangedBlock {
   38         -
    /// Creates a new builder-style object to manufacture [`ChangedBlock`](crate::types::ChangedBlock).
          62  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ChangedBlock`](crate::types::ChangedBlock).
          63  +
    /* BuilderGenerator.kt:175 */
   39     64   
    pub fn builder() -> crate::types::builders::ChangedBlockBuilder {
          65  +
        /* BuilderGenerator.kt:176 */
   40     66   
        crate::types::builders::ChangedBlockBuilder::default()
          67  +
        /* BuilderGenerator.kt:175 */
   41     68   
    }
          69  +
    /* ClientCodegenVisitor.kt:237 */
   42     70   
}
   43     71   
   44         -
/// A builder for [`ChangedBlock`](crate::types::ChangedBlock).
          72  +
/// /* BuilderGenerator.kt:342 */A builder for [`ChangedBlock`](crate::types::ChangedBlock).
          73  +
/* RustType.kt:516 */
   45     74   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
          75  +
/* RustType.kt:516 */
   46     76   
#[non_exhaustive]
          77  +
/* BuilderGenerator.kt:345 */
   47     78   
pub struct ChangedBlockBuilder {
   48         -
    pub(crate) first_block_token: ::std::option::Option<::std::string::String>,
   49         -
    pub(crate) block_index: ::std::option::Option<i32>,
          79  +
    /* BuilderGenerator.kt:275 */ pub(crate) first_block_token: ::std::option::Option<::std::string::String>,
          80  +
    /* BuilderGenerator.kt:275 */ pub(crate) block_index: ::std::option::Option<i32>,
          81  +
    /* BuilderGenerator.kt:275 */
   50     82   
    pub(crate) second_block_token: ::std::option::Option<::std::string::String>,
          83  +
    /* BuilderGenerator.kt:345 */
   51     84   
}
          85  +
/* BuilderGenerator.kt:355 */
   52     86   
impl ChangedBlockBuilder {
   53         -
    /// <p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
          87  +
    /// /* BuilderGenerator.kt:286 */<p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
          88  +
    /* BuilderGenerator.kt:291 */
   54     89   
    pub fn first_block_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          90  +
        /* BuilderGenerator.kt:292 */
   55     91   
        self.first_block_token = ::std::option::Option::Some(input.into());
          92  +
        /* BuilderGenerator.kt:293 */
   56     93   
        self
          94  +
        /* BuilderGenerator.kt:291 */
   57     95   
    }
   58         -
    /// <p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
          96  +
    /// /* BuilderGenerator.kt:312 */<p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
          97  +
    /* BuilderGenerator.kt:314 */
   59     98   
    pub fn set_first_block_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          99  +
        /* BuilderGenerator.kt:315 */
   60    100   
        self.first_block_token = input;
   61    101   
        self
         102  +
        /* BuilderGenerator.kt:314 */
   62    103   
    }
   63         -
    /// <p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
         104  +
    /// /* BuilderGenerator.kt:334 */<p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
         105  +
    /* BuilderGenerator.kt:336 */
   64    106   
    pub fn get_first_block_token(&self) -> &::std::option::Option<::std::string::String> {
         107  +
        /* BuilderGenerator.kt:337 */
   65    108   
        &self.first_block_token
         109  +
        /* BuilderGenerator.kt:336 */
   66    110   
    }
   67         -
    /// <p>The block index.</p>
         111  +
    /// /* BuilderGenerator.kt:286 */<p>The block index.</p>
         112  +
    /* BuilderGenerator.kt:291 */
   68    113   
    pub fn block_index(mut self, input: i32) -> Self {
         114  +
        /* BuilderGenerator.kt:292 */
   69    115   
        self.block_index = ::std::option::Option::Some(input);
         116  +
        /* BuilderGenerator.kt:293 */
   70    117   
        self
         118  +
        /* BuilderGenerator.kt:291 */
   71    119   
    }
   72         -
    /// <p>The block index.</p>
         120  +
    /// /* BuilderGenerator.kt:312 */<p>The block index.</p>
         121  +
    /* BuilderGenerator.kt:314 */
   73    122   
    pub fn set_block_index(mut self, input: ::std::option::Option<i32>) -> Self {
         123  +
        /* BuilderGenerator.kt:315 */
   74    124   
        self.block_index = input;
   75    125   
        self
         126  +
        /* BuilderGenerator.kt:314 */
   76    127   
    }
   77         -
    /// <p>The block index.</p>
         128  +
    /// /* BuilderGenerator.kt:334 */<p>The block index.</p>
         129  +
    /* BuilderGenerator.kt:336 */
   78    130   
    pub fn get_block_index(&self) -> &::std::option::Option<i32> {
         131  +
        /* BuilderGenerator.kt:337 */
   79    132   
        &self.block_index
         133  +
        /* BuilderGenerator.kt:336 */
   80    134   
    }
   81         -
    /// <p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
         135  +
    /// /* BuilderGenerator.kt:286 */<p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
         136  +
    /* BuilderGenerator.kt:291 */
   82    137   
    pub fn second_block_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         138  +
        /* BuilderGenerator.kt:292 */
   83    139   
        self.second_block_token = ::std::option::Option::Some(input.into());
         140  +
        /* BuilderGenerator.kt:293 */
   84    141   
        self
         142  +
        /* BuilderGenerator.kt:291 */
   85    143   
    }
   86         -
    /// <p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
         144  +
    /// /* BuilderGenerator.kt:312 */<p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
         145  +
    /* BuilderGenerator.kt:314 */
   87    146   
    pub fn set_second_block_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         147  +
        /* BuilderGenerator.kt:315 */
   88    148   
        self.second_block_token = input;
   89    149   
        self
         150  +
        /* BuilderGenerator.kt:314 */
   90    151   
    }
   91         -
    /// <p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
         152  +
    /// /* BuilderGenerator.kt:334 */<p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
         153  +
    /* BuilderGenerator.kt:336 */
   92    154   
    pub fn get_second_block_token(&self) -> &::std::option::Option<::std::string::String> {
         155  +
        /* BuilderGenerator.kt:337 */
   93    156   
        &self.second_block_token
         157  +
        /* BuilderGenerator.kt:336 */
   94    158   
    }
   95         -
    /// Consumes the builder and constructs a [`ChangedBlock`](crate::types::ChangedBlock).
         159  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ChangedBlock`](crate::types::ChangedBlock).
         160  +
    /* BuilderGenerator.kt:253 */
   96    161   
    pub fn build(self) -> crate::types::ChangedBlock {
         162  +
        /* BuilderGenerator.kt:477 */
   97    163   
        crate::types::ChangedBlock {
   98         -
            first_block_token: self.first_block_token,
         164  +
            /* BuilderGenerator.kt:481 */ first_block_token: self.first_block_token,
         165  +
            /* BuilderGenerator.kt:481 */
   99    166   
            block_index: self.block_index,
         167  +
            /* BuilderGenerator.kt:481 */
  100    168   
            second_block_token: self.second_block_token,
         169  +
            /* BuilderGenerator.kt:477 */
  101    170   
        }
         171  +
        /* BuilderGenerator.kt:253 */
  102    172   
    }
         173  +
    /* BuilderGenerator.kt:355 */
  103    174   
}
         175  +
/* BuilderGenerator.kt:379 */
  104    176   
impl ::std::fmt::Debug for ChangedBlockBuilder {
         177  +
    /* BuilderGenerator.kt:380 */
  105    178   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         179  +
        /* BuilderGenerator.kt:381 */
  106    180   
        let mut formatter = f.debug_struct("ChangedBlockBuilder");
         181  +
        /* BuilderGenerator.kt:395 */
  107    182   
        formatter.field("first_block_token", &"*** Sensitive Data Redacted ***");
         183  +
        /* BuilderGenerator.kt:395 */
  108    184   
        formatter.field("block_index", &"*** Sensitive Data Redacted ***");
         185  +
        /* BuilderGenerator.kt:395 */
  109    186   
        formatter.field("second_block_token", &"*** Sensitive Data Redacted ***");
         187  +
        /* BuilderGenerator.kt:400 */
  110    188   
        formatter.finish()
         189  +
        /* BuilderGenerator.kt:380 */
  111    190   
    }
         191  +
    /* BuilderGenerator.kt:379 */
  112    192   
}

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

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

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

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

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

@@ -1,1 +108,129 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// When writing a match expression against `RequestThrottledExceptionReason`, it is important to ensure
           2  +
/* ClientEnumGenerator.kt:234 */
           3  +
/// /* ClientEnumGenerator.kt:234 */When writing a match expression against `RequestThrottledExceptionReason`, 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 requestthrottledexceptionreason = unimplemented!();
          15  +
/* ClientEnumGenerator.kt:249 */
   14     16   
/// match requestthrottledexceptionreason {
          17  +
/* ClientEnumGenerator.kt:251 */
   15     18   
///     RequestThrottledExceptionReason::AccountThrottled => { /* ... */ },
          19  +
/* ClientEnumGenerator.kt:251 */
   16     20   
///     RequestThrottledExceptionReason::DependencyRequestThrottled => { /* ... */ },
          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 `requestthrottledexceptionreason` represents
          27  +
/// /* ClientEnumGenerator.kt:256 */```
          28  +
/// /* ClientEnumGenerator.kt:257 */The above code demonstrates that when `requestthrottledexceptionreason` 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 `RequestThrottledExceptionReason::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   
/// `RequestThrottledExceptionReason::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 `RequestThrottledExceptionReason::NewFeature` is defined.
   30     37   
/// Specifically, when `requestthrottledexceptionreason` 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 `RequestThrottledExceptionReason::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 RequestThrottledExceptionReason {
   45         -
    #[allow(missing_docs)] // documentation missing in model
          54  +
pub /* EnumGenerator.kt:267 */ enum RequestThrottledExceptionReason {
          55  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          56  +
    /* EnumGenerator.kt:143 */
   46     57   
    AccountThrottled,
          58  +
    /* EnumGenerator.kt:154 */
   47     59   
    #[allow(missing_docs)] // documentation missing in model
          60  +
    /* EnumGenerator.kt:143 */
   48     61   
    DependencyRequestThrottled,
   49         -
    /// `Unknown` contains new variants that have been added since this code was generated.
          62  +
    /// /* ClientEnumGenerator.kt:175 */`Unknown` contains new variants that have been added since this code was generated.
          63  +
    /* ClientEnumGenerator.kt:176 */
   50     64   
    #[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),
          65  +
    /* ClientEnumGenerator.kt:179 */
          66  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), /* EnumGenerator.kt:267 */
   52     67   
}
          68  +
/* ClientEnumGenerator.kt:42 */
   53     69   
impl ::std::convert::From<&str> for RequestThrottledExceptionReason {
   54     70   
    fn from(s: &str) -> Self {
   55     71   
        match s {
   56     72   
            "ACCOUNT_THROTTLED" => RequestThrottledExceptionReason::AccountThrottled,
   57     73   
            "DEPENDENCY_REQUEST_THROTTLED" => RequestThrottledExceptionReason::DependencyRequestThrottled,
   58     74   
            other => RequestThrottledExceptionReason::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
   59     75   
        }
   60     76   
    }
   61     77   
}
          78  +
/* ClientEnumGenerator.kt:68 */
   62     79   
impl ::std::str::FromStr for RequestThrottledExceptionReason {
   63     80   
    type Err = ::std::convert::Infallible;
   64     81   
   65     82   
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
   66     83   
        ::std::result::Result::Ok(RequestThrottledExceptionReason::from(s))
   67     84   
    }
   68     85   
}
          86  +
/* EnumGenerator.kt:274 */
   69     87   
impl RequestThrottledExceptionReason {
   70     88   
    /// Returns the `&str` value of the enum member.
   71     89   
    pub fn as_str(&self) -> &str {
   72     90   
        match self {
   73     91   
            RequestThrottledExceptionReason::AccountThrottled => "ACCOUNT_THROTTLED",
   74     92   
            RequestThrottledExceptionReason::DependencyRequestThrottled => "DEPENDENCY_REQUEST_THROTTLED",
   75     93   
            RequestThrottledExceptionReason::Unknown(value) => value.as_str(),
   76     94   
        }
   77     95   
    }
   78     96   
    /// Returns all the `&str` representations of the enum members.
   79     97   
    pub const fn values() -> &'static [&'static str] {
   80     98   
        &["ACCOUNT_THROTTLED", "DEPENDENCY_REQUEST_THROTTLED"]
   81     99   
    }
   82    100   
}
         101  +
/* EnumGenerator.kt:223 */
   83    102   
impl ::std::convert::AsRef<str> for RequestThrottledExceptionReason {
   84    103   
    fn as_ref(&self) -> &str {
   85    104   
        self.as_str()
   86    105   
    }
   87    106   
}
         107  +
/* ClientEnumGenerator.kt:117 */
   88    108   
impl RequestThrottledExceptionReason {
   89    109   
    /// Parses the enum value while disallowing unknown variants.
   90    110   
    ///
   91    111   
    /// Unknown variants will result in an error.
   92    112   
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
   93    113   
        match Self::from(value) {
   94    114   
            #[allow(deprecated)]
   95    115   
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
   96    116   
            known => Ok(known),
   97    117   
        }
   98    118   
    }
   99    119   
}
         120  +
/* ClientEnumGenerator.kt:136 */
  100    121   
impl ::std::fmt::Display for RequestThrottledExceptionReason {
  101    122   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  102    123   
        match self {
  103    124   
            RequestThrottledExceptionReason::AccountThrottled => write!(f, "ACCOUNT_THROTTLED"),
  104    125   
            RequestThrottledExceptionReason::DependencyRequestThrottled => write!(f, "DEPENDENCY_REQUEST_THROTTLED"),
  105    126   
            RequestThrottledExceptionReason::Unknown(value) => write!(f, "{}", value),
  106    127   
        }
  107    128   
    }
  108    129   
}

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

@@ -1,1 +108,129 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// When writing a match expression against `ResourceNotFoundExceptionReason`, it is important to ensure
           2  +
/* ClientEnumGenerator.kt:234 */
           3  +
/// /* ClientEnumGenerator.kt:234 */When writing a match expression against `ResourceNotFoundExceptionReason`, 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 resourcenotfoundexceptionreason = unimplemented!();
          15  +
/* ClientEnumGenerator.kt:249 */
   14     16   
/// match resourcenotfoundexceptionreason {
          17  +
/* ClientEnumGenerator.kt:251 */
   15     18   
///     ResourceNotFoundExceptionReason::DependencyResourceNotFound => { /* ... */ },
          19  +
/* ClientEnumGenerator.kt:251 */
   16     20   
///     ResourceNotFoundExceptionReason::SnapshotNotFound => { /* ... */ },
          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 `resourcenotfoundexceptionreason` represents
          27  +
/// /* ClientEnumGenerator.kt:256 */```
          28  +
/// /* ClientEnumGenerator.kt:257 */The above code demonstrates that when `resourcenotfoundexceptionreason` 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 `ResourceNotFoundExceptionReason::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   
/// `ResourceNotFoundExceptionReason::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 `ResourceNotFoundExceptionReason::NewFeature` is defined.
   30     37   
/// Specifically, when `resourcenotfoundexceptionreason` 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 `ResourceNotFoundExceptionReason::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 ResourceNotFoundExceptionReason {
          54  +
pub /* EnumGenerator.kt:267 */ enum ResourceNotFoundExceptionReason {
          55  +
    /* EnumGenerator.kt:154 */
   45     56   
    #[allow(missing_docs)] // documentation missing in model
          57  +
    /* EnumGenerator.kt:143 */
   46     58   
    DependencyResourceNotFound,
   47         -
    #[allow(missing_docs)] // documentation missing in model
          59  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          60  +
    /* EnumGenerator.kt:143 */
   48     61   
    SnapshotNotFound,
   49         -
    /// `Unknown` contains new variants that have been added since this code was generated.
          62  +
    /// /* ClientEnumGenerator.kt:175 */`Unknown` contains new variants that have been added since this code was generated.
          63  +
    /* ClientEnumGenerator.kt:176 */
   50     64   
    #[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),
          65  +
    /* ClientEnumGenerator.kt:179 */
          66  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), /* EnumGenerator.kt:267 */
   52     67   
}
          68  +
/* ClientEnumGenerator.kt:42 */
   53     69   
impl ::std::convert::From<&str> for ResourceNotFoundExceptionReason {
   54     70   
    fn from(s: &str) -> Self {
   55     71   
        match s {
   56     72   
            "DEPENDENCY_RESOURCE_NOT_FOUND" => ResourceNotFoundExceptionReason::DependencyResourceNotFound,
   57     73   
            "SNAPSHOT_NOT_FOUND" => ResourceNotFoundExceptionReason::SnapshotNotFound,
   58     74   
            other => ResourceNotFoundExceptionReason::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
   59     75   
        }
   60     76   
    }
   61     77   
}
          78  +
/* ClientEnumGenerator.kt:68 */
   62     79   
impl ::std::str::FromStr for ResourceNotFoundExceptionReason {
   63     80   
    type Err = ::std::convert::Infallible;
   64     81   
   65     82   
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
   66     83   
        ::std::result::Result::Ok(ResourceNotFoundExceptionReason::from(s))
   67     84   
    }
   68     85   
}
          86  +
/* EnumGenerator.kt:274 */
   69     87   
impl ResourceNotFoundExceptionReason {
   70     88   
    /// Returns the `&str` value of the enum member.
   71     89   
    pub fn as_str(&self) -> &str {
   72     90   
        match self {
   73     91   
            ResourceNotFoundExceptionReason::DependencyResourceNotFound => "DEPENDENCY_RESOURCE_NOT_FOUND",
   74     92   
            ResourceNotFoundExceptionReason::SnapshotNotFound => "SNAPSHOT_NOT_FOUND",
   75     93   
            ResourceNotFoundExceptionReason::Unknown(value) => value.as_str(),
   76     94   
        }
   77     95   
    }
   78     96   
    /// Returns all the `&str` representations of the enum members.
   79     97   
    pub const fn values() -> &'static [&'static str] {
   80     98   
        &["DEPENDENCY_RESOURCE_NOT_FOUND", "SNAPSHOT_NOT_FOUND"]
   81     99   
    }
   82    100   
}
         101  +
/* EnumGenerator.kt:223 */
   83    102   
impl ::std::convert::AsRef<str> for ResourceNotFoundExceptionReason {
   84    103   
    fn as_ref(&self) -> &str {
   85    104   
        self.as_str()
   86    105   
    }
   87    106   
}
         107  +
/* ClientEnumGenerator.kt:117 */
   88    108   
impl ResourceNotFoundExceptionReason {
   89    109   
    /// Parses the enum value while disallowing unknown variants.
   90    110   
    ///
   91    111   
    /// Unknown variants will result in an error.
   92    112   
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
   93    113   
        match Self::from(value) {
   94    114   
            #[allow(deprecated)]
   95    115   
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
   96    116   
            known => Ok(known),
   97    117   
        }
   98    118   
    }
   99    119   
}
         120  +
/* ClientEnumGenerator.kt:136 */
  100    121   
impl ::std::fmt::Display for ResourceNotFoundExceptionReason {
  101    122   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  102    123   
        match self {
  103    124   
            ResourceNotFoundExceptionReason::DependencyResourceNotFound => write!(f, "DEPENDENCY_RESOURCE_NOT_FOUND"),
  104    125   
            ResourceNotFoundExceptionReason::SnapshotNotFound => write!(f, "SNAPSHOT_NOT_FOUND"),
  105    126   
            ResourceNotFoundExceptionReason::Unknown(value) => write!(f, "{}", value),
  106    127   
        }
  107    128   
    }
  108    129   
}

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

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

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/types/_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 `Status`, it is important to ensure
           2  +
/* ClientEnumGenerator.kt:234 */
           3  +
/// /* ClientEnumGenerator.kt:234 */When writing a match expression against `Status`, 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 status = unimplemented!();
          15  +
/* ClientEnumGenerator.kt:249 */
   14     16   
/// match status {
          17  +
/* ClientEnumGenerator.kt:251 */
   15     18   
///     Status::Completed => { /* ... */ },
          19  +
/* ClientEnumGenerator.kt:251 */
   16     20   
///     Status::Error => { /* ... */ },
          21  +
/* ClientEnumGenerator.kt:251 */
   17     22   
///     Status::Pending => { /* ... */ },
          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 `status` represents
          29  +
/// /* ClientEnumGenerator.kt:256 */```
          30  +
/// /* ClientEnumGenerator.kt:257 */The above code demonstrates that when `status` 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 `Status::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   
/// `Status::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 `Status::NewFeature` is defined.
   31     39   
/// Specifically, when `status` 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 `Status::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 Status {
   46         -
    #[allow(missing_docs)] // documentation missing in model
          56  +
pub /* EnumGenerator.kt:267 */ enum Status {
          57  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          58  +
    /* EnumGenerator.kt:143 */
   47     59   
    Completed,
   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   
    Error,
   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   
    Pending,
   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 Status {
   57     74   
    fn from(s: &str) -> Self {
   58     75   
        match s {
   59     76   
            "completed" => Status::Completed,
   60     77   
            "error" => Status::Error,
   61     78   
            "pending" => Status::Pending,
   62     79   
            other => Status::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 Status {
   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(Status::from(s))
   71     89   
    }
   72     90   
}
          91  +
/* EnumGenerator.kt:274 */
   73     92   
impl Status {
   74     93   
    /// Returns the `&str` value of the enum member.
   75     94   
    pub fn as_str(&self) -> &str {
   76     95   
        match self {
   77     96   
            Status::Completed => "completed",
   78     97   
            Status::Error => "error",
   79     98   
            Status::Pending => "pending",
   80     99   
            Status::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   
        &["completed", "error", "pending"]
   86    105   
    }
   87    106   
}
         107  +
/* EnumGenerator.kt:223 */
   88    108   
impl ::std::convert::AsRef<str> for Status {
   89    109   
    fn as_ref(&self) -> &str {
   90    110   
        self.as_str()
   91    111   
    }
   92    112   
}
         113  +
/* ClientEnumGenerator.kt:117 */
   93    114   
impl Status {
   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 Status {
  106    128   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  107    129   
        match self {
  108    130   
            Status::Completed => write!(f, "completed"),
  109    131   
            Status::Error => write!(f, "error"),
  110    132   
            Status::Pending => write!(f, "pending"),
  111    133   
            Status::Unknown(value) => write!(f, "{}", value),
  112    134   
        }
  113    135   
    }
  114    136   
}

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

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

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

@@ -1,1 +174,215 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// When writing a match expression against `ValidationExceptionReason`, it is important to ensure
           2  +
/* ClientEnumGenerator.kt:234 */
           3  +
/// /* ClientEnumGenerator.kt:234 */When writing a match expression against `ValidationExceptionReason`, 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 validationexceptionreason = unimplemented!();
          15  +
/* ClientEnumGenerator.kt:249 */
   14     16   
/// match validationexceptionreason {
          17  +
/* ClientEnumGenerator.kt:251 */
   15     18   
///     ValidationExceptionReason::InvalidBlock => { /* ... */ },
          19  +
/* ClientEnumGenerator.kt:251 */
   16     20   
///     ValidationExceptionReason::InvalidBlockToken => { /* ... */ },
          21  +
/* ClientEnumGenerator.kt:251 */
   17     22   
///     ValidationExceptionReason::InvalidContentEncoding => { /* ... */ },
          23  +
/* ClientEnumGenerator.kt:251 */
   18     24   
///     ValidationExceptionReason::InvalidCustomerKey => { /* ... */ },
          25  +
/* ClientEnumGenerator.kt:251 */
   19     26   
///     ValidationExceptionReason::InvalidDependencyRequest => { /* ... */ },
          27  +
/* ClientEnumGenerator.kt:251 */
   20     28   
///     ValidationExceptionReason::InvalidPageToken => { /* ... */ },
          29  +
/* ClientEnumGenerator.kt:251 */
   21     30   
///     ValidationExceptionReason::InvalidParameterValue => { /* ... */ },
          31  +
/* ClientEnumGenerator.kt:251 */
   22     32   
///     ValidationExceptionReason::InvalidSnapshotId => { /* ... */ },
          33  +
/* ClientEnumGenerator.kt:251 */
   23     34   
///     ValidationExceptionReason::InvalidTag => { /* ... */ },
          35  +
/* ClientEnumGenerator.kt:251 */
   24     36   
///     ValidationExceptionReason::InvalidVolumeSize => { /* ... */ },
          37  +
/* ClientEnumGenerator.kt:251 */
   25     38   
///     ValidationExceptionReason::UnrelatedSnapshots => { /* ... */ },
          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 `validationexceptionreason` represents
          45  +
/// /* ClientEnumGenerator.kt:256 */```
          46  +
/// /* ClientEnumGenerator.kt:257 */The above code demonstrates that when `validationexceptionreason` 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 `ValidationExceptionReason::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   
/// `ValidationExceptionReason::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 `ValidationExceptionReason::NewFeature` is defined.
   39     55   
/// Specifically, when `validationexceptionreason` 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 `ValidationExceptionReason::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 ValidationExceptionReason {
   54         -
    #[allow(missing_docs)] // documentation missing in model
          72  +
pub /* EnumGenerator.kt:267 */ enum ValidationExceptionReason {
          73  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          74  +
    /* EnumGenerator.kt:143 */
   55     75   
    InvalidBlock,
   56         -
    #[allow(missing_docs)] // documentation missing in model
          76  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          77  +
    /* EnumGenerator.kt:143 */
   57     78   
    InvalidBlockToken,
          79  +
    /* EnumGenerator.kt:154 */
   58     80   
    #[allow(missing_docs)] // documentation missing in model
          81  +
    /* EnumGenerator.kt:143 */
   59     82   
    InvalidContentEncoding,
   60         -
    #[allow(missing_docs)] // documentation missing in model
          83  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          84  +
    /* EnumGenerator.kt:143 */
   61     85   
    InvalidCustomerKey,
          86  +
    /* EnumGenerator.kt:154 */
   62     87   
    #[allow(missing_docs)] // documentation missing in model
          88  +
    /* EnumGenerator.kt:143 */
   63     89   
    InvalidDependencyRequest,
   64         -
    #[allow(missing_docs)] // documentation missing in model
          90  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          91  +
    /* EnumGenerator.kt:143 */
   65     92   
    InvalidPageToken,
          93  +
    /* EnumGenerator.kt:154 */
   66     94   
    #[allow(missing_docs)] // documentation missing in model
          95  +
    /* EnumGenerator.kt:143 */
   67     96   
    InvalidParameterValue,
   68         -
    #[allow(missing_docs)] // documentation missing in model
          97  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          98  +
    /* EnumGenerator.kt:143 */
   69     99   
    InvalidSnapshotId,
   70         -
    #[allow(missing_docs)] // documentation missing in model
         100  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
         101  +
    /* EnumGenerator.kt:143 */
   71    102   
    InvalidTag,
   72         -
    #[allow(missing_docs)] // documentation missing in model
         103  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
         104  +
    /* EnumGenerator.kt:143 */
   73    105   
    InvalidVolumeSize,
   74         -
    #[allow(missing_docs)] // documentation missing in model
         106  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
         107  +
    /* EnumGenerator.kt:143 */
   75    108   
    UnrelatedSnapshots,
   76         -
    /// `Unknown` contains new variants that have been added since this code was generated.
         109  +
    /// /* ClientEnumGenerator.kt:175 */`Unknown` contains new variants that have been added since this code was generated.
         110  +
    /* ClientEnumGenerator.kt:176 */
   77    111   
    #[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),
         112  +
    /* ClientEnumGenerator.kt:179 */
         113  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), /* EnumGenerator.kt:267 */
   79    114   
}
         115  +
/* ClientEnumGenerator.kt:42 */
   80    116   
impl ::std::convert::From<&str> for ValidationExceptionReason {
   81    117   
    fn from(s: &str) -> Self {
   82    118   
        match s {
   83    119   
            "INVALID_BLOCK" => ValidationExceptionReason::InvalidBlock,
   84    120   
            "INVALID_BLOCK_TOKEN" => ValidationExceptionReason::InvalidBlockToken,
   85    121   
            "INVALID_CONTENT_ENCODING" => ValidationExceptionReason::InvalidContentEncoding,
   86    122   
            "INVALID_CUSTOMER_KEY" => ValidationExceptionReason::InvalidCustomerKey,
   87    123   
            "INVALID_DEPENDENCY_REQUEST" => ValidationExceptionReason::InvalidDependencyRequest,
   88    124   
            "INVALID_PAGE_TOKEN" => ValidationExceptionReason::InvalidPageToken,
   89    125   
            "INVALID_PARAMETER_VALUE" => ValidationExceptionReason::InvalidParameterValue,
   90    126   
            "INVALID_SNAPSHOT_ID" => ValidationExceptionReason::InvalidSnapshotId,
   91    127   
            "INVALID_TAG" => ValidationExceptionReason::InvalidTag,
   92    128   
            "INVALID_VOLUME_SIZE" => ValidationExceptionReason::InvalidVolumeSize,
   93    129   
            "UNRELATED_SNAPSHOTS" => ValidationExceptionReason::UnrelatedSnapshots,
   94    130   
            other => ValidationExceptionReason::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
   95    131   
        }
   96    132   
    }
   97    133   
}
         134  +
/* ClientEnumGenerator.kt:68 */
   98    135   
impl ::std::str::FromStr for ValidationExceptionReason {
   99    136   
    type Err = ::std::convert::Infallible;
  100    137   
  101    138   
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
  102    139   
        ::std::result::Result::Ok(ValidationExceptionReason::from(s))
  103    140   
    }
  104    141   
}
         142  +
/* EnumGenerator.kt:274 */
  105    143   
impl ValidationExceptionReason {
  106    144   
    /// Returns the `&str` value of the enum member.
  107    145   
    pub fn as_str(&self) -> &str {
  108    146   
        match self {
  109    147   
            ValidationExceptionReason::InvalidBlock => "INVALID_BLOCK",
  110    148   
            ValidationExceptionReason::InvalidBlockToken => "INVALID_BLOCK_TOKEN",
  111    149   
            ValidationExceptionReason::InvalidContentEncoding => "INVALID_CONTENT_ENCODING",
  112    150   
            ValidationExceptionReason::InvalidCustomerKey => "INVALID_CUSTOMER_KEY",
  113    151   
            ValidationExceptionReason::InvalidDependencyRequest => "INVALID_DEPENDENCY_REQUEST",
  114    152   
            ValidationExceptionReason::InvalidPageToken => "INVALID_PAGE_TOKEN",
  115    153   
            ValidationExceptionReason::InvalidParameterValue => "INVALID_PARAMETER_VALUE",
  116    154   
            ValidationExceptionReason::InvalidSnapshotId => "INVALID_SNAPSHOT_ID",
  117    155   
            ValidationExceptionReason::InvalidTag => "INVALID_TAG",
  118    156   
            ValidationExceptionReason::InvalidVolumeSize => "INVALID_VOLUME_SIZE",
  119    157   
            ValidationExceptionReason::UnrelatedSnapshots => "UNRELATED_SNAPSHOTS",
  120    158   
            ValidationExceptionReason::Unknown(value) => value.as_str(),
  121    159   
        }
  122    160   
    }
  123    161   
    /// Returns all the `&str` representations of the enum members.
  124    162   
    pub const fn values() -> &'static [&'static str] {
  125    163   
        &[
  126    164   
            "INVALID_BLOCK",
  127    165   
            "INVALID_BLOCK_TOKEN",
  128    166   
            "INVALID_CONTENT_ENCODING",
  129    167   
            "INVALID_CUSTOMER_KEY",
  130    168   
            "INVALID_DEPENDENCY_REQUEST",
  131    169   
            "INVALID_PAGE_TOKEN",
  132    170   
            "INVALID_PARAMETER_VALUE",
  133    171   
            "INVALID_SNAPSHOT_ID",
  134    172   
            "INVALID_TAG",
  135    173   
            "INVALID_VOLUME_SIZE",
  136    174   
            "UNRELATED_SNAPSHOTS",
  137    175   
        ]
  138    176   
    }
  139    177   
}
         178  +
/* EnumGenerator.kt:223 */
  140    179   
impl ::std::convert::AsRef<str> for ValidationExceptionReason {
  141    180   
    fn as_ref(&self) -> &str {
  142    181   
        self.as_str()
  143    182   
    }
  144    183   
}
         184  +
/* ClientEnumGenerator.kt:117 */
  145    185   
impl ValidationExceptionReason {
  146    186   
    /// Parses the enum value while disallowing unknown variants.
  147    187   
    ///
  148    188   
    /// Unknown variants will result in an error.
  149    189   
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
  150    190   
        match Self::from(value) {
  151    191   
            #[allow(deprecated)]
  152    192   
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
  153    193   
            known => Ok(known),
  154    194   
        }
  155    195   
    }
  156    196   
}
         197  +
/* ClientEnumGenerator.kt:136 */
  157    198   
impl ::std::fmt::Display for ValidationExceptionReason {
  158    199   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  159    200   
        match self {
  160    201   
            ValidationExceptionReason::InvalidBlock => write!(f, "INVALID_BLOCK"),
  161    202   
            ValidationExceptionReason::InvalidBlockToken => write!(f, "INVALID_BLOCK_TOKEN"),
  162    203   
            ValidationExceptionReason::InvalidContentEncoding => write!(f, "INVALID_CONTENT_ENCODING"),
  163    204   
            ValidationExceptionReason::InvalidCustomerKey => write!(f, "INVALID_CUSTOMER_KEY"),
  164    205   
            ValidationExceptionReason::InvalidDependencyRequest => write!(f, "INVALID_DEPENDENCY_REQUEST"),
  165    206   
            ValidationExceptionReason::InvalidPageToken => write!(f, "INVALID_PAGE_TOKEN"),
  166    207   
            ValidationExceptionReason::InvalidParameterValue => write!(f, "INVALID_PARAMETER_VALUE"),

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

@@ -1,1 +6,9 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_tag::TagBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_block::BlockBuilder;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_changed_block::ChangedBlockBuilder;