AWS SDK

AWS SDK

rev. bbca34fa2eddb4be623fbbc6b6df1a2401de0029 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_patch_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 `PatchComplianceStatus`, 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 patchcompliancestatus = unimplemented!();
          14  +
/// match patchcompliancestatus {
          15  +
///     PatchComplianceStatus::Compliant => { /* ... */ },
          16  +
///     PatchComplianceStatus::NonCompliant => { /* ... */ },
          17  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          18  +
///     _ => { /* ... */ },
          19  +
/// }
          20  +
/// ```
          21  +
/// The above code demonstrates that when `patchcompliancestatus` represents
          22  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          23  +
/// even though the enum does not contain a variant `PatchComplianceStatus::NewFeature`
          24  +
/// in the current version of SDK. The reason is that the variable `other`,
          25  +
/// created by the `@` operator, is bound to
          26  +
/// `PatchComplianceStatus::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 `PatchComplianceStatus::NewFeature` is defined.
          30  +
/// Specifically, when `patchcompliancestatus` represents `NewFeature`,
          31  +
/// the execution path will hit the second last match arm as before by virtue of
          32  +
/// calling `as_str` on `PatchComplianceStatus::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 PatchComplianceStatus {
          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 PatchComplianceStatus {
          54  +
    fn from(s: &str) -> Self {
          55  +
        match s {
          56  +
            "COMPLIANT" => PatchComplianceStatus::Compliant,
          57  +
            "NON_COMPLIANT" => PatchComplianceStatus::NonCompliant,
          58  +
            other => PatchComplianceStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          59  +
        }
          60  +
    }
          61  +
}
          62  +
impl ::std::str::FromStr for PatchComplianceStatus {
          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(PatchComplianceStatus::from(s))
          67  +
    }
          68  +
}
          69  +
