Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +32,55 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_validation_exception_field_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::ValidationExceptionField>>, ::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_validation_exception_field::de_validation_exception_field(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
   23         -
                    }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   24     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   25     40   
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
            "expected start array or null",
   30         -
        )),
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
                "expected start array or null",
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

@@ -1,1 +30,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ErrorCorrection.kt:126 */
    2      3   
pub(crate) fn validation_exception_correct_errors(
    3      4   
    mut builder: crate::types::error::builders::ValidationErrorBuilder,
    4      5   
) -> crate::types::error::builders::ValidationErrorBuilder {
    5      6   
    if builder.message.is_none() {
    6      7   
        builder.message = Some(Default::default())
    7      8   
    }
    8      9   
    builder
    9     10   
}
   10     11   
          12  +
/* ErrorCorrection.kt:126 */
   11     13   
pub(crate) fn primitive_int_header_output_output_correct_errors(
   12     14   
    mut builder: crate::operation::primitive_int_header::builders::PrimitiveIntHeaderOutputBuilder,
   13     15   
) -> crate::operation::primitive_int_header::builders::PrimitiveIntHeaderOutputBuilder {
   14     16   
    if builder.field.is_none() {
   15     17   
        builder.field = Some(Default::default())
   16     18   
    }
   17     19   
    builder
   18     20   
}
   19     21   
          22  +
/* ErrorCorrection.kt:126 */
   20     23   
