Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

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

@@ -1,1 +81,141 @@
    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 SimpleUnion {
           8  +
pub /* UnionGenerator.kt:85 */ enum SimpleUnion {
           9  +
    /* UnionGenerator.kt:90 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
          11  +
    /* UnionGenerator.kt:190 */
    7     12   
    Blob(::aws_smithy_types::Blob),
    8         -
    #[allow(missing_docs)] // documentation missing in model
          13  +
    /* UnionGenerator.kt:90 */ #[allow(missing_docs)] // documentation missing in model
          14  +
    /* UnionGenerator.kt:190 */
    9     15   
    Boolean(bool),
          16  +
    /* UnionGenerator.kt:90 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
    /* UnionGenerator.kt:190 */
   11     19   
    String(::std::string::String),
   12         -
    #[allow(missing_docs)] // documentation missing in model
          20  +
    /* UnionGenerator.kt:90 */ #[allow(missing_docs)] // documentation missing in model
          21  +
    /* UnionGenerator.kt:188 */
   13     22   
    Unit,
   14         -
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          23  +
    /// /* UnionGenerator.kt:96 */The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          24  +
    /* UnionGenerator.kt:97 */
   15     25   
    /// An unknown enum variant
          26  +
    /* UnionGenerator.kt:98 */
   16     27   
    ///
          28  +
    /* UnionGenerator.kt:99 */
   17     29   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
          30  +
    /* UnionGenerator.kt:100 */
   18     31   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
          32  +
    /* UnionGenerator.kt:101 */
   19     33   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
          34  +
    /* UnionGenerator.kt:102 */
   20     35   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
          36  +
    /* RustType.kt:516 */
   21     37   
    #[non_exhaustive]
          38  +
    /* UnionGenerator.kt:105 */
   22     39   
    Unknown,
          40  +
    /* UnionGenerator.kt:85 */
   23     41   
}
          42  +
/* UnionGenerator.kt:111 */
   24     43   
impl SimpleUnion {
          44  +
    /* UnionGenerator.kt:217 */
   25     45   
    /// Tries to convert the enum instance into [`Blob`](crate::types::SimpleUnion::Blob), extracting the inner [`Blob`](::aws_smithy_types::Blob).
          46  +
    /* UnionGenerator.kt:222 */
   26     47   
    /// Returns `Err(&Self)` if it can't be converted.
          48  +
    /* UnionGenerator.kt:223 */
   27     49   
    pub fn as_blob(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
          50  +
        /* UnionGenerator.kt:227 */
   28     51   
        if let SimpleUnion::Blob(val) = &self {
   29     52   
            ::std::result::Result::Ok(val)
   30     53   
        } else {
   31     54   
            ::std::result::Result::Err(self)
   32     55   
        }
          56  +
        /* UnionGenerator.kt:223 */
   33     57   
    }
          58  +
    /* UnionGenerator.kt:121 */
   34     59   
    /// Returns true if this is a [`Blob`](crate::types::SimpleUnion::Blob).
          60  +
    /* UnionGenerator.kt:122 */
   35     61   
    pub fn is_blob(&self) -> bool {
          62  +
        /* UnionGenerator.kt:123 */
   36     63   
        self.as_blob().is_ok()
          64  +
        /* UnionGenerator.kt:122 */
   37     65   
    }
          66  +
    /* UnionGenerator.kt:217 */
   38     67   
    /// Tries to convert the enum instance into [`Boolean`](crate::types::SimpleUnion::Boolean), extracting the inner [`bool`](bool).
          68  +
    /* UnionGenerator.kt:222 */
   39     69   
    /// Returns `Err(&Self)` if it can't be converted.
          70  +
    /* UnionGenerator.kt:223 */
   40     71   
    pub fn as_boolean(&self) -> ::std::result::Result<&bool, &Self> {
          72  +
        /* UnionGenerator.kt:227 */
   41     73   
        if let SimpleUnion::Boolean(val) = &self {
   42     74   
            ::std::result::Result::Ok(val)
   43     75   
        } else {
   44     76   
            ::std::result::Result::Err(self)
   45     77   
        }
          78  +
        /* UnionGenerator.kt:223 */
   46     79   
    }
          80  +
    /* UnionGenerator.kt:121 */
   47     81   
    /// Returns true if this is a [`Boolean`](crate::types::SimpleUnion::Boolean).
          82  +
    /* UnionGenerator.kt:122 */
   48     83   
    pub fn is_boolean(&self) -> bool {
          84  +
        /* UnionGenerator.kt:123 */
   49     85   
        self.as_boolean().is_ok()
          86  +
        /* UnionGenerator.kt:122 */
   50     87   
    }
          88  +
    /* UnionGenerator.kt:217 */
   51     89   
    /// Tries to convert the enum instance into [`String`](crate::types::SimpleUnion::String), extracting the inner [`String`](::std::string::String).
          90  +
    /* UnionGenerator.kt:222 */
   52     91   
    /// Returns `Err(&Self)` if it can't be converted.
          92  +
    /* UnionGenerator.kt:223 */
   53     93   
    pub fn as_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
          94  +
        /* UnionGenerator.kt:227 */
   54     95   
        if let SimpleUnion::String(val) = &self {
   55     96   
            ::std::result::Result::Ok(val)
   56     97   
        } else {
   57     98   
            ::std::result::Result::Err(self)
   58     99   
        }
         100  +
        /* UnionGenerator.kt:223 */
   59    101   
    }
         102  +
    /* UnionGenerator.kt:121 */
   60    103   
    /// Returns true if this is a [`String`](crate::types::SimpleUnion::String).
         104  +
    /* UnionGenerator.kt:122 */
   61    105   
    pub fn is_string(&self) -> bool {
         106  +
        /* UnionGenerator.kt:123 */
   62    107   
        self.as_string().is_ok()
         108  +
        /* UnionGenerator.kt:122 */
   63    109   
    }
         110  +
    /* UnionGenerator.kt:203 */
   64    111   
    /// Tries to convert the enum instance into [`Unit`](crate::types::SimpleUnion::Unit), extracting the inner `()`.
         112  +
    /* UnionGenerator.kt:207 */
   65    113   
    /// Returns `Err(&Self)` if it can't be converted.
         114  +
    /* UnionGenerator.kt:208 */
   66    115   
    pub fn as_unit(&self) -> ::std::result::Result<(), &Self> {
         116  +
        /* UnionGenerator.kt:209 */
   67    117   
        if let SimpleUnion::Unit = &self {
   68    118   
            ::std::result::Result::Ok(())
   69    119   
        } else {
   70    120   
            ::std::result::Result::Err(self)
   71    121   
        }
         122  +
        /* UnionGenerator.kt:208 */
   72    123   
    }
         124  +
    /* UnionGenerator.kt:121 */
   73    125   
    /// Returns true if this is a [`Unit`](crate::types::SimpleUnion::Unit).
         126  +
    /* UnionGenerator.kt:122 */
   74    127   
    pub fn is_unit(&self) -> bool {
         128  +
        /* UnionGenerator.kt:123 */
   75    129   
        self.as_unit().is_ok()
         130  +
        /* UnionGenerator.kt:122 */
   76    131   
    }
         132  +
    /* UnionGenerator.kt:127 */
   77    133   
    /// Returns true if the enum instance is the `Unknown` variant.
         134  +
    /* UnionGenerator.kt:128 */
   78    135   
    pub fn is_unknown(&self) -> bool {
         136  +
        /* UnionGenerator.kt:129 */
   79    137   
        matches!(self, Self::Unknown)
         138  +
        /* UnionGenerator.kt:128 */
   80    139   
    }
         140  +
    /* UnionGenerator.kt:111 */
   81    141   
}

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

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

tmp-codegen-diff/codegen-client-test/rpcv2Cbor_extras/rust-client-codegen/src/types/_unit.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 Unit {}
           8  +
pub /* StructureGenerator.kt:201 */ struct Unit {/* StructureGenerator.kt:201 */}
           9  +
/* ClientCodegenVisitor.kt:237 */
    6     10   
impl Unit {
    7         -
    /// Creates a new builder-style object to manufacture [`Unit`](crate::types::Unit).
          11  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`Unit`](crate::types::Unit).
          12  +
    /* BuilderGenerator.kt:175 */
    8     13   
    pub fn builder() -> crate::types::builders::UnitBuilder {
          14  +
        /* BuilderGenerator.kt:176 */
    9     15   
        crate::types::builders::UnitBuilder::default()
          16  +
        /* BuilderGenerator.kt:175 */
   10     17   
    }
          18  +
    /* ClientCodegenVisitor.kt:237 */
   11     19   
}
   12     20   
   13         -
/// A builder for [`Unit`](crate::types::Unit).
          21  +