impl PatchComplianceStatus {
          70  +
    /// Returns the `&str` value of the enum member.
          71  +
    pub fn as_str(&self) -> &str {
          72  +
        match self {
          73  +
            PatchComplianceStatus::Compliant => "COMPLIANT",
          74  +
            PatchComplianceStatus::NonCompliant => "NON_COMPLIANT",
          75  +
            PatchComplianceStatus::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 PatchComplianceStatus {
          84  +
    fn as_ref(&self) -> &str {
          85  +
        self.as_str()
          86  +
    }
          87  +
}
          88  +
impl PatchComplianceStatus {
          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 PatchComplianceStatus {
         101  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         102  +
        match self {
         103  +
            PatchComplianceStatus::Compliant => write!(f, "COMPLIANT"),
         104  +
            PatchComplianceStatus::NonCompliant => write!(f, "NON_COMPLIANT"),
         105  +
            PatchComplianceStatus::Unknown(value) => write!(f, "{value}"),
         106  +
        }
         107  +
    }
         108  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_patch_deployment_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 `PatchDeploymentStatus`, 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 patchdeploymentstatus = unimplemented!();
          14  +
/// match patchdeploymentstatus {
          15  +
///     PatchDeploymentStatus::Approved => { /* ... */ },
          16  +
///     PatchDeploymentStatus::ExplicitApproved => { /* ... */ },
          17  +
///     PatchDeploymentStatus::ExplicitRejected => { /* ... */ },
          18  +
///     PatchDeploymentStatus::PendingApproval => { /* ... */ },
          19  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          20  +
///     _ => { /* ... */ },
          21  +
/// }
          22  +
/// ```
          23  +
/// The above code demonstrates that when `patchdeploymentstatus` represents
          24  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          25  +
/// even though the enum does not contain a variant `PatchDeploymentStatus::NewFeature`
          26  +
/// in the current version of SDK. The reason is that the variable `other`,
          27  +
/// created by the `@` operator, is bound to
          28  +
/// `PatchDeploymentStatus::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 `PatchDeploymentStatus::NewFeature` is defined.
          32  +
/// Specifically, when `patchdeploymentstatus` represents `NewFeature`,
          33  +
/// the execution path will hit the second last match arm as before by virtue of
          34  +
/// calling `as_str` on `PatchDeploymentStatus::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 PatchDeploymentStatus {
          47  +
    #[allow(missing_docs)] // documentation missing in model
          48  +
    Approved,
          49  +
    #[allow(missing_docs)] // documentation missing in model
          50  +
    ExplicitApproved,
          51  +
    #[allow(missing_docs)] // documentation missing in model
          52  +
    ExplicitRejected,
          53  +
    #[allow(missing_docs)] // documentation missing in model
          54  +
    PendingApproval,
          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 PatchDeploymentStatus {
          60  +
    fn from(s: &str) -> Self {
          61  +
        match s {
          62  +
            "APPROVED" => PatchDeploymentStatus::Approved,
          63  +
            "EXPLICIT_APPROVED" => PatchDeploymentStatus::ExplicitApproved,
          64  +
            "EXPLICIT_REJECTED" => PatchDeploymentStatus::ExplicitRejected,
          65  +
            "PENDING_APPROVAL" => PatchDeploymentStatus::PendingApproval,
          66  +
            other => PatchDeploymentStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          67  +
        }
          68  +
    }
          69  +
}
          70  +
impl ::std::str::FromStr for PatchDeploymentStatus {
          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(PatchDeploymentStatus::from(s))
          75  +
    }
          76  +
}
          77  +
impl PatchDeploymentStatus {
          78  +
    /// Returns the `&str` value of the enum member.
          79  +
    pub fn as_str(&self) -> &str {
          80  +
        match self {
          81  +
            PatchDeploymentStatus::Approved => "APPROVED",
          82  +
            PatchDeploymentStatus::ExplicitApproved => "EXPLICIT_APPROVED",
          83  +
            PatchDeploymentStatus::ExplicitRejected => "EXPLICIT_REJECTED",
          84  +
            PatchDeploymentStatus::PendingApproval => "PENDING_APPROVAL",
          85  +
            PatchDeploymentStatus::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  +
        &["APPROVED", "EXPLICIT_APPROVED", "EXPLICIT_REJECTED", "PENDING_APPROVAL"]
          91  +
    }
          92  +
}
          93  +
impl ::std::convert::AsRef<str> for PatchDeploymentStatus {
          94  +
    fn as_ref(&self) -> &str {
          95  +
        self.as_str()
          96  +
    }
          97  +
}
          98  +
impl PatchDeploymentStatus {
          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 PatchDeploymentStatus {
         111  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         112  +
        match self {
         113  +
            PatchDeploymentStatus::Approved => write!(f, "APPROVED"),
         114  +
            PatchDeploymentStatus::ExplicitApproved => write!(f, "EXPLICIT_APPROVED"),
         115  +
            PatchDeploymentStatus::ExplicitRejected => write!(f, "EXPLICIT_REJECTED"),
         116  +
            PatchDeploymentStatus::PendingApproval => write!(f, "PENDING_APPROVAL"),
         117  +
            PatchDeploymentStatus::Unknown(value) => write!(f, "{value}"),
         118  +
        }
         119  +
    }
         120  +
}

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

@@ -0,1 +0,205 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Defines which patches should be included in a patch baseline.</p>
           4  +
/// <p>A patch filter consists of a key and a set of values. The filter key is a patch property. For example, the available filter keys for <code>WINDOWS</code> are <code>PATCH_SET</code>, <code>PRODUCT</code>, <code>PRODUCT_FAMILY</code>, <code>CLASSIFICATION</code>, and <code>MSRC_SEVERITY</code>.</p>
           5  +
/// <p>The filter values define a matching criterion for the patch property indicated by the key. For example, if the filter key is <code>PRODUCT</code> and the filter values are <code>\["Office 2013", "Office 2016"\]</code>, then the filter accepts all patches where product name is either "Office 2013" or "Office 2016". The filter values can be exact values for the patch property given as a key, or a wildcard (*), which matches all values.</p>
           6  +
/// <p>You can view lists of valid values for the patch properties by running the <code>DescribePatchProperties</code> command. For information about which patch properties can be used with each major operating system, see <code>DescribePatchProperties</code>.</p>
           7  +
#[non_exhaustive]
           8  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           9  +
pub struct PatchFilter {
          10  +
    /// <p>The key for the filter.</p>
          11  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid keys for each operating system type.</p>
          12  +
    pub key: crate::types::PatchFilterKey,
          13  +
    /// <p>The value for the filter key.</p>
          14  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid values for each key based on operating system type.</p>
          15  +
    pub values: ::std::vec::Vec<::std::string::String>,
          16  +
}
          17  +
impl PatchFilter {
          18  +
    /// <p>The key for the filter.</p>
          19  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid keys for each operating system type.</p>
          20  +
    pub fn key(&self) -> &crate::types::PatchFilterKey {
          21  +
        &self.key
          22  +
    }
          23  +
    /// <p>The value for the filter key.</p>
          24  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid values for each key based on operating system type.</p>
          25  +
    pub fn values(&self) -> &[::std::string::String] {
          26  +
        use std::ops::Deref;
          27  +
        self.values.deref()
          28  +
    }
          29  +
}
          30  +
static PATCHFILTER_MEMBER_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          31  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchFilter$Key", "com.amazonaws.ssm", "PatchFilter"),
          32  +
    ::aws_smithy_schema::ShapeType::String,
          33  +
    "Key",
          34  +
    0,
          35  +
);
          36  +
static PATCHFILTER_MEMBER_VALUES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          37  +
    ::aws_smithy_schema::ShapeId::from_parts(
          38  +
        "com.amazonaws.ssm#PatchFilterValueList$member",
          39  +
        "com.amazonaws.ssm",
          40  +
        "PatchFilterValueList",
          41  +
    ),
          42  +
    ::aws_smithy_schema::ShapeType::String,
          43  +
    "member",
          44  +
    0,
          45  +
);
          46  +
static PATCHFILTER_MEMBER_VALUES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          47  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchFilter$Values", "com.amazonaws.ssm", "PatchFilter"),
          48  +
    ::aws_smithy_schema::ShapeType::List,
          49  +
    "Values",
          50  +
    1,
          51  +
)
          52  +
.with_list_member(&PATCHFILTER_MEMBER_VALUES_MEMBER);
          53  +
static PATCHFILTER_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          54  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchFilter", "com.amazonaws.ssm", "PatchFilter"),
          55  +
    ::aws_smithy_schema::ShapeType::Structure,
          56  +
    &[&PATCHFILTER_MEMBER_KEY, &PATCHFILTER_MEMBER_VALUES],
          57  +
);
          58  +