pub(crate) fn validation_exception_field_correct_errors(
   21     24   
    mut builder: crate::types::builders::ValidationExceptionFieldBuilder,
   22     25   
) -> crate::types::builders::ValidationExceptionFieldBuilder {
   23     26   
    if builder.path.is_none() {
   24     27   
        builder.path = Some(Default::default())
   25     28   
    }
   26     29   
    if builder.message.is_none() {
   27     30   
        builder.message = Some(Default::default())
   28     31   
    }
   29     32   
    builder

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

@@ -1,1 +26,36 @@
    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::_empty_struct::EmptyStruct;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_single_element_union::SingleElementUnion;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_validation_exception_field::ValidationExceptionField;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_enum_with_escaped_chars::EnumWithEscapedChars;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_string_enum::StringEnum;
   11     16   
          17  +
/* RustModule.kt:172 */
   12     18   
mod _empty_struct;
   13     19   
          20  +
/* RustModule.kt:172 */
   14     21   
mod _enum_with_escaped_chars;
   15     22   
          23  +
/* RustModule.kt:172 */
   16     24   
mod _single_element_union;
   17     25   
          26  +
/* RustModule.kt:172 */
   18     27   
mod _string_enum;
   19     28   
          29  +
/* RustModule.kt:172 */
   20     30   
mod _validation_exception_field;
   21     31   
   22         -
/// Builders
          32  +
/// /* CodegenDelegator.kt:51 */Builders
   23     33   
pub mod builders;
   24     34   
   25         -
/// Error types that the service can respond with.
          35  +
/// /* ClientRustModule.kt:121 */Error types that the service can respond with.
   26     36   
pub mod error;

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

@@ -1,1 +22,39 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct EmptyStruct {}
           8  +
pub /* StructureGenerator.kt:201 */ struct EmptyStruct {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl EmptyStruct {
    7         -
    /// Creates a new builder-style object to manufacture [`EmptyStruct`](crate::types::EmptyStruct).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`EmptyStruct`](crate::types::EmptyStruct).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::types::builders::EmptyStructBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::types::builders::EmptyStructBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`EmptyStruct`](crate::types::EmptyStruct).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`EmptyStruct`](crate::types::EmptyStruct).
          22  +
/* RustType.kt:516 */
   14     23   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          24  +
/* RustType.kt:516 */
   15     25   
#[non_exhaustive]
   16         -
pub struct EmptyStructBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct EmptyStructBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl EmptyStructBuilder {
   18         -
    /// Consumes the builder and constructs a [`EmptyStruct`](crate::types::EmptyStruct).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`EmptyStruct`](crate::types::EmptyStruct).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::types::EmptyStruct {
   20         -
        crate::types::EmptyStruct {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::types::EmptyStruct {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

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

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

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

@@ -1,1 +37,67 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* UnionGenerator.kt:67 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub enum SingleElementUnion {
           8  +
pub /* UnionGenerator.kt:85 */ enum SingleElementUnion {
           9  +
    /* UnionGenerator.kt:90 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
          11  +
    /* UnionGenerator.kt:190 */
    7     12   
    A(::std::string::String),
    8         -
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          13  +
    /// /* UnionGenerator.kt:96 */The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          14  +
    /* UnionGenerator.kt:97 */
    9     15   
    /// An unknown enum variant
          16  +
    /* UnionGenerator.kt:98 */
   10     17   
    ///
          18  +
    /* UnionGenerator.kt:99 */
   11     19   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
          20  +
    /* UnionGenerator.kt:100 */
   12     21   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
          22  +
    /* UnionGenerator.kt:101 */
   13     23   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
          24  +
    /* UnionGenerator.kt:102 */
   14     25   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
          26  +
    /* RustType.kt:516 */
   15     27   
    #[non_exhaustive]
          28  +
    /* UnionGenerator.kt:105 */
   16     29   
    Unknown,
          30  +
    /* UnionGenerator.kt:85 */
   17     31   
}
          32  +
/* UnionGenerator.kt:111 */
   18     33   
impl SingleElementUnion {
          34  +
    /* RustType.kt:516 */
   19     35   
    #[allow(irrefutable_let_patterns)]
          36  +
    /* UnionGenerator.kt:217 */
   20     37   
    /// Tries to convert the enum instance into [`A`](crate::types::SingleElementUnion::A), extracting the inner [`String`](::std::string::String).
          38  +
    /* UnionGenerator.kt:222 */
   21     39   
    /// Returns `Err(&Self)` if it can't be converted.
          40  +
    /* UnionGenerator.kt:223 */
   22     41   
    pub fn as_a(&self) -> ::std::result::Result<&::std::string::String, &Self> {
          42  +
        /* UnionGenerator.kt:227 */
   23     43   
        if let SingleElementUnion::A(val) = &self {
   24     44   
            ::std::result::Result::Ok(val)
   25     45   
        } else {
   26     46   
            ::std::result::Result::Err(self)
   27     47   
        }
          48  +
        /* UnionGenerator.kt:223 */
   28     49   
    }
          50  +
    /* UnionGenerator.kt:121 */
   29     51   
    /// Returns true if this is a [`A`](crate::types::SingleElementUnion::A).
          52  +
    /* UnionGenerator.kt:122 */
   30     53   
    pub fn is_a(&self) -> bool {
          54  +
        /* UnionGenerator.kt:123 */
   31     55   
        self.as_a().is_ok()
          56  +
        /* UnionGenerator.kt:122 */
   32     57   
    }
          58  +
    /* UnionGenerator.kt:127 */
   33     59   
    /// Returns true if the enum instance is the `Unknown` variant.
          60  +
    /* UnionGenerator.kt:128 */
   34     61   
    pub fn is_unknown(&self) -> bool {
          62  +
        /* UnionGenerator.kt:129 */
   35     63   
        matches!(self, Self::Unknown)
          64  +
        /* UnionGenerator.kt:128 */
   36     65   
    }
          66  +
    /* UnionGenerator.kt:111 */
   37     67   
}

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

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

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

@@ -1,1 +89,134 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Describes one specific validation failure for an input member.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */Describes one specific validation failure for an input member.
           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 ValidationExceptionField {
    7         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
           8  +
pub /* StructureGenerator.kt:201 */ struct ValidationExceptionField {
           9  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
    8     10   
    pub path: ::std::string::String,
    9         -
    /// A detailed description of the validation failure.
          11  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
   10     12   
    pub message: ::std::string::String,
          13  +
    /* StructureGenerator.kt:201 */
   11     14   
}
          15  +
/* StructureGenerator.kt:135 */
   12     16   
impl ValidationExceptionField {
   13         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          17  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          18  +
    /* StructureGenerator.kt:166 */
   14     19   
    pub fn path(&self) -> &str {
          20  +
        /* StructureGenerator.kt:171 */
   15     21   
        use std::ops::Deref;
   16     22   
        self.path.deref()
          23  +
        /* StructureGenerator.kt:166 */
   17     24   
    }
   18         -
    /// A detailed description of the validation failure.
          25  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
          26  +
    /* StructureGenerator.kt:166 */
   19     27   
    pub fn message(&self) -> &str {
          28  +
        /* StructureGenerator.kt:171 */
   20     29   
        use std::ops::Deref;
   21     30   
        self.message.deref()
          31  +
        /* StructureGenerator.kt:166 */
   22     32   
    }
          33  +
    /* StructureGenerator.kt:135 */
   23     34   
}
          35  +
/* ClientCodegenVisitor.kt:237 */
   24     36   
impl ValidationExceptionField {
   25         -
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          37  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          38  +
    /* BuilderGenerator.kt:175 */
   26     39   
    pub fn builder() -> crate::types::builders::ValidationExceptionFieldBuilder {
          40  +
        /* BuilderGenerator.kt:176 */
   27     41   
        crate::types::builders::ValidationExceptionFieldBuilder::default()
          42  +
        /* BuilderGenerator.kt:175 */
   28     43   
    }
          44  +
    /* ClientCodegenVisitor.kt:237 */
   29     45   
}
   30     46   
   31         -
/// A builder for [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          47  +
/// /* BuilderGenerator.kt:342 */A builder for [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          48  +
/* RustType.kt:516 */
   32     49   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          50  +
/* RustType.kt:516 */
   33     51   
#[non_exhaustive]
          52  +
/* BuilderGenerator.kt:345 */
   34     53   
pub struct ValidationExceptionFieldBuilder {
   35         -
    pub(crate) path: ::std::option::Option<::std::string::String>,
   36         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
          54  +
    /* BuilderGenerator.kt:275 */ pub(crate) path: ::std::option::Option<::std::string::String>,
          55  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:345 */
   37     57   
}
          58  +
/* BuilderGenerator.kt:355 */
   38     59   
impl ValidationExceptionFieldBuilder {
   39         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   40         -
    /// This field is required.
          60  +
    /// /* BuilderGenerator.kt:286 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          61  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          62  +
    /* BuilderGenerator.kt:291 */
   41     63   
    pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:292 */
   42     65   
        self.path = ::std::option::Option::Some(input.into());
          66  +
        /* BuilderGenerator.kt:293 */
   43     67   
        self
          68  +
        /* BuilderGenerator.kt:291 */
   44     69   
    }
   45         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          70  +
    /// /* BuilderGenerator.kt:312 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          71  +
    /* BuilderGenerator.kt:314 */
   46     72   
    pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          73  +
        /* BuilderGenerator.kt:315 */
   47     74   
        self.path = input;
   48     75   
        self
          76  +
        /* BuilderGenerator.kt:314 */
   49     77   
    }
   50         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          78  +
    /// /* BuilderGenerator.kt:334 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          79  +
    /* BuilderGenerator.kt:336 */
   51     80   
    pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
          81  +
        /* BuilderGenerator.kt:337 */
   52     82   
        &self.path
          83  +
        /* BuilderGenerator.kt:336 */
   53     84   
    }
   54         -
    /// A detailed description of the validation failure.
   55         -
    /// This field is required.
          85  +
    /// /* BuilderGenerator.kt:286 */A detailed description of the validation failure.
          86  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          87  +
    /* BuilderGenerator.kt:291 */
   56     88   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          89  +
        /* BuilderGenerator.kt:292 */
   57     90   
        self.message = ::std::option::Option::Some(input.into());
          91  +
        /* BuilderGenerator.kt:293 */
   58     92   
        self
          93  +
        /* BuilderGenerator.kt:291 */
   59     94   
    }
   60         -
    /// A detailed description of the validation failure.
          95  +
    /// /* BuilderGenerator.kt:312 */A detailed description of the validation failure.
          96  +
    /* BuilderGenerator.kt:314 */
   61     97   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          98  +
        /* BuilderGenerator.kt:315 */
   62     99   
        self.message = input;
   63    100   
        self
         101  +
        /* BuilderGenerator.kt:314 */
   64    102   
    }
   65         -
    /// A detailed description of the validation failure.
         103  +
    /// /* BuilderGenerator.kt:334 */A detailed description of the validation failure.
         104  +
    /* BuilderGenerator.kt:336 */
   66    105   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         106  +
        /* BuilderGenerator.kt:337 */
   67    107   
        &self.message
         108  +
        /* BuilderGenerator.kt:336 */
   68    109   
    }
   69         -
    /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::types::ValidationExceptionField).
   70         -
    /// This method will fail if any of the following fields are not set:
   71         -
    /// - [`path`](crate::types::builders::ValidationExceptionFieldBuilder::path)
   72         -
    /// - [`message`](crate::types::builders::ValidationExceptionFieldBuilder::message)
         110  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::types::ValidationExceptionField).
         111  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         112  +
    /// /* BuilderGenerator.kt:246 */- [`path`](crate::types::builders::ValidationExceptionFieldBuilder::path)
         113  +
    /// /* BuilderGenerator.kt:246 */- [`message`](crate::types::builders::ValidationExceptionFieldBuilder::message)
         114  +
    /* BuilderGenerator.kt:253 */
   73    115   
    pub fn build(self) -> ::std::result::Result<crate::types::ValidationExceptionField, ::aws_smithy_types::error::operation::BuildError> {
   74         -
        ::std::result::Result::Ok(crate::types::ValidationExceptionField {
   75         -
            path: self.path.ok_or_else(|| {
   76         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   77         -
                    "path",
   78         -
                    "path was not specified but it is required when building ValidationExceptionField",
   79         -
                )
   80         -
            })?,
   81         -
            message: self.message.ok_or_else(|| {
   82         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   83         -
                    "message",
   84         -
                    "message was not specified but it is required when building ValidationExceptionField",
   85         -
                )
   86         -
            })?,
   87         -
        })
         116  +
        /* BuilderGenerator.kt:254 */
         117  +
        ::std::result::Result::Ok(
         118  +
            /* BuilderGenerator.kt:477 */crate::types::ValidationExceptionField {
         119  +
                /* BuilderGenerator.kt:481 */path: self.path
         120  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         121  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("path", "path was not specified but it is required when building ValidationExceptionField")
         122  +
                    /* BuilderGenerator.kt:494 */)?
         123  +
                ,
         124  +
                /* BuilderGenerator.kt:481 */message: self.message
         125  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         126  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("message", "message was not specified but it is required when building ValidationExceptionField")
         127  +
                    /* BuilderGenerator.kt:494 */)?
         128  +
                ,
         129  +
            /* BuilderGenerator.kt:477 */}
         130  +
        /* BuilderGenerator.kt:254 */)
         131  +
        /* BuilderGenerator.kt:253 */
   88    132   
    }
         133  +
    /* BuilderGenerator.kt:355 */
   89    134   
}

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