/// /* BuilderGenerator.kt:342 */A builder for [`Unit`](crate::types::Unit).
          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 UnitBuilder {}
          26  +
/* BuilderGenerator.kt:345 */
          27  +
pub struct UnitBuilder {/* BuilderGenerator.kt:345 */}
          28  +
/* BuilderGenerator.kt:355 */
   17     29   
impl UnitBuilder {
   18         -
    /// Consumes the builder and constructs a [`Unit`](crate::types::Unit).
          30  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`Unit`](crate::types::Unit).
          31  +
    /* BuilderGenerator.kt:253 */
   19     32   
    pub fn build(self) -> crate::types::Unit {
   20         -
        crate::types::Unit {}
          33  +
        /* BuilderGenerator.kt:477 */
          34  +
        crate::types::Unit {
          35  +
        /* BuilderGenerator.kt:477 */}
          36  +
        /* BuilderGenerator.kt:253 */
   21     37   
    }
          38  +
    /* BuilderGenerator.kt:355 */
   22     39   
}

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

@@ -1,1 +51,89 @@
    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 UnitUnion {
    6         -
    #[allow(missing_docs)] // documentation missing in model
           8  +
pub /* UnionGenerator.kt:85 */ enum UnitUnion {
           9  +
    /* UnionGenerator.kt:90 */ #[allow(missing_docs)] // documentation missing in model
          10  +
    /* UnionGenerator.kt:188 */
    7     11   
    UnitA,
    8         -
    #[allow(missing_docs)] // documentation missing in model
          12  +
    /* UnionGenerator.kt:90 */ #[allow(missing_docs)] // documentation missing in model
          13  +
    /* UnionGenerator.kt:188 */
    9     14   
    UnitB,
   10         -
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          15  +
    /// /* UnionGenerator.kt:96 */The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          16  +
    /* UnionGenerator.kt:97 */
   11     17   
    /// An unknown enum variant
          18  +
    /* UnionGenerator.kt:98 */
   12     19   
    ///
          20  +
    /* UnionGenerator.kt:99 */
   13     21   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
          22  +
    /* UnionGenerator.kt:100 */
   14     23   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
          24  +
    /* UnionGenerator.kt:101 */
   15     25   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
          26  +
    /* UnionGenerator.kt:102 */
   16     27   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
          28  +
    /* RustType.kt:516 */
   17     29   
    #[non_exhaustive]
          30  +
    /* UnionGenerator.kt:105 */
   18     31   
    Unknown,
          32  +
    /* UnionGenerator.kt:85 */
   19     33   
}
          34  +
/* UnionGenerator.kt:111 */
   20     35   
impl UnitUnion {
          36  +
    /* UnionGenerator.kt:203 */
   21     37   
    /// Tries to convert the enum instance into [`UnitA`](crate::types::UnitUnion::UnitA), extracting the inner `()`.
          38  +
    /* UnionGenerator.kt:207 */
   22     39   
    /// Returns `Err(&Self)` if it can't be converted.
          40  +
    /* UnionGenerator.kt:208 */
   23     41   
    pub fn as_unit_a(&self) -> ::std::result::Result<(), &Self> {
          42  +
        /* UnionGenerator.kt:209 */
   24     43   
        if let UnitUnion::UnitA = &self {
   25     44   
            ::std::result::Result::Ok(())
   26     45   
        } else {
   27     46   
            ::std::result::Result::Err(self)
   28     47   
        }
          48  +
        /* UnionGenerator.kt:208 */
   29     49   
    }
          50  +
    /* UnionGenerator.kt:121 */
   30     51   
    /// Returns true if this is a [`UnitA`](crate::types::UnitUnion::UnitA).
          52  +
    /* UnionGenerator.kt:122 */
   31     53   
    pub fn is_unit_a(&self) -> bool {
          54  +
        /* UnionGenerator.kt:123 */
   32     55   
        self.as_unit_a().is_ok()
          56  +
        /* UnionGenerator.kt:122 */
   33     57   
    }
          58  +
    /* UnionGenerator.kt:203 */
   34     59   
    /// Tries to convert the enum instance into [`UnitB`](crate::types::UnitUnion::UnitB), extracting the inner `()`.
          60  +
    /* UnionGenerator.kt:207 */
   35     61   
    /// Returns `Err(&Self)` if it can't be converted.
          62  +
    /* UnionGenerator.kt:208 */
   36     63   
    pub fn as_unit_b(&self) -> ::std::result::Result<(), &Self> {
          64  +
        /* UnionGenerator.kt:209 */
   37     65   
        if let UnitUnion::UnitB = &self {
   38     66   
            ::std::result::Result::Ok(())
   39     67   
        } else {
   40     68   
            ::std::result::Result::Err(self)
   41     69   
        }
          70  +
        /* UnionGenerator.kt:208 */
   42     71   
    }
          72  +
    /* UnionGenerator.kt:121 */
   43     73   
    /// Returns true if this is a [`UnitB`](crate::types::UnitUnion::UnitB).
          74  +
    /* UnionGenerator.kt:122 */
   44     75   
    pub fn is_unit_b(&self) -> bool {
          76  +
        /* UnionGenerator.kt:123 */
   45     77   
        self.as_unit_b().is_ok()
          78  +
        /* UnionGenerator.kt:122 */
   46     79   
    }
          80  +
    /* UnionGenerator.kt:127 */
   47     81   
    /// Returns true if the enum instance is the `Unknown` variant.
          82  +
    /* UnionGenerator.kt:128 */
   48     83   
    pub fn is_unknown(&self) -> bool {
          84  +
        /* UnionGenerator.kt:129 */
   49     85   
        matches!(self, Self::Unknown)
          86  +
        /* UnionGenerator.kt:128 */
   50     87   
    }
          88  +
    /* UnionGenerator.kt:111 */
   51     89   
}

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

@@ -1,1 +10,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_validation_exception_field::ValidationExceptionFieldBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_unit::UnitBuilder;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_simple_struct::SimpleStructBuilder;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_complex_struct::ComplexStructBuilder;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_empty_struct::EmptyStructBuilder;

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

@@ -1,1 +7,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::_validation_exception::ValidationError;
    3      4   
           5  +
/* RustModule.kt:172 */
    4      6   
mod _validation_exception;
    5      7   
    6         -
/// Builders
           8  +
/// /* CodegenDelegator.kt:51 */Builders
    7      9   
pub mod builders;

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

@@ -1,1 +2,3 @@
    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::_validation_exception::ValidationErrorBuilder;

tmp-codegen-diff/codegen-client-test/simple/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 the service.
   11     12   
///
@@ -77,78 +134,136 @@
   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   
  107         -
/// Operation customization and supporting types.
         108  +
/// /* ClientRustModule.kt:161 */Operation customization and supporting types.
  108    109   
///
  109         -
/// The underlying HTTP requests made during an operation can be customized
         110  +
/// /* ClientRustModule.kt:170 */The underlying HTTP requests made during an operation can be customized
  110    111   
/// by calling the `customize()` method on the builder returned from a client
  111    112   
/// operation call. For example, this can be used to add an additional HTTP header:
  112    113   
///
  113    114   
/// ```ignore
  114    115   
/// # async fn wrapper() -> ::std::result::Result<(), simple::Error> {
  115    116   
/// # let client: simple::Client = unimplemented!();
  116    117   
/// use ::http::header::{HeaderName, HeaderValue};
  117    118   
///
  118    119   
/// let result = client.operation()
  119    120   
///     .customize()
  120    121   
///     .mutate_request(|req| {
  121    122   
///         // Add `x-example-header` with value
  122    123   
///         req.headers_mut()
  123    124   
///             .insert(
  124    125   
///                 HeaderName::from_static("x-example-header"),
  125    126   
///                 HeaderValue::from_static("1"),
  126    127   
///             );
  127    128   
///     })
  128    129   
///     .send()
  129    130   
///     .await;
  130    131   
/// # }
  131    132   
/// ```
  132    133   
pub mod customize;
  133    134   
         135  +
/* RustModule.kt:172 */
  134    136   
mod operation;

tmp-codegen-diff/codegen-client-test/simple/rust-client-codegen/src/client/customize.rs

@@ -1,1 +32,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* CustomizableOperationGenerator.kt:72 */
    3      4   
/// `CustomizableOperation` allows for configuring a single operation invocation before it is sent.
    4      5   
pub struct CustomizableOperation<T, E, B> {
    5      6   
    customizable_send: B,
    6      7   
    config_override: ::std::option::Option<crate::config::Builder>,
    7      8   
    interceptors: Vec<::aws_smithy_runtime_api::client::interceptors::SharedInterceptor>,
    8      9   
    runtime_plugins: Vec<::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin>,
    9     10   
    _output: ::std::marker::PhantomData<T>,
   10     11   
    _error: ::std::marker::PhantomData<E>,
   11     12   
}
   12     13   

tmp-codegen-diff/codegen-client-test/simple/rust-client-codegen/src/client/customize/internal.rs

@@ -1,1 +12,13 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CustomizableOperationGenerator.kt:204 */
    2      3   
pub type BoxFuture<T> = ::std::pin::Pin<::std::boxed::Box<dyn ::std::future::Future<Output = T> + ::std::marker::Send>>;
    3      4   
    4      5   
pub type SendResult<T, E> =
    5      6   
    ::std::result::Result<T, ::aws_smithy_runtime_api::client::result::SdkError<E, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>>;
    6      7   
    7      8   
pub trait CustomizableSend<T, E>: ::std::marker::Send + ::std::marker::Sync {
    8      9   
    // Takes an owned `self` as the implementation will internally call methods that take `self`.
    9     10   
    // If it took `&self`, that would make this trait object safe, but some implementing types do not
   10     11   
    // derive `Clone`, unable to yield `self` from `&self`.
   11     12   
    fn send(self, config_override: crate::config::Builder) -> BoxFuture<SendResult<T, E>>;

tmp-codegen-diff/codegen-client-test/simple/rust-client-codegen/src/client/operation.rs

@@ -1,1 +13,17 @@
    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 [`Operation`](crate::operation::operation::builders::OperationFluentBuilder) operation.
    4      6   
    ///
    5      7   
    /// - The fluent builder is configurable:
    6      8   
    ///   - [`message(impl Into<String>)`](crate::operation::operation::builders::OperationFluentBuilder::message) / [`set_message(Option<String>)`](crate::operation::operation::builders::OperationFluentBuilder::set_message):<br>required: **false**<br>(undocumented)<br>
    7      9   
    /// - On success, responds with [`OperationOutput`](crate::operation::operation::OperationOutput) with field(s):
    8     10   
    ///   - [`message(Option<String>)`](crate::operation::operation::OperationOutput::message): (undocumented)
    9     11   
    /// - On failure, responds with [`SdkError<OperationError>`](crate::operation::operation::OperationError)
          12  +
    /* FluentClientGenerator.kt:234 */
   10     13   
    pub fn operation(&self) -> crate::operation::operation::builders::OperationFluentBuilder {
   11     14   
        crate::operation::operation::builders::OperationFluentBuilder::new(self.handle.clone())
   12     15   
    }
          16  +
    /* FluentClientGenerator.kt:187 */
   13     17   
}

tmp-codegen-diff/codegen-client-test/simple/rust-client-codegen/src/config.rs

@@ -1,1 +171,209 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Configuration for a simple service client.
           2  +
/* ServiceConfigGenerator.kt:409 */
           3  +
/// /* ServiceConfigGenerator.kt:409 */Configuration for a simple service client.
    4      4   
///
           5  +
/* RustType.kt:516 */
    5      6   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
           7  +
/* ServiceConfigGenerator.kt:414 */
    6      8   
pub struct Config {
    7         -
    // Both `config` and `cloneable` are the same config, but the cloneable one
           9  +
    /* ServiceConfigGenerator.kt:415 */// Both `config` and `cloneable` are the same config, but the cloneable one
    8     10   
    // is kept around so that it is possible to convert back into a builder. This can be
    9     11   
    // optimized in the future.
   10     12   
    pub(crate) config: crate::config::FrozenLayer,
   11     13   
    cloneable: ::aws_smithy_types::config_bag::CloneableLayer,
   12     14   
    pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder,
   13     15   
    pub(crate) runtime_plugins: ::std::vec::Vec<crate::config::SharedRuntimePlugin>,
   14     16   
    pub(crate) behavior_version: ::std::option::Option<crate::config::BehaviorVersion>,
          17  +
    /* ServiceConfigGenerator.kt:414 */
   15     18   
}
          19  +
/* ServiceConfigGenerator.kt:433 */
   16     20   
impl Config {
   17         -
    ///
          21  +
    /// /* ServiceConfigGenerator.kt:434 */
   18     22   
    /// Constructs a config builder.
   19     23   
    /// <div class="warning">
   20     24   
    /// Note that a config created from this builder will not have the same safe defaults as one created by
   21     25   
    /// the <a href="https://crates.io/crates/aws-config" target="_blank">aws-config</a> crate.
   22     26   
    /// </div>
   23     27   
    ///
          28  +
    /* ServiceConfigGenerator.kt:435 */
   24     29   
    pub fn builder() -> Builder {
   25     30   
        Builder::default()
   26     31   
    }
          32  +
    /* ServiceConfigGenerator.kt:440 */
   27     33   
    /// Converts this config back into a builder so that it can be tweaked.
   28     34   
    pub fn to_builder(&self) -> Builder {
   29     35   
        Builder {
   30     36   
            config: self.cloneable.clone(),
   31     37   
            runtime_components: self.runtime_components.clone(),
   32     38   
            runtime_plugins: self.runtime_plugins.clone(),
   33     39   
            behavior_version: self.behavior_version,
   34     40   
        }
   35     41   
    }
          42  +
    /* StalledStreamProtectionConfigCustomization.kt:57 */
   36     43   
    /// Return a reference to the stalled stream protection configuration contained in this config, if any.
   37     44   
    pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> {
   38     45   
        self.config.load::<crate::config::StalledStreamProtectionConfig>()
   39     46   
    }
          47  +
    /* HttpConnectorConfigDecorator.kt:52 */
   40     48   
    /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any.
   41     49   
    pub fn http_client(&self) -> Option<crate::config::SharedHttpClient> {
   42     50   
        self.runtime_components.http_client()
   43     51   
    }
          52  +
    /* EndpointConfigCustomization.kt:47 */
   44     53   
    /// Returns the endpoint resolver.
   45     54   
    pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver {
   46     55   
        self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set")
   47     56   
    }
          57  +
    /* ResiliencyConfigCustomization.kt:51 */
   48     58   
    /// Return a reference to the retry configuration contained in this config, if any.
   49     59   
    pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> {
   50     60   
        self.config.load::<::aws_smithy_types::retry::RetryConfig>()
   51     61   
    }
   52     62   
   53     63   
    /// Return a cloned shared async sleep implementation from this config, if any.
   54     64   
    pub fn sleep_impl(&self) -> ::std::option::Option<crate::config::SharedAsyncSleep> {
   55     65   
        self.runtime_components.sleep_impl()
   56     66   
    }
   57     67   
   58     68   
    /// Return a reference to the timeout configuration contained in this config, if any.
   59     69   
    pub fn timeout_config(&self) -> ::std::option::Option<&::aws_smithy_types::timeout::TimeoutConfig> {
   60     70   
        self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>()
   61     71   
    }
   62     72   
   63     73   
    /// Returns a reference to the retry partition contained in this config, if any.
   64     74   
    ///
   65     75   
    /// WARNING: This method is unstable and may be removed at any time. Do not rely on this
   66     76   
    /// method for anything!
   67     77   
    pub fn retry_partition(&self) -> ::std::option::Option<&::aws_smithy_runtime::client::retries::RetryPartition> {
   68     78   
        self.config.load::<::aws_smithy_runtime::client::retries::RetryPartition>()
   69     79   
    }
          80  +
    /* IdentityCacheDecorator.kt:96 */
   70     81   
    /// Returns the configured identity cache for auth.
   71     82   
    pub fn identity_cache(&self) -> ::std::option::Option<crate::config::SharedIdentityCache> {
   72     83   
        self.runtime_components.identity_cache()
   73     84   
    }
          85  +
    /* InterceptorConfigCustomization.kt:30 */
   74     86   
    /// Returns interceptors currently registered by the user.
   75     87   
    pub fn interceptors(&self) -> impl Iterator<Item = crate::config::SharedInterceptor> + '_ {
   76     88   
        self.runtime_components.interceptors()
   77     89   
    }
          90  +
    /* TimeSourceCustomization.kt:34 */
   78     91   
    /// Return time source used for this service.
          92  +
    /* TimeSourceCustomization.kt:35 */
   79     93   
    pub fn time_source(&self) -> ::std::option::Option<::aws_smithy_async::time::SharedTimeSource> {
          94  +
        /* TimeSourceCustomization.kt:39 */
   80     95   
        self.runtime_components.time_source()
          96  +
        /* TimeSourceCustomization.kt:35 */
   81     97   
    }
          98  +
    /* RetryClassifierConfigCustomization.kt:39 */
   82     99   
    /// Returns retry classifiers currently registered by the user.
   83    100   
    pub fn retry_classifiers(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier> + '_ {
   84    101   
        self.runtime_components.retry_classifiers()
   85    102   
    }
         103  +
    /* ServiceConfigGenerator.kt:433 */
   86    104   
}
   87         -