impl PatchFilter {
          59  +
    /// The schema for this shape.
          60  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PATCHFILTER_SCHEMA;
          61  +
}
          62  +
impl ::aws_smithy_schema::serde::SerializableStruct for PatchFilter {
          63  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          64  +
    fn serialize_members(
          65  +
        &self,
          66  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          67  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          68  +
        {
          69  +
            let val = &self.key;
          70  +
            ser.write_string(&PATCHFILTER_MEMBER_KEY, val.as_str())?;
          71  +
        }
          72  +
        {
          73  +
            let val = &self.values;
          74  +
          75  +
            ser.write_list(
          76  +
                &PATCHFILTER_MEMBER_VALUES,
          77  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          78  +
                    for item in val {
          79  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
          80  +
                    }
          81  +
                    Ok(())
          82  +
                },
          83  +
            )?;
          84  +
        }
          85  +
        Ok(())
          86  +
    }
          87  +
}
          88  +
impl PatchFilter {
          89  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          90  +
    pub fn deserialize(
          91  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          92  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          93  +
        #[allow(unused_variables, unused_mut)]
          94  +
        let mut builder = Self::builder();
          95  +
        #[allow(
          96  +
            unused_variables,
          97  +
            unreachable_code,
          98  +
            clippy::single_match,
          99  +
            clippy::match_single_binding,
         100  +
            clippy::diverging_sub_expression
         101  +
        )]
         102  +
        deserializer.read_struct(&PATCHFILTER_SCHEMA, &mut |member, deser| {
         103  +
            match member.member_index() {
         104  +
                Some(0) => {
         105  +
                    builder.key = Some(crate::types::PatchFilterKey::from(deser.read_string(member)?.as_str()));
         106  +
                }
         107  +
                Some(1) => {
         108  +
                    builder.values = Some(deser.read_string_list(member)?);
         109  +
                }
         110  +
                _ => {}
         111  +
            }
         112  +
            Ok(())
         113  +
        })?;
         114  +
        builder.values = builder.values.or(Some(Vec::new()));
         115  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         116  +
    }
         117  +
}
         118  +
impl PatchFilter {
         119  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         120  +
    pub fn deserialize_with_response(
         121  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         122  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         123  +
        _status: u16,
         124  +
        _body: &[u8],
         125  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         126  +
        Self::deserialize(deserializer)
         127  +
    }
         128  +
}
         129  +
impl PatchFilter {
         130  +
    /// Creates a new builder-style object to manufacture [`PatchFilter`](crate::types::PatchFilter).
         131  +
    pub fn builder() -> crate::types::builders::PatchFilterBuilder {
         132  +
        crate::types::builders::PatchFilterBuilder::default()
         133  +
    }
         134  +
}
         135  +
         136  +
/// A builder for [`PatchFilter`](crate::types::PatchFilter).
         137  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         138  +
#[non_exhaustive]
         139  +
pub struct PatchFilterBuilder {
         140  +
    pub(crate) key: ::std::option::Option<crate::types::PatchFilterKey>,
         141  +
    pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         142  +
}
         143  +