@@ -1,1 +4,6 @@
    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::_empty_struct::EmptyStructBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_validation_exception_field::ValidationExceptionFieldBuilder;

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

@@ -1,1 +15,21 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::error::_extra_error::ExtraError;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::error::_case_insensitive_error::CaseInsensitiveError;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::error::_validation_exception::ValidationError;
    7     10   
          11  +
/* RustModule.kt:172 */
    8     12   
mod _case_insensitive_error;
    9     13   
          14  +
/* RustModule.kt:172 */
   10     15   
mod _extra_error;
   11     16   
          17  +
/* RustModule.kt:172 */
   12     18   
mod _validation_exception;
   13     19   
   14         -
/// Builders
          20  +
/// /* CodegenDelegator.kt:51 */Builders
   15     21   
pub mod builders;

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

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

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

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

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

@@ -1,1 +119,184 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
           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 ValidationError {
    7         -
    /// A summary of the validation failure.
           8  +
pub /* StructureGenerator.kt:201 */ struct ValidationError {
           9  +
    /// /* StructureGenerator.kt:231 */A summary of the validation failure.
    8     10   
    pub message: ::std::string::String,
    9         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
          11  +
    /// /* StructureGenerator.kt:231 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
   10     12   
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>,
   11         -
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          13  +
    /* ErrorGenerator.kt:53 */ pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          14  +
    /* StructureGenerator.kt:201 */
   12     15   
}
          16  +
/* StructureGenerator.kt:135 */
   13     17   
impl ValidationError {
   14         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
   15         -
    ///
   16         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.field_list.is_none()`.
          18  +
    /// /* StructureGenerator.kt:231 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
          19  +
    /// /* StructureGenerator.kt:162 */
          20  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.field_list.is_none()`.
          21  +
    /* StructureGenerator.kt:166 */
   17     22   
    pub fn field_list(&self) -> &[crate::types::ValidationExceptionField] {
   18         -
        self.field_list.as_deref().unwrap_or_default()
          23  +
        /* StructureGenerator.kt:169 */
          24  +
        self.field_list
          25  +
            .as_deref()
          26  +
            /* StructureGenerator.kt:175 */
          27  +
            .unwrap_or_default()
          28  +
        /* StructureGenerator.kt:166 */
   19     29   
    }
          30  +
    /* StructureGenerator.kt:135 */
   20     31   
}
          32  +
/* ErrorImplGenerator.kt:99 */
   21     33   
impl ValidationError {
          34  +
    /* ErrorImplGenerator.kt:128 */
   22     35   
    /// Returns the error message.
   23     36   
    pub fn message(&self) -> &str {
   24     37   
        &self.message
   25     38   
    }
          39  +
    /* ErrorImplGenerator.kt:99 */
   26     40   
}
          41  +
/* ErrorImplGenerator.kt:153 */
   27     42   
impl ::std::fmt::Display for ValidationError {
          43  +
    /* ErrorImplGenerator.kt:154 */
   28     44   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          45  +
        /* ErrorImplGenerator.kt:161 */
   29     46   
        ::std::write!(f, "ValidationError [ValidationException]")?;
          47  +
        /* ErrorImplGenerator.kt:166 */
   30     48   
        {
          49  +
            /* ErrorImplGenerator.kt:167 */
   31     50   
            ::std::write!(f, ": {}", &self.message)?;
          51  +
            /* ErrorImplGenerator.kt:166 */
   32     52   
        }
          53  +
        /* ErrorImplGenerator.kt:171 */
   33     54   
        Ok(())
          55  +
        /* ErrorImplGenerator.kt:154 */
   34     56   
    }
          57  +
    /* ErrorImplGenerator.kt:153 */
   35     58   
}
          59  +
