AWS SDK

AWS SDK

rev. aa190e630077955f0bc8f58dee6a16530c1e0578 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_execution_preview.rs

@@ -0,1 +0,85 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Information about the changes that would be made if an execution were run.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub enum ExecutionPreview {
           7  +
    /// <p>Information about the changes that would be made if an Automation workflow were run.</p>
           8  +
    Automation(crate::types::AutomationExecutionPreview),
           9  +
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          10  +
    /// An unknown enum variant
          11  +
    ///
          12  +
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
          13  +
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
          14  +
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
          15  +
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
          16  +
    #[non_exhaustive]
          17  +
    Unknown,
          18  +
}
          19  +
impl ExecutionPreview {
          20  +
    #[allow(irrefutable_let_patterns)]
          21  +
    /// Tries to convert the enum instance into [`Automation`](crate::types::ExecutionPreview::Automation), extracting the inner [`AutomationExecutionPreview`](crate::types::AutomationExecutionPreview).
          22  +
    /// Returns `Err(&Self)` if it can't be converted.
          23  +
    pub fn as_automation(&self) -> ::std::result::Result<&crate::types::AutomationExecutionPreview, &Self> {
          24  +
        if let ExecutionPreview::Automation(val) = &self {
          25  +
            ::std::result::Result::Ok(val)
          26  +
        } else {
          27  +
            ::std::result::Result::Err(self)
          28  +
        }
          29  +
    }
          30  +
    /// Returns true if this is a [`Automation`](crate::types::ExecutionPreview::Automation).
          31  +
    pub fn is_automation(&self) -> bool {
          32  +
        self.as_automation().is_ok()
          33  +
    }
          34  +
    /// Returns true if the enum instance is the `Unknown` variant.
          35  +
    pub fn is_unknown(&self) -> bool {
          36  +
        matches!(self, Self::Unknown)
          37  +
    }
          38  +
}
          39  +
static EXECUTIONPREVIEW_MEMBER_AUTOMATION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          40  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ExecutionPreview$Automation", "com.amazonaws.ssm", "ExecutionPreview"),
          41  +
    ::aws_smithy_schema::ShapeType::Structure,
          42  +
    "Automation",
          43  +
    0,
          44  +
);
          45  +
static EXECUTIONPREVIEW_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          46  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ExecutionPreview", "com.amazonaws.ssm", "ExecutionPreview"),
          47  +
    ::aws_smithy_schema::ShapeType::Union,
          48  +
    &[&EXECUTIONPREVIEW_MEMBER_AUTOMATION],
          49  +
);
          50  +
impl ExecutionPreview {
          51  +
    /// The schema for this shape.
          52  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &EXECUTIONPREVIEW_SCHEMA;
          53  +
}
          54  +
impl ::aws_smithy_schema::serde::SerializableStruct for ExecutionPreview {
          55  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          56  +
    fn serialize_members(
          57  +
        &self,
          58  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          59  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          60  +
        match self {
          61  +
            Self::Automation(val) => {
          62  +
                ser.write_struct(&EXECUTIONPREVIEW_MEMBER_AUTOMATION, val)?;
          63  +
            }
          64  +
            Self::Unknown => return Err(::aws_smithy_schema::serde::SerdeError::custom("cannot serialize unknown union variant")),
          65  +
        }
          66  +
        Ok(())
          67  +
    }
          68  +
}
          69  +