impl PatchFilterBuilder {
         144  +
    /// <p>The key for the filter.</p>
         145  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid keys for each operating system type.</p>
         146  +
    /// This field is required.
         147  +
    pub fn key(mut self, input: crate::types::PatchFilterKey) -> Self {
         148  +
        self.key = ::std::option::Option::Some(input);
         149  +
        self
         150  +
    }
         151  +
    /// <p>The key for the filter.</p>
         152  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid keys for each operating system type.</p>
         153  +
    pub fn set_key(mut self, input: ::std::option::Option<crate::types::PatchFilterKey>) -> Self {
         154  +
        self.key = input;
         155  +
        self
         156  +
    }
         157  +
    /// <p>The key for the filter.</p>
         158  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid keys for each operating system type.</p>
         159  +
    pub fn get_key(&self) -> &::std::option::Option<crate::types::PatchFilterKey> {
         160  +
        &self.key
         161  +
    }
         162  +
    /// Appends an item to `values`.
         163  +
    ///
         164  +
    /// To override the contents of this collection use [`set_values`](Self::set_values).
         165  +
    ///
         166  +
    /// <p>The value for the filter key.</p>
         167  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid values for each key based on operating system type.</p>
         168  +
    pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         169  +
        let mut v = self.values.unwrap_or_default();
         170  +
        v.push(input.into());
         171  +
        self.values = ::std::option::Option::Some(v);
         172  +
        self
         173  +
    }
         174  +
    /// <p>The value for the filter key.</p>
         175  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid values for each key based on operating system type.</p>
         176  +
    pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         177  +
        self.values = input;
         178  +
        self
         179  +
    }
         180  +
    /// <p>The value for the filter key.</p>
         181  +
    /// <p>Run the <code>DescribePatchProperties</code> command to view lists of valid values for each key based on operating system type.</p>
         182  +
    pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         183  +
        &self.values
         184  +
    }
         185  +
    /// Consumes the builder and constructs a [`PatchFilter`](crate::types::PatchFilter).
         186  +
    /// This method will fail if any of the following fields are not set:
         187  +
    /// - [`key`](crate::types::builders::PatchFilterBuilder::key)
         188  +
    /// - [`values`](crate::types::builders::PatchFilterBuilder::values)
         189  +
    pub fn build(self) -> ::std::result::Result<crate::types::PatchFilter, ::aws_smithy_types::error::operation::BuildError> {
         190  +
        ::std::result::Result::Ok(crate::types::PatchFilter {
         191  +
            key: self.key.ok_or_else(|| {
         192  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         193  +
                    "key",
         194  +
                    "key was not specified but it is required when building PatchFilter",
         195  +
                )
         196  +
            })?,
         197  +
            values: self.values.ok_or_else(|| {
         198  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         199  +
                    "values",
         200  +
                    "values was not specified but it is required when building PatchFilter",
         201  +
                )
         202  +
            })?,
         203  +
        })
         204  +
    }
         205  +
}

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

@@ -0,1 +0,153 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>A set of patch filters, typically used for approval rules.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct PatchFilterGroup {
           7  +
    /// <p>The set of patch filters that make up the group.</p>
           8  +
    pub patch_filters: ::std::vec::Vec<crate::types::PatchFilter>,
           9  +
}
          10  +
impl PatchFilterGroup {
          11  +
    /// <p>The set of patch filters that make up the group.</p>
          12  +
    pub fn patch_filters(&self) -> &[crate::types::PatchFilter] {
          13  +
        use std::ops::Deref;
          14  +
        self.patch_filters.deref()
          15  +
    }
          16  +
}
          17  +
static PATCHFILTERGROUP_MEMBER_PATCH_FILTERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          18  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchFilterList$member", "com.amazonaws.ssm", "PatchFilterList"),
          19  +
    ::aws_smithy_schema::ShapeType::Structure,
          20  +
    "member",
          21  +
    0,
          22  +
);
          23  +
static PATCHFILTERGROUP_MEMBER_PATCH_FILTERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          24  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchFilterGroup$PatchFilters", "com.amazonaws.ssm", "PatchFilterGroup"),
          25  +
    ::aws_smithy_schema::ShapeType::List,
          26  +
    "PatchFilters",
          27  +
    0,
          28  +
)
          29  +
.with_list_member(&PATCHFILTERGROUP_MEMBER_PATCH_FILTERS_MEMBER);
          30  +
static PATCHFILTERGROUP_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          31  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#PatchFilterGroup", "com.amazonaws.ssm", "PatchFilterGroup"),
          32  +
    ::aws_smithy_schema::ShapeType::Structure,
          33  +
    &[&PATCHFILTERGROUP_MEMBER_PATCH_FILTERS],
          34  +
);
          35  +
impl PatchFilterGroup {
          36  +
    /// The schema for this shape.
          37  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PATCHFILTERGROUP_SCHEMA;
          38  +
}
          39  +
impl ::aws_smithy_schema::serde::SerializableStruct for PatchFilterGroup {
          40  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          41  +
    fn serialize_members(
          42  +
        &self,
          43  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          44  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          45  +
        {
          46  +
            let val = &self.patch_filters;
          47  +
          48  +
            ser.write_list(
          49  +
                &PATCHFILTERGROUP_MEMBER_PATCH_FILTERS,
          50  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          51  +
                    for item in val {
          52  +
                        ser.write_struct(crate::types::PatchFilter::SCHEMA, item)?;
          53  +
                    }
          54  +
                    Ok(())
          55  +
                },
          56  +
            )?;
          57  +
        }
          58  +
        Ok(())
          59  +
    }
          60  +
}
          61  +