/* ErrorImplGenerator.kt:175 */
   36     60   
impl ::std::error::Error for ValidationError {}
          61  +
/* ErrorGenerator.kt:77 */
   37     62   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ValidationError {
          63  +
    /* ErrorGenerator.kt:78 */
   38     64   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   39     65   
        &self.meta
   40     66   
    }
          67  +
    /* ErrorGenerator.kt:77 */
   41     68   
}
          69  +
/* ErrorGenerator.kt:81 */
   42     70   
impl ValidationError {
   43         -
    /// Creates a new builder-style object to manufacture [`ValidationError`](crate::types::error::ValidationError).
          71  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ValidationError`](crate::types::error::ValidationError).
          72  +
    /* BuilderGenerator.kt:175 */
   44     73   
    pub fn builder() -> crate::types::error::builders::ValidationErrorBuilder {
          74  +
        /* BuilderGenerator.kt:176 */
   45     75   
        crate::types::error::builders::ValidationErrorBuilder::default()
          76  +
        /* BuilderGenerator.kt:175 */
   46     77   
    }
          78  +
    /* ErrorGenerator.kt:81 */
   47     79   
}
   48     80   
   49         -
/// A builder for [`ValidationError`](crate::types::error::ValidationError).
          81  +
/// /* BuilderGenerator.kt:342 */A builder for [`ValidationError`](crate::types::error::ValidationError).
          82  +
/* RustType.kt:516 */
   50     83   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          84  +
/* RustType.kt:516 */
   51     85   
#[non_exhaustive]
          86  +
/* BuilderGenerator.kt:345 */
   52     87   
pub struct ValidationErrorBuilder {
   53         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
   54         -
    pub(crate) field_list: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>,
   55         -
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          88  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          89  +
    /* BuilderGenerator.kt:275 */ pub(crate) field_list: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>,
          90  +
    /* ErrorGenerator.kt:97 */ meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          91  +
    /* BuilderGenerator.kt:345 */
   56     92   
}
          93  +
/* BuilderGenerator.kt:355 */
   57     94   
impl ValidationErrorBuilder {
   58         -
    /// A summary of the validation failure.
   59         -
    /// This field is required.
          95  +
    /// /* BuilderGenerator.kt:286 */A summary of the validation failure.
          96  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          97  +
    /* BuilderGenerator.kt:291 */
   60     98   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          99  +
        /* BuilderGenerator.kt:292 */
   61    100   
        self.message = ::std::option::Option::Some(input.into());
         101  +
        /* BuilderGenerator.kt:293 */
   62    102   
        self
         103  +
        /* BuilderGenerator.kt:291 */
   63    104   
    }
   64         -
    /// A summary of the validation failure.
         105  +
    /// /* BuilderGenerator.kt:312 */A summary of the validation failure.
         106  +
    /* BuilderGenerator.kt:314 */
   65    107   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         108  +
        /* BuilderGenerator.kt:315 */
   66    109   
        self.message = input;
   67    110   
        self
         111  +
        /* BuilderGenerator.kt:314 */
   68    112   
    }
   69         -
    /// A summary of the validation failure.
         113  +
    /// /* BuilderGenerator.kt:334 */A summary of the validation failure.
         114  +
    /* BuilderGenerator.kt:336 */
   70    115   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         116  +
        /* BuilderGenerator.kt:337 */
   71    117   
        &self.message
         118  +
        /* BuilderGenerator.kt:336 */
   72    119   
    }
   73         -
    /// Appends an item to `field_list`.
         120  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `field_list`.
         121  +
    /* BuilderGenerator.kt:411 */
   74    122   
    ///
   75         -
    /// To override the contents of this collection use [`set_field_list`](Self::set_field_list).
         123  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_field_list`](Self::set_field_list).
         124  +
    /* BuilderGenerator.kt:413 */
   76    125   
    ///
   77         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         126  +
    /// /* BuilderGenerator.kt:414 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         127  +
    /* BuilderGenerator.kt:418 */
   78    128   
    pub fn field_list(mut self, input: crate::types::ValidationExceptionField) -> Self {
         129  +
        /* BuilderGenerator.kt:419 */
   79    130   
        let mut v = self.field_list.unwrap_or_default();
   80    131   
        v.push(input);
   81    132   
        self.field_list = ::std::option::Option::Some(v);
   82    133   
        self
         134  +
        /* BuilderGenerator.kt:418 */
   83    135   
    }
   84         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         136  +
    /// /* BuilderGenerator.kt:312 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         137  +
    /* BuilderGenerator.kt:314 */
   85    138   
    pub fn set_field_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>) -> Self {
         139  +
        /* BuilderGenerator.kt:315 */
   86    140   
        self.field_list = input;
   87    141   
        self
         142  +
        /* BuilderGenerator.kt:314 */
   88    143   
    }
   89         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         144  +
    /// /* BuilderGenerator.kt:334 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         145  +
    /* BuilderGenerator.kt:336 */
   90    146   
    pub fn get_field_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>> {
         147  +
        /* BuilderGenerator.kt:337 */
   91    148   
        &self.field_list
         149  +
        /* BuilderGenerator.kt:336 */
   92    150   
    }
         151  +
    /* ErrorGenerator.kt:101 */
   93    152   
    /// Sets error metadata
   94    153   
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   95    154   
        self.meta = Some(meta);
   96    155   
        self
   97    156   
    }
   98    157   
   99    158   
    /// Sets error metadata
  100    159   
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
  101    160   
        self.meta = meta;
  102    161   
        self
  103    162   
    }
  104         -
    /// Consumes the builder and constructs a [`ValidationError`](crate::types::error::ValidationError).
  105         -
    /// This method will fail if any of the following fields are not set:
  106         -
    /// - [`message`](crate::types::error::builders::ValidationErrorBuilder::message)
         163  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ValidationError`](crate::types::error::ValidationError).
         164  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         165  +
    /// /* BuilderGenerator.kt:246 */- [`message`](crate::types::error::builders::ValidationErrorBuilder::message)
         166  +
    /* BuilderGenerator.kt:253 */
  107    167   
    pub fn build(self) -> ::std::result::Result<crate::types::error::ValidationError, ::aws_smithy_types::error::operation::BuildError> {
  108         -
        ::std::result::Result::Ok(crate::types::error::ValidationError {
  109         -
            message: self.message.ok_or_else(|| {
  110         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  111         -
                    "message",
  112         -
                    "message was not specified but it is required when building ValidationError",
  113         -
                )
  114         -
            })?,
  115         -
            field_list: self.field_list,
  116         -
            meta: self.meta.unwrap_or_default(),
  117         -
        })
         168  +
        /* BuilderGenerator.kt:254 */
         169  +
        ::std::result::Result::Ok(
         170  +
            /* BuilderGenerator.kt:477 */crate::types::error::ValidationError {
         171  +
                /* BuilderGenerator.kt:481 */message: self.message
         172  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         173  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("message", "message was not specified but it is required when building ValidationError")
         174  +
                    /* BuilderGenerator.kt:494 */)?
         175  +
                ,
         176  +
                /* BuilderGenerator.kt:481 */field_list: self.field_list
         177  +
                ,
         178  +
                /* ErrorGenerator.kt:120 */meta: self.meta.unwrap_or_default(),
         179  +
            /* BuilderGenerator.kt:477 */}
         180  +
        /* BuilderGenerator.kt:254 */)
         181  +
        /* BuilderGenerator.kt:253 */
  118    182   
    }
         183  +
    /* BuilderGenerator.kt:355 */
  119    184   
}

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

@@ -1,1 +6,9 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::error::_extra_error::ExtraErrorBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::error::_case_insensitive_error::CaseInsensitiveErrorBuilder;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::error::_validation_exception::ValidationErrorBuilder;

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* FluentClientGenerator.kt:105 */
    2      3   
#[derive(Debug)]
    3      4   
pub(crate) struct Handle {
    4      5   
    pub(crate) conf: crate::Config,
    5      6   
    #[allow(dead_code)] // unused when a service does not provide any operations
    6      7   
    pub(crate) runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
    7      8   
}
    8      9   
    9     10   
///
   10     11   
/// An ergonomic client for Sample Rest Xml Protocol Service.
   11     12   
///
@@ -77,78 +258,322 @@
   97     98   
    fn validate_config(handle: &Handle) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
   98     99   
        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
   99    100   
        handle
  100    101   
            .runtime_plugins
  101    102   
            .apply_client_configuration(&mut cfg)?
  102    103   
            .validate_base_client_config(&cfg)?;
  103    104   
        Ok(())
  104    105   
    }
  105    106   
}
  106    107   
         108  +
/* RustModule.kt:172 */
  107    109   
mod all_query_string_types;
  108    110   
         111  +
/* RustModule.kt:172 */
  109    112   
mod body_with_xml_name;
  110    113   
         114  +
/* RustModule.kt:172 */
  111    115   
mod constant_and_variable_query_string;
  112    116   
         117  +
/* RustModule.kt:172 */
  113    118   
mod constant_query_string;
  114    119   
         120  +
/* RustModule.kt:172 */
  115    121   
mod content_type_parameters;
  116    122   
  117         -
/// Operation customization and supporting types.
         123  +
/// /* ClientRustModule.kt:161 */Operation customization and supporting types.
  118    124   
///
  119         -
/// The underlying HTTP requests made during an operation can be customized
         125  +
/// /* ClientRustModule.kt:170 */The underlying HTTP requests made during an operation can be customized
  120    126   
/// by calling the `customize()` method on the builder returned from a client
  121    127   
/// operation call. For example, this can be used to add an additional HTTP header:
  122    128   
///
  123    129   
/// ```ignore
  124    130   