/// Builder for creating a `Config`.
         105  +
/// /* ServiceConfigGenerator.kt:458 */Builder for creating a `Config`.
         106  +
/* RustType.kt:516 */
   88    107   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
         108  +
/* ServiceConfigGenerator.kt:460 */
   89    109   
pub struct Builder {
   90         -
    pub(crate) config: ::aws_smithy_types::config_bag::CloneableLayer,
         110  +
    /* ServiceConfigGenerator.kt:461 */ pub(crate) config: ::aws_smithy_types::config_bag::CloneableLayer,
   91    111   
    pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder,
   92    112   
    pub(crate) runtime_plugins: ::std::vec::Vec<crate::config::SharedRuntimePlugin>,
   93    113   
    pub(crate) behavior_version: ::std::option::Option<crate::config::BehaviorVersion>,
         114  +
    /* ServiceConfigGenerator.kt:460 */
   94    115   
}
         116  +
/* ServiceConfigGenerator.kt:476 */
   95    117   
impl ::std::default::Default for Builder {
         118  +
    /* ServiceConfigGenerator.kt:477 */
   96    119   
    fn default() -> Self {
   97    120   
        Self {
   98    121   
            config: ::std::default::Default::default(),
   99    122   
            runtime_components: crate::config::RuntimeComponentsBuilder::new("service config"),
  100    123   
            runtime_plugins: ::std::default::Default::default(),
  101    124   
            behavior_version: ::std::default::Default::default(),
  102    125   
        }
  103    126   
    }
         127  +
    /* ServiceConfigGenerator.kt:476 */
  104    128   
}
         129  +