impl ExecutionPreview {
          70  +
    /// Deserializes this union from a [`ShapeDeserializer`].
          71  +
    pub fn deserialize(
          72  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          73  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          74  +
        let mut result: ::std::option::Option<Self> = ::std::option::Option::None;
          75  +
        #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding)]
          76  +
        deserializer.read_struct(&EXECUTIONPREVIEW_SCHEMA, &mut |member, deser| {
          77  +
            result = ::std::option::Option::Some(match member.member_index() {
          78  +
                Some(0) => Self::Automation(crate::types::AutomationExecutionPreview::deserialize(deser)?),
          79  +
                _ => Self::Unknown,
          80  +
            });
          81  +
            Ok(())
          82  +
        })?;
          83  +
        result.ok_or_else(|| ::aws_smithy_schema::serde::SerdeError::custom("expected a union variant"))
          84  +
    }
          85  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_execution_preview_status.rs

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

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_external_alarm_state.rs

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

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_failed_create_association.rs

@@ -0,1 +0,214 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Describes a failed association.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct FailedCreateAssociation {
           7  +
    /// <p>The association.</p>
           8  +
    pub entry: ::std::option::Option<crate::types::CreateAssociationBatchRequestEntry>,
           9  +
    /// <p>A description of the failure.</p>
          10  +
    pub message: ::std::option::Option<::std::string::String>,
          11  +
    /// <p>The source of the failure.</p>
          12  +
    pub fault: ::std::option::Option<crate::types::Fault>,
          13  +
}
          14  +
impl FailedCreateAssociation {
          15  +
    /// <p>The association.</p>
          16  +
    pub fn entry(&self) -> ::std::option::Option<&crate::types::CreateAssociationBatchRequestEntry> {
          17  +
        self.entry.as_ref()
          18  +
    }
          19  +
    /// <p>A description of the failure.</p>
          20  +
    pub fn message(&self) -> ::std::option::Option<&str> {
          21  +
        self.message.as_deref()
          22  +
    }
          23  +
    /// <p>The source of the failure.</p>
          24  +
    pub fn fault(&self) -> ::std::option::Option<&crate::types::Fault> {
          25  +
        self.fault.as_ref()
          26  +
    }
          27  +
}
          28  +
static FAILEDCREATEASSOCIATION_MEMBER_ENTRY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          29  +
    ::aws_smithy_schema::ShapeId::from_parts(
          30  +
        "com.amazonaws.ssm#FailedCreateAssociation$Entry",
          31  +
        "com.amazonaws.ssm",
          32  +
        "FailedCreateAssociation",
          33  +
    ),
          34  +
    ::aws_smithy_schema::ShapeType::Structure,
          35  +
    "Entry",
          36  +
    0,
          37  +
);
          38  +
static FAILEDCREATEASSOCIATION_MEMBER_MESSAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          39  +
    ::aws_smithy_schema::ShapeId::from_parts(
          40  +
        "com.amazonaws.ssm#FailedCreateAssociation$Message",
          41  +
        "com.amazonaws.ssm",
          42  +
        "FailedCreateAssociation",
          43  +
    ),
          44  +
    ::aws_smithy_schema::ShapeType::String,
          45  +
    "Message",
          46  +
    1,
          47  +
);
          48  +
static FAILEDCREATEASSOCIATION_MEMBER_FAULT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          49  +
    ::aws_smithy_schema::ShapeId::from_parts(
          50  +
        "com.amazonaws.ssm#FailedCreateAssociation$Fault",
          51  +
        "com.amazonaws.ssm",
          52  +
        "FailedCreateAssociation",
          53  +
    ),
          54  +
    ::aws_smithy_schema::ShapeType::String,
          55  +
    "Fault",
          56  +
    2,
          57  +
);
          58  +
static FAILEDCREATEASSOCIATION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          59  +
    ::aws_smithy_schema::ShapeId::from_parts(
          60  +
        "com.amazonaws.ssm#FailedCreateAssociation",
          61  +
        "com.amazonaws.ssm",
          62  +
        "FailedCreateAssociation",
          63  +
    ),
          64  +
    ::aws_smithy_schema::ShapeType::Structure,
          65  +
    &[
          66  +
        &FAILEDCREATEASSOCIATION_MEMBER_ENTRY,
          67  +
        &FAILEDCREATEASSOCIATION_MEMBER_MESSAGE,
          68  +
        &FAILEDCREATEASSOCIATION_MEMBER_FAULT,
          69  +
    ],
          70  +
);
          71  +
impl FailedCreateAssociation {
          72  +
    /// The schema for this shape.
          73  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &FAILEDCREATEASSOCIATION_SCHEMA;
          74  +
}
          75  +
impl ::aws_smithy_schema::serde::SerializableStruct for FailedCreateAssociation {
          76  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          77  +
    fn serialize_members(
          78  +
        &self,
          79  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          80  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          81  +
        if let Some(ref val) = self.entry {
          82  +
            ser.write_struct(&FAILEDCREATEASSOCIATION_MEMBER_ENTRY, val)?;
          83  +
        }
          84  +
        if let Some(ref val) = self.message {
          85  +
            ser.write_string(&FAILEDCREATEASSOCIATION_MEMBER_MESSAGE, val)?;
          86  +
        }
          87  +
        if let Some(ref val) = self.fault {
          88  +
            ser.write_string(&FAILEDCREATEASSOCIATION_MEMBER_FAULT, val.as_str())?;
          89  +
        }
          90  +
        Ok(())
          91  +
    }
          92  +
}
          93  +