/// # async fn wrapper() -> ::std::result::Result<(), rest_xml::Error> {
  125    131   
/// # let client: rest_xml::Client = unimplemented!();
  126    132   
/// use ::http::header::{HeaderName, HeaderValue};
  127    133   
///
  128    134   
/// let result = client.all_query_string_types()
  129    135   
///     .customize()
  130    136   
///     .mutate_request(|req| {
  131    137   
///         // Add `x-example-header` with value
  132    138   
///         req.headers_mut()
  133    139   
///             .insert(
  134    140   
///                 HeaderName::from_static("x-example-header"),
  135    141   
///                 HeaderValue::from_static("1"),
  136    142   
///             );
  137    143   
///     })
  138    144   
///     .send()
  139    145   
///     .await;
  140    146   
/// # }
  141    147   
/// ```
  142    148   
pub mod customize;
  143    149   
         150  +
/* RustModule.kt:172 */
  144    151   
mod datetime_offsets;
  145    152   
         153  +
/* RustModule.kt:172 */
  146    154   
mod empty_input_and_empty_output;
  147    155   
         156  +
/* RustModule.kt:172 */
  148    157   
mod endpoint_operation;
  149    158   
         159  +
/* RustModule.kt:172 */
  150    160   
mod endpoint_with_host_label_header_operation;
  151    161   
         162  +
