AWS SDK

AWS SDK

rev. 3388bf5e18f4269f2b46f39cdc814c5c39d413d0

Files changed:

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

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

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

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

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

@@ -0,1 +0,108 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// When writing a match expression against `ComplianceStatus`, 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 compliancestatus = unimplemented!();
          14  +
/// match compliancestatus {
          15  +
///     ComplianceStatus::Compliant => { /* ... */ },
          16  +
///     ComplianceStatus::NonCompliant => { /* ... */ },
          17  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          18  +
///     _ => { /* ... */ },
          19  +
/// }
          20  +
/// ```
          21  +
/// The above code demonstrates that when `compliancestatus` represents
          22  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          23  +
/// even though the enum does not contain a variant `ComplianceStatus::NewFeature`
          24  +
/// in the current version of SDK. The reason is that the variable `other`,
          25  +
/// created by the `@` operator, is bound to
          26  +
/// `ComplianceStatus::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 `ComplianceStatus::NewFeature` is defined.
          30  +
/// Specifically, when `compliancestatus` represents `NewFeature`,
          31  +
/// the execution path will hit the second last match arm as before by virtue of
          32  +
/// calling `as_str` on `ComplianceStatus::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  +
#[allow(missing_docs)] // documentation missing in model
          40  +
#[non_exhaustive]
          41  +
#[derive(
          42  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
          43  +
)]
          44  +
pub enum ComplianceStatus {
          45  +
    #[allow(missing_docs)] // documentation missing in model
          46  +
    Compliant,
          47  +
    #[allow(missing_docs)] // documentation missing in model
          48  +
    NonCompliant,
          49  +
    /// `Unknown` contains new variants that have been added since this code was generated.
          50  +
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
          51  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
          52  +
}
          53  +
impl ::std::convert::From<&str> for ComplianceStatus {
          54  +
    fn from(s: &str) -> Self {
          55  +
        match s {
          56  +
            "COMPLIANT" => ComplianceStatus::Compliant,
          57  +
            "NON_COMPLIANT" => ComplianceStatus::NonCompliant,
          58  +
            other => ComplianceStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          59  +
        }
          60  +
    }
          61  +
}
          62  +
impl ::std::str::FromStr for ComplianceStatus {
          63  +
    type Err = ::std::convert::Infallible;
          64  +
          65  +
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
          66  +
        ::std::result::Result::Ok(ComplianceStatus::from(s))
          67  +
    }
          68  +
}
          69  +
impl ComplianceStatus {
          70  +
    /// Returns the `&str` value of the enum member.
          71  +
    pub fn as_str(&self) -> &str {
          72  +
        match self {
          73  +
            ComplianceStatus::Compliant => "COMPLIANT",
          74  +
            ComplianceStatus::NonCompliant => "NON_COMPLIANT",
          75  +
            ComplianceStatus::Unknown(value) => value.as_str(),
          76  +
        }
          77  +
    }
          78  +
    /// Returns all the `&str` representations of the enum members.
          79  +
    pub const fn values() -> &'static [&'static str] {
          80  +
        &["COMPLIANT", "NON_COMPLIANT"]
          81  +
    }
          82  +
}
          83  +
impl ::std::convert::AsRef<str> for ComplianceStatus {
          84  +
    fn as_ref(&self) -> &str {
          85  +
        self.as_str()
          86  +
    }
          87  +
}
          88  +
impl ComplianceStatus {
          89  +
    /// Parses the enum value while disallowing unknown variants.
          90  +
    ///
          91  +
    /// Unknown variants will result in an error.
          92  +
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
          93  +
        match Self::from(value) {
          94  +
            #[allow(deprecated)]
          95  +
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
          96  +
            known => Ok(known),
          97  +
        }
          98  +
    }
          99  +
}
         100  +
impl ::std::fmt::Display for ComplianceStatus {
         101  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         102  +
        match self {
         103  +
            ComplianceStatus::Compliant => write!(f, "COMPLIANT"),
         104  +
            ComplianceStatus::NonCompliant => write!(f, "NON_COMPLIANT"),
         105  +
            ComplianceStatus::Unknown(value) => write!(f, "{value}"),
         106  +
        }
         107  +
    }
         108  +
}

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