impl FailedCreateAssociation {
          94  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          95  +
    pub fn deserialize(
          96  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          97  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          98  +
        #[allow(unused_variables, unused_mut)]
          99  +
        let mut builder = Self::builder();
         100  +
        #[allow(
         101  +
            unused_variables,
         102  +
            unreachable_code,
         103  +
            clippy::single_match,
         104  +
            clippy::match_single_binding,
         105  +
            clippy::diverging_sub_expression
         106  +
        )]
         107  +
        deserializer.read_struct(&FAILEDCREATEASSOCIATION_SCHEMA, &mut |member, deser| {
         108  +
            match member.member_index() {
         109  +
                Some(0) => {
         110  +
                    if deser.is_null() {
         111  +
                        deser.read_null()?;
         112  +
                    } else {
         113  +
                        builder.entry = Some(crate::types::CreateAssociationBatchRequestEntry::deserialize(deser)?);
         114  +
                    }
         115  +
                }
         116  +
                Some(1) => {
         117  +
                    if deser.is_null() {
         118  +
                        deser.read_null()?;
         119  +
                    } else {
         120  +
                        builder.message = Some(deser.read_string(member)?);
         121  +
                    }
         122  +
                }
         123  +
                Some(2) => {
         124  +
                    if deser.is_null() {
         125  +
                        deser.read_null()?;
         126  +
                    } else {
         127  +
                        builder.fault = Some(crate::types::Fault::from(deser.read_string(member)?.as_str()));
         128  +
                    }
         129  +
                }
         130  +
                _ => {}
         131  +
            }
         132  +
            Ok(())
         133  +
        })?;
         134  +
        Ok(builder.build())
         135  +
    }
         136  +
}
         137  +
impl FailedCreateAssociation {
         138  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         139  +
    pub fn deserialize_with_response(
         140  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         141  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         142  +
        _status: u16,
         143  +
        _body: &[u8],
         144  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         145  +
        Self::deserialize(deserializer)
         146  +
    }
         147  +
}
         148  +
impl FailedCreateAssociation {
         149  +
    /// Creates a new builder-style object to manufacture [`FailedCreateAssociation`](crate::types::FailedCreateAssociation).
         150  +
    pub fn builder() -> crate::types::builders::FailedCreateAssociationBuilder {
         151  +
        crate::types::builders::FailedCreateAssociationBuilder::default()
         152  +
    }
         153  +
}
         154  +
         155  +
/// A builder for [`FailedCreateAssociation`](crate::types::FailedCreateAssociation).
         156  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         157  +
#[non_exhaustive]
         158  +
pub struct FailedCreateAssociationBuilder {
         159  +
    pub(crate) entry: ::std::option::Option<crate::types::CreateAssociationBatchRequestEntry>,
         160  +
    pub(crate) message: ::std::option::Option<::std::string::String>,
         161  +
    pub(crate) fault: ::std::option::Option<crate::types::Fault>,
         162  +
}
         163  +
impl FailedCreateAssociationBuilder {
         164  +
    /// <p>The association.</p>
         165  +
    pub fn entry(mut self, input: crate::types::CreateAssociationBatchRequestEntry) -> Self {
         166  +
        self.entry = ::std::option::Option::Some(input);
         167  +
        self
         168  +
    }
         169  +
    /// <p>The association.</p>
         170  +
    pub fn set_entry(mut self, input: ::std::option::Option<crate::types::CreateAssociationBatchRequestEntry>) -> Self {
         171  +
        self.entry = input;
         172  +
        self
         173  +
    }
         174  +
    /// <p>The association.</p>
         175  +
    pub fn get_entry(&self) -> &::std::option::Option<crate::types::CreateAssociationBatchRequestEntry> {
         176  +
        &self.entry
         177  +
    }
         178  +
    /// <p>A description of the failure.</p>
         179  +
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         180  +
        self.message = ::std::option::Option::Some(input.into());
         181  +
        self
         182  +
    }
         183  +
    /// <p>A description of the failure.</p>
         184  +
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         185  +
        self.message = input;
         186  +
        self
         187  +
    }
         188  +
    /// <p>A description of the failure.</p>
         189  +
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         190  +
        &self.message
         191  +
    }
         192  +
    /// <p>The source of the failure.</p>
         193  +
    pub fn fault(mut self, input: crate::types::Fault) -> Self {
         194  +
        self.fault = ::std::option::Option::Some(input);
         195  +
        self
         196  +
    }
         197  +
    /// <p>The source of the failure.</p>
         198  +
    pub fn set_fault(mut self, input: ::std::option::Option<crate::types::Fault>) -> Self {
         199  +
        self.fault = input;
         200  +
        self
         201  +
    }
         202  +
    /// <p>The source of the failure.</p>
         203  +
    pub fn get_fault(&self) -> &::std::option::Option<crate::types::Fault> {
         204  +
        &self.fault
         205  +
    }
         206  +
    /// Consumes the builder and constructs a [`FailedCreateAssociation`](crate::types::FailedCreateAssociation).
         207  +
    pub fn build(self) -> crate::types::FailedCreateAssociation {
         208  +
        crate::types::FailedCreateAssociation {
         209  +
            entry: self.entry,
         210  +
            message: self.message,
         211  +
            fault: self.fault,
         212  +
        }
         213  +
    }
         214  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_failure_details.rs