/* RustModule.kt:172 */
  152    163   
mod endpoint_with_host_label_operation;
  153    164   
         165  +
/* RustModule.kt:172 */
  154    166   
mod flattened_xml_map;
  155    167   
         168  +
/* RustModule.kt:172 */
  156    169   
mod flattened_xml_map_with_xml_name;
  157    170   
         171  +
/* RustModule.kt:172 */
  158    172   
mod flattened_xml_map_with_xml_namespace;
  159    173   
         174  +
/* RustModule.kt:172 */
  160    175   
mod fractional_seconds;
  161    176   
         177  +
/* RustModule.kt:172 */
  162    178   
mod greeting_with_errors;
  163    179   
         180  +
/* RustModule.kt:172 */
  164    181   
mod http_enum_payload;
  165    182   
         183  +
/* RustModule.kt:172 */
  166    184   
mod http_payload_traits;
  167    185   
         186  +
/* RustModule.kt:172 */
  168    187   
mod http_payload_traits_with_media_type;
  169    188   
         189  +
/* RustModule.kt:172 */
  170    190   
mod http_payload_with_member_xml_name;
  171    191   
         192  +
/* RustModule.kt:172 */
  172    193   
mod http_payload_with_structure;
  173    194   
         195  +
/* RustModule.kt:172 */
  174    196   