@@ -0,1 +0,238 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>One or more filters. Use a filter to return a more specific list of results.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct ComplianceStringFilter {
           7  +
    /// <p>The name of the filter.</p>
           8  +
    pub key: ::std::option::Option<::std::string::String>,
           9  +
    /// <p>The value for which to search.</p>
          10  +
    pub values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          11  +
    /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
          12  +
    pub r#type: ::std::option::Option<crate::types::ComplianceQueryOperatorType>,
          13  +
}
          14  +
impl ComplianceStringFilter {
          15  +
    /// <p>The name of the filter.</p>
          16  +
    pub fn key(&self) -> ::std::option::Option<&str> {
          17  +
        self.key.as_deref()
          18  +
    }
          19  +
    /// <p>The value for which to search.</p>
          20  +
    ///
          21  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.values.is_none()`.
          22  +
    pub fn values(&self) -> &[::std::string::String] {
          23  +
        self.values.as_deref().unwrap_or_default()
          24  +
    }
          25  +
    /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
          26  +
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ComplianceQueryOperatorType> {
          27  +
        self.r#type.as_ref()
          28  +
    }
          29  +
}
          30  +
static COMPLIANCESTRINGFILTER_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          31  +
    ::aws_smithy_schema::ShapeId::from_parts(
          32  +
        "com.amazonaws.ssm#ComplianceStringFilter$Key",
          33  +
        "com.amazonaws.ssm",
          34  +
        "ComplianceStringFilter",
          35  +
    ),
          36  +
    ::aws_smithy_schema::ShapeType::String,
          37  +
    "Key",
          38  +
    0,
          39  +
);
          40  +
static COMPLIANCESTRINGFILTER_MEMBER_VALUES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          41  +
    ::aws_smithy_schema::ShapeId::from_parts(
          42  +
        "com.amazonaws.ssm#ComplianceStringFilterValueList$member",
          43  +
        "com.amazonaws.ssm",
          44  +
        "ComplianceStringFilterValueList",
          45  +
    ),
          46  +
    ::aws_smithy_schema::ShapeType::String,
          47  +
    "member",
          48  +
    0,
          49  +
)
          50  +
.with_xml_name("FilterValue");
          51  +
static COMPLIANCESTRINGFILTER_MEMBER_VALUES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          52  +
    ::aws_smithy_schema::ShapeId::from_parts(
          53  +
        "com.amazonaws.ssm#ComplianceStringFilter$Values",
          54  +
        "com.amazonaws.ssm",
          55  +
        "ComplianceStringFilter",
          56  +
    ),
          57  +
    ::aws_smithy_schema::ShapeType::List,
          58  +
    "Values",
          59  +
    1,
          60  +
)
          61  +
.with_list_member(&COMPLIANCESTRINGFILTER_MEMBER_VALUES_MEMBER);
          62  +
static COMPLIANCESTRINGFILTER_MEMBER_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          63  +
    ::aws_smithy_schema::ShapeId::from_parts(
          64  +
        "com.amazonaws.ssm#ComplianceStringFilter$Type",
          65  +
        "com.amazonaws.ssm",
          66  +
        "ComplianceStringFilter",
          67  +
    ),
          68  +
    ::aws_smithy_schema::ShapeType::String,
          69  +
    "Type",
          70  +
    2,
          71  +
);
          72  +
static COMPLIANCESTRINGFILTER_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          73  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ComplianceStringFilter", "com.amazonaws.ssm", "ComplianceStringFilter"),
          74  +
    ::aws_smithy_schema::ShapeType::Structure,
          75  +
    &[
          76  +
        &COMPLIANCESTRINGFILTER_MEMBER_KEY,
          77  +
        &COMPLIANCESTRINGFILTER_MEMBER_VALUES,
          78  +
        &COMPLIANCESTRINGFILTER_MEMBER_TYPE,
          79  +
    ],
          80  +
);
          81  +
impl ComplianceStringFilter {
          82  +
    /// The schema for this shape.
          83  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &COMPLIANCESTRINGFILTER_SCHEMA;
          84  +
}
          85  +
impl ::aws_smithy_schema::serde::SerializableStruct for ComplianceStringFilter {
          86  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          87  +
    fn serialize_members(
          88  +
        &self,
          89  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          90  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          91  +
        if let Some(ref val) = self.key {
          92  +
            ser.write_string(&COMPLIANCESTRINGFILTER_MEMBER_KEY, val)?;
          93  +
        }
          94  +
        if let Some(ref val) = self.values {
          95  +
            ser.write_list(
          96  +
                &COMPLIANCESTRINGFILTER_MEMBER_VALUES,
          97  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          98  +
                    for item in val {
          99  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         100  +
                    }
         101  +
                    Ok(())
         102  +
                },
         103  +
            )?;
         104  +
        }
         105  +
        if let Some(ref val) = self.r#type {
         106  +
            ser.write_string(&COMPLIANCESTRINGFILTER_MEMBER_TYPE, val.as_str())?;
         107  +
        }
         108  +
        Ok(())
         109  +
    }
         110  +
}
         111  +
impl ComplianceStringFilter {
         112  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         113  +
    pub fn deserialize(
         114  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         115  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         116  +
        #[allow(unused_variables, unused_mut)]
         117  +
        let mut builder = Self::builder();
         118  +
        #[allow(
         119  +
            unused_variables,
         120  +
            unreachable_code,
         121  +
            clippy::single_match,
         122  +
            clippy::match_single_binding,
         123  +
            clippy::diverging_sub_expression
         124  +
        )]
         125  +
        deserializer.read_struct(&COMPLIANCESTRINGFILTER_SCHEMA, &mut |member, deser| {
         126  +
            match member.member_index() {
         127  +
                Some(0) => {
         128  +
                    if deser.is_null() {
         129  +
                        deser.read_null()?;
         130  +
                    } else {
         131  +
                        builder.key = Some(deser.read_string(member)?);
         132  +
                    }
         133  +
                }
         134  +
                Some(1) => {
         135  +
                    if deser.is_null() {
         136  +
                        deser.read_null()?;
         137  +
                    } else {
         138  +
                        builder.values = Some(deser.read_string_list(member)?);
         139  +
                    }
         140  +
                }
         141  +
                Some(2) => {
         142  +
                    if deser.is_null() {
         143  +
                        deser.read_null()?;
         144  +
                    } else {
         145  +
                        builder.r#type = Some(crate::types::ComplianceQueryOperatorType::from(deser.read_string(member)?.as_str()));
         146  +
                    }
         147  +
                }
         148  +
                _ => {}
         149  +
            }
         150  +
            Ok(())
         151  +
        })?;
         152  +
        Ok(builder.build())
         153  +
    }
         154  +
}
         155  +
impl ComplianceStringFilter {
         156  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         157  +
    pub fn deserialize_with_response(
         158  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         159  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         160  +
        _status: u16,
         161  +
        _body: &[u8],
         162  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         163  +
        Self::deserialize(deserializer)
         164  +
    }
         165  +
}
         166  +
impl ComplianceStringFilter {
         167  +
    /// Creates a new builder-style object to manufacture [`ComplianceStringFilter`](crate::types::ComplianceStringFilter).
         168  +
    pub fn builder() -> crate::types::builders::ComplianceStringFilterBuilder {
         169  +
        crate::types::builders::ComplianceStringFilterBuilder::default()
         170  +
    }
         171  +
}
         172  +
         173  +
/// A builder for [`ComplianceStringFilter`](crate::types::ComplianceStringFilter).
         174  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         175  +
#[non_exhaustive]
         176  +
pub struct ComplianceStringFilterBuilder {
         177  +
    pub(crate) key: ::std::option::Option<::std::string::String>,
         178  +
    pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         179  +
    pub(crate) r#type: ::std::option::Option<crate::types::ComplianceQueryOperatorType>,
         180  +
}
         181  +
impl ComplianceStringFilterBuilder {
         182  +
    /// <p>The name of the filter.</p>
         183  +
    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         184  +
        self.key = ::std::option::Option::Some(input.into());
         185  +
        self
         186  +
    }
         187  +
    /// <p>The name of the filter.</p>
         188  +
    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         189  +
        self.key = input;
         190  +
        self
         191  +
    }
         192  +
    /// <p>The name of the filter.</p>
         193  +
    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
         194  +
        &self.key
         195  +
    }
         196  +
    /// Appends an item to `values`.
         197  +
    ///
         198  +
    /// To override the contents of this collection use [`set_values`](Self::set_values).
         199  +
    ///
         200  +
    /// <p>The value for which to search.</p>
         201  +
    pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         202  +
        let mut v = self.values.unwrap_or_default();
         203  +
        v.push(input.into());
         204  +
        self.values = ::std::option::Option::Some(v);
         205  +
        self
         206  +
    }
         207  +
    /// <p>The value for which to search.</p>
         208  +
    pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         209  +
        self.values = input;
         210  +
        self
         211  +
    }
         212  +
    /// <p>The value for which to search.</p>
         213  +
    pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         214  +
        &self.values
         215  +
    }
         216  +
    /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
         217  +
    pub fn r#type(mut self, input: crate::types::ComplianceQueryOperatorType) -> Self {
         218  +
        self.r#type = ::std::option::Option::Some(input);
         219  +
        self
         220  +
    }
         221  +
    /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
         222  +
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ComplianceQueryOperatorType>) -> Self {
         223  +
        self.r#type = input;
         224  +
        self
         225  +
    }
         226  +
    /// <p>The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.</p>
         227  +
    pub fn get_type(&self) -> &::std::option::Option<crate::types::ComplianceQueryOperatorType> {
         228  +
        &self.r#type
         229  +
    }
         230  +
    /// Consumes the builder and constructs a [`ComplianceStringFilter`](crate::types::ComplianceStringFilter).
         231  +
    pub fn build(self) -> crate::types::ComplianceStringFilter {
         232  +
        crate::types::ComplianceStringFilter {
         233  +
            key: self.key,
         234  +
            values: self.values,
         235  +
            r#type: self.r#type,
         236  +
        }
         237  +
    }
         238  +
}

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

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

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

@@ -0,1 +0,108 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// When writing a match expression against `ComplianceUploadType`, 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 complianceuploadtype = unimplemented!();
          14  +
/// match complianceuploadtype {
          15  +
///     ComplianceUploadType::Complete => { /* ... */ },
          16  +
///     ComplianceUploadType::Partial => { /* ... */ },
          17  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          18  +
///     _ => { /* ... */ },
          19  +
/// }
          20  +
/// ```
          21  +
/// The above code demonstrates that when `complianceuploadtype` represents
          22  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          23  +
/// even though the enum does not contain a variant `ComplianceUploadType::NewFeature`
          24  +
/// in the current version of SDK. The reason is that the variable `other`,
          25  +
/// created by the `@` operator, is bound to
          26  +
/// `ComplianceUploadType::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 `ComplianceUploadType::NewFeature` is defined.
          30  +
/// Specifically, when `complianceuploadtype` represents `NewFeature`,
          31  +
/// the execution path will hit the second last match arm as before by virtue of
          32  +
/// calling `as_str` on `ComplianceUploadType::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  +
#[allow(missing_docs)] // documentation missing in model
          40  +
#[non_exhaustive]
          41  +
#[derive(
          42  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
          43  +
)]
          44  +