/* ServiceConfigGenerator.kt:492 */
  105    130   
impl Builder {
  106         -
    ///
         131  +
    /// /* ServiceConfigGenerator.kt:493 */
  107    132   
    /// Constructs a config builder.
  108    133   
    /// <div class="warning">
  109    134   
    /// Note that a config created from this builder will not have the same safe defaults as one created by
  110    135   
    /// the <a href="https://crates.io/crates/aws-config" target="_blank">aws-config</a> crate.
  111    136   
    /// </div>
  112    137   
    ///
         138  +
    /* ServiceConfigGenerator.kt:494 */
  113    139   
    pub fn new() -> Self {
  114    140   
        Self::default()
  115    141   
    }
  116         -
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  117         -
    /// but not those in runtime components.
         142  +
    /// /* ServiceConfigGenerator.kt:327 */Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
         143  +
    /// /* ServiceConfigGenerator.kt:328 */but not those in runtime components.
         144  +
    /* RustType.kt:516 */
  118    145   
    #[allow(unused)]
         146  +
    /* ServiceConfigGenerator.kt:330 */
  119    147   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
         148  +
        /* ServiceConfigGenerator.kt:334 */
  120    149   
        let mut builder = Self::new();
         150  +
        /* StalledStreamProtectionConfigCustomization.kt:102 */
  121    151   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         152  +
        /* ResiliencyConfigCustomization.kt:294 */
  122    153   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
         154  +
        /* ResiliencyConfigCustomization.kt:298 */
  123    155   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
         156  +
        /* ResiliencyConfigCustomization.kt:302 */
  124    157   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
         158  +
        /* ServiceConfigGenerator.kt:338 */
  125    159   
        builder
         160  +
        /* ServiceConfigGenerator.kt:330 */
  126    161   
    }
         162  +
    /* StalledStreamProtectionConfigCustomization.kt:69 */
  127    163   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  128    164   
    /// to configure protection for stalled streams.
  129    165   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  130    166   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  131    167   
        self
  132    168   
    }
         169  +
    /* StalledStreamProtectionConfigCustomization.kt:84 */
  133    170   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  134    171   
    /// to configure protection for stalled streams.
  135    172   
    pub fn set_stalled_stream_protection(
  136    173   
        &mut self,
  137    174   
        stalled_stream_protection_config: ::std::option::Option<crate::config::StalledStreamProtectionConfig>,
  138    175   
    ) -> &mut Self {
  139    176   
        self.config.store_or_unset(stalled_stream_protection_config);
  140    177   
        self
  141    178   
    }
         179  +
    /* HttpConnectorConfigDecorator.kt:65 */
  142    180   
    /// Sets the HTTP client to use when making requests.
  143    181   
    ///
  144    182   
    /// # Examples
  145    183   
    /// ```no_run
  146    184   
    /// # #[cfg(test)]
  147    185   
    /// # mod tests {
  148    186   
    /// # #[test]
  149    187   
    /// # fn example() {
  150    188   
    /// use std::time::Duration;
  151    189   
    /// use simple::config::Config;