mod http_payload_with_union;
  175    197   
         198  +
/* RustModule.kt:172 */
  176    199   
mod http_payload_with_xml_name;
  177    200   
         201  +
/* RustModule.kt:172 */
  178    202   
mod http_payload_with_xml_namespace;
  179    203   
         204  +
/* RustModule.kt:172 */
  180    205   
mod http_payload_with_xml_namespace_and_prefix;
  181    206   
         207  +
/* RustModule.kt:172 */
  182    208   
mod http_prefix_headers;
  183    209   
         210  +
/* RustModule.kt:172 */
  184    211   
mod http_request_with_float_labels;
  185    212   
         213  +
/* RustModule.kt:172 */
  186    214   
mod http_request_with_greedy_label_in_path;
  187    215   
         216  +
/* RustModule.kt:172 */
  188    217   
mod http_request_with_labels;
  189    218   
         219  +
/* RustModule.kt:172 */
  190    220   
mod http_request_with_labels_and_timestamp_format;
  191    221   
         222  +
/* RustModule.kt:172 */
  192    223   
mod http_response_code;
  193    224   
         225  +
/* RustModule.kt:172 */
  194    226   
mod http_string_payload;
  195    227   
         228  +
/* RustModule.kt:172 */
  196    229   
mod ignore_query_params_in_response;
  197    230   
         231  +
/* RustModule.kt:172 */
  198    232   
mod input_and_output_with_headers;
  199    233   
         234  +
/* RustModule.kt:172 */
  200    235   
mod nested_xml_map_with_xml_name;
  201    236   
         237  +
/* RustModule.kt:172 */
  202    238   
mod nested_xml_maps;
  203    239   
         240  +
/* RustModule.kt:172 */
  204    241   
mod no_input_and_no_output;
  205    242   
         243  +
/* RustModule.kt:172 */
  206    244   
mod no_input_and_output;
  207    245   
         246  +
/* RustModule.kt:172 */
  208    247   
mod null_and_empty_headers_client;
  209    248   
         249  +
/* RustModule.kt:172 */
  210    250   
mod null_and_empty_headers_server;
  211    251   
         252  +
/* RustModule.kt:172 */
  212    253   
mod omits_null_serializes_empty_string;
  213    254   
         255  +
/* RustModule.kt:172 */
  214    256   
mod put_with_content_encoding;
  215    257   
         258  +
/* RustModule.kt:172 */
  216    259   
mod query_idempotency_token_auto_fill;
  217    260   
         261  +
/* RustModule.kt:172 */
  218    262   
mod query_params_as_string_list_map;
  219    263   
         264  +
/* RustModule.kt:172 */
  220    265   
mod query_precedence;
  221    266   
         267  +
/* RustModule.kt:172 */
  222    268   
mod recursive_shapes;
  223    269   
         270  +
/* RustModule.kt:172 */
  224    271   
mod simple_scalar_properties;
  225    272   
         273  +
/* RustModule.kt:172 */
  226    274   
mod timestamp_format_headers;
  227    275   
         276  +
/* RustModule.kt:172 */
  228    277   
mod xml_attributes;
  229    278   
         279  +
/* RustModule.kt:172 */
  230    280   
mod xml_attributes_on_payload;
  231    281   
         282  +
/* RustModule.kt:172 */
  232    283   
mod xml_blobs;
  233    284   
         285  +
/* RustModule.kt:172 */
  234    286   
mod xml_empty_blobs;
  235    287   
         288  +
/* RustModule.kt:172 */
  236    289   
mod xml_empty_lists;
  237    290   
         291  +
/* RustModule.kt:172 */
  238    292   
mod xml_empty_maps;
  239    293   
         294  +
/* RustModule.kt:172 */
  240    295   
mod xml_empty_strings;
  241    296   
         297  +
/* RustModule.kt:172 */
  242    298   
mod xml_enums;
  243    299   
         300  +
/* RustModule.kt:172 */
  244    301   
mod xml_int_enums;
  245    302   
         303  +
/* RustModule.kt:172 */
  246    304   
mod xml_lists;
  247    305   
         306  +
/* RustModule.kt:172 */
  248    307   
mod xml_map_with_xml_namespace;
  249    308   
         309  +
/* RustModule.kt:172 */
  250    310   
mod xml_maps;
  251    311   
         312  +
/* RustModule.kt:172 */
  252    313   
mod xml_maps_xml_name;
  253    314   
         315  +
/* RustModule.kt:172 */
  254    316   
mod xml_namespaces;
  255    317   
         318  +
/* RustModule.kt:172 */
  256    319   
mod xml_timestamps;
  257    320   
         321  +
/* RustModule.kt:172 */
  258    322   
mod xml_unions;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/client/all_query_string_types.rs