pub enum ComplianceUploadType {
          45  +
    #[allow(missing_docs)] // documentation missing in model
          46  +
    Complete,
          47  +
    #[allow(missing_docs)] // documentation missing in model
          48  +
    Partial,
          49  +
    /// `Unknown` contains new variants that have been added since this code was generated.
          50  +
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
          51  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
          52  +
}
          53  +
impl ::std::convert::From<&str> for ComplianceUploadType {
          54  +
    fn from(s: &str) -> Self {
          55  +
        match s {
          56  +
            "COMPLETE" => ComplianceUploadType::Complete,
          57  +
            "PARTIAL" => ComplianceUploadType::Partial,
          58  +
            other => ComplianceUploadType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          59  +
        }
          60  +
    }
          61  +
}
          62  +
impl ::std::str::FromStr for ComplianceUploadType {
          63  +
    type Err = ::std::convert::Infallible;
          64  +
          65  +
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
          66  +
        ::std::result::Result::Ok(ComplianceUploadType::from(s))
          67  +
    }
          68  +
}
          69  +
impl ComplianceUploadType {
          70  +
    /// Returns the `&str` value of the enum member.
          71  +
    pub fn as_str(&self) -> &str {
          72  +
        match self {
          73  +
            ComplianceUploadType::Complete => "COMPLETE",
          74  +
            ComplianceUploadType::Partial => "PARTIAL",
          75  +
            ComplianceUploadType::Unknown(value) => value.as_str(),
          76  +
        }
          77  +
    }
          78  +
    /// Returns all the `&str` representations of the enum members.
          79  +
    pub const fn values() -> &'static [&'static str] {
          80  +
        &["COMPLETE", "PARTIAL"]
          81  +
    }
          82  +
}
          83  +