@@ -0,1 +0,271 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Information about an Automation failure.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct FailureDetails {
           7  +
    /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
           8  +
    pub failure_stage: ::std::option::Option<::std::string::String>,
           9  +
    /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
          10  +
    pub failure_type: ::std::option::Option<::std::string::String>,
          11  +
    /// <p>Detailed information about the Automation step failure.</p>
          12  +
    pub details: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
          13  +
}
          14  +
impl FailureDetails {
          15  +
    /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
          16  +
    pub fn failure_stage(&self) -> ::std::option::Option<&str> {
          17  +
        self.failure_stage.as_deref()
          18  +
    }
          19  +
    /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
          20  +
    pub fn failure_type(&self) -> ::std::option::Option<&str> {
          21  +
        self.failure_type.as_deref()
          22  +
    }
          23  +
    /// <p>Detailed information about the Automation step failure.</p>
          24  +
    pub fn details(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
          25  +
        self.details.as_ref()
          26  +
    }
          27  +
}
          28  +
static FAILUREDETAILS_MEMBER_FAILURE_STAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          29  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#FailureDetails$FailureStage", "com.amazonaws.ssm", "FailureDetails"),
          30  +
    ::aws_smithy_schema::ShapeType::String,
          31  +
    "FailureStage",
          32  +
    0,
          33  +
);
          34  +
static FAILUREDETAILS_MEMBER_FAILURE_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          35  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#FailureDetails$FailureType", "com.amazonaws.ssm", "FailureDetails"),
          36  +
    ::aws_smithy_schema::ShapeType::String,
          37  +
    "FailureType",
          38  +
    1,
          39  +
);
          40  +
static FAILUREDETAILS_MEMBER_DETAILS_VALUE_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_parts(
          42  +
        "com.amazonaws.ssm#AutomationParameterValueList$member",
          43  +
        "com.amazonaws.ssm",
          44  +
        "AutomationParameterValueList",
          45  +
    ),
          46  +
    ::aws_smithy_schema::ShapeType::String,
          47  +
    "member",
          48  +
    0,
          49  +
);
          50  +
static FAILUREDETAILS_MEMBER_DETAILS_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          51  +
    ::aws_smithy_schema::ShapeId::from_parts(
          52  +
        "com.amazonaws.ssm#AutomationParameterMap$key",
          53  +
        "com.amazonaws.ssm",
          54  +
        "AutomationParameterMap",
          55  +
    ),
          56  +
    ::aws_smithy_schema::ShapeType::String,
          57  +
    "key",
          58  +
    0,
          59  +
);
          60  +
static FAILUREDETAILS_MEMBER_DETAILS_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          61  +
    ::aws_smithy_schema::ShapeId::from_parts(
          62  +
        "com.amazonaws.ssm#AutomationParameterMap$value",
          63  +
        "com.amazonaws.ssm",
          64  +
        "AutomationParameterMap",
          65  +
    ),
          66  +
    ::aws_smithy_schema::ShapeType::List,
          67  +
    "value",
          68  +
    1,
          69  +
)
          70  +
.with_list_member(&FAILUREDETAILS_MEMBER_DETAILS_VALUE_MEMBER);
          71  +
static FAILUREDETAILS_MEMBER_DETAILS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          72  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#FailureDetails$Details", "com.amazonaws.ssm", "FailureDetails"),
          73  +
    ::aws_smithy_schema::ShapeType::Map,
          74  +
    "Details",
          75  +
    2,
          76  +
)
          77  +
.with_map_members(&FAILUREDETAILS_MEMBER_DETAILS_KEY, &FAILUREDETAILS_MEMBER_DETAILS_VALUE);
          78  +
static FAILUREDETAILS_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          79  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#FailureDetails", "com.amazonaws.ssm", "FailureDetails"),
          80  +
    ::aws_smithy_schema::ShapeType::Structure,
          81  +
    &[
          82  +
        &FAILUREDETAILS_MEMBER_FAILURE_STAGE,
          83  +
        &FAILUREDETAILS_MEMBER_FAILURE_TYPE,
          84  +
        &FAILUREDETAILS_MEMBER_DETAILS,
          85  +
    ],
          86  +
);
          87  +
impl FailureDetails {
          88  +
    /// The schema for this shape.
          89  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &FAILUREDETAILS_SCHEMA;
          90  +
}
          91  +