@@ -179,217 +461,511 @@
  199    237   
    /// let mut builder = simple::Config::builder();
  200    238   
    /// override_http_client(&mut builder);
  201    239   
    /// let config = builder.build();
  202    240   
    /// # }
  203    241   
    /// # }
  204    242   
    /// ```
  205    243   
    pub fn set_http_client(&mut self, http_client: Option<crate::config::SharedHttpClient>) -> &mut Self {
  206    244   
        self.runtime_components.set_http_client(http_client);
  207    245   
        self
  208    246   
    }
         247  +
    /* EndpointConfigCustomization.kt:73 */
  209    248   
    /// Set the endpoint URL to use when making requests.
  210    249   
    ///
  211    250   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  212    251   
    ///
  213    252   
    /// # Panics
  214    253   
    /// Panics if an invalid URL is given.
  215    254   
    pub fn endpoint_url(mut self, endpoint_url: impl ::std::convert::Into<::std::string::String>) -> Self {
  216    255   
        self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into()));
  217    256   
        self
  218    257   
    }
  219    258   
  220    259   
    /// Set the endpoint URL to use when making requests.
  221    260   
    ///
  222    261   
    /// Note: setting an endpoint URL will replace any endpoint resolver that has been set.
  223    262   
    ///
  224    263   
    /// # Panics
  225    264   
    /// Panics if an invalid URL is given.
  226    265   
    pub fn set_endpoint_url(&mut self, endpoint_url: ::std::option::Option<::std::string::String>) -> &mut Self {
  227    266   
        #[allow(deprecated)]
  228    267   
        self.set_endpoint_resolver(endpoint_url.map(|url| {
  229    268   
            ::aws_smithy_runtime_api::shared::IntoShared::into_shared(
  230    269   
                ::aws_smithy_runtime::client::orchestrator::endpoints::StaticUriEndpointResolver::uri(url),
  231    270   
            )
  232    271   
        }));
  233    272   
        self
  234    273   
    }
         274  +
    /* EndpointConfigCustomization.kt:105 */
  235    275   
    /// Sets the endpoint resolver to use when making requests.
  236    276   
    ///
  237    277   
    /// This service does not define a default endpoint resolver.
  238    278   
    ///
  239    279   
    /// Note: setting an endpoint resolver will replace any endpoint URL that has been set.
  240    280   
    /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to
  241    281   
    /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`].
  242    282   
    ///
  243    283   
    /// # Examples
  244    284   
    /// Create a custom endpoint resolver that resolves a different endpoing per-stage, e.g. staging vs. production.
  245    285   
    /// ```no_run
  246    286   
    /// use simple::config::endpoint::{ResolveEndpoint, EndpointFuture, Params, Endpoint};
  247    287   
    /// #[derive(Debug)]
  248    288   
    /// struct StageResolver { stage: String }
  249    289   
    /// impl ResolveEndpoint for StageResolver {
  250    290   
    ///     fn resolve_endpoint(&self, params: &Params) -> EndpointFuture<'_> {
  251    291   
    ///         let stage = &self.stage;
  252    292   
    ///         EndpointFuture::ready(Ok(Endpoint::builder().url(format!("{stage}.myservice.com")).build()))
  253    293   
    ///     }
  254    294   
    /// }
  255    295   
    /// let resolver = StageResolver { stage: std::env::var("STAGE").unwrap() };
  256    296   
    /// let config = simple::Config::builder().endpoint_resolver(resolver).build();
  257    297   
    /// let client = simple::Client::from_conf(config);
  258    298   
    /// ```
  259    299   
    pub fn endpoint_resolver(mut self, endpoint_resolver: impl crate::config::endpoint::ResolveEndpoint + 'static) -> Self {
  260    300   
        self.set_endpoint_resolver(::std::option::Option::Some(endpoint_resolver.into_shared_resolver()));
  261    301   
        self
  262    302   
    }
  263    303   
  264    304   
    /// Sets the endpoint resolver to use when making requests.
  265    305   
    ///
  266    306   
    /// This service does not define a default endpoint resolver.
         307  +
    /* EndpointConfigCustomization.kt:143 */
  267    308   
    pub fn set_endpoint_resolver(
  268    309   
        &mut self,
  269    310   
        endpoint_resolver: ::std::option::Option<::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver>,
  270    311   
    ) -> &mut Self {
  271    312   
        self.runtime_components.set_endpoint_resolver(endpoint_resolver);
  272    313   
        self
  273    314   
    }
         315  +
    /* ResiliencyConfigCustomization.kt:81 */
  274    316   
    /// Set the retry_config for the builder
  275    317   
    ///
  276    318   
    /// # Examples
  277    319   
    /// ```no_run
  278    320   
    /// use simple::config::Config;
  279    321   
    /// use simple::config::retry::RetryConfig;
  280    322   
    ///
  281    323   
    /// let retry_config = RetryConfig::standard().with_max_attempts(5);
  282    324   
    /// let config = Config::builder().retry_config(retry_config).build();
  283    325   
    /// ```
  284    326   
    pub fn retry_config(mut self, retry_config: ::aws_smithy_types::retry::RetryConfig) -> Self {
  285    327   
        self.set_retry_config(Some(retry_config));
  286    328   
        self
  287    329   
    }
  288    330   
  289    331   
    /// Set the retry_config for the builder
  290    332   
    ///
  291    333   
    /// # Examples
  292    334   
    /// ```no_run
  293    335   
    /// use simple::config::{Builder, Config};
  294    336   
    /// use simple::config::retry::RetryConfig;
  295    337   
    ///
  296    338   
    /// fn disable_retries(builder: &mut Builder) {
  297    339   
    ///     let retry_config = RetryConfig::standard().with_max_attempts(1);
  298    340   
    ///     builder.set_retry_config(Some(retry_config));
  299    341   
    /// }
  300    342   
    ///
  301    343   
    /// let mut builder = Config::builder();
  302    344   
    /// disable_retries(&mut builder);
  303    345   
    /// let config = builder.build();
  304    346   
    /// ```
         347  +
    /* ResiliencyConfigCustomization.kt:118 */
  305    348   
    pub fn set_retry_config(&mut self, retry_config: ::std::option::Option<::aws_smithy_types::retry::RetryConfig>) -> &mut Self {
  306    349   
        retry_config.map(|r| self.config.store_put(r));
  307    350   
        self
  308    351   
    }
         352  +
    /* ResiliencyConfigCustomization.kt:128 */
  309    353   
    /// Set the sleep_impl for the builder
  310    354   
    ///
  311    355   
    /// # Examples
  312    356   
    ///
  313    357   
    /// ```no_run
  314    358   
    /// use simple::config::{AsyncSleep, Config, SharedAsyncSleep, Sleep};
  315    359   
    ///
  316    360   
    /// #[derive(Debug)]
  317    361   
    /// pub struct ForeverSleep;
  318    362   
    ///
  319    363   
    /// impl AsyncSleep for ForeverSleep {
  320    364   
    ///     fn sleep(&self, duration: std::time::Duration) -> Sleep {
  321    365   
    ///         Sleep::new(std::future::pending())
  322    366   
    ///     }
  323    367   
    /// }
  324    368   
    ///
  325    369   
    /// let sleep_impl = SharedAsyncSleep::new(ForeverSleep);
  326    370   
    /// let config = Config::builder().sleep_impl(sleep_impl).build();
  327    371   
    /// ```
  328    372   
    pub fn sleep_impl(mut self, sleep_impl: impl crate::config::AsyncSleep + 'static) -> Self {
  329    373   
        self.set_sleep_impl(Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared(sleep_impl)));
  330    374   
        self
  331    375   
    }
  332    376   
  333    377   
    /// Set the sleep_impl for the builder
  334    378   
    ///
  335    379   
    /// # Examples
  336    380   
    ///
  337    381   
    /// ```no_run
  338    382   
    /// use simple::config::{AsyncSleep, Builder, Config, SharedAsyncSleep, Sleep};
  339    383   
    ///
  340    384   
    /// #[derive(Debug)]
  341    385   
    /// pub struct ForeverSleep;
  342    386   
    ///
  343    387   
    /// impl AsyncSleep for ForeverSleep {
  344    388   
    ///     fn sleep(&self, duration: std::time::Duration) -> Sleep {
  345    389   
    ///         Sleep::new(std::future::pending())
  346    390   
    ///     }
  347    391   
    /// }
  348    392   
    ///
  349    393   
    /// fn set_never_ending_sleep_impl(builder: &mut Builder) {
  350    394   
    ///     let sleep_impl = SharedAsyncSleep::new(ForeverSleep);
  351    395   
    ///     builder.set_sleep_impl(Some(sleep_impl));
  352    396   
    /// }
  353    397   
    ///
  354    398   
    /// let mut builder = Config::builder();
  355    399   
    /// set_never_ending_sleep_impl(&mut builder);
  356    400   
    /// let config = builder.build();
  357    401   
    /// ```
         402  +
    /* ResiliencyConfigCustomization.kt:184 */
  358    403   
    pub fn set_sleep_impl(&mut self, sleep_impl: ::std::option::Option<crate::config::SharedAsyncSleep>) -> &mut Self {
  359    404   
        self.runtime_components.set_sleep_impl(sleep_impl);
  360    405   
        self
  361    406   
    }
         407  +
    /* ResiliencyConfigCustomization.kt:194 */
  362    408   
    /// Set the timeout_config for the builder
  363    409   
    ///
  364    410   
    /// # Examples
  365    411   
    ///
  366    412   
    /// ```no_run
  367    413   
    /// # use std::time::Duration;
  368    414   
    /// use simple::config::Config;
  369    415   
    /// use simple::config::timeout::TimeoutConfig;
  370    416   
    ///
  371    417   
    /// let timeout_config = TimeoutConfig::builder()
  372    418   
    ///     .operation_attempt_timeout(Duration::from_secs(1))
  373    419   
    ///     .build();
  374    420   
    /// let config = Config::builder().timeout_config(timeout_config).build();
  375    421   
    /// ```
  376    422   
    pub fn timeout_config(mut self, timeout_config: ::aws_smithy_types::timeout::TimeoutConfig) -> Self {
  377    423   
        self.set_timeout_config(Some(timeout_config));
  378    424   
        self
  379    425   
    }
  380    426   
  381    427   
    /// Set the timeout_config for the builder.
  382    428   
    ///
  383    429   
    /// Setting this to `None` has no effect if another source of configuration has set timeouts. If you
  384    430   
    /// are attempting to disable timeouts, use [`TimeoutConfig::disabled`](::aws_smithy_types::timeout::TimeoutConfig::disabled)
  385    431   
    ///
  386    432   
    ///
  387    433   
    /// # Examples
  388    434   
    ///
  389    435   
    /// ```no_run
  390    436   
    /// # use std::time::Duration;
  391    437   
    /// use simple::config::{Builder, Config};
  392    438   
    /// use simple::config::timeout::TimeoutConfig;
  393    439   
    ///
  394    440   
    /// fn set_request_timeout(builder: &mut Builder) {
  395    441   
    ///     let timeout_config = TimeoutConfig::builder()
  396    442   
    ///         .operation_attempt_timeout(Duration::from_secs(1))
  397    443   
    ///         .build();
  398    444   
    ///     builder.set_timeout_config(Some(timeout_config));
  399    445   
    /// }
  400    446   
    ///
  401    447   
    /// let mut builder = Config::builder();
  402    448   
    /// set_request_timeout(&mut builder);
  403    449   
    /// let config = builder.build();
  404    450   
    /// ```
         451  +
    /* ResiliencyConfigCustomization.kt:248 */
  405    452   
    pub fn set_timeout_config(&mut self, timeout_config: ::std::option::Option<::aws_smithy_types::timeout::TimeoutConfig>) -> &mut Self {
  406    453   
        // passing None has no impact.
  407    454   
        let Some(mut timeout_config) = timeout_config else { return self };
  408    455   
  409    456   
        if let Some(base) = self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>() {
  410    457   
            timeout_config.take_defaults_from(base);
  411    458   
        }
  412    459   
        self.config.store_put(timeout_config);
  413    460   
        self
  414    461   
    }
         462  +
    /* ResiliencyConfigCustomization.kt:266 */
  415    463   
    /// Set the partition for retry-related state. When clients share a retry partition, they will
  416    464   
    /// also share things like token buckets and client rate limiters. By default, all clients
  417    465   
    /// for the same service will share a partition.
  418    466   
    pub fn retry_partition(mut self, retry_partition: ::aws_smithy_runtime::client::retries::RetryPartition) -> Self {
  419    467   
        self.set_retry_partition(Some(retry_partition));
  420    468   
        self
  421    469   
    }
         470  +
    /* ResiliencyConfigCustomization.kt:279 */
  422    471   
    /// Set the partition for retry-related state. When clients share a retry partition, they will
  423    472   
    /// also share things like token buckets and client rate limiters. By default, all clients
  424    473   
    /// for the same service will share a partition.
  425    474   
    pub fn set_retry_partition(
  426    475   
        &mut self,
  427    476   
        retry_partition: ::std::option::Option<::aws_smithy_runtime::client::retries::RetryPartition>,
  428    477   
    ) -> &mut Self {
  429    478   
        retry_partition.map(|r| self.config.store_put(r));
  430    479   
        self
  431    480   
    }
         481  +
    /* IdentityCacheDecorator.kt:77 */
  432    482   
    /// Set the identity cache for auth.
  433    483   
    ///
  434    484   
    /// The identity cache defaults to a lazy caching implementation that will resolve
  435    485   
    /// an identity when it is requested, and place it in the cache thereafter. Subsequent
  436    486   
    /// requests will take the value from the cache while it is still valid. Once it expires,
  437    487   
    /// the next request will result in refreshing the identity.
  438    488   
    ///
  439    489   
    /// This configuration allows you to disable or change the default caching mechanism.
  440    490   
    /// To use a custom caching mechanism, implement the [`ResolveCachedIdentity`](crate::config::ResolveCachedIdentity)
  441    491   
    /// trait and pass that implementation into this function.