impl PatchFilterGroup {
          62  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          63  +
    pub fn deserialize(
          64  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          65  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          66  +
        #[allow(unused_variables, unused_mut)]
          67  +
        let mut builder = Self::builder();
          68  +
        #[allow(
          69  +
            unused_variables,
          70  +
            unreachable_code,
          71  +
            clippy::single_match,
          72  +
            clippy::match_single_binding,
          73  +
            clippy::diverging_sub_expression
          74  +
        )]
          75  +
        deserializer.read_struct(&PATCHFILTERGROUP_SCHEMA, &mut |member, deser| {
          76  +
            match member.member_index() {
          77  +
                Some(0) => {
          78  +
                    builder.patch_filters = Some({
          79  +
                        let mut container = Vec::new();
          80  +
                        deser.read_list(member, &mut |deser| {
          81  +
                            container.push(crate::types::PatchFilter::deserialize(deser)?);
          82  +
                            Ok(())
          83  +
                        })?;
          84  +
                        container
          85  +
                    });
          86  +
                }
          87  +
                _ => {}
          88  +
            }
          89  +
            Ok(())
          90  +
        })?;
          91  +
        builder.patch_filters = builder.patch_filters.or(Some(Vec::new()));
          92  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
          93  +
    }
          94  +
}
          95  +
impl PatchFilterGroup {
          96  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          97  +
    pub fn deserialize_with_response(
          98  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          99  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         100  +
        _status: u16,
         101  +
        _body: &[u8],
         102  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         103  +
        Self::deserialize(deserializer)
         104  +
    }
         105  +
}
         106  +
impl PatchFilterGroup {
         107  +
    /// Creates a new builder-style object to manufacture [`PatchFilterGroup`](crate::types::PatchFilterGroup).
         108  +
    pub fn builder() -> crate::types::builders::PatchFilterGroupBuilder {
         109  +
        crate::types::builders::PatchFilterGroupBuilder::default()
         110  +
    }
         111  +
}
         112  +
         113  +
/// A builder for [`PatchFilterGroup`](crate::types::PatchFilterGroup).
         114  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         115  +
#[non_exhaustive]
         116  +
pub struct PatchFilterGroupBuilder {
         117  +
    pub(crate) patch_filters: ::std::option::Option<::std::vec::Vec<crate::types::PatchFilter>>,
         118  +
}
         119  +
impl PatchFilterGroupBuilder {
         120  +
    /// Appends an item to `patch_filters`.
         121  +
    ///
         122  +
    /// To override the contents of this collection use [`set_patch_filters`](Self::set_patch_filters).
         123  +
    ///
         124  +
    /// <p>The set of patch filters that make up the group.</p>
         125  +
    pub fn patch_filters(mut self, input: crate::types::PatchFilter) -> Self {
         126  +
        let mut v = self.patch_filters.unwrap_or_default();
         127  +
        v.push(input);
         128  +
        self.patch_filters = ::std::option::Option::Some(v);
         129  +
        self
         130  +
    }
         131  +
    /// <p>The set of patch filters that make up the group.</p>
         132  +
    pub fn set_patch_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchFilter>>) -> Self {
         133  +
        self.patch_filters = input;
         134  +
        self
         135  +
    }
         136  +
    /// <p>The set of patch filters that make up the group.</p>
         137  +
    pub fn get_patch_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchFilter>> {
         138  +
        &self.patch_filters
         139  +
    }
         140  +
    /// Consumes the builder and constructs a [`PatchFilterGroup`](crate::types::PatchFilterGroup).
         141  +
    /// This method will fail if any of the following fields are not set:
         142  +
    /// - [`patch_filters`](crate::types::builders::PatchFilterGroupBuilder::patch_filters)
         143  +
    pub fn build(self) -> ::std::result::Result<crate::types::PatchFilterGroup, ::aws_smithy_types::error::operation::BuildError> {
         144  +
        ::std::result::Result::Ok(crate::types::PatchFilterGroup {
         145  +
            patch_filters: self.patch_filters.ok_or_else(|| {
         146  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         147  +
                    "patch_filters",
         148  +
                    "patch_filters was not specified but it is required when building PatchFilterGroup",
         149  +
                )
         150  +
            })?,
         151  +
        })
         152  +
    }
         153  +
}

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

@@ -0,1 +0,230 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// When writing a match expression against `PatchFilterKey`, 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 patchfilterkey = unimplemented!();
          14  +
/// match patchfilterkey {
          15  +
///     PatchFilterKey::AdvisoryId => { /* ... */ },
          16  +
///     PatchFilterKey::Arch => { /* ... */ },
          17  +
///     PatchFilterKey::BugzillaId => { /* ... */ },
          18  +