impl ::aws_smithy_schema::serde::SerializableStruct for FailureDetails {
          92  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          93  +
    fn serialize_members(
          94  +
        &self,
          95  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          96  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          97  +
        if let Some(ref val) = self.failure_stage {
          98  +
            ser.write_string(&FAILUREDETAILS_MEMBER_FAILURE_STAGE, val)?;
          99  +
        }
         100  +
        if let Some(ref val) = self.failure_type {
         101  +
            ser.write_string(&FAILUREDETAILS_MEMBER_FAILURE_TYPE, val)?;
         102  +
        }
         103  +
        if let Some(ref val) = self.details {
         104  +
            ser.write_map(
         105  +
                &FAILUREDETAILS_MEMBER_DETAILS,
         106  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         107  +
                    for (key, value) in val {
         108  +
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
         109  +
         110  +
                        ser.write_list(
         111  +
                            &FAILUREDETAILS_MEMBER_DETAILS_VALUE,
         112  +
                            &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         113  +
                                for item in value {
         114  +
                                    ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         115  +
                                }
         116  +
                                Ok(())
         117  +
                            },
         118  +
                        )?;
         119  +
                    }
         120  +
                    Ok(())
         121  +
                },
         122  +
            )?;
         123  +
        }
         124  +
        Ok(())
         125  +
    }
         126  +
}
         127  +
impl FailureDetails {
         128  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         129  +
    pub fn deserialize(
         130  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         131  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         132  +
        #[allow(unused_variables, unused_mut)]
         133  +
        let mut builder = Self::builder();
         134  +
        #[allow(
         135  +
            unused_variables,
         136  +
            unreachable_code,
         137  +
            clippy::single_match,
         138  +
            clippy::match_single_binding,
         139  +
            clippy::diverging_sub_expression
         140  +
        )]
         141  +
        deserializer.read_struct(&FAILUREDETAILS_SCHEMA, &mut |member, deser| {
         142  +
            match member.member_index() {
         143  +
                Some(0) => {
         144  +
                    if deser.is_null() {
         145  +
                        deser.read_null()?;
         146  +
                    } else {
         147  +
                        builder.failure_stage = Some(deser.read_string(member)?);
         148  +
                    }
         149  +
                }
         150  +
                Some(1) => {
         151  +
                    if deser.is_null() {
         152  +
                        deser.read_null()?;
         153  +
                    } else {
         154  +
                        builder.failure_type = Some(deser.read_string(member)?);
         155  +
                    }
         156  +
                }
         157  +
                Some(2) => {
         158  +
                    if deser.is_null() {
         159  +
                        deser.read_null()?;
         160  +
                    } else {
         161  +
                        builder.details = Some({
         162  +
                            let mut container = std::collections::HashMap::new();
         163  +
                            deser.read_map(member, &mut |key, deser| {
         164  +
                                container.insert(key, {
         165  +
                                    let mut list = Vec::new();
         166  +
                                    deser.read_list(&FAILUREDETAILS_MEMBER_DETAILS_VALUE, &mut |deser| {
         167  +
                                        list.push(deser.read_string(&::aws_smithy_schema::prelude::STRING)?);
         168  +
                                        Ok(())
         169  +
                                    })?;
         170  +
                                    list
         171  +
                                });
         172  +
                                Ok(())
         173  +
                            })?;
         174  +
                            container
         175  +
                        });
         176  +
                    }
         177  +
                }
         178  +
                _ => {}
         179  +
            }
         180  +
            Ok(())
         181  +
        })?;
         182  +
        Ok(builder.build())
         183  +
    }
         184  +
}
         185  +
impl FailureDetails {
         186  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         187  +
    pub fn deserialize_with_response(
         188  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         189  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         190  +
        _status: u16,
         191  +
        _body: &[u8],
         192  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         193  +
        Self::deserialize(deserializer)
         194  +
    }
         195  +
}
         196  +
impl FailureDetails {
         197  +
    /// Creates a new builder-style object to manufacture [`FailureDetails`](crate::types::FailureDetails).
         198  +
    pub fn builder() -> crate::types::builders::FailureDetailsBuilder {
         199  +
        crate::types::builders::FailureDetailsBuilder::default()
         200  +
    }
         201  +
}
         202  +
         203  +
/// A builder for [`FailureDetails`](crate::types::FailureDetails).
         204  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         205  +
#[non_exhaustive]
         206  +
pub struct FailureDetailsBuilder {
         207  +
    pub(crate) failure_stage: ::std::option::Option<::std::string::String>,
         208  +
    pub(crate) failure_type: ::std::option::Option<::std::string::String>,
         209  +
    pub(crate) details: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
         210  +
}
         211  +