impl ::std::convert::AsRef<str> for ComplianceUploadType {
          84  +
    fn as_ref(&self) -> &str {
          85  +
        self.as_str()
          86  +
    }
          87  +
}
          88  +
impl ComplianceUploadType {
          89  +
    /// Parses the enum value while disallowing unknown variants.
          90  +
    ///
          91  +
    /// Unknown variants will result in an error.
          92  +
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
          93  +
        match Self::from(value) {
          94  +
            #[allow(deprecated)]
          95  +
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
          96  +
            known => Ok(known),
          97  +
        }
          98  +
    }
          99  +
}
         100  +
impl ::std::fmt::Display for ComplianceUploadType {
         101  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         102  +
        match self {
         103  +
            ComplianceUploadType::Complete => write!(f, "COMPLETE"),
         104  +
            ComplianceUploadType::Partial => write!(f, "PARTIAL"),
         105  +
            ComplianceUploadType::Unknown(value) => write!(f, "{value}"),
         106  +
        }
         107  +
    }
         108  +
}

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

@@ -0,1 +0,161 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>A summary of resources that are compliant. The summary is organized according to the resource count for each compliance type.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct CompliantSummary {
           7  +
    /// <p>The total number of resources that are compliant.</p>
           8  +
    pub compliant_count: i32,
           9  +
    /// <p>A summary of the compliance severity by compliance type.</p>
          10  +
    pub severity_summary: ::std::option::Option<crate::types::SeveritySummary>,
          11  +
}
          12  +