///     PatchFilterKey::Classification => { /* ... */ },
          19  +
///     PatchFilterKey::CveId => { /* ... */ },
          20  +
///     PatchFilterKey::Epoch => { /* ... */ },
          21  +
///     PatchFilterKey::MsrcSeverity => { /* ... */ },
          22  +
///     PatchFilterKey::Name => { /* ... */ },
          23  +
///     PatchFilterKey::PatchId => { /* ... */ },
          24  +
///     PatchFilterKey::PatchSet => { /* ... */ },
          25  +
///     PatchFilterKey::Priority => { /* ... */ },
          26  +
///     PatchFilterKey::Product => { /* ... */ },
          27  +
///     PatchFilterKey::ProductFamily => { /* ... */ },
          28  +
///     PatchFilterKey::Release => { /* ... */ },
          29  +
///     PatchFilterKey::Repository => { /* ... */ },
          30  +
///     PatchFilterKey::Section => { /* ... */ },
          31  +
///     PatchFilterKey::Security => { /* ... */ },
          32  +
///     PatchFilterKey::Severity => { /* ... */ },
          33  +
///     PatchFilterKey::Version => { /* ... */ },
          34  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          35  +
///     _ => { /* ... */ },
          36  +
/// }
          37  +
/// ```
          38  +
/// The above code demonstrates that when `patchfilterkey` represents
          39  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          40  +
/// even though the enum does not contain a variant `PatchFilterKey::NewFeature`
          41  +
/// in the current version of SDK. The reason is that the variable `other`,
          42  +
/// created by the `@` operator, is bound to
          43  +
/// `PatchFilterKey::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
          44  +
/// and calling `as_str` on it yields `"NewFeature"`.
          45  +
/// This match expression is forward-compatible when executed with a newer
          46  +
/// version of SDK where the variant `PatchFilterKey::NewFeature` is defined.
          47  +
/// Specifically, when `patchfilterkey` represents `NewFeature`,
          48  +
/// the execution path will hit the second last match arm as before by virtue of
          49  +
/// calling `as_str` on `PatchFilterKey::NewFeature` also yielding `"NewFeature"`.
          50  +
///
          51  +
/// Explicitly matching on the `Unknown` variant should
          52  +
/// be avoided for two reasons:
          53  +
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
          54  +
/// - It might inadvertently shadow other intended match arms.
          55  +
///
          56  +
#[allow(missing_docs)] // documentation missing in model
          57  +
#[non_exhaustive]
          58  +
#[derive(
          59  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
          60  +
)]
          61  +
pub enum PatchFilterKey {
          62  +
    #[allow(missing_docs)] // documentation missing in model
          63  +
    AdvisoryId,
          64  +
    #[allow(missing_docs)] // documentation missing in model
          65  +
    Arch,
          66  +
    #[allow(missing_docs)] // documentation missing in model
          67  +
    BugzillaId,
          68  +
    #[allow(missing_docs)] // documentation missing in model
          69  +
    Classification,
          70  +
    #[allow(missing_docs)] // documentation missing in model
          71  +
    CveId,
          72  +
    #[allow(missing_docs)] // documentation missing in model
          73  +
    Epoch,
          74  +
    #[allow(missing_docs)] // documentation missing in model
          75  +
    MsrcSeverity,
          76  +
    #[allow(missing_docs)] // documentation missing in model
          77  +
    Name,
          78  +
    #[allow(missing_docs)] // documentation missing in model
          79  +
    PatchId,
          80  +
    #[allow(missing_docs)] // documentation missing in model
          81  +
    PatchSet,
          82  +
    #[allow(missing_docs)] // documentation missing in model
          83  +
    Priority,
          84  +
    #[allow(missing_docs)] // documentation missing in model
          85  +
    Product,
          86  +
    #[allow(missing_docs)] // documentation missing in model
          87  +
    ProductFamily,
          88  +
    #[allow(missing_docs)] // documentation missing in model
          89  +
    Release,
          90  +
    #[allow(missing_docs)] // documentation missing in model
          91  +
    Repository,
          92  +
    #[allow(missing_docs)] // documentation missing in model
          93  +
    Section,
          94  +
    #[allow(missing_docs)] // documentation missing in model
          95  +
    Security,
          96  +
    #[allow(missing_docs)] // documentation missing in model
          97  +
    Severity,
          98  +
    #[allow(missing_docs)] // documentation missing in model
          99  +
    Version,
         100  +
    /// `Unknown` contains new variants that have been added since this code was generated.
         101  +
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
         102  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
         103  +
}
         104  +