impl FailureDetailsBuilder {
         212  +
    /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
         213  +
    pub fn failure_stage(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         214  +
        self.failure_stage = ::std::option::Option::Some(input.into());
         215  +
        self
         216  +
    }
         217  +
    /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
         218  +
    pub fn set_failure_stage(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         219  +
        self.failure_stage = input;
         220  +
        self
         221  +
    }
         222  +
    /// <p>The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.</p>
         223  +
    pub fn get_failure_stage(&self) -> &::std::option::Option<::std::string::String> {
         224  +
        &self.failure_stage
         225  +
    }
         226  +
    /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
         227  +
    pub fn failure_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         228  +
        self.failure_type = ::std::option::Option::Some(input.into());
         229  +
        self
         230  +
    }
         231  +
    /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
         232  +
    pub fn set_failure_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         233  +
        self.failure_type = input;
         234  +
        self
         235  +
    }
         236  +
    /// <p>The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.</p>
         237  +
    pub fn get_failure_type(&self) -> &::std::option::Option<::std::string::String> {
         238  +
        &self.failure_type
         239  +
    }
         240  +
    /// Adds a key-value pair to `details`.
         241  +
    ///
         242  +
    /// To override the contents of this collection use [`set_details`](Self::set_details).
         243  +
    ///
         244  +
    /// <p>Detailed information about the Automation step failure.</p>
         245  +
    pub fn details(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
         246  +
        let mut hash_map = self.details.unwrap_or_default();
         247  +
        hash_map.insert(k.into(), v);
         248  +
        self.details = ::std::option::Option::Some(hash_map);
         249  +
        self
         250  +
    }
         251  +
    /// <p>Detailed information about the Automation step failure.</p>
         252  +
    pub fn set_details(
         253  +
        mut self,
         254  +
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
         255  +
    ) -> Self {
         256  +
        self.details = input;
         257  +
        self
         258  +
    }
         259  +
    /// <p>Detailed information about the Automation step failure.</p>
         260  +
    pub fn get_details(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
         261  +
        &self.details
         262  +
    }
         263  +
    /// Consumes the builder and constructs a [`FailureDetails`](crate::types::FailureDetails).
         264  +
    pub fn build(self) -> crate::types::FailureDetails {
         265  +
        crate::types::FailureDetails {
         266  +
            failure_stage: self.failure_stage,
         267  +
            failure_type: self.failure_type,
         268  +
            details: self.details,
         269  +
        }
         270  +
    }
         271  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_fault.rs

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

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_get_resource_policies_response_entry.rs

@@ -0,1 +0,214 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your Systems Manager resources. Currently, <code>OpsItemGroup</code> is the only resource that supports Systems Manager resource policies. The resource policy for <code>OpsItemGroup</code> enables Amazon Web Services accounts to view and interact with OpsCenter operational work items (OpsItems).</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct GetResourcePoliciesResponseEntry {
           7  +
    /// <p>A policy ID.</p>
           8  +
    pub policy_id: ::std::option::Option<::std::string::String>,
           9  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
          10  +
    pub policy_hash: ::std::option::Option<::std::string::String>,
          11  +
    /// <p>A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your Systems Manager resources. Currently, <code>OpsItemGroup</code> is the only resource that supports Systems Manager resource policies. The resource policy for <code>OpsItemGroup</code> enables Amazon Web Services accounts to view and interact with OpsCenter operational work items (OpsItems).</p>
          12  +
    pub policy: ::std::option::Option<::std::string::String>,
          13  +
}
          14  +
impl GetResourcePoliciesResponseEntry {
          15  +
    /// <p>A policy ID.</p>
          16  +
    pub fn policy_id(&self) -> ::std::option::Option<&str> {
          17  +
        self.policy_id.as_deref()
          18  +
    }
          19  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
          20  +
    pub fn policy_hash(&self) -> ::std::option::Option<&str> {
          21  +
        self.policy_hash.as_deref()
          22  +
    }
          23  +
    /// <p>A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your Systems Manager resources. Currently, <code>OpsItemGroup</code> is the only resource that supports Systems Manager resource policies. The resource policy for <code>OpsItemGroup</code> enables Amazon Web Services accounts to view and interact with OpsCenter operational work items (OpsItems).</p>
          24  +
    pub fn policy(&self) -> ::std::option::Option<&str> {
          25  +
        self.policy.as_deref()
          26  +
    }
          27  +
}
          28  +
static GETRESOURCEPOLICIESRESPONSEENTRY_MEMBER_POLICY_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          29  +
    ::aws_smithy_schema::ShapeId::from_parts(
          30  +
        "com.amazonaws.ssm#GetResourcePoliciesResponseEntry$PolicyId",
          31  +
        "com.amazonaws.ssm",
          32  +
        "GetResourcePoliciesResponseEntry",
          33  +
    ),
          34  +
    ::aws_smithy_schema::ShapeType::String,
          35  +
    "PolicyId",
          36  +
    0,
          37  +
);
          38  +