impl CompliantSummary {
          13  +
    /// <p>The total number of resources that are compliant.</p>
          14  +
    pub fn compliant_count(&self) -> i32 {
          15  +
        self.compliant_count
          16  +
    }
          17  +
    /// <p>A summary of the compliance severity by compliance type.</p>
          18  +
    pub fn severity_summary(&self) -> ::std::option::Option<&crate::types::SeveritySummary> {
          19  +
        self.severity_summary.as_ref()
          20  +
    }
          21  +
}
          22  +
static COMPLIANTSUMMARY_MEMBER_COMPLIANT_COUNT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          23  +
    ::aws_smithy_schema::ShapeId::from_parts(
          24  +
        "com.amazonaws.ssm#CompliantSummary$CompliantCount",
          25  +
        "com.amazonaws.ssm",
          26  +
        "CompliantSummary",
          27  +
    ),
          28  +
    ::aws_smithy_schema::ShapeType::Integer,
          29  +
    "CompliantCount",
          30  +
    0,
          31  +
);
          32  +
static COMPLIANTSUMMARY_MEMBER_SEVERITY_SUMMARY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          33  +
    ::aws_smithy_schema::ShapeId::from_parts(
          34  +
        "com.amazonaws.ssm#CompliantSummary$SeveritySummary",
          35  +
        "com.amazonaws.ssm",
          36  +
        "CompliantSummary",
          37  +
    ),
          38  +
    ::aws_smithy_schema::ShapeType::Structure,
          39  +
    "SeveritySummary",
          40  +
    1,
          41  +
);
          42  +
static COMPLIANTSUMMARY_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          43  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#CompliantSummary", "com.amazonaws.ssm", "CompliantSummary"),
          44  +
    ::aws_smithy_schema::ShapeType::Structure,
          45  +
    &[&COMPLIANTSUMMARY_MEMBER_COMPLIANT_COUNT, &COMPLIANTSUMMARY_MEMBER_SEVERITY_SUMMARY],
          46  +
);
          47  +
impl CompliantSummary {
          48  +
    /// The schema for this shape.
          49  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &COMPLIANTSUMMARY_SCHEMA;
          50  +
}
          51  +
impl ::aws_smithy_schema::serde::SerializableStruct for CompliantSummary {
          52  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          53  +
    fn serialize_members(
          54  +
        &self,
          55  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          56  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          57  +
        {
          58  +
            let val = &self.compliant_count;
          59  +
            ser.write_integer(&COMPLIANTSUMMARY_MEMBER_COMPLIANT_COUNT, *val)?;
          60  +
        }
          61  +
        if let Some(ref val) = self.severity_summary {
          62  +
            ser.write_struct(&COMPLIANTSUMMARY_MEMBER_SEVERITY_SUMMARY, val)?;
          63  +
        }
          64  +
        Ok(())
          65  +
    }
          66  +
}
          67  +