impl ::std::convert::From<&str> for PatchFilterKey {
         105  +
    fn from(s: &str) -> Self {
         106  +
        match s {
         107  +
            "ADVISORY_ID" => PatchFilterKey::AdvisoryId,
         108  +
            "ARCH" => PatchFilterKey::Arch,
         109  +
            "BUGZILLA_ID" => PatchFilterKey::BugzillaId,
         110  +
            "CLASSIFICATION" => PatchFilterKey::Classification,
         111  +
            "CVE_ID" => PatchFilterKey::CveId,
         112  +
            "EPOCH" => PatchFilterKey::Epoch,
         113  +
            "MSRC_SEVERITY" => PatchFilterKey::MsrcSeverity,
         114  +
            "NAME" => PatchFilterKey::Name,
         115  +
            "PATCH_ID" => PatchFilterKey::PatchId,
         116  +
            "PATCH_SET" => PatchFilterKey::PatchSet,
         117  +
            "PRIORITY" => PatchFilterKey::Priority,
         118  +
            "PRODUCT" => PatchFilterKey::Product,
         119  +
            "PRODUCT_FAMILY" => PatchFilterKey::ProductFamily,
         120  +
            "RELEASE" => PatchFilterKey::Release,
         121  +
            "REPOSITORY" => PatchFilterKey::Repository,
         122  +
            "SECTION" => PatchFilterKey::Section,
         123  +
            "SECURITY" => PatchFilterKey::Security,
         124  +
            "SEVERITY" => PatchFilterKey::Severity,
         125  +
            "VERSION" => PatchFilterKey::Version,
         126  +
            other => PatchFilterKey::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
         127  +
        }
         128  +
    }
         129  +
}
         130  +
impl ::std::str::FromStr for PatchFilterKey {
         131  +
    type Err = ::std::convert::Infallible;
         132  +
         133  +
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
         134  +
        ::std::result::Result::Ok(PatchFilterKey::from(s))
         135  +
    }
         136  +
}
         137  +
impl PatchFilterKey {
         138  +
    /// Returns the `&str` value of the enum member.
         139  +
    pub fn as_str(&self) -> &str {
         140  +
        match self {
         141  +
            PatchFilterKey::AdvisoryId => "ADVISORY_ID",
         142  +
            PatchFilterKey::Arch => "ARCH",
         143  +
            PatchFilterKey::BugzillaId => "BUGZILLA_ID",
         144  +
            PatchFilterKey::Classification => "CLASSIFICATION",
         145  +
            PatchFilterKey::CveId => "CVE_ID",
         146  +
            PatchFilterKey::Epoch => "EPOCH",
         147  +
            PatchFilterKey::MsrcSeverity => "MSRC_SEVERITY",
         148  +
            PatchFilterKey::Name => "NAME",
         149  +
            PatchFilterKey::PatchId => "PATCH_ID",
         150  +
            PatchFilterKey::PatchSet => "PATCH_SET",
         151  +
            PatchFilterKey::Priority => "PRIORITY",
         152  +
            PatchFilterKey::Product => "PRODUCT",
         153  +
            PatchFilterKey::ProductFamily => "PRODUCT_FAMILY",
         154  +
            PatchFilterKey::Release => "RELEASE",
         155  +
            PatchFilterKey::Repository => "REPOSITORY",
         156  +
            PatchFilterKey::Section => "SECTION",
         157  +
            PatchFilterKey::Security => "SECURITY",
         158  +
            PatchFilterKey::Severity => "SEVERITY",
         159  +
            PatchFilterKey::Version => "VERSION",
         160  +
            PatchFilterKey::Unknown(value) => value.as_str(),
         161  +
        }
         162  +
    }
         163  +
    /// Returns all the `&str` representations of the enum members.
         164  +
    pub const fn values() -> &'static [&'static str] {
         165  +
        &[
         166  +
            "ADVISORY_ID",
         167  +
            "ARCH",
         168  +
            "BUGZILLA_ID",
         169  +
            "CLASSIFICATION",
         170  +
            "CVE_ID",
         171  +
            "EPOCH",
         172  +
            "MSRC_SEVERITY",
         173  +
            "NAME",
         174  +
            "PATCH_ID",
         175  +
            "PATCH_SET",
         176  +
            "PRIORITY",
         177  +
            "PRODUCT",
         178  +
            "PRODUCT_FAMILY",
         179  +
            "RELEASE",
         180  +
            "REPOSITORY",
         181  +
            "SECTION",
         182  +
            "SECURITY",
         183  +
            "SEVERITY",
         184  +
            "VERSION",
         185  +
        ]
         186  +
    }
         187  +
}
         188  +
impl ::std::convert::AsRef<str> for PatchFilterKey {
         189  +
    fn as_ref(&self) -> &str {
         190  +
        self.as_str()
         191  +
    }
         192  +
}
         193  +
impl PatchFilterKey {
         194  +
    /// Parses the enum value while disallowing unknown variants.
         195  +
    ///
         196  +
    /// Unknown variants will result in an error.
         197  +
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
         198  +
        match Self::from(value) {
         199  +
            #[allow(deprecated)]
         200  +
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
         201  +
            known => Ok(known),
         202  +
        }
         203  +
    }
         204  +
}
         205  +