static GETRESOURCEPOLICIESRESPONSEENTRY_MEMBER_POLICY_HASH: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          39  +
    ::aws_smithy_schema::ShapeId::from_parts(
          40  +
        "com.amazonaws.ssm#GetResourcePoliciesResponseEntry$PolicyHash",
          41  +
        "com.amazonaws.ssm",
          42  +
        "GetResourcePoliciesResponseEntry",
          43  +
    ),
          44  +
    ::aws_smithy_schema::ShapeType::String,
          45  +
    "PolicyHash",
          46  +
    1,
          47  +
);
          48  +
static GETRESOURCEPOLICIESRESPONSEENTRY_MEMBER_POLICY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          49  +
    ::aws_smithy_schema::ShapeId::from_parts(
          50  +
        "com.amazonaws.ssm#GetResourcePoliciesResponseEntry$Policy",
          51  +
        "com.amazonaws.ssm",
          52  +
        "GetResourcePoliciesResponseEntry",
          53  +
    ),
          54  +
    ::aws_smithy_schema::ShapeType::String,
          55  +
    "Policy",
          56  +
    2,
          57  +
);
          58  +
static GETRESOURCEPOLICIESRESPONSEENTRY_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          59  +
    ::aws_smithy_schema::ShapeId::from_parts(
          60  +
        "com.amazonaws.ssm#GetResourcePoliciesResponseEntry",
          61  +
        "com.amazonaws.ssm",
          62  +
        "GetResourcePoliciesResponseEntry",
          63  +
    ),
          64  +
    ::aws_smithy_schema::ShapeType::Structure,
          65  +
    &[
          66  +
        &GETRESOURCEPOLICIESRESPONSEENTRY_MEMBER_POLICY_ID,
          67  +
        &GETRESOURCEPOLICIESRESPONSEENTRY_MEMBER_POLICY_HASH,
          68  +
        &GETRESOURCEPOLICIESRESPONSEENTRY_MEMBER_POLICY,
          69  +
    ],
          70  +
);
          71  +
impl GetResourcePoliciesResponseEntry {
          72  +
    /// The schema for this shape.
          73  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETRESOURCEPOLICIESRESPONSEENTRY_SCHEMA;
          74  +
}
          75  +
impl ::aws_smithy_schema::serde::SerializableStruct for GetResourcePoliciesResponseEntry {
          76  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          77  +
    fn serialize_members(
          78  +
        &self,
          79  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          80  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          81  +
        if let Some(ref val) = self.policy_id {
          82  +
            ser.write_string(&GETRESOURCEPOLICIESRESPONSEENTRY_MEMBER_POLICY_ID, val)?;
          83  +
        }
          84  +
        if let Some(ref val) = self.policy_hash {
          85  +
            ser.write_string(&GETRESOURCEPOLICIESRESPONSEENTRY_MEMBER_POLICY_HASH, val)?;
          86  +
        }
          87  +
        if let Some(ref val) = self.policy {
          88  +
            ser.write_string(&GETRESOURCEPOLICIESRESPONSEENTRY_MEMBER_POLICY, val)?;
          89  +
        }
          90  +
        Ok(())
          91  +
    }
          92  +
}
          93  +
impl GetResourcePoliciesResponseEntry {
          94  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          95  +
    pub fn deserialize(
          96  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          97  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          98  +
        #[allow(unused_variables, unused_mut)]
          99  +
        let mut builder = Self::builder();
         100  +
        #[allow(
         101  +
            unused_variables,
         102  +
            unreachable_code,
         103  +
            clippy::single_match,
         104  +
            clippy::match_single_binding,
         105  +
            clippy::diverging_sub_expression
         106  +
        )]
         107  +
        deserializer.read_struct(&GETRESOURCEPOLICIESRESPONSEENTRY_SCHEMA, &mut |member, deser| {
         108  +
            match member.member_index() {
         109  +
                Some(0) => {
         110  +
                    if deser.is_null() {
         111  +
                        deser.read_null()?;
         112  +
                    } else {
         113  +
                        builder.policy_id = Some(deser.read_string(member)?);
         114  +
                    }
         115  +
                }
         116  +
                Some(1) => {
         117  +
                    if deser.is_null() {
         118  +
                        deser.read_null()?;
         119  +
                    } else {
         120  +
                        builder.policy_hash = Some(deser.read_string(member)?);
         121  +
                    }
         122  +
                }
         123  +
                Some(2) => {
         124  +
                    if deser.is_null() {
         125  +
                        deser.read_null()?;
         126  +
                    } else {
         127  +
                        builder.policy = Some(deser.read_string(member)?);
         128  +
                    }
         129  +
                }
         130  +
                _ => {}
         131  +
            }
         132  +
            Ok(())
         133  +
        })?;
         134  +
        Ok(builder.build())
         135  +
    }
         136  +
}
         137  +