@@ -493,543 +552,603 @@
  513    563   
    ///     )
  514    564   
    ///     // ...
  515    565   
    ///     .build();
  516    566   
    /// let client = simple::Client::from_conf(config);
  517    567   
    /// ```
  518    568   
  519    569   
    pub fn set_identity_cache(&mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> &mut Self {
  520    570   
        self.runtime_components.set_identity_cache(::std::option::Option::Some(identity_cache));
  521    571   
        self
  522    572   
    }
         573  +
    /* InterceptorConfigCustomization.kt:41 */
  523    574   
    /// Add an [interceptor](crate::config::Intercept) that runs at specific stages of the request execution pipeline.
  524    575   
    ///
  525    576   
    /// Interceptors targeted at a certain stage are executed according to the pre-defined priority.
  526    577   
    /// The SDK provides a default set of interceptors. An interceptor configured by this method
  527    578   
    /// will run after those default interceptors.
  528    579   
    ///
  529    580   
    /// # Examples
  530    581   
    /// ```no_run
  531    582   
    /// # #[cfg(test)]
  532    583   
    /// # mod tests {
@@ -599,650 +670,724 @@
  619    670   
    pub fn push_interceptor(&mut self, interceptor: crate::config::SharedInterceptor) -> &mut Self {
  620    671   
        self.runtime_components.push_interceptor(interceptor);
  621    672   
        self
  622    673   
    }
  623    674   
  624    675   
    /// Set [`SharedInterceptor`](crate::config::SharedInterceptor)s for the builder.
  625    676   
    pub fn set_interceptors(&mut self, interceptors: impl IntoIterator<Item = crate::config::SharedInterceptor>) -> &mut Self {
  626    677   
        self.runtime_components.set_interceptors(interceptors.into_iter());
  627    678   
        self
  628    679   
    }
         680  +
    /* TimeSourceCustomization.kt:47 */
  629    681   
    /// Sets the time source used for this service
  630    682   
    pub fn time_source(mut self, time_source: impl ::aws_smithy_async::time::TimeSource + 'static) -> Self {
  631    683   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared(
  632    684   
            time_source,
  633    685   
        )));
  634    686   
        self
  635    687   
    }
         688  +
    /* TimeSourceCustomization.kt:61 */
  636    689   
    /// Sets the time source used for this service
  637    690   
    pub fn set_time_source(&mut self, time_source: ::std::option::Option<::aws_smithy_async::time::SharedTimeSource>) -> &mut Self {
  638    691   
        self.runtime_components.set_time_source(time_source);
  639    692   
        self
  640    693   
    }
         694  +
    /* RetryClassifierConfigCustomization.kt:50 */
  641    695   
    /// Add type implementing [`ClassifyRetry`](::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry) that will be used by the
  642    696   
    /// [`RetryStrategy`](::aws_smithy_runtime_api::client::retries::RetryStrategy) to determine what responses should be retried.
  643    697   
    ///
  644    698   
    /// A retry classifier configured by this method will run according to its [priority](::aws_smithy_runtime_api::client::retries::classifiers::RetryClassifierPriority).
  645    699   
    ///
  646    700   
    /// # Examples
  647    701   
    /// ```no_run
  648    702   
    /// # #[cfg(test)]
  649    703   
    /// # mod tests {
  650    704   
    /// # #[test]
@@ -805,859 +864,919 @@
  825    879   
  826    880   
    /// Set [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier)s for the builder, replacing any that
  827    881   
    /// were previously set.
  828    882   
    pub fn set_retry_classifiers(
  829    883   
        &mut self,
  830    884   
        retry_classifiers: impl IntoIterator<Item = ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier>,
  831    885   
    ) -> &mut Self {
  832    886   
        self.runtime_components.set_retry_classifiers(retry_classifiers.into_iter());
  833    887   
        self
  834    888   
    }
         889  +
    /* ServiceConfigGenerator.kt:375 */
  835    890   
    /// Sets the [`behavior major version`](crate::config::BehaviorVersion).
  836    891   
    ///
  837    892   
    /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards
  838    893   
    /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for
  839    894   
    /// all operations might be the ideal behavior but could break existing applications.
  840    895   
    ///
  841    896   
    /// # Examples
  842    897   
    ///
  843    898   
    /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature.
  844    899   
    /// ```no_run
@@ -882,937 +1137,1235 @@
  902    957   
        self
  903    958   
    }
  904    959   
  905    960   
    /// Convenience method to set the latest behavior major version
  906    961   
    ///
  907    962   
    /// This is equivalent to enabling the `behavior-version-latest` Cargo feature
  908    963   
    pub fn behavior_version_latest(mut self) -> Self {
  909    964   
        self.set_behavior_version(Some(crate::config::BehaviorVersion::latest()));
  910    965   
        self
  911    966   
    }
  912         -
    /// Adds a runtime plugin to the config.
         967  +
    /// /* ServiceConfigGenerator.kt:509 */Adds a runtime plugin to the config.
         968  +
    /* ServiceConfigGenerator.kt:513 */
  913    969   
    pub fn runtime_plugin(mut self, plugin: impl crate::config::RuntimePlugin + 'static) -> Self {
  914    970   
        self.push_runtime_plugin(crate::config::SharedRuntimePlugin::new(plugin));
  915    971   
        self
  916    972   
    }
  917         -
    /// Adds a runtime plugin to the config.
         973  +
    /// /* ServiceConfigGenerator.kt:522 */Adds a runtime plugin to the config.
         974  +
    /* ServiceConfigGenerator.kt:526 */
  918    975   
    pub fn push_runtime_plugin(&mut self, plugin: crate::config::SharedRuntimePlugin) -> &mut Self {
  919    976   
        self.runtime_plugins.push(plugin);
  920    977   
        self
  921    978   
    }
         979  +
    /* RustType.kt:516 */
  922    980   
    #[cfg(any(feature = "test-util", test))]
         981  +
    /* RustType.kt:516 */
  923    982   
    #[allow(unused_mut)]
  924         -
    /// Apply test defaults to the builder
         983  +
    /// /* ServiceConfigGenerator.kt:541 */Apply test defaults to the builder
         984  +
    /* ServiceConfigGenerator.kt:542 */
  925    985   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
         986  +
        /* TimeSourceCustomization.kt:88 */
  926    987   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
  927    988   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
  928    989   
        )));
         990  +
        /* ServiceConfigGenerator.kt:544 */
  929    991   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
         992  +
        /* ServiceConfigGenerator.kt:545 */
  930    993   
        self
         994  +
        /* ServiceConfigGenerator.kt:542 */
  931    995   
    }
         996  +
    /* RustType.kt:516 */
  932    997   
    #[cfg(any(feature = "test-util", test))]
         998  +
    /* RustType.kt:516 */
  933    999   
    #[allow(unused_mut)]
  934         -
    /// Apply test defaults to the builder
        1000  +
    /// /* ServiceConfigGenerator.kt:550 */Apply test defaults to the builder
        1001  +
    /* ServiceConfigGenerator.kt:551 */
  935   1002   
    pub fn with_test_defaults(mut self) -> Self {
        1003  +
        /* ServiceConfigGenerator.kt:552 */
  936   1004   
        self.apply_test_defaults();
  937   1005   
        self
        1006  +
        /* ServiceConfigGenerator.kt:551 */
  938   1007   
    }
  939         -
    /// Builds a [`Config`].
        1008  +
    /// /* ServiceConfigGenerator.kt:555 */Builds a [`Config`].
        1009  +
    /* ServiceConfigGenerator.kt:556 */
  940   1010   
    #[allow(unused_mut)]
        1011  +
    /* ServiceConfigGenerator.kt:557 */
  941   1012   
    pub fn build(mut self) -> Config {
        1013  +
        /* ServiceConfigGenerator.kt:558 */
  942   1014   
        let mut layer = self.config;
        1015  +
        /* TimeSourceCustomization.kt:77 */
  943   1016   
        if self.runtime_components.time_source().is_none() {
  944   1017   
            self.runtime_components
  945   1018   
                .set_time_source(::std::option::Option::Some(::std::default::Default::default()));
  946   1019   
        }
        1020  +
        /* ServiceConfigGenerator.kt:567 */
  947   1021   
        Config {
  948         -
            config: crate::config::Layer::from(layer.clone()).with_name("simple::config::Config").freeze(),
        1022  +
            /* ServiceConfigGenerator.kt:568 */ config: crate::config::Layer::from(layer.clone()).with_name("simple::config::Config").freeze(),
  949   1023   
            cloneable: layer,
  950   1024   
            runtime_components: self.runtime_components,
  951   1025   
            runtime_plugins: self.runtime_plugins,
  952   1026   
            behavior_version: self.behavior_version,
        1027  +
            /* ServiceConfigGenerator.kt:567 */
  953   1028   
        }
        1029  +
        /* ServiceConfigGenerator.kt:557 */
  954   1030   
    }
        1031  +
    /* ServiceConfigGenerator.kt:492 */
  955   1032   
}
        1033  +