impl ::std::fmt::Display for PatchFilterKey {
         206  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         207  +
        match self {
         208  +
            PatchFilterKey::AdvisoryId => write!(f, "ADVISORY_ID"),
         209  +
            PatchFilterKey::Arch => write!(f, "ARCH"),
         210  +
            PatchFilterKey::BugzillaId => write!(f, "BUGZILLA_ID"),
         211  +
            PatchFilterKey::Classification => write!(f, "CLASSIFICATION"),
         212  +
            PatchFilterKey::CveId => write!(f, "CVE_ID"),
         213  +
            PatchFilterKey::Epoch => write!(f, "EPOCH"),
         214  +
            PatchFilterKey::MsrcSeverity => write!(f, "MSRC_SEVERITY"),
         215  +
            PatchFilterKey::Name => write!(f, "NAME"),
         216  +
            PatchFilterKey::PatchId => write!(f, "PATCH_ID"),
         217  +
            PatchFilterKey::PatchSet => write!(f, "PATCH_SET"),
         218  +
            PatchFilterKey::Priority => write!(f, "PRIORITY"),
         219  +
            PatchFilterKey::Product => write!(f, "PRODUCT"),
         220  +
            PatchFilterKey::ProductFamily => write!(f, "PRODUCT_FAMILY"),
         221  +
            PatchFilterKey::Release => write!(f, "RELEASE"),
         222  +
            PatchFilterKey::Repository => write!(f, "REPOSITORY"),
         223  +
            PatchFilterKey::Section => write!(f, "SECTION"),
         224  +
            PatchFilterKey::Security => write!(f, "SECURITY"),
         225  +
            PatchFilterKey::Severity => write!(f, "SEVERITY"),
         226  +
            PatchFilterKey::Version => write!(f, "VERSION"),
         227  +
            PatchFilterKey::Unknown(value) => write!(f, "{value}"),
         228  +
        }
         229  +
    }
         230  +
}

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

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

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_patch_operation_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 `PatchOperationType`, 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 patchoperationtype = unimplemented!();
          14  +
/// match patchoperationtype {
          15  +
///     PatchOperationType::Install => { /* ... */ },
          16  +
///     PatchOperationType::Scan => { /* ... */ },
          17  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          18  +
///     _ => { /* ... */ },
          19  +
/// }
          20  +
/// ```
          21  +
/// The above code demonstrates that when `patchoperationtype` represents
          22  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          23  +
/// even though the enum does not contain a variant `PatchOperationType::NewFeature`
          24  +
/// in the current version of SDK. The reason is that the variable `other`,
          25  +
/// created by the `@` operator, is bound to
          26  +
/// `PatchOperationType::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 `PatchOperationType::NewFeature` is defined.
          30  +
/// Specifically, when `patchoperationtype` represents `NewFeature`,
          31  +
/// the execution path will hit the second last match arm as before by virtue of
          32  +
/// calling `as_str` on `PatchOperationType::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 PatchOperationType {
          45  +
    #[allow(missing_docs)] // documentation missing in model
          46  +
    Install,
          47  +
    #[allow(missing_docs)] // documentation missing in model
          48  +
    Scan,
          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 PatchOperationType {
          54  +
    fn from(s: &str) -> Self {
          55  +
        match s {
          56  +
            "Install" => PatchOperationType::Install,
          57  +
            "Scan" => PatchOperationType::Scan,
          58  +
            other => PatchOperationType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          59  +
        }
          60  +
    }
          61  +
}
          62  +
impl ::std::str::FromStr for PatchOperationType {
          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(PatchOperationType::from(s))
          67  +
    }
          68  +
}
          69  +
impl PatchOperationType {
          70  +
    /// Returns the `&str` value of the enum member.
          71  +
    pub fn as_str(&self) -> &str {
          72  +
        match self {
          73  +
            PatchOperationType::Install => "Install",
          74  +
            PatchOperationType::Scan => "Scan",
          75  +
            PatchOperationType::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  +
        &["Install", "Scan"]
          81  +
    }
          82  +
}
          83  +
impl ::std::convert::AsRef<str> for PatchOperationType {
          84  +
    fn as_ref(&self) -> &str {
          85  +
        self.as_str()
          86  +
    }
          87  +
}
          88  +
impl PatchOperationType {
          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 PatchOperationType {
         101  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         102  +
        match self {
         103  +
            PatchOperationType::Install => write!(f, "Install"),
         104  +
            PatchOperationType::Scan => write!(f, "Scan"),
         105  +
            PatchOperationType::Unknown(value) => write!(f, "{value}"),
         106  +
        }
         107  +
    }
         108  +
}