impl GetResourcePoliciesResponseEntry {
         138  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         139  +
    pub fn deserialize_with_response(
         140  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         141  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         142  +
        _status: u16,
         143  +
        _body: &[u8],
         144  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         145  +
        Self::deserialize(deserializer)
         146  +
    }
         147  +
}
         148  +
impl GetResourcePoliciesResponseEntry {
         149  +
    /// Creates a new builder-style object to manufacture [`GetResourcePoliciesResponseEntry`](crate::types::GetResourcePoliciesResponseEntry).
         150  +
    pub fn builder() -> crate::types::builders::GetResourcePoliciesResponseEntryBuilder {
         151  +
        crate::types::builders::GetResourcePoliciesResponseEntryBuilder::default()
         152  +
    }
         153  +
}
         154  +
         155  +
/// A builder for [`GetResourcePoliciesResponseEntry`](crate::types::GetResourcePoliciesResponseEntry).
         156  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         157  +
#[non_exhaustive]
         158  +
pub struct GetResourcePoliciesResponseEntryBuilder {
         159  +
    pub(crate) policy_id: ::std::option::Option<::std::string::String>,
         160  +
    pub(crate) policy_hash: ::std::option::Option<::std::string::String>,
         161  +
    pub(crate) policy: ::std::option::Option<::std::string::String>,
         162  +
}
         163  +
impl GetResourcePoliciesResponseEntryBuilder {
         164  +
    /// <p>A policy ID.</p>
         165  +
    pub fn policy_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         166  +
        self.policy_id = ::std::option::Option::Some(input.into());
         167  +
        self
         168  +
    }
         169  +
    /// <p>A policy ID.</p>
         170  +
    pub fn set_policy_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         171  +
        self.policy_id = input;
         172  +
        self
         173  +
    }
         174  +
    /// <p>A policy ID.</p>
         175  +
    pub fn get_policy_id(&self) -> &::std::option::Option<::std::string::String> {
         176  +
        &self.policy_id
         177  +
    }
         178  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
         179  +
    pub fn policy_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         180  +
        self.policy_hash = ::std::option::Option::Some(input.into());
         181  +
        self
         182  +
    }
         183  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
         184  +
    pub fn set_policy_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         185  +
        self.policy_hash = input;
         186  +
        self
         187  +
    }
         188  +
    /// <p>ID of the current policy version. The hash helps to prevent a situation where multiple users attempt to overwrite a policy. You must provide this hash when updating or deleting a policy.</p>
         189  +
    pub fn get_policy_hash(&self) -> &::std::option::Option<::std::string::String> {
         190  +
        &self.policy_hash
         191  +
    }
         192  +
    /// <p>A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your Systems Manager resources. Currently, <code>OpsItemGroup</code> is the only resource that supports Systems Manager resource policies. The resource policy for <code>OpsItemGroup</code> enables Amazon Web Services accounts to view and interact with OpsCenter operational work items (OpsItems).</p>
         193  +
    pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         194  +
        self.policy = ::std::option::Option::Some(input.into());
         195  +
        self
         196  +
    }
         197  +
    /// <p>A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your Systems Manager resources. Currently, <code>OpsItemGroup</code> is the only resource that supports Systems Manager resource policies. The resource policy for <code>OpsItemGroup</code> enables Amazon Web Services accounts to view and interact with OpsCenter operational work items (OpsItems).</p>
         198  +
    pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         199  +
        self.policy = input;
         200  +
        self
         201  +
    }
         202  +
    /// <p>A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your Systems Manager resources. Currently, <code>OpsItemGroup</code> is the only resource that supports Systems Manager resource policies. The resource policy for <code>OpsItemGroup</code> enables Amazon Web Services accounts to view and interact with OpsCenter operational work items (OpsItems).</p>
         203  +
    pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
         204  +
        &self.policy
         205  +
    }
         206  +
    /// Consumes the builder and constructs a [`GetResourcePoliciesResponseEntry`](crate::types::GetResourcePoliciesResponseEntry).
         207  +
    pub fn build(self) -> crate::types::GetResourcePoliciesResponseEntry {
         208  +
        crate::types::GetResourcePoliciesResponseEntry {
         209  +
            policy_id: self.policy_id,
         210  +
            policy_hash: self.policy_hash,
         211  +
            policy: self.policy,
         212  +
        }
         213  +
    }
         214  +
}