/* ServiceRuntimePluginGenerator.kt:116 */
  956   1034   
#[derive(::std::fmt::Debug)]
  957   1035   
pub(crate) struct ServiceRuntimePlugin {
  958   1036   
    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
  959   1037   
    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  960   1038   
}
  961   1039   
  962   1040   
impl ServiceRuntimePlugin {
  963   1041   
    pub fn new(_service_config: crate::config::Config) -> Self {
  964   1042   
        let config = {
  965   1043   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("SimpleService");
  966   1044   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
  967   1045   
            ::std::option::Option::Some(cfg.freeze())
  968   1046   
        };
  969   1047   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
  970   1048   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
  971   1049   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
  972   1050   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
  973   1051   
        Self { config, runtime_components }
  974   1052   
    }
  975   1053   
}
  976   1054   
  977   1055   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
  978   1056   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
  979   1057   
        self.config.clone()
  980   1058   
    }
  981   1059   
  982   1060   
    fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {
  983   1061   
        ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults
  984   1062   
    }
  985   1063   
  986   1064   
    fn runtime_components(
  987   1065   
        &self,
  988   1066   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
  989   1067   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
  990   1068   
        ::std::borrow::Cow::Borrowed(&self.runtime_components)
  991   1069   
    }
  992   1070   
}
  993   1071   
  994   1072   
/// Cross-operation shared-state singletons
  995   1073   
        1074  +
/* ConfigOverrideRuntimePluginGenerator.kt:42 */
  996   1075   
/// A plugin that enables configuration for a single operation invocation
  997   1076   
///
  998   1077   
/// The `config` method will return a `FrozenLayer` by storing values from `config_override`.
  999   1078   
/// In the case of default values requested, they will be obtained from `client_config`.
 1000   1079   
#[derive(Debug)]
 1001   1080   
pub(crate) struct ConfigOverrideRuntimePlugin {
 1002   1081   
    pub(crate) config: ::aws_smithy_types::config_bag::FrozenLayer,
 1003   1082   
    pub(crate) components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1004   1083   
}
 1005   1084   
 1006   1085   
impl ConfigOverrideRuntimePlugin {
 1007   1086   
    #[allow(dead_code)] // unused when a service does not provide any operations
 1008   1087   
    pub(crate) fn new(
 1009   1088   
        config_override: Builder,
 1010   1089   
        initial_config: ::aws_smithy_types::config_bag::FrozenLayer,
 1011   1090   
        initial_components: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1012   1091   
    ) -> Self {
 1013   1092   
        let mut layer = config_override.config;
 1014   1093   
        let mut components = config_override.runtime_components;
 1015   1094   
        #[allow(unused_mut)]
 1016   1095   
        let mut resolver =
 1017   1096   
            ::aws_smithy_runtime::client::config_override::Resolver::overrid(initial_config, initial_components, &mut layer, &mut components);
 1018   1097   
 1019   1098   
        let _ = resolver;
 1020   1099   
        Self {
 1021   1100   
            config: ::aws_smithy_types::config_bag::Layer::from(layer)
 1022   1101   
                .with_name("simple::config::ConfigOverrideRuntimePlugin")
 1023   1102   
                .freeze(),
 1024   1103   
            components,
 1025   1104   
        }
 1026   1105   
    }
 1027   1106   
}
 1028   1107   
 1029   1108   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin {
 1030   1109   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
 1031   1110   
        Some(self.config.clone())
 1032   1111   
    }
 1033   1112   
 1034   1113   
    fn runtime_components(
 1035   1114   
        &self,
 1036   1115   
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1037   1116   
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
 1038   1117   
        ::std::borrow::Cow::Borrowed(&self.components)
 1039   1118   
    }
 1040   1119   
}
 1041   1120   
        1121  +
/* ClientRuntimeTypesReExportGenerator.kt:24 */
 1042   1122   
pub use ::aws_smithy_runtime::client::identity::IdentityCache;
 1043   1123   
pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
 1044   1124   
pub use ::aws_smithy_types::config_bag::ConfigBag;
 1045   1125   
        1126  +
/* ResiliencyConfigCustomization.kt:318 */
 1046   1127   
pub use ::aws_smithy_async::rt::sleep::Sleep;
 1047   1128   
        1129  +
/* FluentClientGenerator.kt:261 */
 1048   1130   
pub(crate) fn base_client_runtime_plugins(mut config: crate::Config) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
 1049   1131   
    let mut configured_plugins = ::std::vec::Vec::new();
 1050   1132   
    ::std::mem::swap(&mut config.runtime_plugins, &mut configured_plugins);
 1051   1133   
    #[cfg(feature = "behavior-version-latest")]
 1052   1134   
    {
 1053   1135   
        if config.behavior_version.is_none() {
 1054   1136   
            config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest());
 1055   1137   
        }
 1056   1138   
    }
 1057   1139   
 1058   1140   
    let default_retry_partition = "simpleservice";
 1059   1141   
 1060   1142   
    let scope = "simple";
 1061   1143   
 1062   1144   
    let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new()
 1063   1145   
                        // defaults
 1064   1146   
                        .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins(
 1065   1147   
                            ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new()
 1066   1148   
                                .with_retry_partition_name(default_retry_partition)
 1067   1149   
                                .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature."))
 1068   1150   
                        ))
 1069   1151   
                        // user config
 1070   1152   
                        .with_client_plugin(
 1071   1153   
                            ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new()
 1072   1154   
                                .with_config(config.config.clone())
 1073   1155   
                                .with_runtime_components(config.runtime_components.clone())
 1074   1156   
                        )
 1075   1157   
                        // codegen config
 1076   1158   
                        .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone()))
 1077   1159   
                        .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new())
 1078   1160   
                        .with_client_plugin(
 1079   1161   
                            ::aws_smithy_runtime::client::metrics::MetricsRuntimePlugin::builder()
 1080   1162   
                                .with_scope(scope)
 1081   1163   
                                .with_time_source(config.runtime_components.time_source().unwrap_or_default())
 1082   1164   
                                .build()
 1083   1165   
                                .expect("All required fields have been set")
 1084   1166   
                        );
 1085   1167   
 1086   1168   
    for plugin in configured_plugins {
 1087   1169   
        plugins = plugins.with_client_plugin(plugin);
 1088   1170   
    }
 1089   1171   
    plugins
 1090   1172   
}
 1091   1173   
        1174  +
/* ClientReExports.kt:17 */
 1092   1175   
pub use ::aws_smithy_types::config_bag::FrozenLayer;
 1093   1176   
        1177  +
/* ClientReExports.kt:17 */
 1094   1178   
pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
 1095   1179   
        1180  +
/* ClientReExports.kt:17 */
 1096   1181   
pub use ::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin;
 1097   1182   
        1183  +