@@ -1,1 +32,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* FluentClientGenerator.kt:187 */
    2      3   
impl super::Client {
           4  +
    /* FluentClientGenerator.kt:221 */
    3      5   
    /// Constructs a fluent builder for the [`AllQueryStringTypes`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder) operation.
    4      6   
    ///
    5      7   
    /// - The fluent builder is configurable:
    6      8   
    ///   - [`query_string(impl Into<String>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_string) / [`set_query_string(Option<String>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_string):<br>required: **false**<br>(undocumented)<br>
    7      9   
    ///   - [`query_string_list(impl Into<String>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_string_list) / [`set_query_string_list(Option<Vec::<String>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_string_list):<br>required: **false**<br>(undocumented)<br>
    8     10   
    ///   - [`query_string_set(impl Into<String>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_string_set) / [`set_query_string_set(Option<Vec::<String>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_string_set):<br>required: **false**<br>(undocumented)<br>
    9     11   
    ///   - [`query_byte(i8)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_byte) / [`set_query_byte(Option<i8>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_byte):<br>required: **false**<br>(undocumented)<br>
   10     12   
    ///   - [`query_short(i16)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_short) / [`set_query_short(Option<i16>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_short):<br>required: **false**<br>(undocumented)<br>
   11     13   
    ///   - [`query_integer(i32)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_integer) / [`set_query_integer(Option<i32>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_integer):<br>required: **false**<br>(undocumented)<br>
   12     14   
    ///   - [`query_integer_list(i32)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_integer_list) / [`set_query_integer_list(Option<Vec::<i32>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_integer_list):<br>required: **false**<br>(undocumented)<br>
   13     15   
    ///   - [`query_integer_set(i32)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_integer_set) / [`set_query_integer_set(Option<Vec::<i32>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_integer_set):<br>required: **false**<br>(undocumented)<br>
   14     16   
    ///   - [`query_long(i64)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_long) / [`set_query_long(Option<i64>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_long):<br>required: **false**<br>(undocumented)<br>
   15     17   
    ///   - [`query_float(f32)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_float) / [`set_query_float(Option<f32>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_float):<br>required: **false**<br>(undocumented)<br>
   16     18   
    ///   - [`query_double(f64)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_double) / [`set_query_double(Option<f64>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_double):<br>required: **false**<br>(undocumented)<br>
   17     19   
    ///   - [`query_double_list(f64)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_double_list) / [`set_query_double_list(Option<Vec::<f64>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_double_list):<br>required: **false**<br>(undocumented)<br>
   18     20   
    ///   - [`query_boolean(bool)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_boolean) / [`set_query_boolean(Option<bool>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_boolean):<br>required: **false**<br>(undocumented)<br>
   19     21   
    ///   - [`query_boolean_list(bool)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_boolean_list) / [`set_query_boolean_list(Option<Vec::<bool>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_boolean_list):<br>required: **false**<br>(undocumented)<br>
   20     22   
    ///   - [`query_timestamp(DateTime)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_timestamp) / [`set_query_timestamp(Option<DateTime>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_timestamp):<br>required: **false**<br>(undocumented)<br>
   21     23   
    ///   - [`query_timestamp_list(DateTime)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_timestamp_list) / [`set_query_timestamp_list(Option<Vec::<DateTime>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_timestamp_list):<br>required: **false**<br>(undocumented)<br>
   22     24   
    ///   - [`query_enum(FooEnum)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_enum) / [`set_query_enum(Option<FooEnum>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_enum):<br>required: **false**<br>(undocumented)<br>
   23     25   
    ///   - [`query_enum_list(FooEnum)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_enum_list) / [`set_query_enum_list(Option<Vec::<FooEnum>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_enum_list):<br>required: **false**<br>(undocumented)<br>
   24     26   
    ///   - [`query_integer_enum(i32)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_integer_enum) / [`set_query_integer_enum(Option<i32>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_integer_enum):<br>required: **false**<br>(undocumented)<br>
   25     27   
    ///   - [`query_integer_enum_list(i32)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_integer_enum_list) / [`set_query_integer_enum_list(Option<Vec::<i32>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_integer_enum_list):<br>required: **false**<br>(undocumented)<br>
   26     28   
    ///   - [`query_params_map_of_strings(impl Into<String>, impl Into<String>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::query_params_map_of_strings) / [`set_query_params_map_of_strings(Option<HashMap::<String, String>>)`](crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::set_query_params_map_of_strings):<br>required: **false**<br>(undocumented)<br>
   27     29   
    /// - On success, responds with [`AllQueryStringTypesOutput`](crate::operation::all_query_string_types::AllQueryStringTypesOutput)
   28     30   
    /// - On failure, responds with [`SdkError<AllQueryStringTypesError>`](crate::operation::all_query_string_types::AllQueryStringTypesError)
          31  +
    /* FluentClientGenerator.kt:234 */
   29     32   
    pub fn all_query_string_types(&self) -> crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder {
   30     33   
        crate::operation::all_query_string_types::builders::AllQueryStringTypesFluentBuilder::new(self.handle.clone())
   31     34   
    }
          35  +
    /* FluentClientGenerator.kt:187 */
   32     36   
}