impl CompliantSummary {
          68  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          69  +
    pub fn deserialize(
          70  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          71  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          72  +
        #[allow(unused_variables, unused_mut)]
          73  +
        let mut builder = Self::builder();
          74  +
        #[allow(
          75  +
            unused_variables,
          76  +
            unreachable_code,
          77  +
            clippy::single_match,
          78  +
            clippy::match_single_binding,
          79  +
            clippy::diverging_sub_expression
          80  +
        )]
          81  +
        deserializer.read_struct(&COMPLIANTSUMMARY_SCHEMA, &mut |member, deser| {
          82  +
            match member.member_index() {
          83  +
                Some(0) => {
          84  +
                    builder.compliant_count = Some(deser.read_integer(member)?);
          85  +
                }
          86  +
                Some(1) => {
          87  +
                    if deser.is_null() {
          88  +
                        deser.read_null()?;
          89  +
                    } else {
          90  +
                        builder.severity_summary = Some(crate::types::SeveritySummary::deserialize(deser)?);
          91  +
                    }
          92  +
                }
          93  +
                _ => {}
          94  +
            }
          95  +
            Ok(())
          96  +
        })?;
          97  +
        Ok(builder.build())
          98  +
    }
          99  +
}
         100  +
impl CompliantSummary {
         101  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         102  +
    pub fn deserialize_with_response(
         103  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         104  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         105  +
        _status: u16,
         106  +
        _body: &[u8],
         107  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         108  +
        Self::deserialize(deserializer)
         109  +
    }
         110  +
}
         111  +
impl CompliantSummary {
         112  +
    /// Creates a new builder-style object to manufacture [`CompliantSummary`](crate::types::CompliantSummary).
         113  +
    pub fn builder() -> crate::types::builders::CompliantSummaryBuilder {
         114  +
        crate::types::builders::CompliantSummaryBuilder::default()
         115  +
    }
         116  +
}
         117  +
         118  +
/// A builder for [`CompliantSummary`](crate::types::CompliantSummary).
         119  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         120  +
#[non_exhaustive]
         121  +
pub struct CompliantSummaryBuilder {
         122  +
    pub(crate) compliant_count: ::std::option::Option<i32>,
         123  +
    pub(crate) severity_summary: ::std::option::Option<crate::types::SeveritySummary>,
         124  +
}
         125  +
impl CompliantSummaryBuilder {
         126  +
    /// <p>The total number of resources that are compliant.</p>
         127  +
    pub fn compliant_count(mut self, input: i32) -> Self {
         128  +
        self.compliant_count = ::std::option::Option::Some(input);
         129  +
        self
         130  +
    }
         131  +
    /// <p>The total number of resources that are compliant.</p>
         132  +
    pub fn set_compliant_count(mut self, input: ::std::option::Option<i32>) -> Self {
         133  +
        self.compliant_count = input;
         134  +
        self
         135  +
    }
         136  +
    /// <p>The total number of resources that are compliant.</p>
         137  +
    pub fn get_compliant_count(&self) -> &::std::option::Option<i32> {
         138  +
        &self.compliant_count
         139  +
    }
         140  +
    /// <p>A summary of the compliance severity by compliance type.</p>
         141  +
    pub fn severity_summary(mut self, input: crate::types::SeveritySummary) -> Self {
         142  +
        self.severity_summary = ::std::option::Option::Some(input);
         143  +
        self
         144  +
    }
         145  +
    /// <p>A summary of the compliance severity by compliance type.</p>
         146  +
    pub fn set_severity_summary(mut self, input: ::std::option::Option<crate::types::SeveritySummary>) -> Self {
         147  +
        self.severity_summary = input;
         148  +
        self
         149  +
    }
         150  +
    /// <p>A summary of the compliance severity by compliance type.</p>
         151  +
    pub fn get_severity_summary(&self) -> &::std::option::Option<crate::types::SeveritySummary> {
         152  +
        &self.severity_summary
         153  +
    }
         154  +
    /// Consumes the builder and constructs a [`CompliantSummary`](crate::types::CompliantSummary).
         155  +
    pub fn build(self) -> crate::types::CompliantSummary {
         156  +
        crate::types::CompliantSummary {
         157  +
            compliant_count: self.compliant_count.unwrap_or_default(),
         158  +
            severity_summary: self.severity_summary,
         159  +
        }
         160  +
    }
         161  +
}