/* ClientReExports.kt:17 */
 1098   1184   
pub use ::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion;
 1099   1185   
        1186  +
/* ClientReExports.kt:17 */
 1100   1187   
pub use ::aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig;
 1101   1188   
        1189  +
/* ClientReExports.kt:17 */
 1102   1190   
pub use ::aws_smithy_runtime_api::client::http::SharedHttpClient;
 1103   1191   
        1192  +
/* ClientReExports.kt:17 */
 1104   1193   
pub use ::aws_smithy_async::rt::sleep::SharedAsyncSleep;
 1105   1194   
        1195  +
/* ClientReExports.kt:17 */
 1106   1196   
pub use ::aws_smithy_runtime_api::client::identity::SharedIdentityCache;
 1107   1197   
        1198  +
/* ClientReExports.kt:17 */
 1108   1199   
pub use ::aws_smithy_runtime_api::client::interceptors::SharedInterceptor;
 1109   1200   
        1201  +
/* ClientReExports.kt:17 */
 1110   1202   
pub use ::aws_smithy_runtime_api::client::http::HttpClient;
 1111   1203   
        1204  +
/* ClientReExports.kt:17 */
 1112   1205   
pub use ::aws_smithy_runtime_api::shared::IntoShared;
 1113   1206   
        1207  +
/* ClientReExports.kt:17 */
 1114   1208   
pub use ::aws_smithy_async::rt::sleep::AsyncSleep;
 1115   1209   
        1210  +
/* ClientReExports.kt:17 */
 1116   1211   
pub use ::aws_smithy_runtime_api::client::identity::ResolveCachedIdentity;
 1117   1212   
        1213  +
/* ClientReExports.kt:17 */
 1118   1214   
pub use ::aws_smithy_runtime_api::client::interceptors::Intercept;
 1119   1215   
        1216  +
/* ClientReExports.kt:17 */
 1120   1217   
pub use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
 1121   1218   
        1219  +
/* ClientReExports.kt:17 */
 1122   1220   
pub use ::aws_smithy_types::config_bag::Layer;
 1123   1221   
 1124         -
/// Types needed to configure endpoint resolution.
        1222  +
/// /* ClientRustModule.kt:121 */Types needed to configure endpoint resolution.
 1125   1223   
pub mod endpoint;
 1126   1224   
 1127         -
/// HTTP request and response types.
        1225  +
/// /* ClientRustModule.kt:121 */HTTP request and response types.
 1128   1226   
pub mod http;
 1129   1227   
 1130         -
/// Types needed to implement [`Intercept`](crate::config::Intercept).
        1228  +
/// /* ClientRustModule.kt:121 */Types needed to implement [`Intercept`](crate::config::Intercept).
 1131   1229   
pub mod interceptors;
 1132   1230   
 1133         -
/// Retry configuration.
        1231  +
/// /* ClientRustModule.kt:121 */Retry configuration.
 1134   1232   
pub mod retry;
 1135   1233   
 1136         -
/// Timeout configuration.
        1234  +
/// /* ClientRustModule.kt:121 */Timeout configuration.
 1137   1235   
pub mod timeout;

tmp-codegen-diff/codegen-client-test/simple/rust-client-codegen/src/config/endpoint.rs

@@ -1,1 +86,107 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ClientRuntimeTypesReExportGenerator.kt:38 */
    2      3   
pub use ::aws_smithy_runtime_api::client::endpoint::EndpointFuture;
    3      4   
pub use ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver;
    4      5   
pub use ::aws_smithy_types::endpoint::Endpoint;
    5      6   
           7  +
/* RustType.kt:516 */
    6      8   
#[cfg(test)]
    7         -
mod test {}
           9  +
/* EndpointsDecorator.kt:175 */
          10  +
mod test {
    8     11   
          12  +
    /* EndpointsDecorator.kt:175 */
          13  +
}
          14  +
          15  +
/* EndpointResolverGenerator.kt:416 */
    9     16   
/// Endpoint resolver trait specific to this service
   10     17   
pub trait ResolveEndpoint: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug {
   11     18   
    /// Resolve an endpoint with the given parameters
   12     19   
    fn resolve_endpoint<'a>(&'a self, params: &'a crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a>;
   13     20   
   14     21   
    /// Convert this service-specific resolver into a `SharedEndpointResolver`
   15     22   
    ///
   16     23   
    /// The resulting resolver will downcast `EndpointResolverParams` into `crate::config::endpoint::Params`.
   17     24   
    fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver
   18     25   
    where
   19     26   
        Self: Sized + 'static,
   20     27   
    {
   21     28   
        ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver::new(DowncastParams(self))
   22     29   
    }
   23     30   
}
   24     31   
   25     32   
#[derive(Debug)]
   26     33   
struct DowncastParams<T>(T);
   27     34   
impl<T> ::aws_smithy_runtime_api::client::endpoint::ResolveEndpoint for DowncastParams<T>
   28     35   
where
   29     36   
    T: ResolveEndpoint,
   30     37   
{
   31     38   
    fn resolve_endpoint<'a>(
   32     39   
        &'a self,
   33     40   
        params: &'a ::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams,
   34     41   
    ) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a> {
   35     42   
        let ep = match params.get::<crate::config::endpoint::Params>() {
   36     43   
            Some(params) => self.0.resolve_endpoint(params),
   37     44   
            None => ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(Err("params of expected type was not present".into())),
   38     45   
        };
   39     46   
        ep
   40     47   
    }
   41     48   
}
   42     49   
          50  +
/* RustType.kt:516 */
   43     51   
#[non_exhaustive]
          52  +
/* RustType.kt:516 */
   44     53   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   45         -
/// Configuration parameters for resolving the correct endpoint
   46         -
pub struct Params {}
          54  +
/// /* EndpointParamsGenerator.kt:178 */Configuration parameters for resolving the correct endpoint
          55  +
/* EndpointParamsGenerator.kt:179 */
          56  +
pub struct Params {/* EndpointParamsGenerator.kt:179 */}
          57  +
/* EndpointParamsGenerator.kt:188 */
   47     58   
impl Params {
          59  +
    /* EndpointParamsGenerator.kt:189 */
   48     60   
    /// Create a builder for [`Params`]
   49     61   
    pub fn builder() -> crate::config::endpoint::ParamsBuilder {
   50     62   
        crate::config::endpoint::ParamsBuilder::default()
   51     63   
    }
          64  +
    /* EndpointParamsGenerator.kt:188 */
   52     65   
}
   53     66   
   54         -
/// Builder for [`Params`]
          67  +
/// /* EndpointParamsGenerator.kt:234 */Builder for [`Params`]
          68  +
/* RustType.kt:516 */
   55     69   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   56         -
pub struct ParamsBuilder {}
          70  +
/* EndpointParamsGenerator.kt:238 */
          71  +
pub struct ParamsBuilder {/* EndpointParamsGenerator.kt:238 */}
          72  +
/* EndpointParamsGenerator.kt:246 */
   57     73   
impl ParamsBuilder {
   58         -
    /// Consume this builder, creating [`Params`].
          74  +
    /// /* EndpointParamsGenerator.kt:247 */Consume this builder, creating [`Params`].
          75  +
    /* EndpointParamsGenerator.kt:248 */
   59     76   
    pub fn build(self) -> ::std::result::Result<crate::config::endpoint::Params, crate::config::endpoint::InvalidParams> {
          77  +
        /* EndpointParamsGenerator.kt:272 */
   60     78   
        Ok(
   61     79   
            #[allow(clippy::unnecessary_lazy_evaluations)]
   62     80   
            crate::config::endpoint::Params {},
   63     81   
        )
          82  +
        /* EndpointParamsGenerator.kt:248 */
   64     83   
    }
          84  +
    /* EndpointParamsGenerator.kt:246 */
   65     85   
}
   66     86   
          87  +
/* EndpointParamsGenerator.kt:139 */
   67     88   
/// An error that occurred during endpoint resolution
   68     89   
#[derive(Debug)]
   69     90   
pub struct InvalidParams {
   70     91   
    field: std::borrow::Cow<'static, str>,
   71     92   
}
   72     93   
   73     94   
impl InvalidParams {
   74     95   
    #[allow(dead_code)]
   75     96   
    fn missing(field: &'static str) -> Self {
   76     97   
        Self { field: field.into() }

tmp-codegen-diff/codegen-client-test/simple/rust-client-codegen/src/config/http.rs

@@ -1,1 +3,4 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ClientRuntimeTypesReExportGenerator.kt:60 */
    2      3   
pub use ::aws_smithy_runtime_api::client::orchestrator::HttpRequest;
    3      4   
pub use ::aws_smithy_runtime_api::client::orchestrator::HttpResponse;